Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2010-08-18 19:15:11 +0000
committernhauge2010-08-18 19:15:11 +0000
commit794ce5f90d728774b1e4d00d39b0cf767b0d9851 (patch)
tree686f606f7717d7efa7553992015cc3ed085b8111
parentc6157db37e3da23320e3d5bad580a2867c492d05 (diff)
downloadwebtools.dali-201008192310.tar.gz
webtools.dali-201008192310.tar.xz
webtools.dali-201008192310.zip
This commit was manufactured by cvs2svn to create tag 'v201008192310'.v201008192310
-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/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/feature.properties144
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/feature.xml34
-rw-r--r--assembly/features/org.eclipse.jpt.assembly.feature/license.html93
-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/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml28
-rw-r--r--assembly/features/org.eclipse.jpt.tests.assembly.feature/license.html98
-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/epl-v10.html328
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties145
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml34
-rw-r--r--assembly/features/org.eclipse.jpt_sdk.assembly.feature/license.html98
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties15
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties163
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml60
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties16
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties168
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties163
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml28
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.feature/build.properties15
-rw-r--r--jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.properties163
-rw-r--r--jpa/features/org.eclipse.jpt.feature/feature.xml132
-rw-r--r--jpa/features/org.eclipse.jpt.feature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties16
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties168
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/build.properties10
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.properties171
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/feature.xml44
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/license.html107
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.properties163
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/feature.xml35
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/license.html107
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/.cvsignore2
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/component.xml13
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.classpath13
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/build.properties22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml274
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/common.ecore14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/jpaResourceModels.genmodel513
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecore578
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.properties48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/plugin.xml508
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatforms.exsd166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/GenericJpaProjectManager.java1042
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/IResourcePart.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationDefinitionProvider.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformFactory.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformProvider.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformVariation.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java541
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProjectManager.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModel.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelListener.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelProvider.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceType.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java794
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceDefinition.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessHolder.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideContainer.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideRelationshipReference.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverrideContainer.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseColumn.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/CollectionMapping.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Converter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ConvertibleMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorContainer.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClassReference.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnEnabledRelationshipReference.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnJoiningStrategy.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableEnabledRelationshipReference.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableJoiningStrategy.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoiningStrategy.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/LobConverter.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyRelationshipReference.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OwnableRelationshipReference.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnEnabledRelationshipReference.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnJoiningStrategy.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryContainer.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReferenceTable.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipReference.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlFile.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JarFile.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideContainer.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideRelationshipReference.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingDefinition.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverrideContainer.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaCascade.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdClassReference.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnEnabledRelationshipReference.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnInAssociationOverrideJoiningStrategy.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnJoiningStrategy.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableEnabledRelationshipReference.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableJoiningStrategy.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoiningStrategy.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyRelationshipReference.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByJoiningStrategy.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyRelationshipReference.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneRelationshipReference.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverrideContainer.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOwnableRelationshipReference.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnEnabledRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnJoiningStrategy.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReferenceTable.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipReference.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingDefinition.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullDefaultJavaAttributeMappingDefinition.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullJavaTypeMappingDefinition.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingDefinition.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/MappingFileDefinition.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/NullOrmAttributeMappingDefinition.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideContainer.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideRelationshipReference.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingDefinition.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverrideContainer.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmCascade.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorContainer.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdClassReference.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnEnabledRelationshipReference.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnInAssociationOverrideJoiningStrategy.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnJoiningStrategy.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableEnabledRelationshipReference.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableJoiningStrategy.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoiningStrategy.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyRelationshipReference.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneRelationshipReference.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByJoiningStrategy.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyRelationshipReference.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneRelationshipReference.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverrideContainer.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOwnableRelationshipReference.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnEnabledRelationshipReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnJoiningStrategy.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryContainer.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReferenceTable.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipReference.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlDefinition.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/UnsupportedOrmAttributeMappingDefinition.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/JarFileRef.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java709
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitProperties.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlContextNodeFactory.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlDefinition.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistentTypeContainer.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaAnnotationDefintionProvider.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java408
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaPlatformProvider.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java1672
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractSynchronizerJpaProjectUpdater.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationDefinitionProvider.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationProvider.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformFactory.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformProvider.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JarResourceModelProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaResourceModelProvider.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java276
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaTester.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmResourceModelProvider.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceResourceModelProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ResourceAdapterFactory.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/EntityTextRangeResolver.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PersistentAttributePropertyTester.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyTextRangeResolver.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyValidator.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAssociationOverrideRelationshipReference.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java293
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java328
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java344
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBasicMapping.java311
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEmbeddable.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java1882
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMapping.java472
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMappingDefinition.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnJoiningStrategy.java325
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinTableJoiningStrategy.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToManyMapping.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneMapping.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneRelationshipReference.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappedSuperclass.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java860
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyRelationshipReference.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneRelationshipReference.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentAttribute.java716
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentType.java661
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipReference.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSequenceGenerator.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java502
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMappingDefinition.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaVersionMapping.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdClassReference.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnJoiningStrategy.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTableJoiningStrategy.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyRelationshipReference.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneRelationshipReference.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedByJoiningStrategy.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneRelationshipReference.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumnJoiningStrategy.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityTextRangeResolver.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingDefinition.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassTextRangeResolver.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideAnnotation.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideJoinColumnAnnotation.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumnAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualOverrideAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractEntityMappings.java822
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAssociationOverrideRelationshipReference.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java386
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java384
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBasicMapping.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEmbeddable.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java2134
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmIdMapping.java431
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnJoiningStrategy.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinTableJoiningStrategy.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToManyMapping.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneMapping.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneRelationshipReference.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMappedSuperclass.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java869
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyMapping.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyRelationshipReference.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneMapping.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneRelationshipReference.java263
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmPersistentAttribute.java316
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java356
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipReference.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSequenceGenerator.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java475
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmVersionMapping.java245
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNode.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java449
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlDefinition.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdClassReference.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnJoiningStrategy.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTableJoiningStrategy.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyRelationshipReference.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneRelationshipReference.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedByJoiningStrategy.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneRelationshipReference.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumnJoiningStrategy.java305
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmXmlContextNodeFactory.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmAssociationOverrideContainer.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmJoinTableJoiningStrategy.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableDefinition.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityDefinition.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityTextRangeResolver.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassDefinition.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassTextRangeResolver.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingDefinition.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAssociationOverride.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverrideColumn.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlUniqueConstraint.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractJarFileRef.java310
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractMappingFileRef.java277
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java1940
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnitProperties.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNode.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNodeFactory.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXmlContextNodeFactory.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java689
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProperties.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDelegate.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaLibraryProviderConstants.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderDetector.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderInstallOperation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/RuntimeChangedListener.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaDataSource.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFactory.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFile.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaProject.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java589
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericEntityPrimaryKeyValidator.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericMappedSuperclassPrimaryKeyValidator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericRootContextNode.java282
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJarFile.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverride.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java445
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideRelationshipReference.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverride.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java451
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaBasicMapping.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaCascade.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaColumn.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddable.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedIdMapping.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java375
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEntity.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEnumeratedConverter.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratedValue.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaIdMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinColumn.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinTable.java594
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaLobConverter.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToManyMapping.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToOneMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaMappedSuperclass.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedNativeQuery.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedQuery.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullAttributeMapping.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullConverter.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyRelationshipReference.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToOneMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java401
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentAttribute.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentType.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java293
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryHint.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaReferenceTable.java365
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSecondaryTable.java466
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSequenceGenerator.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTable.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTableGenerator.java533
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTemporalConverter.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTransientMapping.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaUniqueConstraint.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaVersionMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaAssociationOverrideContainer.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinColumnJoiningStrategy.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinTableJoiningStrategy.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/VirtualAssociationOverride1_0Annotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericEntityMappings.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java380
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideRelationshipReference.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java241
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java383
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmBasicMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmCascade.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java482
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEntity.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEnumeratedConverter.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratedValue.java180
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratorContainer.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmIdMapping.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinColumn.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinTable.java766
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmLobConverter.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToManyMapping.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToOneMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmMappedSuperclass.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedNativeQuery.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedQuery.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullAttributeMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullConverter.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyRelationshipReference.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToOneMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java336
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentAttribute.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentType.java1080
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryContainer.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryHint.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmReferenceTable.java400
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSecondaryTable.java509
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSequenceGenerator.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTable.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java420
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTemporalConverter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTransientMapping.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmUniqueConstraint.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmVersionMapping.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXml.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXmlDefinition.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitDefaults.java324
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitMetadata.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/NullOrmJoinColumnJoiningStrategy.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/UnsupportedOrmAttributeMapping.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericClassRef.java307
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericJarFileRef.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericMappingFileRef.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistence.java284
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnit.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnitProperty.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXml.java228
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXmlDefinition.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/ImpliedMappingFileRef.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverride1_0Annotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverrides1_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQueries1_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQuery1_0Annotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinarySequenceGenerator1_0Annotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceNamedQuery1_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceSequenceGenerator1_0Annotation.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaAnnotationDefinitionProvider.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformFactory.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformProvider.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericMetamodelSynchronizer.java432
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/SimpleMetamodelField.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java1684
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaIdMappingDefinition2_0.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaAssociationOverrideRelationshipReference2_0.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCollectionTable2_0.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedIdentity2_0.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaEmbeddable2_0.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaIdDerivedIdentityStrategy2_0.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneRelationshipReference2_0.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaNamedQuery2_0.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyRelationshipReference2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneRelationshipReference2_0.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrphanRemoval2_0.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentType2_0.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaElementCollectionMappingDefinition2_0.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaIdMappingDefinition2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaCacheable2_0.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaDerivedIdentity2_0.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaMapKeyColumn2_0.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrderColumn2_0.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrphanRemoval2_0.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverride2_0Annotation.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverrideJoinTableAnnotation.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java1876
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmAssociationOverrideRelationshipReference2_0.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCollectionTable2_0.java350
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmDerivedIdentity2_0.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmEmbeddable2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmIdDerivedIdentityStrategy2_0.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneRelationshipReference2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmNamedQuery2_0.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyRelationshipReference2_0.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneRelationshipReference2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrphanRemoval2_0.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0ContextNodeFactory.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0Definition.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmCacheable2_0.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmDerivedIdentity2_0.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmOrphanRemoval2_0.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/OrmElementCollectionMapping2_0Definition.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualMapKeyClassReference.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlAssociationOverride2_0.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlBasic2_0.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCascadeType2_0.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCollectionTable.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlElementCollection2_0.java286
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbedded2_0.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbeddedId2_0.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlId2_0.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToOne2_0.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlNullAttributeMapping2_0.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java284
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToOne2_0.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlTransient2_0.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlVersion2_0.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlContextNodeFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/GenericConnection2_0.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/NullConnection2_0.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/GenericOptions2_0.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/NullOptions2_0.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAccess2_0Annotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAssociationOverrideJoinTableAnnotation.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullCollectionTable2_0Annotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyColumnAnnotation.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyEnumerated2_0Annotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyTemporal2_0Annotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapsId2_0Annotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullOrderColumn2_0Annotation.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAccess2_0Annotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverride2_0Annotation.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverrides2_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCacheable2_0Annotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCollectionTable2_0Annotation.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryElementCollection2_0Annotation.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryGeneratedAnnotation.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyClass2_0Annotation.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyColumn2_0Annotation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyEnumerated2_0Annotation.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumn2_0Annotation.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumns2_0Annotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyTemporal2_0Annotation.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapsId2_0Annotation.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQueries2_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQuery2_0Annotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryOrderColumn2_0Annotation.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinarySequenceGenerator2_0Annotation.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryStaticMetamodelAnnotation.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyColumn2_0Annotation.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyEnumerated2_0Annotation.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyTemporal2_0Annotation.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceSequenceGenerator2_0Annotation.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationOperation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/JpaFileCreationDataModelProperties.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java273
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProperties.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProvider.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationOperation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/contenttypes/IndeterminateContentDescriber.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAnnotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumnAnnotation.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTableAnnotation.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasicAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumnAnnotation.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValueAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbeddedAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumeratedAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritanceAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumnAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTableAnnotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumnAnnotation.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToManyAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOneAnnotation.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOwnableRelationshipMappingAnnotation.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTableAnnotation.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporalAnnotation.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseNamedQueryAnnotation.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBasicAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryClassFile.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryColumnAnnotation.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryContainerAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEntityAnnotation.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdClassAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryLobAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNode.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOrderByAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOverrideAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java649
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java272
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java583
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentTypeCache.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableAnnotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java293
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTemporalAnnotation.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTransientAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryVersionAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/RootBinaryNode.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/AnnotationContainerTools.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java252
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java311
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceColumnAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompilationUnit.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddableAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEnumeratedAnnotation.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java376
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceLobAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToOneAnnotation.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNode.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToManyAnnotation.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToOneAnnotation.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java400
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java507
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java830
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java336
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java459
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTemporalAnnotation.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTransientAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceVersionAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmXmlResourceProvider.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceXmlResourceProvider.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourceAdapterFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourcePropertyTester.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/CallbackJobSynchronizer.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobCommand.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobSynchronizer.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/KeyClassesValidator.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/PlatformTools.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleTextRange.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTNodeTextRange.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTTools.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractExpressionConverter.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java422
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/BooleanExpressionConverter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CharacterStringExpressionConverter.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java496
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/GenericVisitor.java791
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAttribute.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java256
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java537
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java238
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java341
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NameStringExpressionConverter.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java334
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullAnnotationEditFormatter.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullExpressionConverter.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NumberIntegerExpressionConverter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringArrayExpressionConverter.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringExpressionConverter.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/TypeStringExpressionConverter.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/BooleanTranslator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EmptyTagBooleanTranslator.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EnumeratedValueTranslator.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleRootTranslator.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleTranslator.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MappingKeys2_0.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MetamodelSynchronizer.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AssociationOverrideRelationshipReference2_0.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeMapping2_0.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeOverride2_0.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cacheable2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CacheableHolder2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cascade2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionMapping2_0.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionTable2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentity2_0.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentityStrategy2_0.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ElementCollectionMapping2_0.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedIdMapping2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedMapping2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdDerivedIdentityStrategy2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdMapping2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/LockModeType2_0.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToManyMapping2_0.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneRelationshipReference2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MappingFilePersistenceUnitDefaults2_0.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MapsIdDerivedIdentityStrategy2_0.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelField.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelSourceType.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/NamedQuery2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyRelationshipReference2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneRelationshipReference2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovable2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovalHolder2_0.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentAttribute2_0.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentType2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SequenceGenerator2_0.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SingleRelationshipMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaAssociationOverrideRelationshipReference2_0.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheable2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheableHolder2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCascade2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionMapping2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionTable2_0.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaDerivedIdentity2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaElementCollectionMapping2_0.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaEmbeddedMapping2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaIdDerivedIdentityStrategy2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaJoinTableInAssociationOverrideJoiningStrategy2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToManyMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneRelationshipReference2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaMapsIdDerivedIdentityStrategy2_0.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaNamedQuery2_0.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyMapping2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyRelationshipReference2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneRelationshipReference2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovable2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovalHolder2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentAttribute2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaRelationshipMapping2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaSingleRelationshipMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmAssociationOverrideRelationshipReference2_0.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheable2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheableHolder2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCascade2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionMapping2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionTable2_0.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmDerivedIdentity2_0.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmElementCollectionMapping2_0.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmEmbeddedMapping2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmIdDerivedIdentityStrategy2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmJoinTableInAssociationOverrideJoiningStrategy2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToManyMapping2_0.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneRelationshipReference2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmMapsIdDerivedIdentityStrategy2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmNamedQuery2_0.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyRelationshipReference2_0.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneRelationshipReference2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovable2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovalHolder2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistenceUnitDefaults2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentAttribute2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentType2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSequenceGenerator2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSingleRelationshipMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/SharedCacheMode.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/ValidationMode.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Access2_0Annotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/AssociationOverride2_0Annotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Cacheable2_0Annotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/CollectionTable2_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ElementCollection2_0Annotation.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/GeneratedAnnotation.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JavaResourcePersistentType2_0.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/LockModeType_2_0.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToMany2_0Annotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToOne2_0Annotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyClass2_0Annotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyColumn2_0Annotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyEnumerated2_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumn2_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumns2_0Annotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyTemporal2_0Annotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapsId2_0Annotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NamedQuery2_0Annotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NestableMapKeyJoinColumnAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToMany2_0Annotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToOne2_0Annotation.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrderColumn2_0Annotation.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrphanRemovable2_0Annotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/RelationshipMapping2_0Annotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/SequenceGenerator2_0Annotation.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/StaticMetamodelAnnotation.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractXmlResourceProvider.java371
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProvider.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderEvent.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderListener.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseNamedQueryAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableColumnAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinTableAnnotation.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java280
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlColumn.java500
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlEmbedded.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlMultiRelationshipMapping.java1086
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java286
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlReferenceTable.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlRelationshipMapping.java382
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlSingleRelationshipMapping.java614
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTable.java439
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java521
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java792
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java586
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java928
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java200
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java285
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java289
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/JPA.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java970
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java12487
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmXmlResourceFactory.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java418
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAccessHolder.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java501
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideContainer.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java433
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideContainer.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java687
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlClassReference.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlCollectionTable.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java375
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlConvertibleMapping.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java297
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlElementCollection.java1634
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java256
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java2312
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java1108
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEventMethodContainer.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratorContainer.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java805
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClassContainer.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnsMapping.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java210
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableMapping.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedByMapping.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java574
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java586
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java542
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java376
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java457
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderColumn.java404
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderable.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java727
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java394
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryContainer.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java366
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlReferenceTable.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java705
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java950
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTypeMapping.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java523
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/JPA2_0.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/LockModeType_2_0.java397
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Package.java3810
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAssociationOverride_2_0.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeMapping_2_0.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeOverride_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributes_2_0.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCacheable_2_0.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCascadeType_2_0.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCollectionTable_2_0.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlDerivedId_2_0.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlElementCollection_2_0.java326
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEmbedded_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntityListener_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntity_2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEventMethod_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlGenerator_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlManyToMany_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyAttributeOverrideContainer_2_0.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyClass_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapsId_2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMultiRelationshipMapping_2_0.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlNamedQuery_2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToMany_2_0.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToOne_2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderColumn_2_0.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderable_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrphanRemovable_2_0.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitDefaults_2_0.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitMetadata_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQueryHint_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQuery_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSequenceGenerator_2_0.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSingleRelationshipMapping_2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSqlResultSetMapping_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlUniqueConstraint_2_0.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/JPA.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java1302
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceXmlResourceFactory.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJarFileRef.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java1077
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java236
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java305
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/JPA2_0.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Factory.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Package.java452
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitCachingType_2_0.java312
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitValidationModeType_2_0.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnit_2_0.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaEObject.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaRootEObject.java336
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonFactory.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonPackage.java436
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/EmfTools.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaEObject.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaRootEObject.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaXmlResource.java305
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/XML.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/BodySourceWriter.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF15
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF20
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseIdentifierAdapter.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java574
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java204
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java380
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java331
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java228
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java326
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java409
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/AbstractVendor.java304
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/CatalogStrategy.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/DB2.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Derby.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FauxCatalogStrategy.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FoldingStrategy.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/HSQLDB.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Informix.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/LowerCaseFoldingStrategy.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MaxDB.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MySQL.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NoCatalogStrategy.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NonFoldingStrategy.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Oracle.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/PostgreSQL.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SQLServer.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Sybase.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnknownCatalogStrategy.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnrecognizedVendor.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UpperCaseFoldingStrategy.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Vendor.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/VendorRepository.java78
-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/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF13
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jarbin46465 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.classpath14
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.core.resources.prefs8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/build.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipseLinkResourceModels.genmodel381
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore469
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml284
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/jpt_eclipselink_core.properties14
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_0.xsd3128
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_1.xsd3248
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_2.xsd3519
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_0.xsd3625
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_1.xsd4108
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd260
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd462
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd4109
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd4183
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd4253
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd4253
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd1477
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd1585
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd1586
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd1591
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd1598
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaProject.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheCoordinationType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheType.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCaching.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTracking.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTrackingType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConversionValue.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConvert.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomConverter.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomizer.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExistenceType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExpiryTimeOfDay.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkIdMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetch.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetchType.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMutable.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkObjectTypeConverter.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyRelationshipReference.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToOneMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkPrivateOwned.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkReadOnly.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkRelationshipMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkStructConverter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTransformationMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeMapping.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkCaching.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkConverterHolder.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEntity.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkConverterHolder.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkEntityMappings.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkCaching.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEntity.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/CacheType.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/Caching.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/FlushClearCache.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/BatchWriting.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/Connection.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/ExclusiveConnectionMode.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Customization.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Profiler.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Weaving.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/general/GeneralProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logger.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logging.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/LoggingLevel.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/Options.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetDatabase.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetServer.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/DdlGenerationType.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/OutputMode.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/SchemaGeneration.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCoreMessages.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkManyToOneMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkOneToOneMapping.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMappingDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMappingDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java604
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java276
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverterHolderImpl.java369
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkExpiryTimeOfDay.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java303
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMappingDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyRelationshipReference.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMappingDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMappingDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMappingDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkManyToOneMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkOneToOneMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java710
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterHolder.java452
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkExpiryTimeOfDay.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java245
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyRelationshipReference.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasic.java284
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicCollection.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicMap.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConversionValue.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConverter.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbedded.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbeddedId.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlId.java282
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToOne.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlNullAttributeMapping.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlObjectTypeConverter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlStructConverter.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransformation.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransient.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTypeConverter.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVariableOneToOne.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVersion.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java464
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java581
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Entity.java143
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java677
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java798
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Entity.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/EclipseLinkGeneralProperties.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java361
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/EclipseLinkSchemaGeneration.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java668
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java311
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java433
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/utility/EclipseLinkLibraryValidator.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformFactory.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformProvider.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkEntityPrimaryKeyValidator.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1Definition.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/OrmEclipseLinkPersistentAttribute1_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtuaEclipseLinklXmlNullAttributeMapping1_1.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasic1_1.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicCollection1_1.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicMap1_1.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbedded1_1.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbeddedId1_1.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlId1_1.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToOne1_1.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java205
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransformation1_1.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransient1_1.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVariableOneToOne1_1.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVersion1_1.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaAnnotationDefinitionProvider.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformFactory.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformProvider.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/java/EclipseLinkJavaPersistentType1_2.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/orm/EclipseLinkOrmXml1_2Definition.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformFactory.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformProvider.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkElementCollectionMapping2_0.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkIdMappingDefinition2_0.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkManyToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0Definition.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkManyToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkOneToOneMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlElementCollection2_0.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlEmbedded2_0.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToMany2_0.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToOne2_0.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/connection/EclipseLinkConnection2_0.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/logging/EclipseLinkLogging2_0.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/options/EclipseLinkOptions2_0.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/ddlgen/EclipseLink2_0DDLGenerator.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaAnnotationDefinitionProvider.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformFactory.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmElementCollectionMapping2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1Definition.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicMapMapping2_1.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheCoordinationType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLink.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchType.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableEclipseLinkConversionValueAnnotation.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java394
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheCoordinationType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheType.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLink.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java887
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java9789
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/ExistenceType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethods.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAttributeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasic.java1481
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java351
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java351
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetch.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetchHolder.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java841
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCacheHolder.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTracking.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingType.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValue.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertersHolder.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertibleMapping.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCopyPolicy.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizer.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizerHolder.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlDirection.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlElementCollection.java1534
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java1157
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbedded.java470
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddedId.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java2143
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java517
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchAttribute.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchGroup.java360
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.java1031
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetch.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetchType.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.java1232
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.java604
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java2646
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMutable.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java644
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java438
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.java1322
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.java695
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLocking.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLockingType.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOrderColumn.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrimaryKey.java406
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrivateOwned.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlProperty.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPropertyContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryRedirectors.java654
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReadOnly.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReturnInsert.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java590
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java229
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTimeOfDay.java446
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java474
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransient.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVariableOneToOne.java355
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.java1028
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java684
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java1521
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java2584
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkElementCollectionMapping2_0.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyMapping2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyRelationshipReference2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToOneMapping2_0.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/connection/Connection2_0.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/logging/Logging2_0.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/options/Options2_0.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLink2_1.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLinkClassExtractorAnnotation2_1.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/META-INF/MANIFEST.MF11
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/build.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink-src.zipbin5194269 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink.jarbin5697505 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties21
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.classpath15
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.cvsignore3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF59
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/build.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.properties30
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.xml131
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui.properties381
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_details.properties152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/JptEclipseLinkUiPlugin.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkHelpContextIds.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java175
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java363
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java483
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkConvertersComposite.java271
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java407
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityListComposite.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java344
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityListComposite.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggerComposite.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/SessionComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ThreadComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/TimestampComposite.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EventListenerComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemContentProviderFactory.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemLabelProviderFactory.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkNavigatorProvider.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkOrmResourceModelStructureProvider.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceItemContentProviderFactory.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceResourceModelStructureProvider.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiDefinition.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiFactory.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkIdMapping1_1Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiFactory.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiProvider.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaResourceUiDefinition.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaUiFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEmbeddable1_2Composite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEntity1_2Composite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/orm/EclipseLinkOrmXml1_2UiDefinition.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiFactory.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiProvider.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/EclipseLinkCaching2_0Composite.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaResourceUiDefinition.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaUiFactory.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkCaching2_0Composite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkEntity2_0Composite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0Composite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiDefinition.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkCaching2_0Composite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEntity2_0Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkIdMapping2_0Composite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiProvider.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiDefinition.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiFactory.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiProvider.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizardPage.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF25
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/Association.java388
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/AssociationRole.java273
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/BaseEntityGenCustomizer.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/DatabaseAnnotationNameBuilder.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenPlugin.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenColumn.java415
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenCustomizer.java820
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenTable.java1031
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OverwriteConfirmer.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java335
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/TagNames.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/CompilationUnitModifier.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/DTPUtil.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/EntityGenTools.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/FileUtil.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/ForeignKeyInfo.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/StringUtil.java648
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/UrlUtil.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/column.vm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/manyToMany.vm26
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/manyToOne.vm13
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/mappingKind.vm34
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/oneToMany.vm18
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/oneToOne.vm22
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/templates/entities/pk.java.vm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java247
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/build.properties21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/component.xml1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gifbin364 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gifbin598 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gifbin3162 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gifbin3213 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java361
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java527
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiIcons.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java635
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/ProjectWizardPage.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java645
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.cvsignore4
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF88
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/build.properties17
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/component.xml11
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/IndentingPrintWriter.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ArrayTools.java3122
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AsynchronousCommandExecutor.java168
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanReference.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanTools.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassName.java431
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java940
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java1933
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CommandRunnable.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeCommand.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ConsumerThreadCoordinator.java253
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ExceptionHandler.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java1002
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java877
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java924
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IntReference.java297
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java349
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NonNullBooleanTransformer.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotBooleanTransformer.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotNullFilter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ObjectReference.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Queue.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReflectionTools.java1544
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/RunnableCommand.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleCommandExecutor.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java213
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java240
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleQueue.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java259
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleThreadFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StatefulCommandExecutor.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java4485
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBag.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java469
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedInt.java1012
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java490
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedQueue.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java325
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommand.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommandExecutor.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Tools.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/EmptyEnumeration.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/IteratorEnumeration.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayIterable.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayListIterable.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneListIterable.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeIterable.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeListIterable.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyIterable.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyListIterable.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListIterable.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListListIterable.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneIterable.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneListIterable.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/PeekableIterable.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/QueueIterable.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyCompositeListIterable.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyIterable.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyListIterable.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementIterable.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementListIterable.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneIterable.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneListIterable.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/StackIterable.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubIterableWrapper.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubListIterableWrapper.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperIterableWrapper.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperListIterableWrapper.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationListIterable.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java269
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java283
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/QueueIterator.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java252
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/StackIterator.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubIteratorWrapper.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubListIteratorWrapper.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperIteratorWrapper.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperListIteratorWrapper.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedIterator.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedListIterator.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java254
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java687
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java2746
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java380
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTChangeListenerWrapper.java454
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractCollectionValueModel.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractListValueModel.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModel.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModelAdapter.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectCollectionValueModelAdapter.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectListValueModelAdapter.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectTreeValueModelAdapter.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java392
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationPropertyValueModel.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationWritablePropertyValueModel.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ChangePropertyValueModelAdapter.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeBooleanPropertyValueModel.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java448
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java683
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositePropertyValueModel.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemChangeListValueModelAdapter.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java164
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java141
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SetCollectionValueModel.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java322
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelWrapper.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueChangeAdapter.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java123
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyCollectionValueModelAdapter.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyListValueModelAdapter.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java346
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java375
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java292
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java427
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java420
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java914
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java941
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java377
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java328
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java455
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java430
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/AsynchronousSynchronizer.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackAsynchronousSynchronizer.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronizer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronousSynchronizer.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/Synchronizer.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/SynchronousSynchronizer.java263
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java143
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionAddEvent.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionClearEvent.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionEvent.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionRemoveEvent.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListAddEvent.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListClearEvent.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListEvent.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListMoveEvent.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListRemoveEvent.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListReplaceEvent.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeAddEvent.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeClearEvent.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeEvent.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeRemoveEvent.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeAdapter.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CommandChangeListener.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java377
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SimpleChangeListener.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableCollectionValueModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableListValueModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore6
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF22
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties19
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml34
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingDefinition.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java20
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformFactory.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformProvider.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUiFactory.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF19
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/build.properties14
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTools.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java1027
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java482
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java404
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java397
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java486
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.cvsignore5
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/META-INF/MANIFEST.MF44
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/build.properties18
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java146
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLink1_0CoreContextModelTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLinkCoreContextModelTests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java647
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java224
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java222
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java254
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java387
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java324
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java148
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java348
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java644
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java579
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java449
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java221
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java313
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java43
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java675
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java389
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmContextModelTestCase.java81
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java194
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java1035
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java2394
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java378
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java2147
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java569
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java742
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java452
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java314
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java199
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java267
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java176
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java43
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingAdapterTests.java444
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingValueModelTests.java444
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/JptEclipseLinkPersistenceCachingTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/EclipseLinkConnectionTests.java542
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/JptEclipseLinkPersistenceConnectionTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/CustomizationValueModelTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/EclipseLinkCustomizationTests.java745
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/JptEclipseLinkPersistenceCustomizationTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesAdapterTests.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesValueModelTests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/JptEclipseLinkPersistenceGeneralTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/JptEclipseLinkPersistenceLoggingTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingAdapterTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingValueModelTests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/JptEclipseLinkPersistenceOptionsTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsAdapterTests.java379
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsValueModelTests.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/JptEclipseLinkPersistenceSchemaGenerationTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationAdapterTests.java254
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationBasicAdapterTests.java154
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationValueModelTests.java232
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/JptEclipselinkCoreResourceModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CacheTests.java447
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java131
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java155
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java111
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java426
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java49
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java155
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java155
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java158
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java214
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java219
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java167
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/JptEclipseLink1_1CoreContextModelTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmContextModelTestCase.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java431
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java301
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/JptEclipseLink1_1CoreOrmContextModelTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java168
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/JptEclipseLink1_2CoreContextModelTests.java30
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/JptEclipseLink2_0CoreContextModelTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java722
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java2064
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java1808
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java1300
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java329
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java528
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java1416
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java812
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/JptEclipseLink2_0JavaContextModelTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java746
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmContextModelTestCase.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java1438
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java1801
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java960
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java2375
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java1067
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java905
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java586
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/JptEclipseLink2_0OrmContextModelTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java172
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java430
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java212
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/JptEclipseLink2_0CorePersistenceContextModelTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF14
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/build.properties18
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java143
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF26
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/build.properties13
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java36
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java602
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java566
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java773
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java78
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java340
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java1203
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java319
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java800
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java84
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java187
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java86
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java124
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java278
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java318
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java665
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java627
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore5
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF21
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java1680
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ArrayToolsTests.java3523
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/AsynchronousCommandExecutorTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BagTests.java82
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiFilterTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiStringConverterTests.java115
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiTransformerTests.java73
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java262
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanReferenceTests.java127
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanToolsTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassNameTests.java368
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java401
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java2313
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandExecutorTests.java113
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandRunnableTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandTests.java137
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CompositeCommandTests.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ExceptionHandlerTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java593
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FilterTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java555
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java573
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java109
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IntReferenceTests.java340
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java67
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java252
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ListenerListTests.java194
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java208
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MultiThreadedTestCase.java141
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java226
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NotNullFilterTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ObjectReferenceTests.java103
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReflectionToolsTests.java440
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java102
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleQueueTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java148
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java1724
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java256
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedIntTests.java385
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedQueueTests.java256
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java257
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java184
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java136
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/EmptyEnumerationTests.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/IteratorEnumerationTests.java100
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayIterableTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayListIterableTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ChainIterableTests.java84
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CloneIterableTests.java144
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeIterableTests.java115
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeListIterableTests.java117
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyIterableTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyListIterableTests.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/FilteringIterableTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/GraphIterableTests.java167
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/JptUtilityIterablesTests.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneIterableTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneListIterableTests.java131
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/PeekableIterableTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/QueueIterableTests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java127
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyIterableTests.java68
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyListIterableTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementIterableTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementListIterableTests.java70
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneIterableTests.java71
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java131
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/StackIterableTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SuperIterableWrapperTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationIterableTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationListIterableTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TreeIterableTests.java155
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java140
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java133
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java237
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java397
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java351
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java331
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java64
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java128
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java120
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java266
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java197
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java141
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java205
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java119
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java72
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SuperIteratorWrapperTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedIteratorTests.java310
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedListIteratorTests.java524
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java230
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java322
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java211
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/ChangeSupportTests.java4575
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java181
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/SingleAspectChangeSupportTests.java192
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java331
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java498
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java176
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java145
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java362
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java504
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java241
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java372
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java247
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java240
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java201
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java415
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java1248
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositePropertyValueModelTests.java199
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java163
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java264
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java313
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java348
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java191
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java243
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java244
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java335
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java306
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java78
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java476
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java282
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java348
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java44
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java40
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java344
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java211
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java157
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SetCollectionValueModelTests.java328
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java378
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java97
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java237
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java189
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java362
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java159
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java169
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java145
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java145
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java398
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java312
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java82
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java314
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java111
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java393
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java160
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java159
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java256
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java320
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java370
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java148
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java205
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java198
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java230
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java260
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java118
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java344
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java641
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java733
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java812
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java425
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java495
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronizerTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java756
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/test.xml38
3551 files changed, 0 insertions, 577700 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/epl-v10.html b/assembly/features/org.eclipse.jpt.assembly.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/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.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt.assembly.feature/feature.properties
deleted file mode 100644
index 5771e2672f..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/feature.properties
+++ /dev/null
@@ -1,144 +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
-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\
-March 17, 2005\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\
-\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.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt.assembly.feature/feature.xml
deleted file mode 100644
index 38ba2730b9..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/feature.xml
+++ /dev/null
@@ -1,34 +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">
-
- <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.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.assembly.feature/license.html b/assembly/features/org.eclipse.jpt.assembly.feature/license.html
deleted file mode 100644
index 2347060ef3..0000000000
--- a/assembly/features/org.eclipse.jpt.assembly.feature/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.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/epl-v10.html b/assembly/features/org.eclipse.jpt.tests.assembly.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/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.tests.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties
deleted file mode 100644
index c98fef25cb..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.properties
+++ /dev/null
@@ -1,145 +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
-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.tests.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml
deleted file mode 100644
index 16f3bd7ef8..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/feature.xml
+++ /dev/null
@@ -1,28 +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">
-
- <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.tests.feature"
- version="0.0.0"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt.tests.assembly.feature/license.html b/assembly/features/org.eclipse.jpt.tests.assembly.feature/license.html
deleted file mode 100644
index 56445985d9..0000000000
--- a/assembly/features/org.eclipse.jpt.tests.assembly.feature/license.html
+++ /dev/null
@@ -1,98 +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>June 06, 2007</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>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.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.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/epl-v10.html b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/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.assembly.feature/feature.properties b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties
deleted file mode 100644
index 1f4dd698f5..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.properties
+++ /dev/null
@@ -1,145 +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
-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_sdk.assembly.feature/feature.xml b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml
deleted file mode 100644
index 26870a4ac0..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/feature.xml
+++ /dev/null
@@ -1,34 +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">
-
- <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"/>
-
-</feature>
diff --git a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/license.html b/assembly/features/org.eclipse.jpt_sdk.assembly.feature/license.html
deleted file mode 100644
index 76abfb4621..0000000000
--- a/assembly/features/org.eclipse.jpt_sdk.assembly.feature/license.html
+++ /dev/null
@@ -1,98 +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>June 06, 2007</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>
-
- <LI>Common Development and Distribution License (CDDL) Version 1.0 (available at <A
- href="http://www.sun.com/cddl/cddl.html">http://www.sun.com/cddl/cddl.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/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore b/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
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 93f19b18a8..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/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/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/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/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties
deleted file mode 100644
index 024fdc1a21..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,163 +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 - EclipseLink Support (Optional)
-
-# "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 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
-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/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml b/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
deleted file mode 100644
index 7471e7d9ac..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.eclipselink.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.eclipselink.branding">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.feature" version="2.3.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core.ddlgen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.jaxb.core.schemagen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/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/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 53abe6605b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +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 = \
- epl-v10.html,\
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties,\
- license.html
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/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.eclipselink.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index ae6b7ad4ef..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,168 +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
-###############################################################################
-# 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 (Optional)
-
-# "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
-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/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplateFeature/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/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
deleted file mode 100644
index 15f9157901..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.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.eclipselink_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index b479ccbeeb..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.eclipselink.feature.source=org.eclipse.jpt.eclipselink.feature
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/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/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index be836175c0..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,163 +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 - EclipseLink Support SDK (Optional)
-
-# "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 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
-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/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 54b848b440..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.eclipselink_sdk.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/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/jpa/features/org.eclipse.jpt.feature/.cvsignore b/jpa/features/org.eclipse.jpt.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.feature/.project b/jpa/features/org.eclipse.jpt.feature/.project
deleted file mode 100644
index c8eb2f0481..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/build.properties b/jpa/features/org.eclipse.jpt.feature/build.properties
deleted file mode 100644
index 7200939aca..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/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/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/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/jpa/features/org.eclipse.jpt.feature/feature.properties b/jpa/features/org.eclipse.jpt.feature/feature.properties
deleted file mode 100644
index 43967bbc60..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.properties
+++ /dev/null
@@ -1,163 +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
-
-# "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
-
-# "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
-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/jpa/features/org.eclipse.jpt.feature/feature.xml b/jpa/features/org.eclipse.jpt.feature/feature.xml
deleted file mode 100644
index 63c2bbc466..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/feature.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.branding">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <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.utility"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.db.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.ui"
- 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.core.schemagen"
- 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.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.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.apache.velocity"
- download-size="0"
- install-size="0"
- version="1.5.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.feature/license.html b/jpa/features/org.eclipse.jpt.feature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/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/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 20288ae9d9..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index f60dad3f94..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,16 +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 = \
- epl-v10.html,\
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties,\
- license.html
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/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.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index 8cccce1155..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,168 +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
-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/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplateFeature/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/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 021634dd5c..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.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.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.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.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
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 91760f21b4..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.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.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.tests.feature/build.properties
deleted file mode 100644
index d6a4dce096..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/build.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- epl-v10.html,\
- license.html,\
- feature.properties
-src.includes = license.html,\
- feature.xml,\
- epl-v10.html,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html b/jpa/features/org.eclipse.jpt.tests.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/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/jpa/features/org.eclipse.jpt.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
deleted file mode 100644
index bb09352da6..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.properties
+++ /dev/null
@@ -1,171 +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 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 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
-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/jpa/features/org.eclipse.jpt.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
deleted file mode 100644
index 4318f070f5..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/feature.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.tests.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <plugin
- id="org.eclipse.jpt.utility.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.core.tests.extension.resource"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.eclipselink.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/license.html b/jpa/features/org.eclipse.jpt.tests.feature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/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/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt_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_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project
deleted file mode 100644
index 33da750336..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_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_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt_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_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
deleted file mode 100644
index 2d7ab8d203..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- license.html,\
- feature.properties,\
- epl-v10.html,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.feature.source=org.eclipse.jpt.feature
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html b/jpa/features/org.eclipse.jpt_sdk.feature/epl-v10.html
deleted file mode 100644
index ed4b196655..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/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/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
deleted file mode 100644
index a2fe8ca5c2..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.properties
+++ /dev/null
@@ -1,163 +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 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
-
-# "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
-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/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
deleted file mode 100644
index 26f9defe91..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/feature.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt_sdk.feature"
- label="%featureName"
- version="2.3.1.qualifier"
- provider-name="%providerName">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.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_sdk.feature/license.html b/jpa/features/org.eclipse.jpt_sdk.feature/license.html
deleted file mode 100644
index c184ca36a9..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/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/jpa/plugins/org.eclipse.jpt.branding/.cvsignore b/jpa/plugins/org.eclipse.jpt.branding/.cvsignore
deleted file mode 100644
index c9401a2c83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/.project b/jpa/plugins/org.eclipse.jpt.branding/.project
deleted file mode 100644
index e1a9beda8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index b76c929bcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding;singleton:=true
-Bundle-Version: 2.3.1.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.branding/about.html b/jpa/plugins/org.eclipse.jpt.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/about.ini b/jpa/plugins/org.eclipse.jpt.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/about.properties b/jpa/plugins/org.eclipse.jpt.branding/about.properties
deleted file mode 100644
index 4b821e2ac7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2009. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.branding/build.properties b/jpa/plugins/org.eclipse.jpt.branding/build.properties
deleted file mode 100644
index 4e089bbd76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.branding/component.xml b/jpa/plugins/org.eclipse.jpt.branding/component.xml
deleted file mode 100644
index 622c26c9a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.branding/component.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.branding" 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.jaxb.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.utility" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.branding/plugin.properties
deleted file mode 100644
index 0cadd22a37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.core/.classpath b/jpa/plugins/org.eclipse.jpt.core/.classpath
deleted file mode 100644
index 5ee7c76127..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.core/.cvsignore
deleted file mode 100644
index 31362a7d19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.*
diff --git a/jpa/plugins/org.eclipse.jpt.core/.project b/jpa/plugins/org.eclipse.jpt.core/.project
deleted file mode 100644
index 6ab3035c3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.core/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index a35e16a202..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Wed Jan 20 17:49:11 EST 2010
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 00070b73fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Nov 12 15:24:36 EST 2006
-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.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 0f45878634..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,92 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core;singleton:=true
-Bundle-Version: 2.3.1.qualifier
-Bundle-Activator: org.eclipse.jpt.core.JptCorePlugin
-Bundle-ActivationPolicy: lazy;exclude:="org.eclipse.jpt.core.internal.resource.contenttypes"
-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.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.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.db;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.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,1.2.0)",
- org.eclipse.jst.j2ee.core;bundle-version="[1.1.200,1.3.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,1.3.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.eclipse.wst.sse.core;bundle-version="[1.1.300,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.core,
- org.eclipse.jpt.core.context,
- org.eclipse.jpt.core.context.java,
- org.eclipse.jpt.core.context.orm,
- org.eclipse.jpt.core.context.persistence,
- org.eclipse.jpt.core.internal;x-internal:=true,
- org.eclipse.jpt.core.internal.context;x-internal:=true,
- org.eclipse.jpt.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.core.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.core.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.core.internal.facet;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.context;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.context.java;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.context.orm;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.context.persistence;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa1.resource.java.source;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context.java;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context.orm;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context.persistence;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context.persistence.connection;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.context.persistence.options;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.resource.java;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.core.internal.jpa2.resource.java.source;x-internal:=true,
- org.eclipse.jpt.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.core.internal.prefs;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.contenttypes;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.orm;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.persistence;x-internal:=true,
- org.eclipse.jpt.core.internal.resource.xml,
- org.eclipse.jpt.core.internal.synch;x-internal:=true,
- org.eclipse.jpt.core.internal.utility;x-internal:=true,
- org.eclipse.jpt.core.internal.utility.jdt;x-internal:=true,
- org.eclipse.jpt.core.internal.utility.translators;x-internal:=true,
- org.eclipse.jpt.core.internal.validation;x-internal:=true,
- org.eclipse.jpt.core.jpa2,
- org.eclipse.jpt.core.jpa2.context,
- org.eclipse.jpt.core.jpa2.context.java,
- org.eclipse.jpt.core.jpa2.context.orm,
- org.eclipse.jpt.core.jpa2.context.persistence,
- org.eclipse.jpt.core.jpa2.context.persistence.connection,
- org.eclipse.jpt.core.jpa2.context.persistence.options,
- org.eclipse.jpt.core.jpa2.resource.java,
- org.eclipse.jpt.core.resource,
- org.eclipse.jpt.core.resource.java,
- org.eclipse.jpt.core.resource.orm,
- org.eclipse.jpt.core.resource.orm.v2_0,
- org.eclipse.jpt.core.resource.persistence,
- org.eclipse.jpt.core.resource.persistence.v2_0,
- org.eclipse.jpt.core.resource.xml,
- org.eclipse.jpt.core.utility,
- org.eclipse.jpt.core.utility.jdt
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.core/about.html b/jpa/plugins/org.eclipse.jpt.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.core/build.properties b/jpa/plugins/org.eclipse.jpt.core/build.properties
deleted file mode 100644
index 1035f84e58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/build.properties
+++ /dev/null
@@ -1,22 +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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = model/,\
- schema/
diff --git a/jpa/plugins/org.eclipse.jpt.core/component.xml b/jpa/plugins/org.eclipse.jpt.core/component.xml
deleted file mode 100644
index f6eef93d38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/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.core"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.core" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml b/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
deleted file mode 100644
index 147065a21f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/DaliEmfFormatter.xml
+++ /dev/null
@@ -1,274 +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
- -->
-
-<profiles version="11">
-<profile kind="CodeFormatterProfile" name="DaliEMFFormatter" version="11">
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="2"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="32"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="48"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="32"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.source" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="insert"/>
-<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
-<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.5"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="52"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
-<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
-<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="true"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
-</profile>
-</profiles>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/common.ecore b/jpa/plugins/org.eclipse.jpt.core/model/common.ecore
deleted file mode 100644
index f2415c0e10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/common.ecore
+++ /dev/null
@@ -1,14 +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="xml"
- nsURI="jpt.common.xmi" nsPrefix="org.eclipse.jpt.core.resource.xml">
- <eClassifiers xsi:type="ecore:EClass" name="AbstractJpaRootEObject" abstract="true"
- eSuperTypes="#//JpaRootEObject"/>
- <eClassifiers xsi:type="ecore:EClass" name="JpaRootEObject" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="version" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schemaLocation" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/jpaResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/jpaResourceModels.genmodel
deleted file mode 100644
index 1bd4352658..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/jpaResourceModels.genmodel
+++ /dev/null
@@ -1,513 +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.core/src"
- creationCommands="false" creationIcons="false" editDirectory="" editorDirectory=""
- modelPluginID="org.eclipse.jpt.core" modelName="Core" editPluginClass="" editorPluginClass=""
- updateClasspath="false" rootExtendsInterface="org.eclipse.jpt.core.resource.xml.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.core.resource.xml.AbstractJpaEObject" suppressInterfaces="true"
- testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
- <foreignModel>common.ecore</foreignModel>
- <foreignModel>orm.ecore</foreignModel>
- <foreignModel>persistence.ecore</foreignModel>
- <genPackages prefix="Common" basePackage="org.eclipse.jpt.core.resource" disposableProviderFactory="true"
- adapterFactory="false" ecorePackage="common.ecore#/">
- <genClasses image="false" ecoreClass="common.ecore#//AbstractJpaRootEObject"/>
- <genClasses image="false" ecoreClass="common.ecore#//JpaRootEObject">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute common.ecore#//JpaRootEObject/version"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute common.ecore#//JpaRootEObject/schemaLocation"/>
- </genClasses>
- </genPackages>
- <genPackages prefix="Orm" basePackage="org.eclipse.jpt.core.resource" disposableProviderFactory="true"
- adapterFactory="false" ecorePackage="orm.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//AccessType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//AccessType/PROPERTY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//AccessType/FIELD"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//DiscriminatorType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/STRING"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/CHAR"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//DiscriminatorType/INTEGER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//EnumType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//EnumType/ORDINAL"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//EnumType/STRING"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//FetchType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//FetchType/LAZY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//FetchType/EAGER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//GenerationType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/SEQUENCE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/IDENTITY"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//GenerationType/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//InheritanceType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/SINGLE_TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/JOINED"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//InheritanceType/TABLE_PER_CLASS"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//TemporalType">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/DATE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/TIME"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//TemporalType/TIMESTAMP"/>
- </genEnums>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlAttributeMapping"/>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/insertable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/nullable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/unique"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/updatable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlEmbedded"/>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlMultiRelationshipMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlMultiRelationshipMapping/mapKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlNamedColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlNamedColumn/columnDefinition"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlNamedColumn/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlRelationshipMapping/targetEntity"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlRelationshipMapping/fetch"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlRelationshipMapping/cascade"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlSingleRelationshipMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlSingleRelationshipMapping/optional"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlReferenceTable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlTable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTable/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTable/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlTable/schema"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlTable/uniqueConstraints"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlTypeMapping"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAccessHolder">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAccessHolder/access"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAttributeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlAttributeMapping/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlAssociationOverride"/>
- <genClasses ecoreClass="orm.ecore#//XmlAssociationOverrideContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAssociationOverrideContainer/associationOverrides"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlAttributeOverride">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAttributeOverride/column"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlAttributeOverrideContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlAttributeOverrideContainer/attributeOverrides"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//Attributes">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/ids"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/embeddedIds"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/basics"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/versions"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/manyToOnes"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/oneToManys"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/oneToOnes"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/manyToManys"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/embeddeds"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//Attributes/transients"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlBasic">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/fetch"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlBasic/optional"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//CascadeType">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeAll"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeMerge"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute orm.ecore#//CascadeType/cascadeRefresh"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlClassReference">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlClassReference/className"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlCollectionTable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/length"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/precision"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlColumn/scale"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//ColumnMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//ColumnMapping/column"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//ColumnResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//ColumnResult/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlConvertibleMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlConvertibleMapping/lob"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlConvertibleMapping/temporal"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlConvertibleMapping/enumerated"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlDiscriminatorColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/discriminatorType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/length"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlElementCollection"/>
- <genClasses ecoreClass="orm.ecore#//XmlEmbeddable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbedded"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbeddedId"/>
- <genClasses ecoreClass="orm.ecore#//XmlEntity">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/name"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/table"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/secondaryTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/primaryKeyJoinColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/inheritance"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/discriminatorValue"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/discriminatorColumn"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/sqlResultSetMappings"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/excludeDefaultListeners"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntity/excludeSuperclassListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntity/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityListener">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityListener/className"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityListeners">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityListeners/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlEntityMappings">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/persistenceUnitMetadata"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/package"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlEntityMappings/catalog"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/sequenceGenerators"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/tableGenerators"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/sqlResultSetMappings"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/mappedSuperclasses"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/entities"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityMappings/embeddables"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EntityResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityResult/discriminatorColumn"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EntityResult/entityClass"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//EntityResult/fieldResults"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//EventMethod">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//EventMethod/methodName"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlEventMethodContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/prePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/postPersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/preRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/postRemove"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/preUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/postUpdate"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEventMethodContainer/postLoad"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//FieldResult">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//FieldResult/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//FieldResult/column"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlGeneratedValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGeneratedValue/generator"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGeneratedValue/strategy"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/initialValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlGenerator/allocationSize"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlGeneratorContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlGeneratorContainer/sequenceGenerator"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlGeneratorContainer/tableGenerator"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlId">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlId/generatedValue"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlIdClassContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlIdClassContainer/idClass"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//Inheritance">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//Inheritance/strategy"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlJoinColumn/referencedColumnName"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinColumnsMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinColumnsMapping/joinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlJoinTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTable/inverseJoinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlJoinTableMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlJoinTableMapping/joinTable"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//Lob"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToMany"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="orm.ecore#//MapKey">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//MapKey/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlMappedByMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMappedByMapping/mappedBy"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlMappedSuperclass">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMappedSuperclass/excludeDefaultListeners"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlMappedSuperclass/excludeSuperclassListeners"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlNamedNativeQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedNativeQuery/resultClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlNamedNativeQuery/resultSetMapping"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlNamedQuery"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlNullAttributeMapping"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToMany"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOneToOne">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlOneToOne/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOrderable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlOrderable/orderBy"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlOrderColumn"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlOverride">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlOverride/name"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlPersistenceUnitDefaults">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitDefaults/cascadePersist"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistenceUnitDefaults/entityListeners"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlPersistenceUnitMetadata">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPersistenceUnitMetadata/xmlMappingMetadataComplete"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistenceUnitMetadata/persistenceUnitDefaults"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlReferenceTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlReferenceTable/joinColumns"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//PostLoad"/>
- <genClasses ecoreClass="orm.ecore#//PostPersist"/>
- <genClasses ecoreClass="orm.ecore#//PostRemove"/>
- <genClasses ecoreClass="orm.ecore#//PostUpdate"/>
- <genClasses ecoreClass="orm.ecore#//PrePersist"/>
- <genClasses ecoreClass="orm.ecore#//PreRemove"/>
- <genClasses ecoreClass="orm.ecore#//PreUpdate"/>
- <genClasses ecoreClass="orm.ecore#//XmlPrimaryKeyJoinColumn">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlPrimaryKeyJoinColumn/referencedColumnName"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQuery/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQuery/query"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlQuery/hints"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlQueryContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlQueryContainer/namedQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlQueryContainer/namedNativeQueries"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlQueryHint">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQueryHint/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlQueryHint/value"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlSecondaryTable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlSecondaryTable/primaryKeyJoinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlSequenceGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlSequenceGenerator/sequenceName"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//SqlResultSetMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//SqlResultSetMapping/name"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//SqlResultSetMapping/entityResults"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//SqlResultSetMapping/columnResults"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlTable"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTableGenerator">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/pkColumnName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/valueColumnName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTableGenerator/pkColumnValue"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlTableGenerator/uniqueConstraints"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTransient"/>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlTypeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTypeMapping/className"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTypeMapping/metadataComplete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlTypeMapping/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlTypeMapping/attributes"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlUniqueConstraint">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlUniqueConstraint/columnNames"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//XmlVersion"/>
- <nestedGenPackages prefix="OrmV2_0" basePackage="org.eclipse.jpt.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="orm.ecore#//v2_0">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="orm.ecore#//v2_0/LockModeType_2_0">
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/NONE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/READ"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/WRITE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/OPTIMISTIC"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/OPTIMISTIC_FORCE_INCREMENT"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/PESSIMISTIC_READ"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/PESSIMISTIC_WRITE"/>
- <genEnumLiterals ecoreEnumLiteral="orm.ecore#//v2_0/LockModeType_2_0/PESSIMISTIC_FORCE_INCREMENT"/>
- </genEnums>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlAssociationOverride_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlAssociationOverride_2_0/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlAssociationOverride_2_0/joinTable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlAttributeMapping_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlAttributeOverride_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlAttributeOverride_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlAttributes_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlAttributes_2_0/description"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlAttributes_2_0/elementCollections"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlCacheable_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlCacheable_2_0/cacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlCascadeType_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlCascadeType_2_0/cascadeDetach"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlCollectionTable_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlDerivedId_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlDerivedId_2_0/id"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlElementCollection_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlElementCollection_2_0/targetClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlElementCollection_2_0/fetch"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/mapKey"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/mapKeyClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlElementCollection_2_0/mapKeyTemporal"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlElementCollection_2_0/mapKeyEnumerated"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/mapKeyColumn"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/mapKeyJoinColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/column"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlElementCollection_2_0/collectionTable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlEmbedded_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlEntity_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlEntityListener_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlEntityListener_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlEventMethod_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlEventMethod_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlGenerator_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlGenerator_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlManyToMany_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlMapKeyAttributeOverrideContainer_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlMapKeyAttributeOverrideContainer_2_0/mapKeyAttributeOverrides"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlMapsId_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlMapsId_2_0/mapsId"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0/mapKeyClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0/mapKeyTemporal"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0/mapKeyEnumerated"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0/mapKeyColumn"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlMultiRelationshipMapping_2_0/mapKeyJoinColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlNamedQuery_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlNamedQuery_2_0/lockMode"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlOneToMany_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlOneToOne_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlOrderable_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//v2_0/XmlOrderable_2_0/orderColumn"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlOrderColumn_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlOrderColumn_2_0/nullable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlOrderColumn_2_0/insertable"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlOrderColumn_2_0/updatable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlOrphanRemovable_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlOrphanRemovable_2_0/orphanRemoval"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlPersistenceUnitDefaults_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlPersistenceUnitDefaults_2_0/description"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlPersistenceUnitDefaults_2_0/delimitedIdentifiers"/>
- </genClasses>
- <genClasses ecoreClass="orm.ecore#//v2_0/XmlPersistenceUnitMetadata_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlPersistenceUnitMetadata_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlQuery_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlQuery_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlQueryHint_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlQueryHint_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlSequenceGenerator_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlSequenceGenerator_2_0/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlSequenceGenerator_2_0/schema"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlSingleRelationshipMapping_2_0"/>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlSqlResultSetMapping_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlSqlResultSetMapping_2_0/description"/>
- </genClasses>
- <genClasses image="false" ecoreClass="orm.ecore#//v2_0/XmlUniqueConstraint_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//v2_0/XmlUniqueConstraint_2_0/name"/>
- </genClasses>
- </nestedGenPackages>
- </genPackages>
- <genPackages prefix="Persistence" basePackage="org.eclipse.jpt.core.resource" disposableProviderFactory="true"
- adapterFactory="false" ecorePackage="persistence.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="persistence.ecore#//XmlPersistenceUnitTransactionType">
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/JTA"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/RESOURCE_LOCAL"/>
- </genEnums>
- <genClasses ecoreClass="persistence.ecore#//XmlJavaClassRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlJavaClassRef/javaClass"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlJarFileRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlJarFileRef/fileName"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlMappingFileRef">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlMappingFileRef/fileName"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlPersistence">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistence/persistenceUnits"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlPersistenceUnit">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/description"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/provider"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/jtaDataSource"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/nonJtaDataSource"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/mappingFiles"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/jarFiles"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/classes"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/excludeUnlistedClasses"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlPersistenceUnit/properties"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlPersistenceUnit/transactionType"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlProperties">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference persistence.ecore#//XmlProperties/properties"/>
- </genClasses>
- <genClasses ecoreClass="persistence.ecore#//XmlProperty">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlProperty/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//XmlProperty/value"/>
- </genClasses>
- <nestedGenPackages prefix="PersistenceV2_0" basePackage="org.eclipse.jpt.core.resource.persistence"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="persistence.ecore#//v2_0">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0">
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0/ALL"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0/NONE"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0/ENABLE_SELECTIVE"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0/DISABLE_SELECTIVE"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitCachingType_2_0/UNSPECIFIED"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="persistence.ecore#//v2_0/XmlPersistenceUnitValidationModeType_2_0">
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitValidationModeType_2_0/AUTO"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitValidationModeType_2_0/CALLBACK"/>
- <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//v2_0/XmlPersistenceUnitValidationModeType_2_0/NONE"/>
- </genEnums>
- <genClasses image="false" ecoreClass="persistence.ecore#//v2_0/XmlPersistenceUnit_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//v2_0/XmlPersistenceUnit_2_0/sharedCacheMode"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute persistence.ecore#//v2_0/XmlPersistenceUnit_2_0/validationMode"/>
- </genClasses>
- </nestedGenPackages>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
deleted file mode 100644
index c222b13b12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ /dev/null
@@ -1,578 +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.orm.xmi" nsPrefix="org.eclipse.jpt.core.resource.orm">
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlAttributeMapping" abstract="true"
- eSuperTypes="#//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlColumn" abstract="true" eSuperTypes="#//AbstractXmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insertable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nullable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <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="updatable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlEmbedded" abstract="true"
- eSuperTypes="#//AbstractXmlAttributeMapping #//XmlAttributeOverrideContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlMultiRelationshipMapping"
- abstract="true" eSuperTypes="#//AbstractXmlRelationshipMapping #//XmlMappedByMapping #//XmlJoinTableMapping #//XmlOrderable #//v2_0/XmlMultiRelationshipMapping_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKey" eType="#//MapKey"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlNamedColumn" abstract="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnDefinition" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <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="AbstractXmlRelationshipMapping" abstract="true"
- eSuperTypes="#//AbstractXmlAttributeMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetEntity" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//FetchType"
- defaultValueLiteral="LAZY"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cascade" eType="#//CascadeType"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlSingleRelationshipMapping"
- abstract="true" eSuperTypes="#//AbstractXmlRelationshipMapping #//XmlJoinTableMapping #//XmlJoinColumnsMapping #//v2_0/XmlSingleRelationshipMapping_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlReferenceTable" abstract="true"
- eSuperTypes="#//AbstractXmlTable #//XmlReferenceTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlTable" abstract="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="catalog" 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:EReference" name="uniqueConstraints" upperBound="-1"
- eType="#//XmlUniqueConstraint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlTypeMapping" abstract="true"
- eSuperTypes="#//XmlTypeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAccessHolder" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="access" eType="#//AccessType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlAttributeMapping_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAssociationOverride" eSuperTypes="#//XmlOverride #//XmlJoinColumnsMapping #//v2_0/XmlAssociationOverride_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAssociationOverrideContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="associationOverrides" upperBound="-1"
- eType="#//XmlAssociationOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverride" eSuperTypes="#//XmlOverride #//v2_0/XmlAttributeOverride_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" lowerBound="1"
- eType="#//XmlColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverrideContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributeOverrides" upperBound="-1"
- eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="#//v2_0/XmlAttributes_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="ids" upperBound="-1" eType="#//XmlId"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddedIds" upperBound="-1"
- eType="#//XmlEmbeddedId" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="basics" upperBound="-1"
- eType="#//XmlBasic" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="versions" upperBound="-1"
- eType="#//XmlVersion" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="manyToOnes" upperBound="-1"
- eType="#//XmlManyToOne" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oneToManys" upperBound="-1"
- eType="#//XmlOneToMany" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="oneToOnes" upperBound="-1"
- eType="#//XmlOneToOne" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="manyToManys" upperBound="-1"
- eType="#//XmlManyToMany" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddeds" upperBound="-1"
- eType="#//XmlEmbedded" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="transients" upperBound="-1"
- eType="#//XmlTransient" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic" eSuperTypes="#//AbstractXmlAttributeMapping #//ColumnMapping #//XmlConvertibleMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//FetchType"
- defaultValueLiteral="LAZY"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="optional" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="CascadeType" eSuperTypes="#//v2_0/XmlCascadeType_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadePersist" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeMerge" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeRemove" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeRefresh" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlClassReference">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable" eSuperTypes="#//AbstractXmlReferenceTable #//v2_0/XmlCollectionTable_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlColumn" eSuperTypes="#//AbstractXmlColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="precision" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="scale" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ColumnMapping" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" eType="#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="ColumnResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConvertibleMapping" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="lob" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="temporal" eType="#//TemporalType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="enumerated" eType="#//EnumType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlDiscriminatorColumn" eSuperTypes="#//AbstractXmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorType" eType="#//DiscriminatorType"
- defaultValueLiteral="STRING"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection" eSuperTypes="#//AbstractXmlAttributeMapping #//v2_0/XmlElementCollection_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="#//AbstractXmlTypeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="#//AbstractXmlEmbedded #//v2_0/XmlEmbedded_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="#//AbstractXmlEmbedded"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="#//AbstractXmlTypeMapping #//XmlQueryContainer #//XmlGeneratorContainer #//XmlEventMethodContainer #//XmlAttributeOverrideContainer #//XmlAssociationOverrideContainer #//v2_0/XmlEntity_2_0 #//XmlIdClassContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="#//XmlTable"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="secondaryTables" upperBound="-1"
- eType="#//XmlSecondaryTable" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="inheritance" eType="#//Inheritance"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="discriminatorColumn" eType="#//XmlDiscriminatorColumn"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings" upperBound="-1"
- eType="#//SqlResultSetMapping" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityListener" eSuperTypes="#//XmlEventMethodContainer #//v2_0/XmlEntityListener_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityListeners">
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" upperBound="-1"
- eType="#//EntityListener" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings" eSuperTypes="common.ecore#//AbstractJpaRootEObject #//XmlQueryContainer #//XmlAccessHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnitMetadata"
- eType="#//XmlPersistenceUnitMetadata" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="package" 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:EReference" name="sequenceGenerators" upperBound="-1"
- eType="#//XmlSequenceGenerator" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerators" upperBound="-1"
- eType="#//XmlTableGenerator" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings" upperBound="-1"
- eType="#//SqlResultSetMapping" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappedSuperclasses" upperBound="-1"
- eType="#//XmlMappedSuperclass" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entities" upperBound="-1"
- eType="#//XmlEntity" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="embeddables" upperBound="-1"
- eType="#//XmlEmbeddable" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EntityResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorColumn" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="entityClass" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="fieldResults" upperBound="-1"
- eType="#//FieldResult" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="EventMethod" abstract="true" eSuperTypes="#//v2_0/XmlEventMethod_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="methodName" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEventMethodContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="prePersist" eType="#//PrePersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postPersist" eType="#//PostPersist"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preRemove" eType="#//PreRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postRemove" eType="#//PostRemove"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="preUpdate" eType="#//PreUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postUpdate" eType="#//PostUpdate"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="postLoad" eType="#//PostLoad"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="FieldResult">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="column" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGeneratedValue">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="generator" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//GenerationType"
- defaultValueLiteral="TABLE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGenerator" abstract="true" interface="true"
- eSuperTypes="#//v2_0/XmlGenerator_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="initialValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="allocationSize" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGeneratorContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sequenceGenerator" eType="#//XmlSequenceGenerator"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tableGenerator" eType="#//XmlTableGenerator"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId" eSuperTypes="#//AbstractXmlAttributeMapping #//ColumnMapping #//XmlConvertibleMapping #//XmlGeneratorContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="#//XmlGeneratedValue"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIdClassContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="idClass" eType="#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Inheritance">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//InheritanceType"
- defaultValueLiteral="SINGLE_TABLE"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinColumn" eSuperTypes="#//AbstractXmlColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="referencedColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinColumnsMapping" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable" eSuperTypes="#//AbstractXmlReferenceTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="inverseJoinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTableMapping" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinTable" eType="#//XmlJoinTable"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Lob"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" eSuperTypes="#//AbstractXmlMultiRelationshipMapping #//v2_0/XmlManyToMany_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" eSuperTypes="#//AbstractXmlSingleRelationshipMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="MapKey">
- <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="XmlMappedByMapping" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//AbstractXmlTypeMapping #//XmlIdClassContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedNativeQuery" eSuperTypes="#//XmlQuery">
- <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"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedQuery" eSuperTypes="#//XmlQuery #//v2_0/XmlNamedQuery_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNullAttributeMapping" abstract="true"
- eSuperTypes="#//AbstractXmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" eSuperTypes="#//AbstractXmlMultiRelationshipMapping #//XmlJoinColumnsMapping #//v2_0/XmlOneToMany_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" eSuperTypes="#//AbstractXmlSingleRelationshipMapping #//XmlMappedByMapping #//v2_0/XmlOneToOne_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderable" abstract="true" interface="true"
- eSuperTypes="#//v2_0/XmlOrderable_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="orderBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn" eSuperTypes="#//AbstractXmlNamedColumn #//v2_0/XmlOrderColumn_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOverride" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults" eSuperTypes="#//XmlAccessHolder #//v2_0/XmlPersistenceUnitDefaults_2_0">
- <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="cascadePersist" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata" eSuperTypes="#//v2_0/XmlPersistenceUnitMetadata_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="xmlMappingMetadataComplete"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnitDefaults"
- eType="#//XmlPersistenceUnitDefaults" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReferenceTable" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="PostLoad" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostPersist" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostRemove" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PostUpdate" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PrePersist" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PreRemove" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="PreUpdate" eSuperTypes="#//EventMethod"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKeyJoinColumn" eSuperTypes="#//AbstractXmlNamedColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="referencedColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQuery" abstract="true" interface="true"
- eSuperTypes="#//v2_0/XmlQuery_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="query" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hints" upperBound="-1"
- eType="#//XmlQueryHint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryContainer" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedQueries" upperBound="-1"
- eType="#//XmlNamedQuery" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedNativeQueries" upperBound="-1"
- eType="#//XmlNamedNativeQuery" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryHint" eSuperTypes="#//v2_0/XmlQueryHint_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable" eSuperTypes="#//AbstractXmlTable">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKeyJoinColumns"
- upperBound="-1" eType="#//XmlPrimaryKeyJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSequenceGenerator" eSuperTypes="#//XmlGenerator #//v2_0/XmlSequenceGenerator_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="sequenceName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="SqlResultSetMapping" eSuperTypes="#//v2_0/XmlSqlResultSetMapping_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityResults" upperBound="-1"
- eType="#//EntityResult" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="columnResults" upperBound="-1"
- eType="#//ColumnResult" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable" eSuperTypes="#//AbstractXmlTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator" eSuperTypes="#//XmlGenerator">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" 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="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="pkColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueColumnName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="pkColumnValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="uniqueConstraints" upperBound="-1"
- eType="#//XmlUniqueConstraint" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" eSuperTypes="#//AbstractXmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeMapping" abstract="true" interface="true"
- eSuperTypes="#//XmlAccessHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="metadataComplete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" eType="#//Attributes"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUniqueConstraint" eSuperTypes="#//v2_0/XmlUniqueConstraint_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- lowerBound="1" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="#//AbstractXmlAttributeMapping #//ColumnMapping #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EEnum" name="AccessType">
- <eLiterals name="PROPERTY"/>
- <eLiterals name="FIELD" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="DiscriminatorType">
- <eLiterals name="STRING"/>
- <eLiterals name="CHAR" value="1"/>
- <eLiterals name="INTEGER" value="2"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="EnumType">
- <eLiterals name="ORDINAL"/>
- <eLiterals name="STRING" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="FetchType">
- <eLiterals name="LAZY"/>
- <eLiterals name="EAGER" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="GenerationType">
- <eLiterals name="TABLE"/>
- <eLiterals name="SEQUENCE" value="1"/>
- <eLiterals name="IDENTITY" value="2"/>
- <eLiterals name="AUTO" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="InheritanceType">
- <eLiterals name="SINGLE_TABLE" literal="SINGLE_TABLE"/>
- <eLiterals name="JOINED" value="1"/>
- <eLiterals name="TABLE_PER_CLASS" value="2" literal="TABLE_PER_CLASS"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="TemporalType">
- <eLiterals name="DATE"/>
- <eLiterals name="TIME" value="1"/>
- <eLiterals name="TIMESTAMP" value="2"/>
- </eClassifiers>
- <eSubpackages name="v2_0" nsURI="jpt.orm.v2_0.xmi" nsPrefix="org.eclipse.jpt.core.resource.orm.v2_0">
- <eClassifiers xsi:type="ecore:EClass" name="XmlAssociationOverride_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="joinTable" eType="#//XmlJoinTable"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeOverride_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributes_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="elementCollections" upperBound="-1"
- eType="#//XmlElementCollection" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheable_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCascadeType_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeDetach" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlReferenceTable"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlDerivedId_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlConvertibleMapping #//XmlOrderable #//XmlAttributeOverrideContainer #//XmlAssociationOverrideContainer #//v2_0/XmlMapKeyAttributeOverrideContainer_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//FetchType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKey" eType="#//MapKey"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyClass" eType="#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyTemporal" eType="#//TemporalType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyEnumerated" eType="#//EnumType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyColumn" eType="#//XmlColumn"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyJoinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="column" eType="#//XmlColumn"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="collectionTable" eType="#//XmlCollectionTable"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded_2_0" abstract="true" interface="true"
- eSuperTypes="#//XmlAssociationOverrideContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_0" abstract="true" interface="true"
- eSuperTypes="#//v2_0/XmlCacheable_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityListener_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEventMethod_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlGenerator_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlMultiRelationshipMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMapKeyAttributeOverrideContainer_2_0"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyAttributeOverrides"
- upperBound="-1" eType="#//XmlAttributeOverride" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMapsId_2_0" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapsId" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultiRelationshipMapping_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlOrderable_2_0 #//v2_0/XmlMapKeyAttributeOverrideContainer_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyClass" eType="#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyTemporal" eType="#//TemporalType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyEnumerated" eType="#//EnumType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyColumn" eType="#//XmlColumn"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyJoinColumns" upperBound="-1"
- eType="#//XmlJoinColumn" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedQuery_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="lockMode" eType="#//v2_0/LockModeType_2_0"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlMultiRelationshipMapping_2_0 #//v2_0/XmlOrphanRemovable_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_0" abstract="true" interface="true"
- eSuperTypes="#//v2_0/XmlSingleRelationshipMapping_2_0 #//v2_0/XmlOrphanRemovable_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderable_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="orderColumn" eType="#//XmlOrderColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nullable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insertable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="updatable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrphanRemovable_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="orphanRemoval" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="delimitedIdentifiers"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQuery_2_0" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryHint_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSequenceGenerator_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" 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"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSingleRelationshipMapping_2_0"
- abstract="true" interface="true" eSuperTypes="#//v2_0/XmlDerivedId_2_0 #//v2_0/XmlMapsId_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSqlResultSetMapping_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUniqueConstraint_2_0" 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:EEnum" name="LockModeType_2_0">
- <eLiterals name="NONE"/>
- <eLiterals name="READ" value="1"/>
- <eLiterals name="WRITE" value="2"/>
- <eLiterals name="OPTIMISTIC" value="3"/>
- <eLiterals name="OPTIMISTIC_FORCE_INCREMENT" value="4"/>
- <eLiterals name="PESSIMISTIC_READ" value="5"/>
- <eLiterals name="PESSIMISTIC_WRITE" value="6"/>
- <eLiterals name="PESSIMISTIC_FORCE_INCREMENT" value="7"/>
- </eClassifiers>
- </eSubpackages>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore b/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
deleted file mode 100644
index 03599cbc26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/model/persistence.ecore
+++ /dev/null
@@ -1,84 +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="persistence"
- nsURI="jpt.persistence.xmi" nsPrefix="org.eclipse.jpt.core.resource.persistence">
- <eClassifiers xsi:type="ecore:EClass" name="XmlJavaClassRef">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="javaClass" ordered="false"
- unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJarFileRef">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fileName" ordered="false"
- unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappingFileRef">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="fileName" ordered="false"
- unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistence" eSuperTypes="common.ecore#//AbstractJpaRootEObject">
- <eStructuralFeatures xsi:type="ecore:EReference" name="persistenceUnits" upperBound="-1"
- eType="#//XmlPersistenceUnit" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnit" eSuperTypes="#//v2_0/XmlPersistenceUnit_2_0">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="provider" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jtaDataSource" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonJtaDataSource" unique="false"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="mappingFiles" upperBound="-1"
- eType="#//XmlMappingFileRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="jarFiles" upperBound="-1"
- eType="#//XmlJarFileRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="classes" upperBound="-1"
- eType="#//XmlJavaClassRef" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeUnlistedClasses"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" eType="#//XmlProperties"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="transactionType" unique="false"
- eType="#//XmlPersistenceUnitTransactionType" defaultValueLiteral="JTA"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlPersistenceUnitTransactionType">
- <eLiterals name="JTA"/>
- <eLiterals name="RESOURCE_LOCAL" value="1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperties">
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
- eType="#//XmlProperty" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperty">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" unique="false" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eSubpackages name="v2_0" nsURI="jpt.persistence.v2_0.xmi" nsPrefix="org.eclipse.jpt.core.resource.persistence.v2_0">
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnit_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="sharedCacheMode" unique="false"
- eType="#//v2_0/XmlPersistenceUnitCachingType_2_0" defaultValueLiteral="UNSPECIFIED"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="validationMode" unique="false"
- eType="#//v2_0/XmlPersistenceUnitValidationModeType_2_0" defaultValueLiteral="AUTO"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlPersistenceUnitCachingType_2_0">
- <eLiterals name="ALL"/>
- <eLiterals name="NONE" value="1"/>
- <eLiterals name="ENABLE_SELECTIVE" value="2"/>
- <eLiterals name="DISABLE_SELECTIVE" value="3"/>
- <eLiterals name="UNSPECIFIED" value="4"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlPersistenceUnitValidationModeType_2_0">
- <eLiterals name="AUTO"/>
- <eLiterals name="CALLBACK" value="1"/>
- <eLiterals name="NONE" value="2"/>
- </eClassifiers>
- </eSubpackages>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.core/plugin.properties
deleted file mode 100644
index e77e457a62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.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
-###############################################################################
-# ====================================================================
-# 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
-providerName = Eclipse Web Tools Platform
-
-JPA_PLATFORM=JPA Platform
-JPA_RESOURCE_MODEL_PROVIDERS=JPA Resource Model Providers
-JPA_PROBLEM_MARKER=JPA Problem Marker
-JPA_FILE_CONTENT=JPA File Content
-
-BASE_JPA_CONTENT = Base content for JPA XML files
-PERSISTENCE_XML_CONTENT = JPA persistence.xml files
-MAPPING_FILE_CONTENT = Base content for JPA XML mapping files
-ORM_XML_CONTENT = JPA orm.xml mapping files
-JAR_CONTENT = JAR Content
-
-GENERIC_1_0_PLATFORM_LABEL=Generic 1.0
-GENERIC_2_0_PLATFORM_LABEL=Generic 2.0
-
-NO_OP_LIBRARY_PROVIDER_WARNING = Library configuration is disabled. The user may need to configure further classpath changes later.
-NO_OP_LIBRARY_PROVIDER_MESSAGE = The JPA facet requires a JPA 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.
-
-JPA_PREREQ_GROUP_LABEL="JPA prerequisite facets"
-JPA_FACET_LABEL=JPA
-JPA_FACET_DESCRIPTION=Adds support for writing persistent meta-data using the Java Persistence API (JPA).
-JPA_1.0_PRESET_LABEL=Minimal JPA 1.0 Configuration
-JPA_2.0_PRESET_LABEL=Minimal JPA 2.0 Configuration
-JPA_TEMPLATE_LABEL=JPA Project
-JPA_VALIDATOR=JPA Validator
diff --git a/jpa/plugins/org.eclipse.jpt.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.core/plugin.xml
deleted file mode 100644
index 26ccdd0e83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/plugin.xml
+++ /dev/null
@@ -1,508 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.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
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jpaPlatforms"
- name="%JPA_PLATFORM"
- schema="schema/jpaPlatforms.exsd"
- />
-
-
- <!-- ***** Eclipse core extensions ***** -->
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <!-- "abstract" content type to be extended by all JPA XML file content types -->
- <content-type
- id="org.eclipse.jpt.core.content.baseJpaContent"
- name="%BASE_JPA_CONTENT"
- base-type="org.eclipse.core.runtime.xml"
- describer="org.eclipse.jpt.core.internal.resource.contenttypes.IndeterminateContentDescriber">
- </content-type>
-
- <!-- persistence.xml content type -->
- <content-type
- id="org.eclipse.jpt.core.content.persistence"
- name="%PERSISTENCE_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.baseJpaContent"
- file-names="persistence.xml">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
- <parameter
- name="element"
- value="{http://java.sun.com/xml/ns/persistence}persistence"/>
- </describer>
- </content-type>
-
- <!-- "abstract" mapping file content type -->
- <content-type
- id="org.eclipse.jpt.core.content.mappingFile"
- name="%MAPPING_FILE_CONTENT"
- base-type="org.eclipse.jpt.core.content.baseJpaContent">
- </content-type>
-
- <!-- orm.xml content type -->
- <content-type
- id="org.eclipse.jpt.core.content.orm"
- name="%ORM_XML_CONTENT"
- base-type="org.eclipse.jpt.core.content.mappingFile">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
- <parameter
- name="element"
- value="{http://java.sun.com/xml/ns/persistence/orm}entity-mappings"/>
- </describer>
- </content-type>
-
- <!-- JAR content type -->
- <content-type
- id="org.eclipse.jpt.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>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.expressions.propertyTesters">
-
- <propertyTester
- id="org.eclipse.jpt.core.propertyTester.persistentAttribute"
- type="org.eclipse.jpt.core.context.PersistentAttribute"
- namespace="org.eclipse.jpt.core"
- properties="isMapped, isVirtual"
- class="org.eclipse.jpt.core.internal.context.PersistentAttributePropertyTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.core.propertyTester.platformResource"
- type="org.eclipse.core.resources.IResource"
- namespace="org.eclipse.jpt.core"
- properties="jpaPlatform"
- class="org.eclipse.jpt.core.internal.JpaPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.core.propertyTester.javaElement"
- type="org.eclipse.jdt.core.IJavaElement"
- namespace="org.eclipse.jpt.core"
- properties="jpaPlatform"
- class="org.eclipse.jpt.core.internal.JpaPlatformTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.core.propertyTester.xmlResource"
- type="org.eclipse.jpt.core.resource.xml.JpaXmlResource"
- namespace="org.eclipse.jpt.core"
- properties="isLatestSupportedVersion"
- class="org.eclipse.jpt.core.internal.resource.xml.JpaXmlResourcePropertyTester"/>
-
- <propertyTester
- id="org.eclipse.jpt.core.propertyTester.xmlFile"
- type="org.eclipse.jpt.core.context.XmlFile"
- namespace="org.eclipse.jpt.core"
- properties="isLatestSupportedVersion"
- class="org.eclipse.jpt.core.internal.resource.xml.JpaXmlResourcePropertyTester"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <factory
- class="org.eclipse.jpt.core.internal.ProjectAdapterFactory"
- adaptableType="org.eclipse.core.resources.IProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.core.internal.ProjectAdapterFactory"
- adaptableType="org.eclipse.jdt.core.IJavaProject">
- <adapter type="org.eclipse.jpt.core.JpaProject"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.core.internal.ResourceAdapterFactory"
- adaptableType="org.eclipse.core.resources.IResource">
- <adapter type="org.eclipse.jpt.core.IResourcePart"/>
- </factory>
-
- <factory
- class="org.eclipse.jpt.core.internal.resource.xml.JpaXmlResourceAdapterFactory"
- adaptableType="org.eclipse.core.resources.IFile">
- <adapter type="org.eclipse.jpt.core.resource.xml.JpaXmlResource"/>
- </factory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.core.runtime.preferences">
-
- <initializer
- class="org.eclipse.jpt.core.internal.prefs.JpaPreferenceInitializer"/>
-
- </extension>
-
-
- <!-- ***** JPT extensions (eat our own dogfood) ***** -->
-
- <extension
- point="org.eclipse.jpt.core.jpaPlatforms">
-
- <jpaPlatform
- id="generic"
- label="%GENERIC_1_0_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.core.internal.GenericJpaPlatformFactory"
- jpaFacetVersion="1.0"
- default="false">
- </jpaPlatform>
-
- <jpaPlatform
- id="generic2_0"
- label="%GENERIC_2_0_PLATFORM_LABEL"
- factoryClass="org.eclipse.jpt.core.internal.jpa2.Generic2_0JpaPlatformFactory"
- jpaFacetVersion="2.0"
- default="false">
- </jpaPlatform>
-
- </extension>
-
-
- <!--
- ******************************************
- * Library Provider Framework Integration *
- ******************************************
- -->
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jpa-legacy-library-provider"
- extends="legacy-library-provider"
- hidden="true">
- <action type="UNINSTALL">
- <operation
- class="org.eclipse.jpt.core.internal.facet.LegacyJpaLibraryProviderInstallOperation"/>
- </action>
- </provider>
-
- <provider
- id="jpa-no-op-library-provider"
- extends="no-op-library-provider">
- <param name="message" value="%NO_OP_LIBRARY_PROVIDER_MESSAGE"/>
- <param name="warning" value="%NO_OP_LIBRARY_PROVIDER_WARNING"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider
- id="jpa-generic1_0-user-library-provider"
- extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="generic"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- <provider
- id="jpa-generic2_0-user-library-provider"
- extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.core.internal.utility.KeyClassesValidator"/>
- <param name="validator.param.0" value="javax.persistence.Entity"/>
- <param name="validator.param.1" value="javax.persistence.ElementCollection"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="generic2_0"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.legacyLibraryProviderDetectors">
-
- <detector
- class="org.eclipse.jpt.core.internal.facet.LegacyJpaLibraryProviderDetector"/>
-
- </extension>
-
-
- <extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider id="eclipselink-102-osgi-bundles-library-provider" extends="wtp-osgi-bundles-library-provider">
- <label>EclipseLink 1.0.x</label>
- <param name="container.label" value="EclipseLink 1.0.x"/>
- <param name="bundle.0" value="javax.persistence:[1.0.0, 2.0.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.0.0, 1.1.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.0.0, 1.1.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.0.0, 1.1.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.0.0, 1.1.0)"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider id="eclipselink-110-osgi-bundles-library-provider" extends="wtp-osgi-bundles-library-provider">
- <label>EclipseLink 1.1.x</label>
- <param name="container.label" value="EclipseLink 1.1.x"/>
- <param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.1.0, 1.2.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.1.0, 1.2.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.1.0, 1.2.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.1.0, 1.2.0)"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider id="eclipselink-120-osgi-bundles-library-provider" extends="wtp-osgi-bundles-library-provider">
- <label>EclipseLink 1.2.x</label>
- <param name="container.label" value="EclipseLink 1.2.x"/>
- <param name="bundle.0" value="javax.persistence:[1.99.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[1.2.0, 1.3.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[1.2.0, 1.3.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[1.2.0, 1.3.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[1.2.0, 1.3.0)"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider id="eclipselink-200-osgi-bundles-library-provider" extends="wtp-osgi-bundles-library-provider">
- <label>EclipseLink 2.0.x</label>
- <param name="container.label" value="EclipseLink 2.0.x"/>
- <param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[2.0.0, 2.1.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[2.0.0, 2.1.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[2.0.0, 2.1.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[2.0.0, 2.1.0)"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- <provider id="eclipselink-210-osgi-bundles-library-provider" extends="wtp-osgi-bundles-library-provider">
- <label>EclipseLink 2.1.x</label>
- <param name="container.label" value="EclipseLink 2.1.x"/>
- <param name="bundle.0" value="javax.persistence:[2.0.0, 2.1.0)"/>
- <param name="bundle.1" value="org.eclipse.persistence.core:[2.1.0, 2.2.0)"/>
- <param name="bundle.2" value="org.eclipse.persistence.jpa:[2.1.0, 2.2.0)"/>
- <param name="bundle.3" value="org.eclipse.persistence.asm:[2.1.0, 2.2.0)"/>
- <param name="bundle.4" value="org.eclipse.persistence.antlr:[2.1.0, 2.2.0)"/>
- <enablement>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- </enablement>
- </provider>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.persistence.PersistenceXmlResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.persistence">
- </contentTypeBinding>
- </resourceFactory>
-
- <resourceFactory
- class="org.eclipse.jpt.core.resource.orm.OrmXmlResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.groups">
-
- <group id="jpa-prereqs">
- <label>%JPA_PREREQ_GROUP_LABEL</label>
- <description>The set of facets that each fulfill JPA prerequisites</description>
- <include facet="jst.utility" versions="[1.0"/>
- <include facet="jst.appclient" versions="[1.2"/>
- <include facet="jst.ejb" versions="[1.1"/>
- <include facet="jst.connector" versions="[1.0"/>
- <include facet="jst.web" versions="[2.2"/>
- </group>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
-
- <project-facet id="jpt.jpa">
- <label>%JPA_FACET_LABEL</label>
- <description>%JPA_FACET_DESCRIPTION</description>
- </project-facet>
-
- <project-facet-version facet="jpt.jpa" version="1.0">
- <constraint>
- <and>
- <requires facet="jst.java" version="[5.0"/>
- <requires group="jpa-prereqs"/>
- </and>
- </constraint>
- </project-facet-version>
-
- <project-facet-version facet="jpt.jpa" version="2.0">
- <constraint>
- <and>
- <requires facet="jst.java" version="[5.0"/>
- <requires group="jpa-prereqs"/>
- </and>
- </constraint>
- </project-facet-version>
-
- <template id="jpt.jpa.template">
- <label>%JPA_TEMPLATE_LABEL</label>
- <fixed facet="jpt.jpa"/>
- <fixed facet="jst.java"/>
- <fixed facet="jst.utility"/>
- <preset id="jpt.jpa.2_0.preset"/>
- </template>
-
- <action facet="jpt.jpa" type="install" id="jpt.jpa.install">
- <config-factory class="org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProvider"/>
- <delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetInstallDelegate"/>
- </action>
-
- <!--
- The uninstall action is only used to enable facet uninstallation
- through the facet UI. The delegate currently has no functionality.
- -->
- <action facet="jpt.jpa" type="uninstall" id="jpt.jpa.uninstall">
- <delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetUninstallDelegate"/>
- </action>
-
- <!--
- The version change
- -->
- <action facet="jpt.jpa" type="version-change" id="jpt.jpa.version-change">
- <config-factory class="org.eclipse.jpt.core.internal.facet.JpaFacetVersionChangeDataModelProvider"/>
- <delegate class="org.eclipse.jpt.core.internal.facet.JpaFacetVersionChangeDelegate"/>
- </action>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.listeners">
-
- <listener
- class="org.eclipse.jpt.core.internal.facet.RuntimeChangedListener"
- eventTypes="TARGETED_RUNTIMES_CHANGED"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.presets">
-
- <static-preset id="jpt.jpa.1_0.preset">
- <label>%JPA_1.0_PRESET_LABEL</label>
- <facet id="jst.java" version="5.0"/>
- <facet id="jst.utility" version="1.0"/>
- <facet id="jpt.jpa" version="1.0"/>
- </static-preset>
-
- <static-preset id="jpt.jpa.2_0.preset">
- <label>%JPA_2.0_PRESET_LABEL</label>
- <facet id="jst.java" version="6.0"/>
- <facet id="jst.utility" version="1.0"/>
- <facet id="jpt.jpa" version="2.0"/>
- </static-preset>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
-
- <supported>
- <runtime-component any="true"/>
- <facet id="jpt.jpa"/>
- </supported>
-
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validatorV2"
- id="jpaValidator"
- name="%JPA_VALIDATOR">
-
- <validator
- class="org.eclipse.jpt.core.internal.validation.JpaValidator">
- <include>
- <rules>
- <facet id="jpt.jpa"/>
- </rules>
- </include>
- <include>
- <rules>
- <contentType id="org.eclipse.jdt.core.javaSource"/>
- <contentType id="org.eclipse.jpt.core.content.jar"/>
- <contentType id="org.eclipse.jpt.core.content.baseJpaContent" exactMatch="false"/>
- </rules>
- </include>
- </validator>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
deleted file mode 100644
index 9eeede567a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_core.properties
+++ /dev/null
@@ -1,49 +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
-################################################################################
-
-NONE=<None>
-VALIDATE_JOB=Validation
-VALIDATE_PROJECT_NOT_SPECIFIED=Project must be specified
-VALIDATE_SOURCE_FOLDER_NOT_SPECIFIED=Source folder must be specified
-VALIDATE_SOURCE_FOLDER_ILLEGAL=Source folder path is illegal
-VALIDATE_SOURCE_FOLDER_DOES_NOT_EXIST=Source folder ''{0}'' does not exist
-VALIDATE_SOURCE_FOLDER_NOT_IN_PROJECT=Source folder ''{0}'' is not in project ''{1}''
-VALIDATE_SOURCE_FOLDER_NOT_SOURCE_FOLDER=Source folder ''{0}'' is not an actual source folder
-VALIDATE_FILE_PATH_NOT_SPECIFIED=File path must be specified
-VALIDATE_FILE_ALREADY_EXISTS=File already exists at this location
-VALIDATE_FILE_VERSION_NOT_SUPPORTED=File version not supported
-VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION=File version not supported for JPA facet version
-VALIDATE_PERSISTENCE_UNIT_DOES_NOT_SPECIFIED=Persistence unit not specified
-VALIDATE_PERSISTENCE_UNIT_NOT_IN_PROJECT=Persistence unit ''{0}'' not defined in project ''{1}''
-VALIDATE_PLATFORM_NOT_SPECIFIED=Platform must be specified
-VALIDATE_PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION=Platform does not support the current JPA facet version
-VALIDATE_CONNECTION_NOT_SPECIFIED=Connection must be specified
-VALIDATE_CONNECTION_INVALID=Connection profile ''{0}'' does not exist
-VALIDATE_CONNECTION_NOT_CONNECTED=Connection must be active to get data source specific help and validation.
-VALIDATE_DEFAULT_CATALOG_NOT_SPECIFIED=Default catalog is not specified
-VALIDATE_CONNECTION_DOESNT_CONTAIN_CATALOG=Catalog ''{0}'' does not exist on the connection specified
-VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED=Default schema is not specified
-VALIDATE_CONNECTION_DOESNT_CONTAIN_SCHEMA=Schema ''{0}'' does not exist on the connection specified
-VALIDATE_RUNTIME_NOT_SPECIFIED=There is no server runtime associated with this project to provide a JPA implementation
-VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30=The server runtime selected does not support EJB 3.0, so it likely does not provide a JPA implementation
-VALIDATE_LIBRARY_NOT_SPECIFIED=No JPA implementation library specified
-SYNCHRONIZE_CLASSES_JOB=Synchronizing classes
-SYNCHRONIZING_CLASSES_TASK=Synchronizing classes ...
-INVALID_PERSISTENCE_XML_CONTENT=Invalid persistence.xml content
-ERROR_SYNCHRONIZING_CLASSES_COULD_NOT_VALIDATE=Error synchronizing classes. Could not validate.
-ERROR_WRITING_FILE=Could not write to persistence.xml
-REGISTRY_MISSING_ATTRIBUTE=The extension element ''{0}'' in plug-in ''{1}'' is missing the required attribute ''{2}''.
-REGISTRY_DUPLICATE=The plug-ins ''{0}'' and ''{1}'' have registered a duplicate attribute ''{2}'' for the extension element ''{3}'': ''{4}''.
-REGISTRY_FAILED_INSTANTIATION=Unable to instantiate the class ''{0}'' for the extension element ''{1}'' in the plug-in ''{2}''.
-UPDATE_JOB_NAME=Update JPA project: ''{0}''
-PLATFORM_ID_DOES_NOT_EXIST=No JPA platform exists for the id: ''{0}''. The JPA project was not created for project ''{1}''. Ensure that the platform''s plugin has been added to this Eclipse installation.
-DALI_EVENT_HANDLER_THREAD_NAME=Dali Event Handler
-PREFERENCES_FLUSH_JOB_NAME=Flush Preferences: {0}
-KEY_CLASSES_VALIDATOR__CLASS_NOT_FOUND=The class ''{0}'' is required to be in the selected libraries.
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
deleted file mode 100644
index 7ef934e0dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
+++ /dev/null
@@ -1,187 +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
-################################################################################
-
-PROJECT_NO_CONNECTION=No connection specified for project. No database-specific validation will be performed.
-PROJECT_INVALID_CONNECTION=Connection \"{0}\" does not exist. No database-specific validation will be performed.
-PROJECT_INACTIVE_CONNECTION=Connection \"{0}\" is not active. No validation will be done against the data source.
-PROJECT_NO_PERSISTENCE_XML=No persistence.xml file found in project
-PROJECT_MULTIPLE_PERSISTENCE_XML=Multiple persistence.xml files in project
-XML_VERSION_NOT_LATEST=A more recent version of this document is supported by this JPA platform
-PERSISTENCE_XML_INVALID_CONTENT=The persistence.xml file does not have recognized content.
-PERSISTENCE_XML_UNSUPPORTED_CONTENT=The persistence.xml file does not have supported content for this JPA platform.
-PERSISTENCE_NO_PERSISTENCE_UNIT=No persistence unit defined
-PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=Multiple persistence units defined - only the first persistence unit will be recognized
-PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=Unspecified mapping file
-PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT=Mapping file {0} does not have supported content for this JPA platform.
-PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file {0} does not have recognized content.
-PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=Mapping file \"{0}\" cannot be resolved.
-PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=Duplicate mapping file \"{0}\"
-PERSISTENCE_UNIT_UNSPECIFIED_CLASS=Unspecified class
-PERSISTENCE_UNIT_NONEXISTENT_CLASS=Class \"{0}\" cannot be resolved
-PERSISTENCE_UNIT_INVALID_CLASS=Class \"{0}\" is included in a persistence unit, but is not mapped
-PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate class \"{0}\"
-PERSISTENCE_UNIT_REDUNDANT_CLASS=Class \"{0}\" is already specified in mapping file \"{1}\"
-PERSISTENCE_UNIT_DUPLICATE_JAR_FILE=Duplicate JAR file \"{0}\"
-PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE=Unspecified JAR file
-PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING=The path to the JAR file will vary on your deployment environment. Please make sure the specified path fits your particular environment.
-PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE=JAR file \"{0}\" cannot be resolved
-GENERATOR_DUPLICATE_NAME=Duplicate generator named \"{0}\" defined in this persistence unit
-QUERY_DUPLICATE_NAME=Duplicate query named \"{0}\" defined in this persistence unit
-MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS=Extraneous persistence unit defaults found for mapping file \"{0}\". These defaults will not be used.
-PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class \"{0}\" is mapped, but is not included in any persistence unit
-PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class \"{0}\" is annotated, but is not included in any persistence unit
-PERSISTENT_TYPE_UNSPECIFIED_CLASS=Unspecified class
-PERSISTENT_TYPE_UNRESOLVED_CLASS=Class \"{0}\" cannot be resolved
-TYPE_MAPPING_PK_REDEFINED_ID_CLASS=An ancestor of this class has already defined the primary key. The ID class may not be defined here.
-TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE=An ancestor of this class has already defined the primary key. Primary key attributes may not be defined here.
-TYPE_MAPPING_ID_CLASS_REDEFINED=An ancestor of this class has already defined the ID class. The ID class may not be defined here.
-TYPE_MAPPING_ID_CLASS_REQUIRED=This class has a composite primary key. It must use an ID class.
-TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED=This class must use either an ID class or an embedded ID to specify its composite primary key, not both.
-TYPE_MAPPING_MULTIPLE_EMBEDDED_ID=This class uses multiple embedded ID mappings. Only one is allowed.
-TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID=The relationship ''{0}'' maps an ID, which is not allowed in conjunction with an ID class.
-TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE=The type of the ID mapped by the relationship ''{0}'' does not agree with the primary key class of the target entity.
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH=There is no primary key attribute to match the ID class attribute {0}
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH=There is no ID class attribute to match the primary key attribute {0}
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH=Primary key attribute {0} is a duplicate match for ID class
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY=The attribute matching the ID class attribute {0} is not mapped as a primary key
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE=The attribute matching the ID class attribute {0} does not have the correct type {1}
-ENTITY_NON_ROOT_ID_CLASS_SPECIFIED=An ID class should only be defined on the root entity or a mapped superclass
-ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED=A primary key attribute should only be defined on the root entity or a mapped superclass
-ENTITY_NO_PK=The entity has no primary key attribute defined
-ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE=No table should be defined for non-root entity \"{0}\" using single-table inheritance
-ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE=No table should be defined for abstract entity \"{0}\" using table-per-concrete-class inheritance
-ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED = No discriminator value should be defined for abstract entity \"{0}\"
-ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED = No discriminator value should be defined for entity \"{0}\" using table-per-concrete-class inheritance
-ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED =No discriminator column should be defined for non-root entity \"{0}\"
-ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED = No discriminator column should be defined for entity \"{0}\" using table-per-concrete-class inheritance
-PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Unspecified name
-PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute \"{0}\" in class \"{1}\" cannot be resolved
-PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED=Attribute \"{0}\" is inherited; referring to inherited attributes in the orm.xml may not be supported by all persistence providers
-PERSISTENT_ATTRIBUTE_INVALID_MAPPING=Attribute \"{0}\" has invalid mapping type in this context
-PERSISTENT_ATTRIBUTE_FINAL_FIELD=The java field for attribute \"{0}\" is final
-PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=The java field for attribute \"{0}\" is public
-MAPPING_UNRESOLVED_MAPPED_BY=In {0}, the "mapped by" value ''{1}'' cannot be resolved to an attribute on the target entity.
-MAPPING_INVALID_MAPPED_BY=In {0}, the "mapped by" attribute ''{1}'' has an invalid mapping type for this relationship.
-MAPPING_MAPPED_BY_ON_BOTH_SIDES=In {0}, the "mapped by" attribute ''{1}'' also maps this attribute. Every relationship must have an owner.
-ID_MAPPING_UNRESOLVED_GENERATOR_NAME=Unresolved generator name \"{0}\"
-ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED=In {0}, a column is specified, but it is mapped by a relationship. IDs that are mapped by a relationship should not specify a column.
-EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=Embedded IDs that are mapped by a relationship should not specify any attribute overrides.
-ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED=Attributes (or subattributes of an attribute) that are mapped by a relationship should not be overridden.
-TABLE_UNRESOLVED_CATALOG=Catalog \"{0}\" cannot be resolved for table \"{1}\"
-TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for table \"{1}\"
-TABLE_UNRESOLVED_NAME=Table \"{0}\" cannot be resolved
-SECONDARY_TABLE_UNRESOLVED_CATALOG=Catalog \"{0}\" cannot be resolved for secondary table \"{1}\"
-SECONDARY_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for secondary table \"{1}\"
-SECONDARY_TABLE_UNRESOLVED_NAME=Secondary table \"{0}\" cannot be resolved
-JOIN_TABLE_UNRESOLVED_CATALOG=Catalog \"{0}\" cannot be resolved for join table \"{1}\"
-JOIN_TABLE_UNRESOLVED_SCHEMA=Schema \"{0}\" cannot be resolved for join table \"{1}\"
-JOIN_TABLE_UNRESOLVED_NAME=Join table \"{0}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG=In implied attribute \"{0}\", catalog \"{1}\" cannot be resolved for join table \"{2}\"
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=In implied attribute \"{0}\", schema \"{1}\" cannot be resolved for join table \"{2}\"
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=In implied attribute \"{0}\", join table \"{1}\" cannot be resolved
-COLUMN_UNRESOLVED_TABLE=Table \"{0}\" for column \"{1}\" cannot be resolved
-COLUMN_UNRESOLVED_NAME=Column \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In implied attribute override \"{0}\", column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", attribute override \"{1}\", column \"{2}\" cannot be resolved on table \"{3}\"
-VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In implied map key attribute override \"{0}\", column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", map key attribute override \"{1}\", column \"{2}\" cannot be resolved on table \"{3}\"
-JOIN_COLUMN_UNRESOLVED_NAME=Join column \"{0}\" cannot be resolved on table \"{1}\"
-JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Name must be specified when there are multiple join columns
-JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Join column referenced column name \"{0}\" cannot be resolved on table \"{1}\"
-JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Referenced column name must be specified when there are multiple join columns
-
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE=In implied attribute \"{0}\", table \"{1}\" for join column \"{2}\" cannot be resolved
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", join column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", name must be specified when there are multiple join columns
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=In implied attribute \"{0}\", join column referenced column name \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", referenced column name must be specified when there are multiple join columns
-INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Inverse join column \"{0}\" cannot be resolved on table \"{1}\"
-INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Name must be specified when there are multiple inverse join columns
-INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Inverse join column referenced column name \"{0}\" cannot be resolved on table \"{1}\"
-INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Referenced column name must be specified when there are multiple inverse join columns
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", inverse join column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", name must be specified when there are multiple inverse join columns
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", referenced column name must be specified when there are multiple inverse join columns
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=In implied attribute \"{0}\", inverse join column referenced column name \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=In implied association override \"{0}\", join column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=In implied association override \"{0}\", join column referenced column name \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied association override \"{0}\", name must be specified when there are multiple join columns
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied association override \"{0}\", referenced column name must be specified when there are multiple join columns
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", association override \"{1}\", join column \"{2}\" cannot be resolved on table \"{3}\"
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", association override \"{1}\", join column referenced column name \"{2}\" cannot be resolved on table \"{3}\"
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", association override \"{1}\", name must be specified when there are multiple join columns
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied attribute \"{0}\", association override \"{1}\", referenced column name must be specified when there are multiple join columns
-GENERATED_VALUE_UNRESOLVED_GENERATOR=No generator named \"{0}\" is defined in the persistence unit
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column \"{0}\" cannot be resolved on table \"{1}\"
-PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Name must be specified when there are multiple primary key join columns
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Primary key join column referenced column name \"{0}\" cannot be resolved on table \"{1}\"
-PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Referenced column name must be specified when there are multiple primary key join columns
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=In implied primary key join column, name \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=In implied primary key join column, referenced column name \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=In implied secondary table \"{0}\", primary key join column \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=In implied secondary table \"{0}\", primary key join column referenced column name \"{1}\" cannot be resolved on table \"{2}\"
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied secondary table \"{0}\", name must be specified when there are multiple primary key join columns
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=In implied secondary table \"{0}\", referenced column name must be specified when there are multiple primary key join columns
-
-NO_JPA_PROJECT=This project has the JPA facet, but no JPA project could be created. See the error log for more details.
-TARGET_ENTITY_NOT_DEFINED=Target entity for \"{0}\" is not defined
-VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=In implied attribute \"{0}\", target entity is not defined
-TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity \"{0}\" for \"{1}\" is not an Entity
-VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY=In implied attribute \"{0}\", target entity \"{1}\" is not an Entity
-DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=Discriminator column \"{0}\" cannot be resolved on table \"{1}\"
-ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM=Entity \"{0}\" cannot use table-per-concrete-class inheritance because the chosen JPA platform does not support it
-ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM=Entity \"{0}\" uses table-per-concrete-class inheritance which is not portable and may not be supported by the JPA provider
-TARGET_NOT_AN_EMBEDDABLE={0} is not mapped as an embeddable
-
-MAPS_ID_VALUE_NOT_SPECIFIED=In {0}, the "maps ID" value is not specified and could not be determined from defaults
-MAPS_ID_VALUE_NOT_RESOLVED=In {0}, the "maps ID" value ''{1}'' could not be resolved to an attribute on this entity or this entity''s embedded ID
-MAPS_ID_VALUE_INVALID=In {0}, the "maps ID" value ''{1}'' does not refer to an attribute that is used as an ID for this entity
-ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED=Attribute \"{0}\" specifies both OrderColumn and OrderBy annotations
-ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Target class is not defined
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=In implied attribute \"{0}\", target class is not defined
-ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED=Map key class is not defined
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED=In implied attribute \"{0}\", map key class is not defined
-ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Target class \"{0}\" is not an embeddable or basic type
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=In implied attribute \"{0}\" target class \"{1}\" is not an embeddable or basic type
-MAP_KEY_COLUMN_UNRESOLVED_NAME = Map key column \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME = In implied attribute \"{0}\", map key column \"{1}\" cannot be resolved on table \"{2}\"
-COLLECTION_TABLE_UNRESOLVED_CATALOG = Catalog \"{0}\" cannot be resolved for collection table \"{1}\"
-COLLECTION_TABLE_UNRESOLVED_NAME = Collection table \"{0}\" cannot be resolved
-COLLECTION_TABLE_UNRESOLVED_SCHEMA = Schema \"{0}\" cannot be resolved for collection table \"{1}\"
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG = In implied attribute \"{0}\", catalog \"{1}\" cannot be resolved for collection table \"{2}\"
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA = In implied attribute \"{0}\", schema \"{1}\" cannot be resolved for collection table \"{2}\"
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME = In implied attribute \"{0}\", collection table \"{1}\" cannot be resolved
-ORDER_COLUMN_UNRESOLVED_NAME=Order column \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", order column \"{1}\" cannot be resolved on table \"{2}\"
-
-
-#These messages have a parameter at the end which is used to plugin a different description.
-#The possible message endings are found in jpa_validation_description.properties.
-COLUMN_TABLE_NOT_VALID=Table \"{0}\" for column \"{1}\" {2}
-VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for column \"{2}\" {3}
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=In implied attribute override \"{0}\", table \"{1}\" for column \"{2}\" {3}
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", attribute override \"{1}\", table \"{2}\" for column \"{3}\" {4}
-JOIN_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for join column \"{1}\" {2}
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for join column \"{2}\" {3}
-INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for inverse join column \"{1}\" {2}
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for inverse join column \"{2}\" {3}
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=In implied association override \"{0}\", table \"{1}\" for join column \"{2}\" {3}
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", association override \"{1}\", table \"{2}\" for join column \"{3}\" {4}
-
-VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=In implied map key attribute override \"{0}\", table \"{1}\" for column \"{2}\" {3}
-VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", map key attribute override \"{1}\", table \"{2}\" for column \"{3}\" {4}
-MAP_KEY_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for map key column \"{1}\" {2}
-VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for map key column \"{2}\" {3}
-
-
-
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties
deleted file mode 100644
index 4d59ad01a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-#
-# The messages are used as the description of validation messages found in the
-# jpa_validation.properties bundle. They are used as parameters to validation messages.
-#
-################################################################################
-
-DOES_NOT_MATCH_JOIN_TABLE=does not match join table
-DOES_NOT_MATCH_COLLECTION_TABLE=does not match collection table
-NOT_VALID_FOR_THIS_ENTITY=is not valid for this entity
-
-ATTRIBUTE_DESC=attribute ''{0}''
-VIRTUAL_ATTRIBUTE_DESC=implied attribute ''{0}''
diff --git a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatforms.exsd b/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatforms.exsd
deleted file mode 100644
index 1923aa80b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/schema/jpaPlatforms.exsd
+++ /dev/null
@@ -1,166 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.core" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.jpt.core" id="jpaPlatforms" name="JPA Platforms"/>
- </appInfo>
- <documentation>
- Used to add JPA platforms as choices when configuring a project with the JPA facet. The optional &quot;jpaFacetVersion&quot; attribute is used to tie a platform to a particular JPA facet version (if not present, the platform is available for all facet versions.) The optional &quot;default&quot; attribute is used to determine if a platform should have a higher priority when calculating the default platform for a project.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="jpaPlatform" 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="jpaPlatform">
- <annotation>
- <documentation>
- Declares a JPA platform, one jpaPlatform will be chosen per JpaProject. See &lt;samp&gt;org.eclipse.jpt.core.JpaPlatform&lt;/samp&gt; for more information on JPA platforms. Also see the org.eclipse.jpt.ui.jpaPlatforms 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.core.JpaPlatformFactory&lt;/samp&gt;.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.core.JpaPlatformFactory"/>
- </appInfo>
- </annotation>
- </attribute>
- <attribute name="jpaFacetVersion" type="string">
- <annotation>
- <documentation>
- Declares the JPA facet version for which this platform may be used. If no JPA facet version is specified, this platform is available for all JPA 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 JPA platform for new JPA project content. Note that if a workspace contains more than one default platform for a JPA 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>
- 2.2
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- The following example shows a basic JPA platform which should be considered a prominent platform for JPA 1.0
-
-&lt;extension point=&quot;org.eclipse.jpt.core.jpaPlatforms&quot;&gt;
- &lt;jpaPlatform
- id=&quot;myJpaPlatform&quot;
- label=&quot;My JPA Platform&quot;
- factoryClass=&quot;org.foo.MyJpaPlatformFactory&quot;
- jpaFacetVersion=&quot;1.0&quot;
- default=&quot;true&quot;&gt;
- &lt;/jpaPlatform&gt;
-&lt;/extension&gt;
- </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) 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
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java
deleted file mode 100644
index 7e25fdd499..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/EntityGeneratorDatabaseAnnotationNameBuilder.java
+++ /dev/null
@@ -1,78 +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.core;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Provide a pluggable way to determine whether and how the entity generator
- * prints the names of various database objects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EntityGeneratorDatabaseAnnotationNameBuilder {
-
- /**
- * 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);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/GenericJpaProjectManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/GenericJpaProjectManager.java
deleted file mode 100644
index a4646d5d06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/GenericJpaProjectManager.java
+++ /dev/null
@@ -1,1042 +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.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.core.internal.AsynchronousJpaProjectUpdater;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.internal.SimpleJpaProjectConfig;
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.AsynchronousCommandExecutor;
-import org.eclipse.jpt.utility.internal.SimpleCommandExecutor;
-import org.eclipse.jpt.utility.internal.StatefulCommandExecutor;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-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;
-
-/**
- * The JPA project manager maintains a list of all JPA projects in the workspace.
- * It keeps the list (and the state of the JPA 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 JPA
- * 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 JPA 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 JPA projects and returning execution to the event
- * source.
- * <p>
- * Various things that cause us to add or remove a JPA project:<ul>
- * <li>The {@link JptCorePlugin} will "lazily" instantiate and {@link #start() start}
- * a JPA project manager as appropriate. This will trigger the manager
- * to find and add all pre-existing JPA 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 GenericJpaProjectManager
- extends AbstractModel
- implements JpaProjectManager
-{
- /**
- * All the JPA projects in the workspace.
- */
- private final Vector<JpaProject> jpaProjects = new Vector<JpaProject>();
-
- /**
- * Synchronize access to the JPA 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(JptCoreMessages.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 JPA 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 JPA 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 JptCorePlugin Dali plug-in}.
- */
- GenericJpaProjectManager() {
- super();
- }
-
-
- // ********** plug-in controlled life-cycle **********
-
- /**
- * Internal: called by {@link JptCorePlugin Dali plug-in}.
- */
- void start() {
- try {
- this.lock.acquire();
- this.start_();
- } finally {
- this.lock.release();
- }
- }
-
- private void start_() {
- debug("*** JPA project manager START ***"); //$NON-NLS-1$
- try {
- this.buildJpaProjects();
- 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) {
- JptCorePlugin.log(ex);
- this.stop_();
- }
- }
-
- /**
- * Side-effect: {@link #jpaProjects} populated.
- */
- private void buildJpaProjects() {
- try {
- this.buildJpaProjects_();
- } catch (CoreException ex) {
- // if we have a problem, leave the currently built JPA projects in
- // place and keep executing (should be OK...)
- JptCorePlugin.log(ex);
- }
- }
-
- private void buildJpaProjects_() throws CoreException {
- this.getWorkspace().getRoot().accept(new ResourceProxyVisitor(), IResource.NONE);
- }
-
- /**
- * Internal: called by {@link JptCorePlugin Dali plug-in}.
- */
- void stop() throws Exception {
- try {
- this.lock.acquire();
- this.stop_();
- } finally {
- this.lock.release();
- }
- }
-
- private void stop_() {
- debug("*** JPA project manager STOP ***"); //$NON-NLS-1$
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- FacetedProjectFramework.removeListener(this.facetedProjectListener);
- this.getWorkspace().removeResourceChangeListener(this.resourceChangeListener);
- this.eventHandler.stop();
- this.clearJpaProjects();
- }
-
- private void clearJpaProjects() {
- // clone to prevent concurrent modification exceptions
- for (JpaProject jpaProject : this.getJpaProjects_()) {
- this.removeJpaProject(jpaProject);
- }
- }
-
-
- // ********** JpaProjectManager implementation **********
-
- public Iterable<JpaProject> getJpaProjects() {
- try {
- this.lock.acquire();
- return this.getJpaProjects_();
- } finally {
- this.lock.release();
- }
- }
-
- private Iterable<JpaProject> getJpaProjects_() {
- return new LiveCloneIterable<JpaProject>(this.jpaProjects);
- }
-
- public int getJpaProjectsSize() {
- return this.jpaProjects.size();
- }
-
- public JpaProject getJpaProject(IProject project) {
- try {
- this.lock.acquire();
- return this.getJpaProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- private JpaProject getJpaProject_(IProject project) {
- for (JpaProject jpaProject : this.jpaProjects) {
- if (jpaProject.getProject().equals(project)) {
- return jpaProject;
- }
- }
- return null;
- }
-
- public JpaFile getJpaFile(IFile file) {
- JpaProject jpaProject = this.getJpaProject(file.getProject());
- return (jpaProject == null) ? null : jpaProject.getJpaFile(file);
- }
-
- public void rebuildJpaProject(IProject project) {
- try {
- this.lock.acquire();
- this.rebuildJpaProject_(project);
- } finally {
- this.lock.release();
- }
- }
-
- /**
- * assumption: the JPA project holder exists
- */
- private void rebuildJpaProject_(IProject project) {
- this.removeJpaProject(this.getJpaProject_(project));
- this.addJpaProject(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 JPA projects **********
-
- /* private */ void addJpaProject(IProject project) {
- this.addJpaProject(this.buildJpaProject(project));
- }
-
- private void addJpaProject(JpaProject jpaProject) {
- // figure out exactly when JPA projects are added
- dumpStackTrace("add: ", jpaProject); //$NON-NLS-1$
- // the JPA project will be null if we have any problems building it...
- // (e.g. if we have problems getting the JPA platform)
- if (jpaProject != null) {
- this.addItemToCollection(jpaProject, this.jpaProjects, JPA_PROJECTS_COLLECTION);
- }
- }
-
- /**
- * return null if we have any problems...
- */
- private JpaProject buildJpaProject(IProject project) {
- return this.buildJpaProject(this.buildJpaProjectConfig(project));
- }
-
- /**
- * return null if we have any problems...
- */
- private JpaProject buildJpaProject(JpaProject.Config config) {
- JpaPlatform jpaPlatform = config.getJpaPlatform();
- if (jpaPlatform == null) {
- return null;
- }
- JpaProject jpaProject = this.buildJpaProject(jpaPlatform, config);
- if (jpaProject == null) {
- return null;
- }
- jpaProject.setUpdater(new AsynchronousJpaProjectUpdater(jpaProject));
- return jpaProject;
- }
-
- /**
- * return null if we have any problems...
- */
- private JpaProject buildJpaProject(JpaPlatform jpaPlatform, JpaProject.Config config) {
- try {
- return jpaPlatform.getJpaFactory().buildJpaProject(config);
- } catch (RuntimeException ex) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- private JpaProject.Config buildJpaProjectConfig(IProject project) {
- SimpleJpaProjectConfig config = new SimpleJpaProjectConfig();
- config.setProject(project);
- config.setJpaPlatform(JptCorePlugin.getJpaPlatform(project));
- config.setConnectionProfileName(JptCorePlugin.getConnectionProfileName(project));
- config.setUserOverrideDefaultCatalog(JptCorePlugin.getUserOverrideDefaultCatalog(project));
- config.setUserOverrideDefaultSchema(JptCorePlugin.getUserOverrideDefaultSchema(project));
- config.setDiscoverAnnotatedClasses(JptCorePlugin.discoverAnnotatedClasses(project));
- config.setMetamodelSourceFolderName(JptCorePlugin.getMetamodelSourceFolderName(project));
- return config;
- }
-
- /* private */ void removeJpaProject(JpaProject jpaProject) {
- // figure out exactly when JPA projects are removed
- dumpStackTrace("remove: ", jpaProject); //$NON-NLS-1$
- this.removeItemFromCollection(jpaProject, this.jpaProjects, JPA_PROJECTS_COLLECTION);
- jpaProject.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_() {
- GenericJpaProjectManager.this.projectChanged_(delta);
- }
- };
- }
-
- /**
- * Forward the specified resource delta to all our JPA projects;
- * they will each determine whether the event is significant.
- */
- /* private */ void projectChanged_(IResourceDelta delta) {
- for (JpaProject jpaProject : this.jpaProjects) {
- jpaProject.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_() {
- GenericJpaProjectManager.this.projectPostCleanBuild_(project);
- }
- };
- }
-
- /* private */ void projectPostCleanBuild_(IProject project) {
- JpaProject jpaProject = this.getJpaProject_(project);
- if (jpaProject != null) {
- this.removeJpaProject(jpaProject);
- this.addJpaProject(project);
- }
- }
-
-
- // ********** File POST_CHANGE **********
-
- /**
- * The Faceted Project settings file has changed in some fashion, check
- * whether the JPA facet has been added to or removed from the specified
- * project.
- */
- /* private */ void checkForJpaFacetTransition(IProject project) {
- JpaProject jpaProject = this.getJpaProject_(project);
-
- if (JptCorePlugin.projectHasJpaFacet(project)) {
- if (jpaProject == null) { // JPA facet added
- this.executeAfterEventsHandled(this.buildAddJpaProjectCommand(project));
- }
- } else {
- if (jpaProject != null) { // JPA facet removed
- this.executeAfterEventsHandled(this.buildRemoveJpaProjectCommand(jpaProject));
- }
- }
- }
-
- private Command buildAddJpaProjectCommand(final IProject project) {
- return new EventHandlerCommand("Add JPA Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJpaProjectManager.this.addJpaProject(project);
- }
- };
- }
-
- private Command buildRemoveJpaProjectCommand(final JpaProject jpaProject) {
- return new EventHandlerCommand("Remove JPA Project Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJpaProjectManager.this.removeJpaProject(jpaProject);
- }
- };
- }
-
- // ********** FacetedProject PRE_UNINSTALL **********
-
- /* private */ void jpaFacetedProjectPreUninstall(IProjectFacetActionEvent event) {
- IProject project = event.getProject().getProject();
- this.executeAfterEventsHandled(this.buildJpaFacetedProjectPreUninstallCommand(project));
- }
-
- private Command buildJpaFacetedProjectPreUninstallCommand(final IProject project) {
- return new EventHandlerCommand("Faceted Project PRE_UNINSTALL Command") { //$NON-NLS-1$
- @Override
- void execute_() {
- GenericJpaProjectManager.this.jpaFacetedProjectPreUninstall_(project);
- }
- };
- }
-
- /* private */ void jpaFacetedProjectPreUninstall_(IProject project) {
- // assume(?) this is the first event to indicate we need to remove the JPA project from the JPA project manager
- this.removeJpaProject(this.getJpaProject_(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_() {
- GenericJpaProjectManager.this.javaElementChanged_(event);
- }
- };
- }
-
- /**
- * Forward the Java element changed event to all the JPA projects
- * because the event could affect multiple projects.
- */
- /* private */ void javaElementChanged_(ElementChangedEvent event) {
- for (JpaProject jpaProject : this.jpaProjects) {
- jpaProject.javaElementChanged(event);
- }
- }
-
-
- // ********** miscellaneous **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.jpaProjects);
- }
-
-
- // ********** 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 JPA project manager:<ol>
- * <li>it will set the flag to <code>true</code>, allowing the JPA project
- * manager to resume executing on its own thread
- * <li>then it will suspend its command executor until the JPA project
- * manager sets the flag back to <code>false</code>.
- * </ol>
- * If this "pause" command is executing (synchronously) on the same thread
- * as the JPA 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 JPA project to the
- * JPA project manager for each open Eclipse project that has a JPA 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 (JptCorePlugin.projectHasJpaFacet(project)) {
- GenericJpaProjectManager.this.addJpaProject(project);
- }
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** event handler command **********
-
- /**
- * Command that holds the JPA 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 {
- GenericJpaProjectManager.this.lock.acquire();
- this.execute_();
- } catch (RuntimeException ex) {
- JptCorePlugin.log(ex);
- } finally {
- GenericJpaProjectManager.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 JPA 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 JPA 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 JPA project will not be built until the children are processed
- * and we see that the facet metadata file is added.
- * Otherwise the JPA project would be built and then we would process
- * the ADDED deltas for all the files in the project.
- */
- private void processPostChangeProjectDelta(IResourceDelta delta) {
- GenericJpaProjectManager.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 :
- GenericJpaProjectManager.this.checkForJpaFacetTransition(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$
- GenericJpaProjectManager.this.projectPostCleanBuild(project);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** faceted project listener **********
-
- /**
- * Forward the Faceted project change event back to the JPA project manager.
- */
- private class FacetedProjectListener implements IFacetedProjectListener {
-
- FacetedProjectListener() {
- super();
- }
-
- /**
- * Check for:<ul>
- * <li>un-install of JPA 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().getId().equals(JptCorePlugin.FACET_ID)) {
- GenericJpaProjectManager.this.jpaFacetedProjectPreUninstall(event);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-
- // ********** Java element change listener **********
-
- /**
- * Forward the Java element change event back to the JPA 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) {
- GenericJpaProjectManager.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 JpaProjectManagerTests#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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/IResourcePart.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/IResourcePart.java
deleted file mode 100644
index 21eccaa7e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index f48c8eeba3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,46 +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.core;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-
-/**
- * Provides annotationDefinitions for types and attributes. JpaAnnotationProvider
- * then uses a collection of these to build 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.
- *
- * @version 2.3
- * @since 2.2
- */
-public interface JpaAnnotationDefinitionProvider
-{
- /**
- * Return all annotation definitions which can appear on a type
- */
- Iterator<AnnotationDefinition> typeAnnotationDefinitions();
-
- /**
- * Return all annotation definitions which can appear on a type and are used to determine
- * whether and how the type is persisted (how it is "mapped").
- * This should be a subset of {@link #typeAnnotationDefinitions()}.
- */
- Iterator<AnnotationDefinition> typeMappingAnnotationDefinitions();
-
- /**
- * Return all annotation definitions which can appear on an attribute
- */
- Iterator<AnnotationDefinition> attributeAnnotationDefinitions();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java
deleted file mode 100644
index a26aaf80d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaAnnotationProvider.java
+++ /dev/null
@@ -1,110 +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.core;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * This is used to provide type and attribute annotations.
- * Also provides list of supported annotation names, check the appropriate list
- * before trying to build an annotation with that name. An exception will
- * be thrown on an attempt to build an annotation that does not exist.
- *
- * This interface is not intended to be implemented. Instead implement
- * JpaAnnotationDefinitionProvider to extend the list of supported annotation definitions.
- *
- * @see JpaAnnotationDefinitionProvider
- * @version 2.3
- * @since 2.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 JpaAnnotationProvider
-{
- // ********** type annotations **********
-
- /**
- * Return the names of the annotations that can appear on a type.
- */
- Iterator<String> typeAnnotationNames();
-
- /**
- * Return the names of the annotations that can appear on a type and are used to
- * determine whether and how the type is persisted (how it is "mapped").
- * This should be a subset of {@link #typeAnnotationNames()}.
- */
- Iterator<String> typeMappingAnnotationNames();
-
- /**
- * Build a type annotation with the specified name.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #typeAnnotationNames()
- */
- Annotation buildTypeAnnotation(
- JavaResourcePersistentType parent, Type type, String annotationName);
-
- /**
- * Build a type annotation for the specified JDT annotation.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #typeAnnotationNames()
- */
- Annotation buildTypeAnnotation(
- JavaResourcePersistentType parent, IAnnotation jdtAnnotation);
-
- /**
- * Build a null type annotation with the specified name.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #typeAnnotationNames()
- */
- Annotation buildNullTypeAnnotation(
- JavaResourcePersistentType parent, String annotationName);
-
-
- // ********** attribute annotations **********
-
- /**
- * Return the names of the annotations that can appear on an attribute.
- */
- Iterator<String> attributeAnnotationNames();
-
- /**
- * Build an attribute annotation with the specified name.
- * Throw an IllegalArgumentException if the specified name is unsupported.
- * @see #attributeAnnotationNames()
- */
- Annotation buildAttributeAnnotation(
- JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName);
-
- /**
- * Build an attribute annotation for the specified JDT annotation.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #attributeAnnotationNames()
- */
- Annotation buildAttributeAnnotation(
- JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation);
-
- /**
- * Build a null attribute annotation with the specified name.
- * Throw an IllegalArgumentException if the specified annotation is unsupported.
- * @see #attributeMappingAnnotationNames()
- */
- Annotation buildNullAttributeAnnotation(
- JavaResourcePersistentAttribute parent, String annotationName);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java
deleted file mode 100644
index 8bc2f6ddd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaDataSource.java
+++ /dev/null
@@ -1,81 +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.core;
-
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseObject;
-
-/**
- * Interface to the connection profile.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JpaDataSource
- extends JpaNode {
-
- /**
- * Return the data source's connection profile name.
- * The connection profile is looked up based on this setting.
- */
- String getConnectionProfileName();
-
- /**
- * Set the data source's connection profile name.
- * The connection profile is looked up based on this setting.
- */
- void setConnectionProfileName(String connectionProfileName);
-
- /**
- * ID string used when connectionProfileName property is changed
- * @see org.eclipse.jpt.utility.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String CONNECTION_PROFILE_NAME_PROPERTY = "connectionProfileName"; //$NON-NLS-1$
-
- /**
- * The connection profile is null if the connection profile name is invalid.
- */
- ConnectionProfile getConnectionProfile();
-
- /**
- * ID string used when connectionProfile property is changed
- * @see org.eclipse.jpt.utility.model.Model#addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String CONNECTION_PROFILE_PROPERTY = "connectionProfile"; //$NON-NLS-1$
-
- /**
- * Return whether the profile is either connected to a live database
- * session or working off-line (i.e. it has access to meta-data).
- */
- boolean connectionProfileIsActive();
-
- /**
- * If the connection profile is active, return its database.
- */
- Database getDatabase();
-
- /**
- * Select and return the database object with the specified identifier.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier);
-
- /**
- * Dispose the data source.
- */
- void dispose();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
deleted file mode 100644
index 8f67a12637..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFactory.java
+++ /dev/null
@@ -1,236 +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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaEnumeratedConverter;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaLobConverter;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOrderable;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaTemporalConverter;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-/**
- * Use a JPA factory to build any core (e.g. {@link JpaProject})
- * model object or any Java (e.g. {@link JavaEntity}), ORM (e.g.
- * {@link EntityMappings}), or persistence (e.g. {@link PersistenceUnit})
- * context model objects.
- * <p>
- * Assumes a base JPA project context structure
- * corresponding to the JPA spec:
- * <pre>
- * RootContext
- * |- persistence.xml
- * |- persistence unit(s)
- * |- mapping file(s) (e.g. orm.xml)
- * | |- persistent type mapping(s) (e.g. Entity)
- * | |- persistent attribute mapping(s) (e.g. Basic)
- * |- persistent type mapping(s)
- * </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.core.internal.jpa1.GenericJpaFactory
- *
- * @version 2.3
- * @since 2.0
- */
-public interface JpaFactory
-{
- // ********** Core Model **********
-
- /**
- * Construct a JpaProject for the specified config, to be
- * added to the specified JPA project. Return null if unable to create
- * the JPA file (e.g. the content type is unrecognized).
- */
- JpaProject buildJpaProject(JpaProject.Config config);
-
- JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName);
-
- /**
- * Construct a JPA file for the specified JPA project, file, content type,
- * and resource model.
- */
- JpaFile buildJpaFile(JpaProject jpaProject, IFile file, IContentType contentType, JpaResourceModel resourceModel);
-
-
- // ********** Context Nodes **********
-
- /**
- * Build a (/an updated) root context node to be associated with the given
- * JPA project.
- * The root context node will be built once, but updated many times.
- * @see JpaProject#update(org.eclipse.core.runtime.IProgressMonitor)
- */
- JpaRootContextNode buildRootContextNode(JpaProject jpaProject);
-
-
- // ********** XML Context Model **********
-
- PersistenceXml buildPersistenceXml(JpaRootContextNode parent, JpaXmlResource resource);
-
- MappingFile buildMappingFile(MappingFileRef parent, JpaXmlResource resource);
-
-
- // ********** Java Context Model **********
-
- JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourcePersistentType jrpt);
-
- JavaEntity buildJavaEntity(JavaPersistentType parent);
-
- JavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent);
-
- JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent);
-
- JavaTypeMapping buildJavaNullTypeMapping(JavaPersistentType parent);
-
- JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa);
-
- JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedIdMapping buildJavaEmbeddedIdMapping(JavaPersistentAttribute parent);
-
- JavaEmbeddedMapping buildJavaEmbeddedMapping(JavaPersistentAttribute parent);
-
- JavaGeneratorContainer buildJavaGeneratorContainer(JavaJpaContextNode parent);
-
- JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent);
-
- JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent);
-
- JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent);
-
- JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent);
-
- JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent);
-
- JavaTransientMapping buildJavaTransientMapping(JavaPersistentAttribute parent);
-
- JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent);
-
- JavaAttributeMapping buildJavaNullAttributeMapping(JavaPersistentAttribute parent);
-
- JavaTable buildJavaTable(JavaEntity parent);
-
- JavaJoinTable buildJavaJoinTable(JavaJoinTableJoiningStrategy parent);
-
- JavaColumn buildJavaColumn(JavaJpaContextNode parent, JavaBaseColumn.Owner owner);
-
- JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaDiscriminatorColumn.Owner owner);
-
- JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner);
-
- JavaSecondaryTable buildJavaSecondaryTable(JavaEntity parent);
-
- JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent);
-
- JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent);
-
- JavaGeneratedValue buildJavaGeneratedValue(JavaIdMapping parent);
-
- JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner);
-
- JavaAttributeOverrideContainer buildJavaAttributeOverrideContainer(JavaJpaContextNode parent, JavaAttributeOverrideContainer.Owner owner);
-
- JavaAttributeOverride buildJavaAttributeOverride(JavaAttributeOverrideContainer parent, JavaAttributeOverride.Owner owner);
-
- JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaJpaContextNode parent, JavaAssociationOverrideContainer.Owner owner);
-
- JavaAssociationOverride buildJavaAssociationOverride(JavaAssociationOverrideContainer parent, JavaAssociationOverride.Owner owner);
-
- JavaAssociationOverrideRelationshipReference buildJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent);
-
- JavaQueryContainer buildJavaQueryContainer(JavaJpaContextNode parent);
-
- JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent);
-
- JavaNamedNativeQuery buildJavaNamedNativeQuery(JavaJpaContextNode parent);
-
- JavaQueryHint buildJavaQueryHint(JavaQuery parent);
-
- JavaUniqueConstraint buildJavaUniqueConstraint(JavaJpaContextNode parent, UniqueConstraint.Owner owner);
-
- JavaEnumeratedConverter buildJavaEnumeratedConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa);
-
- JavaTemporalConverter buildJavaTemporalConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa);
-
- JavaLobConverter buildJavaLobConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa);
-
- JavaConverter buildJavaNullConverter(JavaAttributeMapping parent);
-
- JavaOrderable buildJavaOrderable(JavaAttributeMapping parent, Orderable.Owner owner);
-
- AssociationOverrideAnnotation buildJavaVirtualAssociationOverrideAnnotation(JavaResourcePersistentMember jrpm, String name, JoiningStrategy joiningStrategy);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java
deleted file mode 100644
index b2f4da7826..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaFile.java
+++ /dev/null
@@ -1,92 +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.core;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-
-/**
- * A JPA Project contains JPA files for all files in the project that
- * are relevant to the JPA 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 2.2
- * @since 2.0
- */
-public interface JpaFile
- extends JpaNode
-{
- /**
- * Return the JPA file's Eclipse file.
- */
- IFile getFile();
-
- /**
- * 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).
- */
- JpaResourceModel 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()
- */
- JpaResourceModel 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java
deleted file mode 100644
index 741b35d570..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaNode.java
+++ /dev/null
@@ -1,40 +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.core;
-
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * JPA-specific protocol. All JPA objects belong to a JPA project, are
- * associated with a resource, and have a parent (excepting the JPA 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 2.1
- * @since 2.0
- */
-public interface JpaNode
- extends Model, IAdaptable, IResourcePart
-{
- /**
- * Return the JPA project the node belongs to.
- */
- JpaProject getJpaProject();
-
- /**
- * Return the JPA node's parent. The JPA project will not have a parent.
- */
- JpaNode getParent();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
deleted file mode 100644
index 75f15eed11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatform.java
+++ /dev/null
@@ -1,214 +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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * the core JPA model. The core JPA model will provide functionality for JPA
- * spec annotations in Java, <code>persistence.xml</code> and mapping
- * (<code>orm.xml</code>) files.
- * The <code>org.eclipse.jpt.core.generic</code> extension supplies
- * resource models for those file types. As another vendor option you
- * will have to supply those resource models as well or different ones
- * as necessary. In the extension point you actually provide a
- * {@link JpaPlatformFactory} that will build the JPA platform.
- * <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>
- * See the <code>org.eclipse.jpt.core.jpaPlatforms</code> extension point.
- * @see JpaPlatformFactory
- * @see JpaPlatformProvider
- *
- * @version 2.3
- * @since 2.0
- */
-public interface JpaPlatform
-{
- /**
- * Get the ID for this platform
- */
- String getId();
-
- /**
- * Get the version object for this platform.
- */
- Version getJpaVersion();
-
- // ********** factory **********
-
- /**
- * Return a factory responsible for creating core (e.g. JpaProject), resource
- * (e.g. PersistenceResource), and context (e.g. PersistenceUnit) model
- * objects
- */
- JpaFactory getJpaFactory();
-
-
- // ********** JPA files **********
-
- /**
- * Return a JPA file corresponding to the specified Eclipse file.
- * Return null if the file's content is unsupported.
- */
- JpaFile buildJpaFile(JpaProject jpaProject, IFile file);
-
-
- // ********** Java annotations **********
-
- /**
- * Return an annotation provider responsible for determining what Java
- * annotations are supported and constructing java resource model objects.
- */
- JpaAnnotationProvider getAnnotationProvider();
-
- /**
- * Return a formatter that can clean up the Java annotations added to source
- * code.
- */
- AnnotationEditFormatter getAnnotationEditFormatter();
-
-
- // ********** Java type/attribute mappings **********
-
- /**
- * Return a {@link JavaTypeMappingDefinition} that describes the interpretation of the type
- * as it exists, complete with annotations.
- * This may not be null (@see {@link NullJavaTypeMappingDefinition},) else
- * an {@link IllegalStateException} is thrown.
- *
- * @param type The persistent type to analyze
- * @return The mapping definition used to describe the annotated state of the type
- */
- JavaTypeMappingDefinition getJavaTypeMappingDefinition(JavaPersistentType type);
-
- /**
- * Return a {@link JavaTypeMappingDefinition} for the given mapping key.
- * Throw an {@link IllegalArgumentException} if the key is not supported by the platform.
- */
- JavaTypeMappingDefinition getJavaTypeMappingDefinition(String mappingKey);
-
- /**
- * Return a {@link JavaAttributeMappingDefinition} that describes the interpretation of the attribute
- * as it exists, ignoring all annotations.
- * This may not be null (@see {@link NullDefaultJavaAttributeMappingDefinition},) else
- * an {@link IllegalStateException} is thrown.
- *
- * @param attribute The persistent attribute to analyze
- * @return The mapping definition describing the unannotated state of the attribute
- */
- JavaAttributeMappingDefinition getDefaultJavaAttributeMappingDefinition(JavaPersistentAttribute attribute);
-
- /**
- * 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(JavaPersistentAttribute 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);
-
-
- // ********** resource types and definitions **********
-
- /**
- * Return true if the resource type is supported. The result of this call is consistent with
- * the result of {@link #getResourceDefinition(JpaResourceType)}
- */
- boolean supportsResourceType(JpaResourceType resourceType);
-
- /**
- * Return a {@link ResourceDefinition} to describe the context model for a file of the given
- * resource type.
- * Throw an {@link IllegalArgumentException} if the resource type is not supported by the platform.
- *
- * @param resourceType The resource type of a potential resource definition
- * @return The resource definition that can be used for such a file
- */
- ResourceDefinition getResourceDefinition(JpaResourceType resourceType);
-
- /**
- * Return the most recent supported {@link JpaResourceType} for the given content type.
- * Throw an {@link IllegalArgumentException} if the content type is not supported by the platform.
- *
- * @param contentType A content type supported by the platform
- * @return The most recent resource type supported by the platform
- */
- JpaResourceType getMostRecentSupportedResourceType(IContentType contentType);
-
-
- // ********** database **********
-
- /**
- * Return a connection repository that can be used to query the database
- * about database metadata.
- */
- ConnectionProfileFactory getConnectionProfileFactory();
-
- /**
- * Return an entity generator database annotation name builder, which is
- * used by Entity Generation to determine whether and how the entity generator
- * prints the names of various database objects.
- */
- EntityGeneratorDatabaseAnnotationNameBuilder getEntityGeneratorDatabaseAnnotationNameBuilder();
-
-
- // ********** platform variation **********
-
- /**
- * Return a platform variation that is used to determine differences platforms and/or JPA specification versions
- */
- JpaPlatformVariation getJpaVariation();
-
-
- interface Version
- {
- /**
- * Return the platform's version.
- */
- String getVersion();
-
- /**
- * Return the highest JPA specification version supported by the platform.
- * @see JptCorePlugin#JPA_FACET_VERSION_1_0
- * @see JptCorePlugin#JPA_FACET_VERSION_2_0
- */
- String getJpaVersion();
-
- /**
- * Return whether the platform is compatible with the specified JPA
- * specification version.
- * @see JptCorePlugin#JPA_FACET_VERSION_1_0
- * @see JptCorePlugin#JPA_FACET_VERSION_2_0
- */
- boolean isCompatibleWithJpaVersion(String jpaVersion);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformFactory.java
deleted file mode 100644
index 7c085af410..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformFactory.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.core;
-
-/**
- * This interface is to be implemented by a JPA vendor to build a
- * {@link JpaPlatform}.
- * <p>
- * See the <code>org.eclipse.jpt.core.jpaPlatforms</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 2.2
- * @since 2.2
- */
-public interface JpaPlatformFactory {
- /**
- * Build the JPA platform with the specified ID.
- */
- JpaPlatform buildJpaPlatform(String id);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformProvider.java
deleted file mode 100644
index d08bc963b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformProvider.java
+++ /dev/null
@@ -1,70 +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.core;
-
-import java.util.ListIterator;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * the core JPA model. The core JPA model will provide functionality for JPA
- * spec annotations in java, persistence.xml and mapping (orm.xml) files.
- * The org.eclipse.jpt.core.generic extension supplies
- * resource models for those file types in GenericJpaPlatformProvider.
- *
- * This JpaPlatformProvider implementation most likely only returns providers
- * that are extensions of other platforms. Then in the GenericJpaPlatform implementation
- * you pass in 1 or more JpaPlatformProviders.
- *
- * See the org.eclipse.jpt.core.jpaPlatforms 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 2.3
- * @since 2.2
- */
-public interface JpaPlatformProvider
-{
- /**
- * Return the most recent resource type for the given content type supported by this platform
- */
- public JpaResourceType getMostRecentSupportedResourceType(IContentType contentType);
-
- /**
- * Return the resource model providers that apply to this platform.
- */
- ListIterator<JpaResourceModelProvider> resourceModelProviders();
-
- /**
- * Return the resource definitions supported by this platform.
- */
- ListIterator<ResourceDefinition> resourceDefinitions();
-
- /**
- * Return the java type mapping definitions that apply to this platform.
- */
- ListIterator<JavaTypeMappingDefinition> javaTypeMappingDefinitions();
-
- /**
- * Return the mapping definitions to use for default java attribute mappings for this platform.
- */
- ListIterator<JavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions();
-
- /**
- * Return the mapping definitions to use for specified java attribute mappings for this platform.
- */
- ListIterator<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformVariation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformVariation.java
deleted file mode 100644
index 74710d42af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaPlatformVariation.java
+++ /dev/null
@@ -1,60 +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.core;
-
-/**
- * A JpaPlatform contains a JpaPlatformVariation. This is used for various jpa spec
- * items that are either optional or only supported by certain version of the spec.
- * Each platform implementation must determine if it supports these things.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaPlatformVariation
-{
- /**
- * Return whether table-per-concrete-class is a supported
- * inheritance strategy in the JPA platform.
- * Supported.MAYBE means that it is in the JPA spec, but not portable
- * or might not be supported by a particular provider.
- * @return
- */
- Supported getTablePerConcreteClassInheritanceIsSupported();
-
- /**
- * This is used to determine if a relationship mapping that uses a join table
- * can be overridden with an association override.
- */
- boolean isJoinTableOverridable();
-
-
- public enum Supported {
- /**
- * fully supported by the platform
- */
- YES,
-
- /**
- * not supported by the platform
- */
- NO,
-
- /**
- * in the JPA spec, might not supported be supported by a particular provider
- */
- MAYBE,
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java
deleted file mode 100644
index 6d3b8f6966..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProject.java
+++ /dev/null
@@ -1,541 +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.core;
-
-import java.util.Iterator;
-
-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.IJavaProject;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentTypeCache;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * A JPA 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 2.3
- * @since 2.0
- */
-public interface JpaProject
- extends JpaNode
-{
-
- // ********** general **********
-
- /**
- * Return the JPA project's name, which is the same as the associated
- * Eclipse project's name.
- */
- String getName();
-
- /**
- * Return the Eclipse project associated with the JPA project.
- */
- IProject getProject();
-
- /**
- * Return the Java project associated with the JPA project.
- */
- IJavaProject getJavaProject();
-
- /**
- * Return the vendor-specific JPA platform that builds the JPA project
- * and its contents.
- */
- JpaPlatform getJpaPlatform();
-
- /**
- * Return the root of the JPA project's context model.
- */
- JpaRootContextNode getRootContextNode();
-
- /**
- * The JPA project has been removed from the JPA model. Clean up any
- * hooks to external resources etc.
- */
- void dispose();
-
-
- // ********** JPA files **********
-
- /**
- * ID string used when the JPA project's collection of JPA files changes.
- * @see #addCollectionChangeListener(String, org.eclipse.jpt.utility.model.listener.CollectionChangeListener)
- */
- String JPA_FILES_COLLECTION = "jpaFiles"; //$NON-NLS-1$
-
- /**
- * Return the JPA project's JPA files.
- */
- Iterator<JpaFile> jpaFiles();
-
- /**
- * Return the size of the JPA project's JPA files.
- */
- int jpaFilesSize();
-
- /**
- * Return the JPA file corresponding to the specified file.
- * Return null if there is no JPA file associated with the specified file.
- */
- JpaFile getJpaFile(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.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();
-
-
- // ********** XML resources **********
-
- /**
- * Return the XML resource model corresponding to the file
- * <code>META-INF/persistence.xml</code> if that file has the persistence content type
- * (<code>"org.eclipse.jpt.core.content.persistence"</code>).
- *
- * @see JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH
- */
- JpaXmlResource getPersistenceXmlResource();
-
- /**
- * Return the XML resource model corresponding to the specified file
- * if that file has the mapping file content type
- * (<code>"org.eclipse.jpt.core.content.mappingFile"</code>)
- *
- * @see JptCorePlugin#MAPPING_FILE_CONTENT_TYPE
- */
- JpaXmlResource getMappingFileXmlResource(String filePath);
-
- /**
- * Return the XML resource model corresponding to the file
- * <code>META-INF/orm.xml</code> if that file has the mapping file content type.
- *
- * @see JptCorePlugin#DEFAULT_ORM_XML_FILE_PATH
- */
- JpaXmlResource getDefaultOrmXmlResource();
-
-
- // ********** Java resources **********
-
- /**
- * Return the names of the JPA project's annotated Java classes
- * (ignoring classes in JARs referenced in the persistence.xml).
- */
- Iterator<String> annotatedJavaSourceClassNames();
-
- /**
- * Return the names of the JPA project's mapped (i.e. annotated with @Entity, etc.) Java
- * classes (ignoring classes in JARs referenced in the persistence.xml).
- */
- Iterator<String> mappedJavaSourceClassNames();
-
- /**
- * Return the Java resource persistent type for the specified type.
- * Return null if invalid or absent.
- */
- JavaResourcePersistentType getJavaResourcePersistentType(String typeName);
-
- /**
- * Return the Java resource package fragement root for the specified JAR.
- * Return null if absent.
- */
- JavaResourcePackageFragmentRoot getJavaResourcePackageFragmentRoot(String jarFileName);
-
-
- // ********** 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 **********
-
- void synchronizeContextModel();
-
-
- // ********** project "update" **********
-
- /**
- * Return the implementation of the Updater
- * interface that will be used to "update" the JPA project.
- */
- Updater getUpdater();
-
- /**
- * Set the implementation of the Updater
- * interface that will be used to "update" the JPA project.
- * Before setting the updater, clients should save the current updater so
- * it can be restored later.
- */
- void setUpdater(Updater updater);
-
- /**
- * The JPA project's state has changed, "update" those parts of the
- * JPA project that are dependent on other parts of the JPA project.
- * This is called when<ul>
- * <li>(almost) any state in the JPA project changes
- * <li>the JPA project's database connection is changed, opened, or closed
- * </ul>
- */
- void update();
-
- /**
- * This is the callback used by the updater to perform the actual
- * "update", which most likely will happen asynchronously.
- */
- IStatus update(IProgressMonitor monitor);
-
- /**
- * This is the callback used by the updater to notify the JPA project that
- * the "update" has quiesced (i.e. the "update" has completed and there
- * are no outstanding requests for further "updates").
- */
- void updateQuiesced();
-
-
- /**
- * Define a strategy that can be used to "update" a JPA project whenever
- * something changes.
- */
- interface Updater {
-
- /**
- * The updater has just been assigned to its JPA project.
- */
- void start();
-
- /**
- * Update the JPA project.
- * <p>
- * {@link JpaProject#update()} will call {@link Updater#update()},
- * from which the updater is to call {@link JpaProject#update(IProgressMonitor)}
- * as appropriate (typically from an asynchronously executing job).
- * Once the updating has quiesced (i.e. there are no outstanding requests
- * for another update), the updater is to call {@link JpaProject#updateQuiesced()}.
- */
- void update();
-
- /**
- * The JPA project is disposed; stop the updater.
- */
- void stop();
-
- /**
- * This updater does nothing. Useful for testing.
- */
- final class Null implements Updater {
- private static final Updater INSTANCE = new Null();
- public static Updater instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void start() {
- // do nothing
- }
- public void update() {
- // do nothing
- }
- public void stop() {
- // do nothing
- }
- @Override
- public String toString() {
- return "JpaProject.Updater.Null"; //$NON-NLS-1$
- }
- }
-
- }
-
-
- // ********** utility **********
-
- /**
- * Convert the specified file name to a file mapped to the appropriate
- * deployment location.
- */
- IFile convertToPlatformFile(String fileName);
-
-
- // ********** validation **********
-
- /**
- * Return JPA project's validation messages.
- */
- Iterator<IMessage> validationMessages(IReporter reporter);
-
-
- // ********** database **********
-
- /**
- * Return the data source the JPA project is mapped to.
- */
- JpaDataSource getDataSource();
-
- /**
- * Return the JPA project's connection.
- * The connection profile is null if the JPA project's connection profile
- * name does not match the name of a DTP connection profile.
- */
- ConnectionProfile getConnectionProfile();
-
- /**
- * Return the JPA project's default database schema container;
- * which is either the JPA project's default catalog or the JPA project's
- * database, depending on how the DTP model is implemented.
- */
- SchemaContainer getDefaultDbSchemaContainer();
-
- /**
- * Return the JPA project's default catalog; which is either the user
- * override catalog or the database's default catalog.
- */
- String getDefaultCatalog();
-
- /**
- * Return the JPA project's default database catalog.
- * @see #getDefaultCatalog()
- */
- Catalog getDefaultDbCatalog();
-
- /**
- * Return the JPA project's default schema; which can be one of the
- * following:<ul>
- * <li>the user override schema
- * <li>the default catalog's default schema
- * <li>the database's default schema (if catalogs are not supported)
- * </ul>
- */
- String getDefaultSchema();
-
- /**
- * Return the JPA project's default database schema.
- * @see #getDefaultSchema()
- * @see #getDefaultDbSchemaContainer()
- */
- Schema getDefaultDbSchema();
-
-
- // ********** user override default catalog **********
-
- /**
- * ID string used when the JPA project's user override default catalog changes.
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY = "userOverrideDefaultCatalog"; //$NON-NLS-1$
-
- /**
- * Return the <em>identifier</em> of the catalog to be used as a default
- * for the JPA project instead of the one that is associated by default
- * with the connection profile.
- * @return The catalog identifier. May be null (implying the connection profile
- * default catalog should be used).
- */
- String getUserOverrideDefaultCatalog();
-
- /**
- * Set the <em>identifier</em> of the catalog to be used as a default
- * for the JPA project instead of the one that is associated by default
- * with the connection profile.
- * @parameter catalog The catalog identifier. May be null (implying the connection profile
- * default catalog should be used).
- */
- void setUserOverrideDefaultCatalog(String catalog);
-
-
- // ********** user override default schema **********
-
- /**
- * ID string used when the JPA project's user override default schema changes.
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY = "userOverrideDefaultSchema"; //$NON-NLS-1$
-
- /**
- * Return the <em>identifier</em> of the schema to be used as a default
- * for the JPA project instead of the one that is associated by default
- * with the connection profile.
- * @return The schema identifier. May be null (implying the connection profile
- * default schema should be used).
- */
- String getUserOverrideDefaultSchema();
-
- /**
- * Set the <em>identifier</em> of the schema to be used as a default
- * for the JPA project instead of the one that is associated by default
- * with the connection profile.
- * @parameter schema The schema identifier. May be null (implying the connection profile
- * default schema should be used).
- */
- void setUserOverrideDefaultSchema(String schema);
-
-
- // ********** discover annotated classes **********
-
- /**
- * ID string used when discoversAnnotatedClasses property is changed.
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String DISCOVERS_ANNOTATED_CLASSES_PROPERTY = "discoversAnnotatedClasses"; //$NON-NLS-1$
-
- /**
- * Return whether the JPA project will "discover" annotated classes
- * automatically, as opposed to requiring the classes to be listed in the
- * persistence.xml or one of its mapping files.
- * This is a user-specified preference that is probably
- * only helpful when deploying to a JavaSE environment. The JPA spec
- * says annotated classes are to be discovered automatically in a JavaEE
- * environment; while the managed persistence classes must be explicitly
- * listed in a JavaSE environment: "A list of all named managed persistence
- * classes must be specified in Java SE environments to insure portability".
- * This flag allows Dali to behave consistently with the user's JPA
- * implementation, which may allow "discovery" in a JavaSE environment
- * (e.g. EclipseLink). This setting can also be used when the user wants
- * to explicitly list classes, even when the classes are "discovered"
- * by the JPA implementation. If this flag is set to false, error messages
- * will be generated for all of the annotated classes that are not
- * explicitly listed.
- */
- boolean discoversAnnotatedClasses();
-
- /**
- * Set whether the JPA project will "discover" annotated classes
- * automatically, as opposed to requiring the classes to be listed in the
- * persistence.xml.
- */
- void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses);
-
-
- // ********** 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 JPA project.
- */
- interface Config {
-
- /**
- * Return the Eclipse project to be associated with the new JPA project.
- */
- IProject getProject();
-
- /**
- * Return the JPA platform to be associated with the new JPA project.
- */
- JpaPlatform getJpaPlatform();
-
- /**
- * Return the name of the connection profile to be associated
- * with the new JPA project. (This connection profile wraps a DTP
- * connection profile.)
- */
- String getConnectionProfileName();
-
- /**
- * Return the catalog to use instead of the connection profile's
- * default catalog.
- * May be null.
- */
- String getUserOverrideDefaultCatalog();
-
- /**
- * Return the name of the schema to use instead of the default schema
- * of the connection profile.
- * May be null.
- */
- String getUserOverrideDefaultSchema();
-
- /**
- * Return whether the new JPA project is to "discover" annotated
- * classes.
- */
- boolean discoverAnnotatedClasses();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProjectManager.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProjectManager.java
deleted file mode 100644
index 88e70ec5a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaProjectManager.java
+++ /dev/null
@@ -1,73 +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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * The JPA project manager holds all the JPA 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 2.3
- * @since 2.3
- */
-public interface JpaProjectManager
- extends Model {
-
- /**
- * Return the JPA model's JPA projects.
- */
- Iterable<JpaProject> getJpaProjects();
- public static final String JPA_PROJECTS_COLLECTION = "jpaProjects"; //$NON-NLS-1$
-
- /**
- * Return the size of the JPA model's list of JPA projects.
- */
- int getJpaProjectsSize();
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project.
- * Return null if unable to associate the specified Eclipse project
- * with a JPA project.
- */
- JpaProject getJpaProject(IProject project);
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or null if unable to associate the specified file with a JPA file.
- */
- JpaFile getJpaFile(IFile file);
-
- /**
- * The JPA 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 JPA platform).
- */
- void rebuildJpaProject(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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModel.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModel.java
deleted file mode 100644
index c51634299b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModel.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.core;
-
-/**
- * Listeners are notified whenever anything in the JPA 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 JpaResourceModel {
-
- /**
- * 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.
- */
- JpaResourceType getResourceType();
-
- /**
- * Changes to the resource model result in events.
- * In particular, the JPA project performs an "update" whenever a resource
- * model changes.
- */
- void addResourceModelListener(JpaResourceModelListener listener);
-
- /**
- * @see #addResourceModelListener(ResourceModelListener)
- */
- void removeResourceModelListener(JpaResourceModelListener listener);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelListener.java
deleted file mode 100644
index 233485c874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelListener.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.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 JpaResourceModelListener
- extends EventListener
-{
- void resourceModelChanged(JpaResourceModel jpaResourceModel);
-
- void resourceModelReverted(JpaResourceModel jpaResourceModel);
-
- void resourceModelUnloaded(JpaResourceModel jpaResourceModel);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelProvider.java
deleted file mode 100644
index 9d78132dab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceModelProvider.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.core;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-
-/**
- * Map a content type to a JPA 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 2.2
- * @since 2.2
- */
-public interface JpaResourceModelProvider
-{
- /**
- * Return the file content type the provider is for.
- */
- IContentType getContentType();
-
- /**
- * Build a JPA resource model for the specified JPA 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.
- */
- JpaResourceModel buildResourceModel(JpaProject jpaProject, IFile file);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceType.java
deleted file mode 100644
index 037a0f3ed9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaResourceType.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.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 JpaResourceType
-{
- 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 JpaResourceType(IContentType contentType) {
- this(contentType, UNDETERMINED_VERSION);
- }
-
- public JpaResourceType(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;
- }
- JpaResourceType other = (JpaResourceType) 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.java
deleted file mode 100644
index 75959b33f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JpaStructureNode.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.core;
-
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * Implement this interface for objects that appear in the Structure view
- * This is used by JpaSelection to determine selection in the editor.
- * Details pages are also provided for each JpaStructureNode.
- *
- * I did not implement JpaContextNode and I'm not even sure we should implement
- * JpaNode. It is possibly someone could want a structure node that is
- * not actually a contextNode in the model.//TODO
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JpaStructureNode
- extends JpaNode
-{
- /**
- * Return the structure node at the given offset.
- */
- JpaStructureNode getStructureNode(int textOffset);
-
- /**
- * Return the text range to be used to select text in the editor
- * corresponding to this node.
- */
- TextRange getSelectionTextRange();
-
- /**
- * Return a unique identifier for all of this class of structure nodes
- */
- String getId();
-
- /**
- * Return the content type of the structure node's resource.
- * This is used to find the appropriate ui provider for building composites
- */
- JpaResourceType getResourceType();
-
- /**
- * Dispose of this structureNode and dispose of child structureNodes.
- * Typically this would be used to update the JpaFile rootStructureNodes.
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
deleted file mode 100644
index 8047e52def..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ /dev/null
@@ -1,794 +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.core;
-
-import javax.xml.parsers.SAXParserFactory;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.CoreException;
-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.Plugin;
-import org.eclipse.core.runtime.QualifiedName;
-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.jdt.core.JavaCore;
-import org.eclipse.jpt.core.internal.GenericJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.internal.jpa2.Generic2_0JpaPlatformProvider;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jst.j2ee.internal.J2EEConstants;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.prefs.BackingStoreException;
-import org.osgi.service.prefs.Preferences;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- * The Dali 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 2.3
- * @since 2.0
- */
-public class JptCorePlugin extends Plugin {
-
- private volatile GenericJpaProjectManager jpaProjectManager;
- private volatile ServiceTracker parserTracker;
- private static volatile boolean flushPreferences = true;
-
-
- // ********** public constants **********
-
- /**
- * The plug-in identifier of the persistence support
- * (value <code>"org.eclipse.jpt.core"</code>).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- /**
- * The identifier for the JPA facet
- * (value <code>"jpt.jpa"</code>).
- */
- public static final String FACET_ID = "jpt.jpa"; //$NON-NLS-1$
-
- /**
- * Version string for JPA facet version 1.0
- */
- public static final String JPA_FACET_VERSION_1_0 = "1.0"; //$NON-NLS-1$
-
- /**
- * Version string for JPA facet version 2.0
- */
- public static final String JPA_FACET_VERSION_2_0 = "2.0"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's platform ID in the Eclipse
- * project's preferences.
- */
- private static final String JPA_PLATFORM_PREF_KEY = PLUGIN_ID_ + "platform"; //$NON-NLS-1$
-
- /**
- * The old key for storing the default JPA platform ID in the workspace preferences.
- * @deprecated As of version 2.3. Instead use {@link #DEFAULT_JPA_PLATFORM_1_0_PREF_KEY} or
- * {@link #DEFAULT_JPA_PLATFORM_2_0_PREF_KEY}
- */
- @Deprecated
- public static final String DEFAULT_JPA_PLATFORM_PREF_KEY = "defaultJpaPlatform"; //$NON-NLS-1$
-
- /**
- * The key for storing the default JPA platform ID for JPA 1.0 in the workspace preferences.
- */
- public static final String DEFAULT_JPA_PLATFORM_1_0_PREF_KEY =
- DEFAULT_JPA_PLATFORM_PREF_KEY + "_" + JPA_FACET_VERSION_1_0; //$NON-NLS-1$
-
- /**
- * The key for storing the default JPA platform ID for JPA 2.0 in the workspace preferences.
- */
- public static final String DEFAULT_JPA_PLATFORM_2_0_PREF_KEY =
- DEFAULT_JPA_PLATFORM_PREF_KEY + "_" + JPA_FACET_VERSION_2_0; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's "discover" flag in the Eclipse
- * project's preferences.
- */
- public static final String DISCOVER_ANNOTATED_CLASSES = PLUGIN_ID_ + "discoverAnnotatedClasses"; //$NON-NLS-1$
-
- /**
- * The key for storing the name of a JPA project's metamodel source folder
- * in the Eclipse project's preferences.
- */
- public static final String METAMODEL_SOURCE_FOLDER_NAME = PLUGIN_ID_ + "metamodelSourceFolderName"; //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's data source connection profile name
- * in the Eclipse project's persistent properties.
- */
- public static final QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME =
- new QualifiedName(PLUGIN_ID, "dataSource.connectionProfileName"); //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's user overridden default catalog name
- * in the Eclipse project's persistent properties.
- */
- public static final QualifiedName USER_OVERRIDE_DEFAULT_CATALOG =
- new QualifiedName(PLUGIN_ID, "userOverrideDefaultCatalogName"); //$NON-NLS-1$
-
- /**
- * The key for storing a JPA project's user overridden default schema name
- * in the Eclipse project's persistent properties.
- */
- public static final QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA =
- new QualifiedName(PLUGIN_ID, "userOverrideDefaultSchemaName"); //$NON-NLS-1$
-
- /**
- * The identifier for the JPA validator
- * (value <code>"org.eclipse.jpt.core.jpaValidator"</code>).
- */
- public static final String VALIDATOR_ID = PLUGIN_ID_ + "jpaValidator"; //$NON-NLS-1$
-
- /**
- * 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 JpaResourceType JAVA_SOURCE_RESOURCE_TYPE = new JpaResourceType(JAVA_SOURCE_CONTENT_TYPE);
-
- /**
- * The content type for <code>persistence.xml</code> files.
- */
- public static final IContentType PERSISTENCE_XML_CONTENT_TYPE = getJpaContentType("persistence"); //$NON-NLS-1$
-
- /**
- * The resource type for <code>persistence.xml</code> version 1.0 files
- */
- public static final JpaResourceType PERSISTENCE_XML_1_0_RESOURCE_TYPE =
- new JpaResourceType(PERSISTENCE_XML_CONTENT_TYPE, org.eclipse.jpt.core.resource.persistence.JPA.SCHEMA_VERSION);
-
- /**
- * The resource type for <code>persistence.xml</code> version 2.0 files
- */
- public static final JpaResourceType PERSISTENCE_XML_2_0_RESOURCE_TYPE =
- new JpaResourceType(PERSISTENCE_XML_CONTENT_TYPE, org.eclipse.jpt.core.resource.persistence.v2_0.JPA2_0.SCHEMA_VERSION);
-
- /**
- * The base content type for all mapping files.
- */
- public static final IContentType MAPPING_FILE_CONTENT_TYPE = getJpaContentType("mappingFile"); //$NON-NLS-1$
-
- /**
- * The content type for <code>orm.xml</code> mapping files.
- */
- public static final IContentType ORM_XML_CONTENT_TYPE = getJpaContentType("orm"); //$NON-NLS-1$
-
- /**
- * The resource type for <code>orm.xml</code> version 1.0 mapping files
- */
- public static final JpaResourceType ORM_XML_1_0_RESOURCE_TYPE =
- new JpaResourceType(ORM_XML_CONTENT_TYPE, org.eclipse.jpt.core.resource.orm.JPA.SCHEMA_VERSION);
-
- /**
- * The resource type for <code>orm.xml</code> version 2.0 mapping files
- */
- public static final JpaResourceType ORM_XML_2_0_RESOURCE_TYPE =
- new JpaResourceType(ORM_XML_CONTENT_TYPE, org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0.SCHEMA_VERSION);
-
- /**
- * The content type for Java archives (JARs).
- */
- public static final IContentType JAR_CONTENT_TYPE = getJpaContentType("jar"); //$NON-NLS-1$
-
- /**
- * The resource type for Java archives (JARs).
- */
- public static final JpaResourceType JAR_RESOURCE_TYPE = new JpaResourceType(JAR_CONTENT_TYPE);
-
- /**
- * Web projects have some special exceptions.
- */
- public static final String WEB_PROJECT_FACET_ID = IModuleConstants.JST_WEB_MODULE;
-
- /**
- * Web projects have some special exceptions.
- */
- public static final String WEB_PROJECT_DEPLOY_PREFIX = J2EEConstants.WEB_INF_CLASSES;
-
- public static final String DEFAULT_PERSISTENCE_XML_FILE_PATH = "META-INF/persistence.xml"; //$NON-NLS-1$
-
- public static final String DEFAULT_ORM_XML_FILE_PATH = "META-INF/orm.xml"; //$NON-NLS-1$
-
- private static IContentType getJpaContentType(String jpaContentType) {
- return getContentType(CONTENT_PREFIX_ + jpaContentType);
- }
-
- 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);
- }
-
-
- // ********** singleton **********
-
- private static JptCorePlugin INSTANCE;
-
- /**
- * Return the singleton Dali core plug-in.
- */
- public static JptCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- /**
- * Return the singular JPA project manager corresponding
- * to the current workspace.
- */
- public static JpaProjectManager getJpaProjectManager() {
- return INSTANCE.getJpaProjectManager_();
- }
-
- /**
- * Return the JPA project corresponding to the specified Eclipse project,
- * or <code>null</code> if unable to associate the specified project with a
- * JPA project.
- */
- public static JpaProject getJpaProject(IProject project) {
- return getJpaProjectManager().getJpaProject(project);
- }
-
- /**
- * Return the JPA file corresponding to the specified Eclipse file,
- * or <code>null</code> if unable to associate the specified file with a JPA file.
- */
- public static JpaFile getJpaFile(IFile file) {
- return getJpaProjectManager().getJpaFile(file);
- }
-
- /**
- * The JPA 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 JPA platform).
- */
- public static void rebuildJpaProject(IProject project) {
- getJpaProjectManager().rebuildJpaProject(project);
- }
-
- /**
- * Return whether the specified Eclipse project has a JPA facet.
- */
- public static boolean projectHasJpaFacet(IProject project) {
- return projectHasFacet(project, FACET_ID);
- }
-
- /**
- * Return whether the specified Eclipse project has a Web facet.
- */
- public static boolean projectHasWebFacet(IProject project) {
- return projectHasFacet(project, WEB_PROJECT_FACET_ID);
- }
-
- /**
- * Checked exceptions bite.
- */
- private static boolean projectHasFacet(IProject project, String facetId) {
- try {
- return FacetedProjectFramework.hasProjectFacet(project, facetId);
- } catch (CoreException ex) {
- log(ex); // problems reading the project metadata - assume facet doesn't exist - return 'false'
- return false;
- }
- }
-
- /**
- * Return the <code>persistence.xml</code> (specified as <code>"META-INF/persistence.xml"</code>)
- * deployment URI for the specified project.
- */
- public static String getPersistenceXmlDeploymentURI(IProject project) {
- return getDeploymentURI(project, DEFAULT_PERSISTENCE_XML_FILE_PATH);
- }
-
- /**
- * Return the default mapping file (specified as <code>"META-INF/orm.xml"</code>)
- * deployment URI for the specified project.
- */
- public static String getDefaultOrmXmlDeploymentURI(IProject project) {
- return getDeploymentURI(project, DEFAULT_ORM_XML_FILE_PATH);
- }
-
- /**
- * Return the mapping file (specified as {@code"META-INF/<mappingFileName>"})
- * deployment URI for the specified project.
- */
- public static String getOrmXmlDeploymentURI(IProject project, String mappingFileName) {
- return getDeploymentURI(project, mappingFileName);
- }
-
- /**
- * Tweak the specified deployment URI if the specified project
- * has a Web facet.
- */
- public static String getDeploymentURI(IProject project, String defaultURI) {
- return projectHasWebFacet(project) ?
- WEB_PROJECT_DEPLOY_PREFIX + '/' + defaultURI
- :
- defaultURI;
- }
-
- /**
- * Return the deployment path to which JARs are relatively specified for
- * the given project.
- * (Web projects have a different deployment structure than non-web projects.)
- */
- public static IPath getJarDeploymentRootPath(IProject project) {
- return new Path(getJarDeploymentRootPathName(project));
- }
-
- private static String getJarDeploymentRootPathName(IProject project) {
- return projectHasWebFacet(project) ? ("/" + J2EEConstants.WEB_INF) : "/"; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public static IFile getPlatformFile(IProject project, String defaultURI) {
- IPath deploymentPath = new Path(getDeploymentURI(project, defaultURI));
- IVirtualFile vFile = ComponentCore.createFile(project, deploymentPath);
- return vFile.getUnderlyingFile();
-
- }
-
- public static JpaFile getJpaFile(IProject project, String defaultURI) {
- IFile xmlFile = getPlatformFile(project, defaultURI);
- return xmlFile.exists() ? getJpaFile(xmlFile) : null;
- }
-
- public static void initializeDefaultPreferences() {
- IEclipsePreferences node = getDefaultPreferences();
-
- // default JPA platforms
- String defaultPlatformId_1_0 = JpaPlatformRegistry.instance().getDefaultJpaPlatformId(JPA_FACET_VERSION_1_0);
- if (StringTools.stringIsEmpty(defaultPlatformId_1_0)) {
- defaultPlatformId_1_0 = GenericJpaPlatformProvider.ID;
- }
- node.put(DEFAULT_JPA_PLATFORM_1_0_PREF_KEY, defaultPlatformId_1_0);
-
- String defaultPlatformId_2_0 = JpaPlatformRegistry.instance().getDefaultJpaPlatformId(JPA_FACET_VERSION_2_0);
- if (StringTools.stringIsEmpty(defaultPlatformId_2_0)) {
- defaultPlatformId_2_0 = Generic2_0JpaPlatformProvider.ID;
- }
- node.put(DEFAULT_JPA_PLATFORM_2_0_PREF_KEY, defaultPlatformId_2_0);
- }
-
- /**
- * Return the default Dali preferences
- * @see JpaPreferenceInitializer
- */
- public static IEclipsePreferences getDefaultPreferences() {
- return getPreferences(new DefaultScope());
- }
-
- /**
- * Return the Dali preferences for the current workspace instance.
- */
- public static IEclipsePreferences getWorkspacePreferences() {
- return getPreferences(new InstanceScope());
- }
-
- /**
- * Return the Dali preferences for the specified Eclipse project.
- */
- public static IEclipsePreferences getProjectPreferences(IProject project) {
- return getPreferences(new ProjectScope(project));
- }
-
- /**
- * Return the Dali preferences for the specified context.
- */
- private static IEclipsePreferences getPreferences(IScopeContext context) {
- return context.getNode(PLUGIN_ID);
- }
-
- /**
- * Return the default JPA Platform ID for new JPA projects with the given JPA facet version.
- */
- public static String getDefaultJpaPlatformId(String jpaFacetVersion) {
- String defaultPlatformId =
- getDefaultJpaPlatformId(jpaFacetVersion, getWorkspacePreferences(), getDefaultPreferences());
- if (defaultPlatformId == null) {
- // if the platform ID stored in the workspace prefs is invalid (i.e. null), look in the default prefs
- defaultPlatformId = getDefaultJpaPlatformId(jpaFacetVersion, getDefaultPreferences());
- }
- return defaultPlatformId;
- }
-
- private static String getDefaultJpaPlatformId(String jpaFacetVersion, Preferences ... nodes) {
- String defaultDefaultPlatformId =
- getDefaultJpaPlatformId(jpaFacetVersion, DEFAULT_JPA_PLATFORM_PREF_KEY, null, nodes);
- String preferenceKey = null;
- if (jpaFacetVersion.equals(JPA_FACET_VERSION_1_0)) {
- if (defaultDefaultPlatformId == null) {
- defaultDefaultPlatformId = GenericJpaPlatformProvider.ID;
- }
- preferenceKey = DEFAULT_JPA_PLATFORM_1_0_PREF_KEY;
- }
- else if (jpaFacetVersion.equals(JPA_FACET_VERSION_2_0)) {
- if (defaultDefaultPlatformId == null) {
- defaultDefaultPlatformId = Generic2_0JpaPlatformProvider.ID;
- }
- preferenceKey = DEFAULT_JPA_PLATFORM_2_0_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JPA facet version: " + jpaFacetVersion); //$NON-NLS-1$
- }
- return getDefaultJpaPlatformId(jpaFacetVersion, preferenceKey, defaultDefaultPlatformId, nodes);
- }
-
- private static String getDefaultJpaPlatformId(
- String jpaFacetVersion, String preferenceKey, String defaultDefault, Preferences ... nodes) {
- String defaultPlatformId = Platform.getPreferencesService().get(preferenceKey, defaultDefault, nodes);
- if (jpaPlatformIdIsValid(defaultPlatformId)
- && JpaPlatformRegistry.instance().platformSupportsJpaFacetVersion(defaultPlatformId, jpaFacetVersion)) {
- return defaultPlatformId;
- }
- else if (jpaPlatformIdIsValid(defaultDefault)
- && JpaPlatformRegistry.instance().platformSupportsJpaFacetVersion(defaultDefault, jpaFacetVersion)) {
- return defaultDefault;
- }
- return null;
- }
-
- private static boolean jpaPlatformIdIsValid(String platformId) {
- return JpaPlatformRegistry.instance().containsPlatform(platformId);
- }
-
- /**
- * Set the default JPA platform ID for creating new JPA projects
- */
- public static void setDefaultJpaPlatformId(String jpaFacetVersion, String platformId) {
- IEclipsePreferences prefs = getWorkspacePreferences();
- String preferenceKey = null;
- if (JPA_FACET_VERSION_1_0.equals(jpaFacetVersion)) {
- preferenceKey = DEFAULT_JPA_PLATFORM_1_0_PREF_KEY;
- }
- else if (JPA_FACET_VERSION_2_0.equals(jpaFacetVersion)) {
- preferenceKey = DEFAULT_JPA_PLATFORM_2_0_PREF_KEY;
- }
- else {
- throw new IllegalArgumentException("Illegal JPA facet version: " + jpaFacetVersion); //$NON-NLS-1$
- }
- prefs.put(preferenceKey, platformId);
- flush(prefs);
- }
-
- /**
- * Return the JPA platform associated with the specified Eclipse project.
- */
- public static JpaPlatform getJpaPlatform(IProject project) {
- return JpaPlatformRegistry.instance().getJpaPlatform(project);
- }
-
- /**
- * Return the JPA platform ID associated with the specified Eclipse project.
- */
- public static String getJpaPlatformId(IProject project) {
- return getProjectPreferences(project).get(JPA_PLATFORM_PREF_KEY, GenericJpaPlatformProvider.ID);
- }
-
- /**
- * Set the JPA platform ID associated with the specified Eclipse project.
- */
- public static void setJpaPlatformId(IProject project, String jpaPlatformId) {
- IEclipsePreferences prefs = getProjectPreferences(project);
- prefs.put(JPA_PLATFORM_PREF_KEY, jpaPlatformId);
- flush(prefs);
- }
-
- /**
- * Return the preferences key used to look up an Eclipse project's
- * JPA platform ID.
- */
- public static String getJpaPlatformIdPrefKey() {
- return JPA_PLATFORM_PREF_KEY;
- }
-
- /**
- * Return the JPA "discover" flag associated with the specified
- * Eclipse project.
- */
- public static boolean discoverAnnotatedClasses(IProject project) {
- return getProjectPreferences(project).getBoolean(DISCOVER_ANNOTATED_CLASSES, false);
- }
-
- /**
- * Set the JPA "discover" flag associated with the specified
- * Eclipse project.
- */
- public static void setDiscoverAnnotatedClasses(IProject project, boolean discoverAnnotatedClasses) {
- IEclipsePreferences prefs = getProjectPreferences(project);
- prefs.putBoolean(DISCOVER_ANNOTATED_CLASSES, discoverAnnotatedClasses);
- flush(prefs);
- }
-
- /**
- * Return the name of the metamodel source folder associated with the
- * specified Eclipse project.
- */
- public static String getMetamodelSourceFolderName(IProject project) {
- return getProjectPreferences(project).get(METAMODEL_SOURCE_FOLDER_NAME, null);
- }
-
- /**
- * Set the name of the metamodel source folder associated with the
- * specified Eclipse project.
- */
- public static void setMetamodelSourceFolderName(IProject project, String metamodelSourceFolderName) {
- IEclipsePreferences prefs = getProjectPreferences(project);
- if (metamodelSourceFolderName == null) {
- prefs.remove(METAMODEL_SOURCE_FOLDER_NAME);
- }
- else {
- prefs.put(METAMODEL_SOURCE_FOLDER_NAME, metamodelSourceFolderName);
- }
- flush(prefs);
- }
-
- /**
- * This method is called (via reflection) when the test plug-in is loaded.
- * The prefs end up getting flushed after the test case has deleted the
- * project, resulting resource exceptions in the log, e.g.
- * Resource '/JpaProjectManagerTests' is not open.
- * @see JptCoreTestsPlugin#start(BundleContext)
- */
- @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).
- */
- 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(JptCoreMessages.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;
- }
- }
-
- /**
- * Return the name of the connection profile associated with the specified
- * Eclipse project.
- */
- public static String getConnectionProfileName(IProject project) {
- try {
- String connectionProfileName = project.getPersistentProperty(DATA_SOURCE_CONNECTION_PROFILE_NAME);
- // some old connection profile names were stored as empty strings instead of nulls :-(
- // convert them here
- return (StringTools.stringIsEmpty(connectionProfileName)) ? null : connectionProfileName;
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Set the name of the connection profile associated with the specified
- * Eclipse project.
- */
- public static void setConnectionProfileName(IProject project, String connectionProfileName) {
- try {
- project.setPersistentProperty(DATA_SOURCE_CONNECTION_PROFILE_NAME, connectionProfileName);
- } catch (CoreException ex) {
- log(ex);
- }
- }
-
- /**
- * Return the default catalog (identifier) associated with the specified Eclipse project.
- * @see JpaProject#getUserOverrideDefaultCatalog()
- */
- public static String getUserOverrideDefaultCatalog(IProject project) {
- try {
- return project.getPersistentProperty(USER_OVERRIDE_DEFAULT_CATALOG);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Set the default catalog (identifier) associated with the specified Eclipse project.
- * @see JpaProject#setUserOverrideDefaultCatalog(String)
- */
- public static void setUserOverrideDefaultCatalog(IProject project, String defaultCatalog) {
- try {
- project.setPersistentProperty(USER_OVERRIDE_DEFAULT_CATALOG, defaultCatalog);
- } catch (CoreException ex) {
- log(ex);
- }
- }
-
- /**
- * Return the default schema (identifier) associated with the specified Eclipse project.
- * @see JpaProject#getUserOverrideDefaultSchema()
- */
- public static String getUserOverrideDefaultSchema(IProject project) {
- try {
- return project.getPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA);
- } catch (CoreException ex) {
- log(ex);
- return null;
- }
- }
-
- /**
- * Set the default schema (identifier) associated with the specified Eclipse project.
- * @see JpaProject#setUserOverrideDefaultSchema(String)
- */
- public static void setUserOverrideDefaultSchema(IProject project, String defaultSchema) {
- try {
- project.setPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA, defaultSchema);
- } catch (CoreException ex) {
- log(ex);
- }
- }
-
- public static boolean nodeIsJpa2_0Compatible(JpaNode jpaNode) {
- return jpaNode.getJpaProject().getJpaPlatform().getJpaVersion().isCompatibleWithJpaVersion(JPA_FACET_VERSION_2_0);
- }
-
- /**
- * Return whether the JPA project manager's Java change listener is active.
- */
- public static boolean javaElementChangeListenerIsActive() {
- return getJpaProjectManager().javaElementChangeListenerIsActive();
- }
-
- /**
- * Set whether the JPA project manager's Java change listener is active.
- */
- public static void setJavaElementChangeListenerIsActive(boolean javaElementChangeListenerIsActive) {
- getJpaProjectManager().setJavaElementChangeListenerIsActive(javaElementChangeListenerIsActive);
- }
-
- /**
- * 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 JptCorePlugin() {
- 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.jpaProjectManager != null) {
- this.jpaProjectManager.stop();
- this.jpaProjectManager = null;
- }
- if (this.parserTracker != null) {
- this.parserTracker.close();
- this.parserTracker = null;
- }
- } finally {
- super.stop(context);
- }
- }
-
- private synchronized GenericJpaProjectManager getJpaProjectManager_() {
- if (this.jpaProjectManager == null) {
- this.jpaProjectManager = this.buildJpaProjectManager();
- this.jpaProjectManager.start();
- }
- return this.jpaProjectManager;
- }
-
- private GenericJpaProjectManager buildJpaProjectManager() {
- return new GenericJpaProjectManager();
- }
-
- public synchronized SAXParserFactory getSAXParserFactory() {
- SAXParserFactory factory = (SAXParserFactory) this.getParserTracker().getService();
- if (factory != null) {
- factory.setNamespaceAware(true);
- }
- return factory;
- }
-
- private ServiceTracker getParserTracker() {
- if (this.parserTracker == null) {
- this.parserTracker = this.buildParserTracker();
- this.parserTracker.open();
- }
- return this.parserTracker;
- }
-
- private ServiceTracker buildParserTracker() {
- return new ServiceTracker(this.getBundle().getBundleContext(), "javax.xml.parsers.SAXParserFactory", null); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java
deleted file mode 100644
index bafb1fa24a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/MappingKeys.java
+++ /dev/null
@@ -1,44 +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.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 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public interface MappingKeys {
-
- String ENTITY_TYPE_MAPPING_KEY = "entity";
- String MAPPED_SUPERCLASS_TYPE_MAPPING_KEY = "mappedSuperclass";
- String EMBEDDABLE_TYPE_MAPPING_KEY = "embeddable";
- String NULL_TYPE_MAPPING_KEY = null;
-
- String BASIC_ATTRIBUTE_MAPPING_KEY = "basic";
- String ID_ATTRIBUTE_MAPPING_KEY = "id";
- String VERSION_ATTRIBUTE_MAPPING_KEY = "version";
- String ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "oneToOne";
- String ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY = "oneToMany";
- String MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY = "manyToOne";
- String MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY = "manyToMany";
- String EMBEDDED_ATTRIBUTE_MAPPING_KEY = "embedded";
- String EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY = "embeddedId";
- String TRANSIENT_ATTRIBUTE_MAPPING_KEY = "transient";
- String NULL_ATTRIBUTE_MAPPING_KEY = null;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceDefinition.java
deleted file mode 100644
index 36e58c1601..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/ResourceDefinition.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.core;
-
-/**
- * A JpaPlatform can support multiple resources. Each will
- * have a unique resource type and must be defined with a resource definition.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ResourceDefinition
-{
- /**
- * Return the associated resource type.
- */
- JpaResourceType getResourceType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessHolder.java
deleted file mode 100644
index add227ec73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessHolder.java
+++ /dev/null
@@ -1,59 +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.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.2
- * @since 2.2
- */
-public interface AccessHolder
- extends JpaContextNode
-{
- /**
- * Return the access type, whether specified or defaulted.
- * This should never return null since at least the default will be set
- */
- AccessType getAccess();
-
- /**
- * Return the default access type, never null
- */
- AccessType getDefaultAccess();
-
- /**
- * String constant associated with changes to the default access type
- */
- String DEFAULT_ACCESS_PROPERTY = "defaultAccess"; //$NON-NLS-1$
-
- /**
- * Return the specified access type;
- */
- AccessType getSpecifiedAccess();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedAccess(AccessType newSpecifiedAccess);
-
- /**
- * String constant associated with changes to the specified access type
- */
- String SPECIFIED_ACCESS_PROPERTY = "specifiedAccess"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java
deleted file mode 100644
index 05e6ca8c48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AccessType.java
+++ /dev/null
@@ -1,95 +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.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 2.2
- * @since 2.0
- */
-public enum AccessType {
-
- FIELD(
- org.eclipse.jpt.core.resource.java.AccessType.FIELD,
- org.eclipse.jpt.core.resource.orm.AccessType.FIELD
- ),
- PROPERTY(
- org.eclipse.jpt.core.resource.java.AccessType.PROPERTY,
- org.eclipse.jpt.core.resource.orm.AccessType.PROPERTY
- );
-
-
- private org.eclipse.jpt.core.resource.java.AccessType javaAccessType;
- private org.eclipse.jpt.core.resource.orm.AccessType ormAccessType;
-
- AccessType(org.eclipse.jpt.core.resource.java.AccessType javaAccessType, org.eclipse.jpt.core.resource.orm.AccessType ormAccessType) {
- if (javaAccessType == null) {
- throw new NullPointerException();
- }
- if (ormAccessType == null) {
- throw new NullPointerException();
- }
- this.javaAccessType = javaAccessType;
- this.ormAccessType = ormAccessType;
- }
-
- public org.eclipse.jpt.core.resource.java.AccessType getJavaAccessType() {
- return this.javaAccessType;
- }
-
- public org.eclipse.jpt.core.resource.orm.AccessType getOrmAccessType() {
- return this.ormAccessType;
- }
-
-
- // ********** static methods **********
-
- public static AccessType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.AccessType javaAccessType) {
- return (javaAccessType == null) ? null : fromJavaResourceModel_(javaAccessType);
- }
-
- private static AccessType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.AccessType javaAccessType) {
- for (AccessType accessType : AccessType.values()) {
- if (accessType.getJavaAccessType() == javaAccessType) {
- return accessType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.AccessType toJavaResourceModel(AccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAccessType();
- }
-
- public static AccessType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.AccessType ormAccessType) {
- return (ormAccessType == null) ? null : fromOrmResourceModel_(ormAccessType);
- }
-
- private static AccessType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.AccessType ormAccessType) {
- for (AccessType accessType : AccessType.values()) {
- if (accessType.getOrmAccessType() == ormAccessType) {
- return accessType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.AccessType toOrmResourceModel(AccessType accessType) {
- return (accessType == null) ? null : accessType.getOrmAccessType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java
deleted file mode 100644
index 51aefb7a70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverride.java
+++ /dev/null
@@ -1,68 +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.core.context;
-
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface AssociationOverride
- extends BaseOverride
-{
- AssociationOverrideRelationshipReference getRelationshipReference();
-
- AssociationOverride.Owner getOwner();
-
- AssociationOverride setVirtual(boolean virtual);
-
- void initializeFrom(AssociationOverride oldAssociationOverride);
-
- interface Owner extends BaseOverride.Owner
- {
- /**
- * Return the relationship mapping with the given attribute name.
- * Return null if it does not exist. This relationship mapping
- * will be found in the mapped superclass, not in the owning entity
- */
- RelationshipMapping getRelationshipMapping(String attributeName);
-
-
- /**
- * Return a validation message for the join column referenced column name
- * not resolving to the table. The given text range is for the referenced
- * column name if it is specified or for the relevant owning object.
- */
- IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
-
- /**
- * Return a validation message for multiple join columns and the name
- * is unspecified on the given join column. Use the given text range in the message.
- */
- IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
-
- /**
- * Return a validation message for multiple join columns and the
- * referenced column name is unspecified on the given join column.
- * Use the given text range in the message.
- */
- IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideContainer.java
deleted file mode 100644
index a8f9030c69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideContainer.java
+++ /dev/null
@@ -1,106 +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.core.context;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 AssociationOverrideContainer
- extends OverrideContainer
-{
-
- // **************** association overrides **************************************
-
- /**
- * Return a list iterator of the association overrides whether specified or default.
- * This will not be null.
- */
- <T extends AssociationOverride> ListIterator<T> associationOverrides();
-
- /**
- * Return the number of association overrides, both specified and default.
- */
- int associationOverridesSize();
-
- /**
- * Return a list iterator of the specified association overrides.
- * This will not be null. No add/remove for specified association overrides, the
- * virtual association overrides will be populated from superclasses, then use
- * {@link AssociationOverride#setVirtual(boolean)} to add/remove the association
- * override from the source
- */
- <T extends AssociationOverride> ListIterator<T> specifiedAssociationOverrides();
-
- /**
- * Return the number of specified association overrides.
- */
- int specifiedAssociationOverridesSize();
-
- /**
- * Return the number of default association overrides.
- */
- <T extends AssociationOverride> ListIterator<T> virtualAssociationOverrides();
-
- /**
- * Return the number of default association overrides.
- */
- int virtualAssociationOverridesSize();
-
- /**
- * Move the specified association override from the source index to the target index.
- */
- void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex);
- String SPECIFIED_ASSOCIATION_OVERRIDES_LIST = "specifiedAssociationOverrides"; //$NON-NLS-1$
- String VIRTUAL_ASSOCIATION_OVERRIDES_LIST = "virtualAssociationOverrides"; //$NON-NLS-1$
-
- /**
- * Return the association override, whether specified or default,
- * with the given name.
- */
- AssociationOverride getAssociationOverrideNamed(String name);
-
- interface Owner extends OverrideContainer.Owner
- {
-
- RelationshipReference resolveRelationshipReference(String associationOverrideName);
-
- /**
- * Return a validation message for the join column's referenced column name not resolving on the
- * table either specified or default. Use the given text range in the message
- */
- IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
-
- /**
- * Return a validation message for multiple join columns and the name
- * is unspecified on the given join column. Use the given text range in the message.
- */
- IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
-
- /**
- * Return a validation message for multiple join columns and the
- * referenced column name is unspecified on the given join column.
- * Use the given text range in the message.
- */
- IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange);
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideRelationshipReference.java
deleted file mode 100644
index 98749aaa41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AssociationOverrideRelationshipReference.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.core.context;
-
-/**
- * An <code>AssociationOverrideRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy}
- * <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 AssociationOverride
- *
- * @version 2.3
- * @since 2.3
- */
-public interface AssociationOverrideRelationshipReference
- extends
- RelationshipReference,
- JoinColumnEnabledRelationshipReference
-{
- AssociationOverride getAssociationOverride();
-
- void initializeFrom(AssociationOverrideRelationshipReference oldAssociationOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java
deleted file mode 100644
index cd0b2a2488..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeMapping.java
+++ /dev/null
@@ -1,126 +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.core.context;
-
-import java.util.Iterator;
-
-/**
- * JPA 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 2.3
- * @since 2.0
- */
-public interface AttributeMapping
- extends JpaContextNode
-{
- PersistentAttribute getPersistentAttribute();
-
- String getName();
-
- boolean isDefault();
-
- /**
- * Return a unique key for the attribute mapping. If this is defined in
- * an extension they should be equal.
- */
- String getKey();
-
- /**
- * Return whether the "attribute" mapping can be overridden.
- * Must be a {@link ColumnMapping}
- */
- boolean isOverridableAttributeMapping();
-
- /**
- * Return whether the "association" mapping can be overridden.
- * Must be a {@link RelationshipMapping}
- */
- boolean isOverridableAssociationMapping();
-
- /**
- * Return the mapping for the attribute mapping's attribute's type.
- */
- TypeMapping getTypeMapping();
-
- /**
- * If the mapping is for a primary key column, return the column's name,
- * otherwise return null.
- */
- String getPrimaryKeyColumnName();
-
- /**
- * Return whether this mapping is the owning side of the relationship.
- * Either this is a unidirectional mapping or it is the owning side of a
- * bidirectional relationship. If bidirectional, the owning side is the
- * side that does not specify 'mappedBy'. The owning side is the side where
- * the join table would be specified. If this returns true then the mapping
- * will be a RelationshipMapping
- */
- boolean isRelationshipOwner();
-
- /**
- * Return whether the given mapping manages a relationship with this mapping
- */
- boolean isOwnedBy(AttributeMapping mapping);
-
- /**
- * Return whether any database metadata specific validation should occur.
- * (For instance, if the connection is not active, then it should not.)
- */
- boolean shouldValidateAgainstDatabase();
-
- /**
- * This is used for mappedBy choices in a relationship mapping.
- * Typically this will just be a single element iterator with the name of the mapping.
- * In a 2.0 project, an embedded mapping should return its own name as well as
- * the name of its target Embeddable's mappings with the embedded mapping name
- * prepended : "embedded", "embedded.foo", "embedded.bar".
- */
- Iterator<String> allMappingNames();
-
- /**
- * This is used to determine the virtual attribute overrides for an embedded mapping
- * or an entity. Return an Iterator of all attribute names that can be overridden.
- * In a 2.0 project this will include nested attributes that are overridable
- * @see isOverridableAttributeMapping()
- */
- Iterator<String> allOverrideableAttributeMappingNames();
-
- /**
- * This is used to determine the virtual association overrides for an embedded mapping
- * or an entity. Return an Iterator of all association names that can be overridden.
- * In a 2.0 project this will include nested associations that are overridable
- * @see isOverridableAssociationMapping()
- */
- Iterator<String> allOverrideableAssociationMappingNames();
-
- /**
- * Returns this attribute mapping if its name matches the name.
- * In 2.0 this name could use dot-notation for nested mappings.
- * 2.0 Embedded mappings will have to parse this name and return the appropriate
- * nested attribute mapping.
- */
- AttributeMapping resolveAttributeMapping(String name);
-
- /**
- * Returns the Column of the overridable attribute mapping with the given
- * attribute name. In 2.0 this name could use dot-notation for nested mappings.
- */
- Column resolveOverriddenColumn(String attributeName);
-
- RelationshipReference resolveRelationshipReference(String attributeName);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java
deleted file mode 100644
index 273f0be437..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverride.java
+++ /dev/null
@@ -1,38 +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.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.3
- * @since 2.0
- */
-public interface AttributeOverride
- extends BaseOverride, Column.Owner
-{
- Column getColumn();
-
- AttributeOverride setVirtual(boolean virtual);
-
- interface Owner extends BaseOverride.Owner
- {
- /**
- * Return the column of the mapping or attribute override with the given attribute name.
- * Return null if it does not exist. This column mapping
- * will be found in the mapped superclass (or embeddable), not in the owning entity
- */
- Column resolveOverriddenColumn(String attributeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverrideContainer.java
deleted file mode 100644
index a6f6275545..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/AttributeOverrideContainer.java
+++ /dev/null
@@ -1,84 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 AttributeOverrideContainer
- extends OverrideContainer
-{
-
- // **************** attribute overrides **************************************
-
- /**
- * Return a list iterator of the attribute overrides whether specified or default.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> attributeOverrides();
-
- /**
- * Return the number of attribute overrides, both specified and default.
- */
- int attributeOverridesSize();
-
- /**
- * Return a list iterator of the specified attribute overrides.
- * This will not be null. No add/remove for specified attribute overrides, the
- * virtual attribute overrides will be populated from superclasses, then use
- * {@link AttributeOverride#setVirtual(boolean)} to add/remove the attribute
- * override from the source
- */
- <T extends AttributeOverride> ListIterator<T> specifiedAttributeOverrides();
-
- /**
- * Return the number of specified attribute overrides.
- */
- int specifiedAttributeOverridesSize();
-
- /**
- * Return a list iterator of the virtual attribute overrides, those not specified.
- * This will not be null.
- */
- <T extends AttributeOverride> ListIterator<T> virtualAttributeOverrides();
-
- /**
- * Return the number of default attribute overrides.
- */
- int virtualAttributeOverridesSize();
-
- /**
- * Move the specified attribute override from the source index to the target index.
- */
- void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex);
- String SPECIFIED_ATTRIBUTE_OVERRIDES_LIST = "specifiedAttributeOverrides"; //$NON-NLS-1$
- String VIRTUAL_ATTRIBUTE_OVERRIDES_LIST = "virtualAttributeOverrides"; //$NON-NLS-1$
-
- /**
- * Return the attribute override, whether specified or default,
- * with the given name.
- */
- AttributeOverride getAttributeOverrideNamed(String name);
-
- interface Owner extends OverrideContainer.Owner
- {
- Column resolveOverriddenColumn(String attributeOverrideName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseColumn.java
deleted file mode 100644
index 057248addd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseColumn.java
+++ /dev/null
@@ -1,117 +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.core.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface BaseColumn
- extends NamedColumn
-{
-
- String getDefaultTable();
- String DEFAULT_TABLE_PROPERTY = "defaultTable"; //$NON-NLS-1$
-
- String getSpecifiedTable();
- void setSpecifiedTable(String value);
- String SPECIFIED_TABLE_PROPERTY = "specifiedTable"; //$NON-NLS-1$
-
-
- boolean isUnique();
-
- boolean isDefaultUnique();
- String DEFAULT_UNIQUE_PROPERTY = "defaultUnique"; //$NON-NLS-1$
- boolean DEFAULT_UNIQUE = false;
- Boolean getSpecifiedUnique();
- void setSpecifiedUnique(Boolean newSpecifiedUnique);
- String SPECIFIED_UNIQUE_PROPERTY = "specifiedUnique"; //$NON-NLS-1$
-
-
- boolean isNullable();
-
- boolean isDefaultNullable();
- String DEFAULT_NULLABLE_PROPERTY = "defaultNullable"; //$NON-NLS-1$
- boolean DEFAULT_NULLABLE = true;
- Boolean getSpecifiedNullable();
- void setSpecifiedNullable(Boolean newSpecifiedNullable);
- String SPECIFIED_NULLABLE_PROPERTY = "specifiedNullable"; //$NON-NLS-1$
-
-
- boolean isInsertable();
-
- boolean isDefaultInsertable();
- String DEFAULT_INSERTABLE_PROPERTY = "defaultInsertable"; //$NON-NLS-1$
- boolean DEFAULT_INSERTABLE = true;
- Boolean getSpecifiedInsertable();
- void setSpecifiedInsertable(Boolean newSpecifiedInsertable);
- String SPECIFIED_INSERTABLE_PROPERTY = "specifiedInsertable"; //$NON-NLS-1$
-
-
- boolean isUpdatable();
-
- boolean isDefaultUpdatable();
- String DEFAULT_UPDATABLE_PROPERTY = "defaultUpdatable"; //$NON-NLS-1$
- boolean DEFAULT_UPDATABLE = true;
- Boolean getSpecifiedUpdatable();
- void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable);
- String SPECIFIED_UPDATABLE_PROPERTY = "specifiedUpdatable"; //$NON-NLS-1$
-
- /**
- * return whether the column's table is invalid in the given context
- */
- boolean tableNameIsInvalid();
-
- //TODO This is used by ColumnComposite to get a list of possible associated tables,
- //but right now that list isn't going to update in the UI except when we repopulate
- /**
- * Return a list of table names that are valid for this column
- */
- Iterator<String> candidateTableNames();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
-
- /**
- * return whether the given table cannot be explicitly specified
- * in the column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * Return a list of table names that are valid for this column
- */
- Iterator<String> candidateTableNames();
-
- /**
- * Return a validation message for when the specified table is not valid in this context.
- * An example is a basic mapping column where a table is specified that is
- * not included as table or secondary tables of the owning entity.
- */
- IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange);
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java
deleted file mode 100644
index a4ef7310d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseEmbeddedMapping.java
+++ /dev/null
@@ -1,37 +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.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.3
- * @since 2.0
- */
-public interface BaseEmbeddedMapping
- extends AttributeMapping
-{
- AttributeOverrideContainer getAttributeOverrideContainer();
-
- /**
- * Return the Embeddable that matches the type of this mapping.
- * If none, return null.
- */
- Embeddable getTargetEmbeddable();
-
- /**
- * String associated with property change events for the target embeddable
- */
- public final static String TARGET_EMBEDDABLE_PROPERTY = "targetEmbeddable"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java
deleted file mode 100644
index 7481041ab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseJoinColumn.java
+++ /dev/null
@@ -1,88 +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.core.context;
-
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface BaseJoinColumn
- extends NamedColumn
-{
- String getReferencedColumnName();
- String getSpecifiedReferencedColumnName();
- void setSpecifiedReferencedColumnName(String value);
- String SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY = "specifiedReferencedColumnName"; //$NON-NLS-1$
- String getDefaultReferencedColumnName();
- String DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY = "defaultReferencedColumnName"; //$NON-NLS-1$
-
- /**
- * Return the wrapper for the datasource referenced column
- */
- Column getReferencedDbColumn();
-
- /**
- * Return whether the reference column is found on the datasource
- * @see #getReferencedDbColumn()
- */
- boolean isReferencedColumnResolved();
-
- /**
- * Return the wrapper for the referenced column datasource table
- */
- Table getReferencedColumnDbTable();
-
- boolean isVirtual();
-
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the wrapper for the datasource table for the referenced column
- */
- Table getReferencedColumnDbTable();
-
- boolean isVirtual(BaseJoinColumn joinColumn);
-
- /**
- * return the size of the joinColumns collection this join column is a part of
- */
- int joinColumnsSize();
-
- /**
- * On a virtual object validation message for when the column name does not resolve on the table
- */
- IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange);
-
- /**
- * Validation message for when multiple join columns exist and the
- * name is not specified and the owner is virtual
- */
- IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange);
-
- /**
- * Validation message for when multiple join columns exist and the
- * referenced column name is not specified and the owner is virtual
- */
- IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
deleted file mode 100644
index 3963a1fbb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.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.core.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface BaseOverride
- extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return true if override exists as specified on the owning object, or false
- * if the override is "gotten for free" as a result of defaults calculation
- */
- boolean isVirtual();
-
- /**
- * If false, add the given override as a specified override and remove
- * it from the list of virtual overrides. If true, then remove it
- * from the specified overrides and add it to the virtual overrides
- * as applicable. Return the new override (whether virtual or specified)
- */
- BaseOverride setVirtual(boolean virtual);
-
- interface Owner
- {
- /**
- * Return the type mapping that this override is contained in
- * @return
- */
- TypeMapping getTypeMapping();
-
- /**
- * Return an Iterator of all attribute names that can be overridden
- */
- Iterator<String> allOverridableAttributeNames();
-
- /**
- * Return whether the given override is virtual. Virtual means that
- * it is not specified, but defaulted in from the mapped superclass or
- * embeddable.
- */
- boolean isVirtual(BaseOverride override);
-
- /**
- * If false, add the given override as a specified override and remove
- * it from the list of virtual overrides. If true, then remove it
- * from the specified overrides and add it to the virtual overrides
- * as applicable. Return the new override (whether virtual or specified)
- */
- BaseOverride setVirtual(boolean virtual, BaseOverride override);
-
- /**
- * return whether the given table cannot be explicitly specified
- * in the column or join column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * Return a list of table names that are valid for the overrides column or join columns
- */
- Iterator<String> candidateTableNames();
-
- /**
- * Return the database table for the specified table name
- */
- Table getDbTable(String tableName);
-
- /**
- * Return the name of the table which the column belongs to by default
- */
- String getDefaultTableName();
-
- /**
- *
- */
- IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange);
-
- /**
- * Return a validation message for the column's name not resolving on the
- * table either specified or default. Use the given text range in the message
- */
- IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java
deleted file mode 100644
index 893b4bbd0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BasicMapping.java
+++ /dev/null
@@ -1,30 +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.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.0
- */
-public interface BasicMapping
- extends AttributeMapping, ColumnMapping, Fetchable, Nullable, ConvertibleMapping
-{
- FetchType DEFAULT_FETCH_TYPE = FetchType.EAGER;
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java
deleted file mode 100644
index dcd7902efd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Cascade.java
+++ /dev/null
@@ -1,44 +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.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.2
- * @since 2.0
- */
-public interface Cascade
- extends JpaContextNode
-{
- boolean isAll();
- void setAll(boolean value);
- String ALL_PROPERTY = "all"; //$NON-NLS-1$
-
- boolean isPersist();
- void setPersist(boolean value);
- String PERSIST_PROPERTY = "persist"; //$NON-NLS-1$
-
- boolean isMerge();
- void setMerge(boolean value);
- String MERGE_PROPERTY = "merge"; //$NON-NLS-1$
-
- boolean isRemove();
- void setRemove(boolean value);
- String REMOVE_PROPERTY = "remove"; //$NON-NLS-1$
-
- boolean isRefresh();
- void setRefresh(boolean value);
- String REFRESH_PROPERTY = "refresh"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/CollectionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/CollectionMapping.java
deleted file mode 100644
index 038a4b62b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/CollectionMapping.java
+++ /dev/null
@@ -1,74 +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.core.context;
-
-import java.util.Iterator;
-
-/**
- * 1:m, m:m, element collection are all collection mappings.
- * <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 CollectionMapping
- extends AttributeMapping, Fetchable
-{
- FetchType DEFAULT_FETCH_TYPE = FetchType.LAZY;
-
- Orderable getOrderable();
-
- PersistentType getResolvedTargetType();
-
-
-
- Type getValueType();
- String VALUE_TYPE_PROPERTY = "valueType"; //$NON-NLS-1$
-
- Type getKeyType();
- String KEY_TYPE_PROPERTY = "keyType"; //$NON-NLS-1$
-
- public enum Type {
- BASIC_TYPE,
- EMBEDDABLE_TYPE,
- ENTITY_TYPE,
- NO_TYPE
- }
-
- //**************** map key *****************
-
- String getMapKey();
-
- String getSpecifiedMapKey();
- void setSpecifiedMapKey(String mapKey);
- String SPECIFIED_MAP_KEY_PROPERTY = "specifiedMapKey"; //$NON-NLS-1$
-
- boolean isNoMapKey();
- void setNoMapKey(boolean noMapKey);
- String NO_MAP_KEY_PROPERTY = "noMapKey"; //$NON-NLS-1$
-
- boolean isPkMapKey();
- void setPkMapKey(boolean pkMapKey);
- String PK_MAP_KEY_PROPERTY = "pkMapKey"; //$NON-NLS-1$
-
- boolean isCustomMapKey();
- void setCustomMapKey(boolean customMapKey);
- String CUSTOM_MAP_KEY_PROPERTY = "customMapKey"; //$NON-NLS-1$
-
- Iterator<String> candidateMapKeyNames();
-
- String getMetamodelFieldMapKeyTypeName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java
deleted file mode 100644
index c5c4868c5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Column.java
+++ /dev/null
@@ -1,58 +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.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.2
- * @since 2.0
- */
-public interface Column
- extends BaseColumn
-{
- int getLength();
-
- int getDefaultLength();
- int DEFAULT_LENGTH = 255;
- String DEFAULT_LENGTH_PROPERTY = "defaultLength"; //$NON-NLS-1$
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer newSpecifiedLength);
- String SPECIFIED_LENGTH_PROPERTY = "specifiedLength"; //$NON-NLS-1$
-
- int getPrecision();
-
- int getDefaultPrecision();
- int DEFAULT_PRECISION = 0;
- String DEFAULT_PRECISION_PROPERTY = "defaultPrecision"; //$NON-NLS-1$
-
- Integer getSpecifiedPrecision();
- void setSpecifiedPrecision(Integer newSpecifiedPrecision);
- String SPECIFIED_PRECISION_PROPERTY = "specifiedPrecision"; //$NON-NLS-1$
-
-
- int getScale();
-
- int getDefaultScale();
- int DEFAULT_SCALE = 0;
- String DEFAULT_SCALE_PROPERTY = "defaultScale"; //$NON-NLS-1$
-
- Integer getSpecifiedScale();
- void setSpecifiedScale(Integer newSpecifiedScale);
- String SPECIFIED_SCALE_PROPERTY = "specifiedScale"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java
deleted file mode 100644
index ec20c0b778..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ColumnMapping.java
+++ /dev/null
@@ -1,29 +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.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.3
- * @since 2.0
- */
-public interface ColumnMapping
- extends AttributeMapping, Column.Owner
-{
- Column getColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Converter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Converter.java
deleted file mode 100644
index d46548bf35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Converter.java
+++ /dev/null
@@ -1,51 +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.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 interface Converter extends JpaContextNode
-{
- /**
- * Return a string that represents the type of converter.
- * Possibilities are below, NO_CONVERTER, LOB_CONVERTER, ENUMERATED_CONVERTER, TEMPORAL_CONVERTER
- */
- String getType();
-
- String NO_CONVERTER = "noConverter"; //$NON-NLS-1$
- String LOB_CONVERTER = "lobConverter"; //$NON-NLS-1$
- String ENUMERATED_CONVERTER = "enumeratedConverter"; //$NON-NLS-1$
- String TEMPORAL_CONVERTER = "temporalConverter"; //$NON-NLS-1$
-
- /**
- * Remove the Converter from the resource model
- */
- void removeFromResourceModel();
-
- /**
- * Add the appropriate Converter to the resource model
- */
- void addToResourceModel();
-
-
- //****** covariant overrides ******
- AttributeMapping getParent();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ConvertibleMapping.java
deleted file mode 100644
index a71d1c56f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ConvertibleMapping.java
+++ /dev/null
@@ -1,47 +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.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.3
- * @since 2.1
- */
-
-public interface ConvertibleMapping
-{
-
- /**
- * Return a converter of type Converter.NO_CONVERTER
- * instead of null if no converter is specified.
- */
- Converter getConverter();
-
- /**
- * Set the converter type, adding the converter to the resource model
- * and removing the old converter, if any, from the resource model. JPA 1.0
- * support Enumerated, Lob, and Temporal as converter types.
- * {@link Converter#ENUMERATED_CONVERTER}
- * {@link Converter#LOB_CONVERTER}
- * {@link Converter#TEMPORAL_CONVERTER}
- * {@link Converter#NO_CONVERTER}
- */
- void setConverter(String converterType);
- String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java
deleted file mode 100644
index bfd9fe8c3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorColumn.java
+++ /dev/null
@@ -1,71 +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.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.2
- * @since 2.0
- */
-public interface DiscriminatorColumn
- extends NamedColumn
-{
- String DEFAULT_NAME = "DTYPE"; //$NON-NLS-1$
-
- DiscriminatorType getDiscriminatorType();
-
- DiscriminatorType getDefaultDiscriminatorType();
- String DEFAULT_DISCRIMINATOR_TYPE_PROPERTY = "defaultDiscriminatorType"; //$NON-NLS-1$
- DiscriminatorType DEFAULT_DISCRIMINATOR_TYPE = DiscriminatorType.STRING;
-
- DiscriminatorType getSpecifiedDiscriminatorType();
- void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType);
- String SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY = "specifiedDiscriminatorType"; //$NON-NLS-1$
-
-
- int getLength();
-
- int getDefaultLength();
- int DEFAULT_LENGTH = 31;
- String DEFAULT_LENGTH_PROPERTY = "defaultLength"; //$NON-NLS-1$
-
- Integer getSpecifiedLength();
- void setSpecifiedLength(Integer value);
- String SPECIFIED_LENGTH_PROPERTY = "specifiedLength"; //$NON-NLS-1$
-
-
- /**
- * Return whether the column is specified in the resource.
- */
- boolean isResourceSpecified();
-
- /**
- * interface allowing columns to be used in multiple places
- */
- interface Owner extends NamedColumn.Owner {
-
- /**
- * Return the default discriminator column length
- */
- int getDefaultLength();
-
- /**
- * Return the default discriminator column type
- */
- DiscriminatorType getDefaultDiscriminatorType();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java
deleted file mode 100644
index f238d65382..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/DiscriminatorType.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-/**
- * Discriminator 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 2.2
- * @since 2.0
- */
-public enum DiscriminatorType {
-
- STRING(
- org.eclipse.jpt.core.resource.java.DiscriminatorType.STRING,
- org.eclipse.jpt.core.resource.orm.DiscriminatorType.STRING
- ),
- CHAR(
- org.eclipse.jpt.core.resource.java.DiscriminatorType.CHAR,
- org.eclipse.jpt.core.resource.orm.DiscriminatorType.CHAR
- ),
- INTEGER(
- org.eclipse.jpt.core.resource.java.DiscriminatorType.INTEGER,
- org.eclipse.jpt.core.resource.orm.DiscriminatorType.INTEGER
- );
-
-
- private org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType;
- private org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType;
-
- DiscriminatorType(org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType, org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType) {
- if (javaDiscriminatorType == null) {
- throw new NullPointerException();
- }
- if (ormDiscriminatorType == null) {
- throw new NullPointerException();
- }
- this.javaDiscriminatorType = javaDiscriminatorType;
- this.ormDiscriminatorType = ormDiscriminatorType;
- }
-
- public org.eclipse.jpt.core.resource.java.DiscriminatorType getJavaDiscriminatorType() {
- return this.javaDiscriminatorType;
- }
-
- public org.eclipse.jpt.core.resource.orm.DiscriminatorType getOrmDiscriminatorType() {
- return this.ormDiscriminatorType;
- }
-
-
- // ********** static methods **********
-
- public static DiscriminatorType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType) {
- return (javaDiscriminatorType == null) ? null : fromJavaResourceModel_(javaDiscriminatorType);
- }
-
- private static DiscriminatorType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.DiscriminatorType javaDiscriminatorType) {
- for (DiscriminatorType discriminatorType : DiscriminatorType.values()) {
- if (discriminatorType.getJavaDiscriminatorType() == javaDiscriminatorType) {
- return discriminatorType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.DiscriminatorType toJavaResourceModel(DiscriminatorType discriminatorType) {
- return (discriminatorType == null) ? null : discriminatorType.getJavaDiscriminatorType();
- }
-
- public static DiscriminatorType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType) {
- return (ormDiscriminatorType == null) ? null : fromOrmResourceModel_(ormDiscriminatorType);
- }
-
- private static DiscriminatorType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.DiscriminatorType ormDiscriminatorType) {
- for (DiscriminatorType discriminatorType : DiscriminatorType.values()) {
- if (discriminatorType.getOrmDiscriminatorType() == ormDiscriminatorType) {
- return discriminatorType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.DiscriminatorType toOrmResourceModel(DiscriminatorType discriminatorType) {
- return (discriminatorType == null) ? null : discriminatorType.getOrmDiscriminatorType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java
deleted file mode 100644
index ef9d28fcaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Embeddable.java
+++ /dev/null
@@ -1,28 +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.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.0
- * @since 2.0
- */
-public interface Embeddable
- extends TypeMapping {
- // nothing yet
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.java
deleted file mode 100644
index f669cebd92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedIdMapping.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.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.0
- * @since 2.0
- */
-public interface EmbeddedIdMapping
- extends BaseEmbeddedMapping
-{
- //nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.java
deleted file mode 100644
index bd82e76d05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EmbeddedMapping.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.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.0
- * @since 2.0
- */
-public interface EmbeddedMapping
- extends BaseEmbeddedMapping
-{
- //nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java
deleted file mode 100644
index 094511a7c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Entity.java
+++ /dev/null
@@ -1,301 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * 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.3
- * @since 2.0
- */
-public interface Entity
- extends TypeMapping
-{
- // **************** name **************************************
-
- /**
- * Return the name, specified or default if not specified.
- */
- String getName();
-
- /**
- * Return the specified name.
- */
- String getSpecifiedName();
-
- /**
- * Set the specified name on the entity.
- */
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- /**
- * Return the default name, based on the class name.
- */
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultName"; //$NON-NLS-1$
-
-
- // **************** id class **********************************************
-
- /**
- * Return the (aggregate) class reference for configuring and validating id class
- */
- IdClassReference getIdClassReference();
-
-
- // **************** table **************************************
-
- /**
- * Return the table for this entity, either specified or default.
- * This will not be null.
- */
- Table getTable();
-
- /**
- * Return the name of the entity's primary key column.
- * Return null if the entity's primary key is "compound"
- * (i.e. the primary key is composed of multiple columns).
- */
- String getPrimaryKeyColumnName();
-
- /**
- * Return the entity's default table name, which depends on the entity's
- * inheritance hierarchy.
- */
- String getDefaultTableName();
-
- /**
- * Return the entity's default schema, which depends on the entity's
- * inheritance hierarchy.
- */
- String getDefaultSchema();
-
- /**
- * Return the entity's default catalog, which depends on the entity's
- * inheritance hierarchy.
- */
- String getDefaultCatalog();
-
-
- // **************** secondary tables **************************************
-
- /**
- * Return a list iterator of the secondary tables whether specified or default.
- * This will not be null.
- */
- <T extends SecondaryTable> ListIterator<T> secondaryTables();
-
- /**
- * Return the number of secondary tables, both specified and default.
- */
- int secondaryTablesSize();
-
- /**
- * Return a list iterator of the specified secondary tables.
- * This will not be null.
- */
- <T extends SecondaryTable> ListIterator<T> specifiedSecondaryTables();
-
- /**
- * Return the number of specified secondary tables.
- */
- int specifiedSecondaryTablesSize();
-
- /**
- * Add a specified secondary table to the entity return the object
- * representing it.
- */
- SecondaryTable addSpecifiedSecondaryTable(int index);
-
- /**
- * Add a specified secondary table to the entity return the object
- * representing it.
- */
- SecondaryTable addSpecifiedSecondaryTable();
-
- /**
- * Remove the specified secondary table from the entity.
- */
- void removeSpecifiedSecondaryTable(int index);
-
- /**
- * Remove the specified secondary table at the index from the entity.
- */
- void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable);
-
- /**
- * Move the specified secondary table from the source index to the target index.
- */
- void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex);
- String SPECIFIED_SECONDARY_TABLES_LIST = "specifiedSecondaryTables"; //$NON-NLS-1$
-
-
- // **************** inheritance **************************************
-
- InheritanceType getInheritanceStrategy();
-
- InheritanceType getDefaultInheritanceStrategy();
- String DEFAULT_INHERITANCE_STRATEGY_PROPERTY = "defaultInheritanceStrategy"; //$NON-NLS-1$
-
- InheritanceType getSpecifiedInheritanceStrategy();
- void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType);
- String SPECIFIED_INHERITANCE_STRATEGY_PROPERTY = "specifiedInheritanceStrategy"; //$NON-NLS-1$
-
- /**
- * The first parent in the class hierarchy that is an entity.
- * This is the parent in the entity (persistent) inheritance hierarchy
- * (vs class inheritance hierarchy). Return null if there is no parent entity.
- */
- Entity getParentEntity();
-
- DiscriminatorColumn getDiscriminatorColumn();
-
- String getDiscriminatorValue();
-
- String getDefaultDiscriminatorValue();
- String DEFAULT_DISCRIMINATOR_VALUE_PROPERTY = "defaultDiscriminatorValue"; //$NON-NLS-1$
-
- String getSpecifiedDiscriminatorValue();
- void setSpecifiedDiscriminatorValue(String value);
- String SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY = "specifiedDiscriminatorValue"; //$NON-NLS-1$
-
- /**
- * Return whether a DiscriminatorValue is allowed for this Entity.
- * It is allowed if the entity is not abstract and not part of
- * a table-per-class inheritance hierarchy
- */
- boolean specifiedDiscriminatorValueIsAllowed();
- String SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY = "discriminatorValueIsAllowed"; //$NON-NLS-1$
-
- /**
- * Return whether a DiscriminatorValue is undefined for this Entity.
- * It is undefined if the entity is abstract or if it
- * is part of a table-per-class inheritance hierarchy
- */
- boolean discriminatorValueIsUndefined();
- String DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY = "discriminatorValueIsUndefined"; //$NON-NLS-1$
-
- /**
- * Return whether a DiscriminatorColumn is allowed for this Entity.
- * It is allowed if the entity is the root of the inheritance hierarchy (with descendant entities)
- * and the strategy is not table-per-class
- */
- boolean specifiedDiscriminatorColumnIsAllowed();
- String SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY = "specifiedDiscriminatorColumnIsAllowed"; //$NON-NLS-1$
-
- /**
- * Return whether a DiscriminatorColumn is undefined for this Entity.
- * It is undefined if the inheritance strategy is table-per-class
- */
- boolean discriminatorColumnIsUndefined();
- String DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY = "discriminatorColumnIsUndefined"; //$NON-NLS-1$
-
- /**
- * Return whether a Table is allowed for this Entity.
- * If the inheritance strategy is single-table, Table is allowed only
- * on the root entity.
- * If the inheritance strategy is table-per-class it is allowed only
- * on concrete entities.
- */
- boolean specifiedTableIsAllowed();
- String SPECIFIED_TABLE_IS_ALLOWED_PROPERTY = "specifiedTableIsAllowed"; //$NON-NLS-1$
-
- /**
- * Return whether a Table is undefined for this Entity.
- * If the inheritance strategy is table-per-class and the entity is
- * abstract, then a Table object is undefined
- */
- boolean tableIsUndefined();
- String TABLE_IS_UNDEFINED_PROPERTY = "tableIsUndefined"; //$NON-NLS-1$
-
-
- // **************** primary key join columns ******************************
-
- <T extends PrimaryKeyJoinColumn> ListIterator<T> primaryKeyJoinColumns();
-
- int primaryKeyJoinColumnsSize();
-
- <T extends PrimaryKeyJoinColumn> ListIterator<T> specifiedPrimaryKeyJoinColumns();
- String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST = "specifiedPrimaryKeyJoinColumns"; //$NON-NLS-1$
-
- int specifiedPrimaryKeyJoinColumnsSize();
-
- PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- String DEFAULT_PRIMARY_KEY_JOIN_COLUMN = "defaultPrimaryKeyJoinColumn"; //$NON-NLS-1$
-
- PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- void removeSpecifiedPrimaryKeyJoinColumn(int index);
-
- void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn);
-
- void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex);
-
-
- // ********** misc **********
-
- AttributeOverrideContainer getAttributeOverrideContainer();
-
- AssociationOverrideContainer getAssociationOverrideContainer();
-
- QueryContainer getQueryContainer();
-
- GeneratorContainer getGeneratorContainer();
-
-
- // **************** entity inheritance ************************************
-
- /**
- * Return whether this entity is a root entity in an inheritance hierarchy
- */
- boolean isRoot();
-
- /**
- * Return the ultimate top of the inheritance hierarchy
- * This method should never return null. The root
- * is defined as the persistent type in the inheritance hierarchy
- * that has no parent. The root should be an entity
- *
- * Non-entities in the hierarchy should be ignored, ie skip
- * over them in the search for the root.
- */
- Entity getRootEntity();
-
- /**
- * The given Entity has this entity as its root entity, add
- * it as a sub entity.
- * @see org.eclipse.jpt.core.context.persistence.PersistenceUnit#addRootWithSubEntities(String)
- */
- void addSubEntity(Entity subEntity);
-
-
- // ************************************************************************
-
- /**
- * Returns the attribute mapping that matches the name.
- * In 2.0 this name could use dot-notation for nested mappings.
- */
- AttributeMapping resolveAttributeMapping(String name);
-
- /**
- * If an entity has a single id attribute, return that attribute.
- * Else return null.
- */
- PersistentAttribute getIdAttribute();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java
deleted file mode 100644
index ddb3440a39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumType.java
+++ /dev/null
@@ -1,95 +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.core.context;
-
-/**
- * Enum 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 2.2
- * @since 2.0
- */
-public enum EnumType {
-
- ORDINAL(
- org.eclipse.jpt.core.resource.java.EnumType.ORDINAL,
- org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL
- ),
- STRING(
- org.eclipse.jpt.core.resource.java.EnumType.STRING,
- org.eclipse.jpt.core.resource.orm.EnumType.STRING
- );
-
-
- private org.eclipse.jpt.core.resource.java.EnumType javaEnumType;
- private org.eclipse.jpt.core.resource.orm.EnumType ormEnumType;
-
- EnumType(org.eclipse.jpt.core.resource.java.EnumType javaEnumType, org.eclipse.jpt.core.resource.orm.EnumType ormEnumType) {
- if (javaEnumType == null) {
- throw new NullPointerException();
- }
- if (ormEnumType == null) {
- throw new NullPointerException();
- }
- this.javaEnumType = javaEnumType;
- this.ormEnumType = ormEnumType;
- }
-
- public org.eclipse.jpt.core.resource.java.EnumType getJavaEnumType() {
- return this.javaEnumType;
- }
-
- public org.eclipse.jpt.core.resource.orm.EnumType getOrmEnumType() {
- return this.ormEnumType;
- }
-
-
- // ********** static methods **********
-
- public static EnumType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.EnumType javaEnumType) {
- return (javaEnumType == null) ? null : fromJavaResourceModel_(javaEnumType);
- }
-
- private static EnumType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.EnumType javaEnumType) {
- for (EnumType enumType : EnumType.values()) {
- if (enumType.getJavaEnumType() == javaEnumType) {
- return enumType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.EnumType toJavaResourceModel(EnumType enumType) {
- return (enumType == null) ? null : enumType.getJavaEnumType();
- }
-
- public static EnumType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.EnumType ormEnumType) {
- return (ormEnumType == null) ? null : fromOrmResourceModel_(ormEnumType);
- }
-
- private static EnumType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.EnumType ormEnumType) {
- for (EnumType enumType : EnumType.values()) {
- if (enumType.getOrmEnumType() == ormEnumType) {
- return enumType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.EnumType toOrmResourceModel(EnumType enumType) {
- return (enumType == null) ? null : enumType.getOrmEnumType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.java
deleted file mode 100644
index ca42d9d8cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/EnumeratedConverter.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.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.2
- * @since 2.1
- */
-public interface EnumeratedConverter
- extends Converter
-{
- EnumType getEnumType();
-
- EnumType getDefaultEnumType();
- EnumType DEFAULT_ENUM_TYPE = EnumType.ORDINAL;
-
- EnumType getSpecifiedEnumType();
- void setSpecifiedEnumType(EnumType newSpecifiedEnumType);
- String SPECIFIED_ENUM_TYPE_PROPERTY = "specifiedEnumType"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java
deleted file mode 100644
index ff5d584d52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/FetchType.java
+++ /dev/null
@@ -1,95 +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.core.context;
-
-/**
- * Fetch 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 2.2
- * @since 2.0
- */
-public enum FetchType {
-
- EAGER(
- org.eclipse.jpt.core.resource.java.FetchType.EAGER,
- org.eclipse.jpt.core.resource.orm.FetchType.EAGER
- ),
- LAZY(
- org.eclipse.jpt.core.resource.java.FetchType.LAZY,
- org.eclipse.jpt.core.resource.orm.FetchType.LAZY
- );
-
-
- private org.eclipse.jpt.core.resource.java.FetchType javaFetchType;
- private org.eclipse.jpt.core.resource.orm.FetchType ormFetchType;
-
- FetchType(org.eclipse.jpt.core.resource.java.FetchType javaFetchType, org.eclipse.jpt.core.resource.orm.FetchType ormFetchType) {
- if (javaFetchType == null) {
- throw new NullPointerException();
- }
- if (ormFetchType == null) {
- throw new NullPointerException();
- }
- this.javaFetchType = javaFetchType;
- this.ormFetchType = ormFetchType;
- }
-
- public org.eclipse.jpt.core.resource.java.FetchType getJavaFetchType() {
- return this.javaFetchType;
- }
-
- public org.eclipse.jpt.core.resource.orm.FetchType getOrmFetchType() {
- return this.ormFetchType;
- }
-
-
- // ********** static methods **********
-
- public static FetchType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.FetchType javaFetchType) {
- return (javaFetchType == null) ? null : fromJavaResourceModel_(javaFetchType);
- }
-
- private static FetchType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.FetchType javaFetchType) {
- for (FetchType fetchType : FetchType.values()) {
- if (fetchType.getJavaFetchType() == javaFetchType) {
- return fetchType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.FetchType toJavaResourceModel(FetchType fetchType) {
- return (fetchType == null) ? null : fetchType.getJavaFetchType();
- }
-
- public static FetchType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.FetchType ormFetchType) {
- return (ormFetchType == null) ? null : fromOrmResourceModel_(ormFetchType);
- }
-
- private static FetchType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.FetchType ormFetchType) {
- for (FetchType fetchType : FetchType.values()) {
- if (fetchType.getOrmFetchType() == ormFetchType) {
- return fetchType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.FetchType toOrmResourceModel(FetchType fetchType) {
- return (fetchType == null) ? null : fetchType.getOrmFetchType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java
deleted file mode 100644
index 74443c1526..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Fetchable.java
+++ /dev/null
@@ -1,36 +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.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.2
- * @since 2.0
- */
-public interface Fetchable
- extends AttributeMapping
-{
- FetchType getFetch();
-
- FetchType getDefaultFetch();
- String DEFAULT_FETCH_PROPERTY = "defaultFetch"; //$NON-NLS-1$
-
- FetchType getSpecifiedFetch();
- void setSpecifiedFetch(FetchType newSpecifiedFetch);
- String SPECIFIED_FETCH_PROPERTY = "specifiedFetch"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.java
deleted file mode 100644
index c8330625b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratedValue.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.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.0
- */
-public interface GeneratedValue
- extends JpaContextNode
-{
-
- GenerationType getStrategy();
- GenerationType getDefaultStrategy();
- String DEFAULT_STRATEGY_PROPERTY = "defaultStrategy"; //$NON-NLS-1$
- GenerationType DEFAULT_STRATEGY = GenerationType.AUTO;
- GenerationType getSpecifiedStrategy();
- void setSpecifiedStrategy(GenerationType strategy);
- String SPECIFIED_STRATEGY_PROPERTY = "specifiedStrategy"; //$NON-NLS-1$
-
- String getGenerator();
- String getDefaultGenerator();
- String DEFAULT_GENERATOR_PROPERTY = "defaultGenerator"; //$NON-NLS-1$
- String getSpecifiedGenerator();
- void setSpecifiedGenerator(String generator);
- String SPECIFIED_GENERATOR_PROPERTY = "specifiedGenerator"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java
deleted file mode 100644
index 58b99fa21e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GenerationType.java
+++ /dev/null
@@ -1,103 +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.core.context;
-
-/**
- * Generation 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 2.2
- * @since 2.0
- */
-public enum GenerationType {
-
- TABLE(
- org.eclipse.jpt.core.resource.java.GenerationType.TABLE,
- org.eclipse.jpt.core.resource.orm.GenerationType.TABLE
- ),
- SEQUENCE(
- org.eclipse.jpt.core.resource.java.GenerationType.SEQUENCE,
- org.eclipse.jpt.core.resource.orm.GenerationType.SEQUENCE
- ),
- IDENTITY(
- org.eclipse.jpt.core.resource.java.GenerationType.IDENTITY,
- org.eclipse.jpt.core.resource.orm.GenerationType.IDENTITY
- ),
- AUTO(
- org.eclipse.jpt.core.resource.java.GenerationType.AUTO,
- org.eclipse.jpt.core.resource.orm.GenerationType.AUTO
- );
-
-
- private org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType;
- private org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType;
-
- GenerationType(org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType, org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType) {
- if (javaGenerationType == null) {
- throw new NullPointerException();
- }
- if (ormGenerationType == null) {
- throw new NullPointerException();
- }
- this.javaGenerationType = javaGenerationType;
- this.ormGenerationType = ormGenerationType;
- }
-
- public org.eclipse.jpt.core.resource.java.GenerationType getJavaGenerationType() {
- return this.javaGenerationType;
- }
-
- public org.eclipse.jpt.core.resource.orm.GenerationType getOrmGenerationType() {
- return this.ormGenerationType;
- }
-
-
- // ********** static methods **********
-
- public static GenerationType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType) {
- return (javaGenerationType == null) ? null : fromJavaResourceModel_(javaGenerationType);
- }
-
- private static GenerationType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.GenerationType javaGenerationType) {
- for (GenerationType generationType : GenerationType.values()) {
- if (generationType.getJavaGenerationType() == javaGenerationType) {
- return generationType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.GenerationType toJavaResourceModel(GenerationType generationType) {
- return (generationType == null) ? null : generationType.getJavaGenerationType();
- }
-
- public static GenerationType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType) {
- return (ormGenerationType == null) ? null : fromOrmResourceModel_(ormGenerationType);
- }
-
- private static GenerationType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.GenerationType ormGenerationType) {
- for (GenerationType generationType : GenerationType.values()) {
- if (generationType.getOrmGenerationType() == ormGenerationType) {
- return generationType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.GenerationType toOrmResourceModel(GenerationType generationType) {
- return (generationType == null) ? null : generationType.getOrmGenerationType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java
deleted file mode 100644
index 72140f6957..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Generator.java
+++ /dev/null
@@ -1,98 +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.core.context;
-
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface Generator
- extends JpaContextNode
-{
- String SEQUENCE_GENERATOR = "sequenceGenerator"; //$NON-NLS-1$
- String TABLE_GENERATOR = "tableGenerator"; //$NON-NLS-1$
-
- // ********** name **********
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
-
- // ********** initial value **********
-
- int getInitialValue();
- Integer getSpecifiedInitialValue();
- void setSpecifiedInitialValue(Integer value);
- String SPECIFIED_INITIAL_VALUE_PROPERTY = "specifiedInitialValue"; //$NON-NLS-1$
- int getDefaultInitialValue();
- String DEFAULT_INITIAL_VALUE_PROPERTY = "defaultInitialValue"; //$NON-NLS-1$
-
-
- // ********** allocation size **********
-
- int getAllocationSize();
- Integer getSpecifiedAllocationSize();
- void setSpecifiedAllocationSize(Integer value);
- String SPECIFIED_ALLOCATION_SIZE_PROPERTY = "specifiedAllocationSize"; //$NON-NLS-1$
- int getDefaultAllocationSize();
- int DEFAULT_ALLOCATION_SIZE = 50;
- String DEFAULT_ALLOCATION_SIZE_PROPERTY = "defaultAllocationSize"; //$NON-NLS-1$
-
-
- // ********** validation **********
-
- /**
- * Return whether the generator overrides the definition of the given generator
- * (e.g. a generator defined in orm.xml overrides one defined in java).
- */
- boolean overrides(Generator generator);
-
- /**
- * Return whether the generator is a duplicate of the given generator.
- * A generator is not a duplicate of another generator if is the same exact generator,
- * if it is a nameless generator (which is an error condition), or if it overrides
- * or is overridden by the other generator.
- */
- boolean duplicates(Generator generator);
-
- boolean isVirtual();
-
-
- // ********** database stuff **********
-
- /**
- * Return a db Schema object with the specified/default schema name.
- * This can return null if no Schema exists on the database with that name.
- */
- Schema getDbSchema();
-
- /**
- * Return a db Catalog object with the specified/default catalog name.
- * This can return null if no Catalog exists on the database with that name.
- */
- Catalog getDbCatalog();
-
- /**
- * Return a db container object that hold the relevant schemata.
- */
- SchemaContainer getDbSchemaContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorContainer.java
deleted file mode 100644
index b1f8e204d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/GeneratorContainer.java
+++ /dev/null
@@ -1,46 +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.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.3
- * @since 2.3
- */
-public interface GeneratorContainer
- extends JpaContextNode
-{
- //******************** table generator *****************
-
- String TABLE_GENERATOR_PROPERTY = "tableGenerator"; //$NON-NLS-1$
-
- TableGenerator getTableGenerator();
-
- TableGenerator addTableGenerator();
-
- void removeTableGenerator();
-
-
- //******************** sequence generator *****************
-
- String SEQUENCE_GENERATOR_PROPERTY = "sequenceGenerator"; //$NON-NLS-1$
-
- SequenceGenerator getSequenceGenerator();
-
- SequenceGenerator addSequenceGenerator();
-
- void removeSequenceGenerator();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClassReference.java
deleted file mode 100644
index 2b930186c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdClassReference.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.context;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 IdClassReference
- extends JpaNode, PersistentType.Owner
-{
- /**
- * Property string associated with changes to the {@link IdClassHolder}'s specified id class name
- */
- String SPECIFIED_ID_CLASS_NAME_PROPERTY = "specifiedIdClassName"; //$NON-NLS-1$
-
- /**
- * Return the specified name of the id class, null if none is specified in the resource model
- */
- String getSpecifiedIdClassName();
-
- /**
- * Set the specified name of the id class.
- * Use null to remove the id class specification from the resource model
- */
- void setSpecifiedIdClassName(String value);
-
- /**
- * Property string associated with changes to the {@link IdClassHolder}'s default id class name
- */
- String DEFAULT_ID_CLASS_NAME_PROPERTY = "defaultIdClassName"; //$NON-NLS-1$
-
- /**
- * Return the default name of the id class, null if there is none
- */
- String getDefaultIdClassName();
-
- /**
- * Return the name of the id class, taking into consideration the default value if applicable
- */
- String getIdClassName();
-
- /**
- * Return whether the id class has been specified.
- * Generally, this simply means that the id class name has been set, although if a default
- * applies, this should also return true.
- */
- boolean isSpecified();
-
- /**
- * Property string associated with changes to the {@link IdClassHolder}'s id class.
- * This will change (potentially) if the id class name changes, or if other changes result
- * in changes in the id class' resolution.
- */
- String ID_CLASS_PROPERTY = "idClass"; //$NON-NLS-1$
-
- /**
- * Return the {@link JavaPersistentType} that is resolved from the id class name.
- * This will be null if the id class name is null or if the class cannot be resolved from that
- * name.
- */
- JavaPersistentType getIdClass();
-
- /**
- * Return the char to be used for browsing or creating the id class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getIdClassEnclosingTypeSeparator();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java
deleted file mode 100644
index 12fd9d9add..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/IdMapping.java
+++ /dev/null
@@ -1,35 +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.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.3
- * @since 2.0
- */
-public interface IdMapping
- extends AttributeMapping, ColumnMapping, ConvertibleMapping
-{
- GeneratorContainer getGeneratorContainer();
-
- GeneratedValue getGeneratedValue();
- GeneratedValue addGeneratedValue();
- void removeGeneratedValue();
- String GENERATED_VALUE_PROPERTY = "generatedValue"; //$NON-NLS-1$
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java
deleted file mode 100644
index 751032425d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/InheritanceType.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-/**
- * Inheritance 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 2.2
- * @since 2.0
- */
-public enum InheritanceType {
-
- SINGLE_TABLE(
- org.eclipse.jpt.core.resource.java.InheritanceType.SINGLE_TABLE,
- org.eclipse.jpt.core.resource.orm.InheritanceType.SINGLE_TABLE
- ),
- JOINED(
- org.eclipse.jpt.core.resource.java.InheritanceType.JOINED,
- org.eclipse.jpt.core.resource.orm.InheritanceType.JOINED
- ),
- TABLE_PER_CLASS(
- org.eclipse.jpt.core.resource.java.InheritanceType.TABLE_PER_CLASS,
- org.eclipse.jpt.core.resource.orm.InheritanceType.TABLE_PER_CLASS
- );
-
-
- private org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType;
- private org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType;
-
- InheritanceType(org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType, org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType) {
- if (javaInheritanceType == null) {
- throw new NullPointerException();
- }
- if (ormInheritanceType == null) {
- throw new NullPointerException();
- }
- this.javaInheritanceType = javaInheritanceType;
- this.ormInheritanceType = ormInheritanceType;
- }
-
- public org.eclipse.jpt.core.resource.java.InheritanceType getJavaInheritanceType() {
- return this.javaInheritanceType;
- }
-
- public org.eclipse.jpt.core.resource.orm.InheritanceType getOrmInheritanceType() {
- return this.ormInheritanceType;
- }
-
-
- // ********** static methods **********
-
- public static InheritanceType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType) {
- return (javaInheritanceType == null) ? null : fromJavaResourceModel_(javaInheritanceType);
- }
-
- private static InheritanceType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.InheritanceType javaInheritanceType) {
- for (InheritanceType inheritanceType : InheritanceType.values()) {
- if (inheritanceType.getJavaInheritanceType() == javaInheritanceType) {
- return inheritanceType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.InheritanceType toJavaResourceModel(InheritanceType inheritanceType) {
- return (inheritanceType == null) ? null : inheritanceType.getJavaInheritanceType();
- }
-
- public static InheritanceType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType) {
- return (ormInheritanceType == null) ? null : fromOrmResourceModel_(ormInheritanceType);
- }
-
- private static InheritanceType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.InheritanceType ormInheritanceType) {
- for (InheritanceType inheritanceType : InheritanceType.values()) {
- if (inheritanceType.getOrmInheritanceType() == ormInheritanceType) {
- return inheritanceType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.InheritanceType toOrmResourceModel(InheritanceType inheritanceType) {
- return (inheritanceType == null) ? null : inheritanceType.getOrmInheritanceType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java
deleted file mode 100644
index b0ec5212ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumn.java
+++ /dev/null
@@ -1,53 +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.core.context;
-
-/**
- * join column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JoinColumn
- extends BaseColumn, BaseJoinColumn
-{
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner
- extends BaseJoinColumn.Owner, BaseColumn.Owner
- {
-
- /**
- * The target of the relationship will usually be the target entity.
- * In the case of a target foreign key relationship the source and target
- * are swapped.
- */
- Entity getRelationshipTarget();
-
- /**
- * return the join column's attribute name
- */
- String getAttributeName();
-
- /**
- * return the persistent attribute for this join column
- */
- PersistentAttribute getPersistentAttribute();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index eb4958034a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnEnabledRelationshipReference.java
+++ /dev/null
@@ -1,67 +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.core.context;
-
-/**
- * A <code>JoinColumnEnabledRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy}
- * <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 RelationshipMapping
- * @see RelationshipReference
- * @see JoinColumn
- *
- * @version 2.2
- * @since 2.2
- */
-public interface JoinColumnEnabledRelationshipReference
- extends RelationshipReference
-{
- /**
- * Return the aggregate (never null) object used to configure the join column
- * joining strategy
- */
- JoinColumnJoiningStrategy getJoinColumnJoiningStrategy();
-
- /**
- * Return whether the join column joining strategy is currently the
- * predominant joining strategy
- */
- boolean usesJoinColumnJoiningStrategy();
-
- /**
- * Set the join column joining strategy as the predominant joining strategy
- */
- void setJoinColumnJoiningStrategy();
-
- /**
- * Unset the join column joining strategy as the predominant joining strategy.
- * This will not set any other joining strategy as the predominant one, so
- * whichever one is also configured (is specified) or the default strategy
- * will apply at that point.
- */
- // TODO remove this API (bug 311945)- wanted to remove it when I fixed bug 311248.
- // API users should just call set on another strategy, this will unset all other strategies
- void unsetJoinColumnJoiningStrategy();
-
- /**
- * Return whether this reference may potentially have a default join column.
- * (For example, a 1-1 mapping may have one if it does not specify a mappedBy
- * or a join table, but a 1-M mapping may not.)
- */
- boolean mayHaveDefaultJoinColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnJoiningStrategy.java
deleted file mode 100644
index 2e81b5340e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,125 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Joining strategy that uses join columns
- * <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
- *
- * @see {@link RelationshipMapping}
- * @see {@link JoinColumnEnabledRelationshipReference}
- */
-public interface JoinColumnJoiningStrategy
- extends JoiningStrategy
-{
-
- void initializeFrom(JoinColumnJoiningStrategy oldStrategy);
-
- /**
- * The source of the relationship will usually be the owning type mapping.
- * In the case of a target foreign key relationship the source and target
- * are swapped.
- * @see isTargetForeignKeyRelationship()
- */
- TypeMapping getRelationshipSource();
-
- /**
- * The target of the relationship will usually be the target entity.
- * In the case of a target foreign key relationship the source and target
- * are swapped.
- * @see isTargetForeignKeyRelationship()
- */
- TypeMapping getRelationshipTarget();
-
- /**
- * Return whether this relationship is a target foreign key relationship.
- * A one-to-many mapping with a join column will have the foreign key
- * in the target table.
- */
- boolean isTargetForeignKeyRelationship();
-
- /**
- * Return a list iterator of the join columns whether specified or default.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> joinColumns();
-
- /**
- * Return the number of join columns, both specified and default.
- */
- int joinColumnsSize();
-
- /**
- * Change notification identifier for "defaultJoinColumn" property
- */
- String DEFAULT_JOIN_COLUMN_PROPERTY = "defaultJoinColumn"; //$NON-NLS-1$
-
- /**
- * Return the default join column or null. If there are specified join
- * columns, then there will be no default join column (though there are
- * times that there may be no default join column even if there are no
- * specified join columns.)
- */
- JoinColumn getDefaultJoinColumn();
-
- /**
- * Change notification identifier for "specifiedJoinColumns" list
- */
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumns"; //$NON-NLS-1$
-
- /**
- * Return a list iterator of the specified join columns.
- * This will not be null.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
-
- /**
- * Return the number of specified join columns.
- */
- int specifiedJoinColumnsSize();
-
- /**
- * Return whether this has any specified join columns.
- * (Equivalent to {@link #specifiedJoinColumnsSize()} == 0)
- */
- boolean hasSpecifiedJoinColumns();
-
- /**
- * Add a specified join column to the join table return the object
- * representing it.
- */
- JoinColumn addSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column from the join table.
- */
- void removeSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column at the index from the join table.
- */
- void removeSpecifiedJoinColumn(JoinColumn joinColumn);
-
- /**
- * Move the specified join column from the source index to the target index.
- */
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java
deleted file mode 100644
index 7911302a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTable.java
+++ /dev/null
@@ -1,102 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Used by ManyToMany and OneToMany mappings.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JoinTable
- extends ReferenceTable
-{
- RelationshipMapping getRelationshipMapping();
-
- JoinTableJoiningStrategy getParent();
-
-
- // ********** inverse join columns **********
-
- /**
- * Return the join table's inverse join columns, whether specified or default.
- */
- <T extends JoinColumn> ListIterator<T> inverseJoinColumns();
-
- /**
- * Return the number of inverse join columns, whether specified or default.
- */
- int inverseJoinColumnsSize();
-
- /**
- * Convert the join table's default inverse join column to a specified
- * inverse join column.
- */
- void convertDefaultToSpecifiedInverseJoinColumn();
-
- /**
- * Return the specified inverse join columns.
- */
- <T extends JoinColumn> ListIterator<T> specifiedInverseJoinColumns();
- String SPECIFIED_INVERSE_JOIN_COLUMNS_LIST = "specifiedInverseJoinColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified inverse join columns.
- */
- int specifiedInverseJoinColumnsSize();
-
- /**
- * Return the default inverse join column or null. A default inverse join column
- * only exists if there are no specified inverse join columns.
- */
- JoinColumn getDefaultInverseJoinColumn();
- String DEFAULT_INVERSE_JOIN_COLUMN = "defaultInverseJoinColumn"; //$NON-NLS-1$
-
- /**
- * Add a specified join column to the join table.
- * Return the newly-created join column.
- */
- JoinColumn addSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the inverse join column at the specified index from the join table.
- */
- void removeSpecifiedInverseJoinColumn(int index);
-
- /**
- * Remove the specified inverse join column from the join table.
- */
- void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn);
-
- /**
- * Move an inverse join column from the specified source index to the
- * specified target index.
- */
- void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Return whether the join table has specified inverse join columns.
- */
- boolean hasSpecifiedInverseJoinColumns();
-
- /**
- * Remove all the join table's inverse join columns.
- */
- void clearSpecifiedInverseJoinColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableEnabledRelationshipReference.java
deleted file mode 100644
index 65337304b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableEnabledRelationshipReference.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.core.context;
-
-/**
- * A <code>JoinTableEnabledRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinTableJoiningStrategy}
- * <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 RelationshipMapping
- * @see RelationshipReference
- * @see JoinTableJoiningStrategy
- * @see JoinTable
- *
- * @version 2.2
- * @since 2.2
- */
-public interface JoinTableEnabledRelationshipReference
- extends RelationshipReference
-{
- /**
- * Return the aggregate (never null) object used to configure the join table
- * joining strategy
- */
- JoinTableJoiningStrategy getJoinTableJoiningStrategy();
-
- /**
- * Return whether the join table joining strategy is currently the
- * predominant joining strategy
- */
- boolean usesJoinTableJoiningStrategy();
-
- /**
- * Set the join table joining strategy as the predominant joining strategy
- */
- void setJoinTableJoiningStrategy();
-
- /**
- * Unset the join table joining strategy as the predominant joining strategy.
- * This will not set any other joining strategy as the predominant one, so
- * whichever one is also configured (is specified) or the default strategy
- * will apply at that point.
- */
- // TODO remove this API (bug 311945)- wanted to remove it when I fixed bug 311248.
- // API users should just call set on another strategy, this will unset all other strategies
- void unsetJoinTableJoiningStrategy();
-
- /**
- * Return whether this reference may potentially have a default join table.
- * (For example, a M-M mapping may have one if it does not specify a
- * mappedBy)
- */
- boolean mayHaveDefaultJoinTable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableJoiningStrategy.java
deleted file mode 100644
index 6f045bf7e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableJoiningStrategy.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.core.context;
-
-/**
- * Joining strategy that uses a join 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.
- *
- * @version 2.3
- * @since 2.2
- *
- * @see {@link RelationshipMapping}
- * @see {@link JoinTableEnabledRelationshipReference}
- */
-public interface JoinTableJoiningStrategy
- extends JoiningStrategy
-{
-
- void initializeFrom(JoinTableJoiningStrategy oldStrategy);
-
- /**
- * Change notification identifier for "joinTable" property
- */
- String JOIN_TABLE_PROPERTY = "joinTable"; //$NON-NLS-1$
-
- /**
- * Return the join table used in this reference or null. This will be the
- * specified or default join table if one has been specified or a default
- * join table applies, otherwise null.
- */
- JoinTable getJoinTable();
-
- /**
- * Return the default name for the JoinTable in this context
- */
- String getJoinTableDefaultName();
-
- boolean shouldValidateAgainstDatabase();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoiningStrategy.java
deleted file mode 100644
index 778f4b8f4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoiningStrategy.java
+++ /dev/null
@@ -1,84 +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.core.context;
-
-import org.eclipse.jpt.db.Table;
-
-/**
- * Represents how the information in two entities are joined together via a
- * {@link RelationshipMapping}
- * <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
- *
- * @see {@link RelationshipMapping}
- * @see {@link RelationshipReference}
- */
-public interface JoiningStrategy
- extends JpaContextNode
-{
- /**
- * Return the relationship reference that owns this strategy
- */
- RelationshipReference getRelationshipReference();
-
- /**
- * Add this strategy to the relationship reference
- */
- void addStrategy();
-
- /**
- * Remove this strategy from the relationship reference
- */
- void removeStrategy();
-
- /**
- * Return whether the mapping can be overridden with an association override
- */
- boolean isOverridableAssociation();
-
- /**
- * Return the table name associated with columns on this joining strategy.
- * The join table name, for instance, or in the case of a bi-directional relationship,
- * the table of the owning relationship.
- */
- String getTableName();
-
- /**
- * Return the database table for the specified table name
- */
- Table getDbTable(String tableName);
-
- /**
- * return whether the given table cannot be explicitly specified
- * in the column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * Return a message description used when the column's table is not valid
- * in this context. This will be passed in as a parameter to a validation
- * message. Here is an example where the description is what is returned
- * by the implementation:
- * <p>location:
- * Table "table name" for map key column "column name"
- * <p>description:
- * does not match join table
- */
- String getColumnTableNotValidDescription();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java
deleted file mode 100644
index 1fc39f18e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaContextNode.java
+++ /dev/null
@@ -1,67 +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.core.context;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-/**
- * Common protocol for JPA 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 2.3
- * @since 2.0
- */
-public interface JpaContextNode
- extends JpaNode
-{
- /**
- * Return the resource type of the context node's resource.
- */
- JpaResourceType getResourceType();
-
- /**
- * Return the persistence unit if the context node is within a
- * persistence unit. Otherwise throw an exception.
- */
- PersistenceUnit getPersistenceUnit();
-
- /**
- * Return the mapping file root if the context node is within a
- * mapping file. Otherwise throw an exception.
- */
- MappingFileRoot getMappingFileRoot();
-
- SchemaContainer getContextDefaultDbSchemaContainer();
-
- Catalog getContextDefaultDbCatalog();
-
- Schema getContextDefaultDbSchema();
-
- /**
- * "Post update" is called once the JPA project "update" is complete.
- * We use this to calculate (typically default) state that is dependent
- * on the entity inheritance hierarchy (e.g. discriminator column name).
- * Of course, if these settings change, yet another "update" will be
- * triggered, followed by yet another "post update"; until the JPA
- * project's state quiesces
- */
- void postUpdate();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java
deleted file mode 100644
index f2736ca5a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JpaRootContextNode.java
+++ /dev/null
@@ -1,66 +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.core.context;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Root of the Dali 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 2.2
- * @since 2.0
- */
-public interface JpaRootContextNode
- extends JpaContextNode
-{
-
- // ********** persistence.xml **********
-
- /**
- * String constant associated with changes to the persistence XML property
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- public final static String PERSISTENCE_XML_PROPERTY = "persistenceXml"; //$NON-NLS-1$
-
- /**
- * Return the content represented by the <code>persistence.xml</code>
- * file associated with the root context node's JPA project.
- * This may be null.
- */
- PersistenceXml getPersistenceXml();
-
-
- // ********** updating **********
-
- /**
- * Update the context model with the content of the JPA resource model.
- */
- void update(IProgressMonitor monitor);
-
-
- // ********** validation **********
-
- /**
- * Add validation messages to the specified list.
- */
- public void validate(List<IMessage> messages, IReporter reporter);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/LobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/LobConverter.java
deleted file mode 100644
index bb81cdd9fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/LobConverter.java
+++ /dev/null
@@ -1,25 +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.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 interface LobConverter extends Converter
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java
deleted file mode 100644
index 1a8f7dfcec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyMapping.java
+++ /dev/null
@@ -1,28 +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.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.2
- * @since 2.0
- */
-public interface ManyToManyMapping
- extends MultiRelationshipMapping
-{
- ManyToManyRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyRelationshipReference.java
deleted file mode 100644
index 7943649160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToManyRelationshipReference.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.core.context;
-
-
-/**
- * Represents the {@link RelationshipReference} of a {@link ManyToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToManyRelationshipReference
- extends OwnableRelationshipReference, JoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java
deleted file mode 100644
index ef9acb8f39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneMapping.java
+++ /dev/null
@@ -1,28 +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.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.2
- * @since 2.0
- */
-public interface ManyToOneMapping
- extends SingleRelationshipMapping
-{
- ManyToOneRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneRelationshipReference.java
deleted file mode 100644
index 68393ec5e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ManyToOneRelationshipReference.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.core.context;
-
-
-/**
- * Represents the {@link RelationshipReference} of a {@link ManyToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToOneRelationshipReference
- extends RelationshipReference, JoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java
deleted file mode 100644
index 46d234a5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByJoiningStrategy.java
+++ /dev/null
@@ -1,60 +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.core.context;
-
-import java.util.Iterator;
-
-/**
- * Joining strategy that depends on another mapping (the owning side of the
- * relationship) to join the two entities. Uses "mappedBy" meta-data.
- * <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
- *
- * @see {@link RelationshipMapping}
- * @see {@link OwnableRelationshipReference}
- */
-public interface MappedByJoiningStrategy
- extends JoiningStrategy
-{
- /**
- * String associated with changes to the attribute property of this object
- */
- String MAPPED_BY_ATTRIBUTE_PROPERTY = "mappedByAttribute"; //$NON-NLS-1$
-
- /**
- * Return the attribute of this object. A null indicates that the resource
- * element does not exist
- */
- String getMappedByAttribute();
-
- /**
- * Set the attribute of this object. A null will result in removal of the
- * resource element
- */
- void setMappedByAttribute(String newAttribute);
-
- /**
- * Return an iterator of possible attribute names that this object might use
- */
- Iterator<String> candidateMappedByAttributeNames();
-
- /**
- * Return whether this strategy's relationship is owned by the given other
- * relationship mapping
- */
- boolean relationshipIsOwnedBy(RelationshipMapping otherMapping);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java
deleted file mode 100644
index 31d5e015b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedSuperclass.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.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.3
- * @since 2.0
- */
-public interface MappedSuperclass
- extends TypeMapping
-{
- IdClassReference getIdClassReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java
deleted file mode 100644
index 4ac72e609f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFile.java
+++ /dev/null
@@ -1,52 +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.core.context;
-
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistentTypeContainer;
-
-/**
- * JPA mapping file (typically <code>orm.xml</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.3
- * @since 2.1
- */
-public interface MappingFile
- extends XmlFile, PersistentTypeContainer
-{
- /**
- * covariant override
- */
- MappingFileRef getParent();
-
- /**
- * Return the mapping file's root.
- */
- MappingFileRoot getRoot();
-
- /**
- * Return the specified persistent type if it is listed in the mapping file;
- * otherwise return null.
- */
- PersistentType getPersistentType(String name);
-
- /**
- * Update the context mapping file to match its resource mapping file.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.java
deleted file mode 100644
index 2453c6c02a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFilePersistenceUnitDefaults.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.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 interface MappingFilePersistenceUnitDefaults
-{
- AccessType getAccess();
-
- String getCatalog();
-
- String getSchema();
-
- boolean isCascadePersist();
-
- /**
- * Return whether the mapping file's underlying resource exists.
- * If there is a node in the <code>orm.xml</code> file for the
- * <code>persistence-unit-defaults</code> element,
- * return true; otherwise false.
- */
- boolean resourceExists();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java
deleted file mode 100644
index d22489922d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingFileRoot.java
+++ /dev/null
@@ -1,52 +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.core.context;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MappingFileRoot
- extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return the specified access if present, otherwise return the default
- * access.
- */
- AccessType getAccess();
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
-
- /**
- * Return the defaults defined within this mapping file *for the persistence unit*.
- * Return null if none exists.
- * @see MappingFilePersistenceUnitDefaults.resourceExists()
- */
- MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.java
deleted file mode 100644
index 06b09d7cd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MultiRelationshipMapping.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.core.context;
-
-/**
- * Multi-valued (1:m, m:m) relationship 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.0
- */
-public interface MultiRelationshipMapping
- extends RelationshipMapping, CollectionMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java
deleted file mode 100644
index 67cb0419e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedColumn.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedColumn
- extends JpaContextNode
-{
- String getName();
-
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultName"; //$NON-NLS-1$
-
- String getSpecifiedName();
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
-
- /**
- * Return the table name for this column. Columns that don't have a
- * specified table still have a table that they belong to.
- */
- String getTable();
-
- String getColumnDefinition();
-
- void setColumnDefinition(String value);
- String COLUMN_DEFINITION_PROPERTY = "columnDefinition"; //$NON-NLS-1$
-
-
- /**
- * Return the wrapper for the datasource column
- */
- Column getDbColumn();
-
- /**
- * Return the wrapper for the datasource table
- */
- Table getDbTable();
-
- /**
- * Return whether the column is found on the datasource.
- */
- boolean isResolved();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner {
- /**
- * Return the type mapping that contains the column.
- */
- TypeMapping getTypeMapping();
-
- /**
- * Return the name of the table which the column belongs to by default
- */
- String getDefaultTableName();
-
- /**
- * Return the database table for the specified table name
- */
- Table getDbTable(String tableName);
-
- /**
- * Return the default column name
- */
- String getDefaultColumnName();
-
- /**
- * Return a validation message for the column's name not resolving on the
- * table either specified or default. Use the given text range in the message
- */
- IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java
deleted file mode 100644
index f20d11be1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedNativeQuery.java
+++ /dev/null
@@ -1,41 +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.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.2
- * @since 2.0
- */
-public interface NamedNativeQuery
- extends Query
-{
- String getResultClass();
- void setResultClass(String value);
- String RESULT_CLASS_PROPERTY = "resultClass"; //$NON-NLS-1$
-
- String getResultSetMapping();
- void setResultSetMapping(String value);
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMapping"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the result class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getResultClassEnclosingTypeSeparator();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java
deleted file mode 100644
index 9b6a988bf5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/NamedQuery.java
+++ /dev/null
@@ -1,27 +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.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.0
- * @since 2.0
- */
-public interface NamedQuery
- extends Query {
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.java
deleted file mode 100644
index 18767e6fc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Nullable.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.core.context;
-
-
-/**
- * This interface is used for mappings that support the optional element.
- * From the JPA spec:
- * Whether the value of the field or property may be null. This is a hint
- * and is disregarded for primitive types; it may be used in schema generation.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface Nullable
- extends AttributeMapping
-{
- boolean isOptional();
-
- boolean isDefaultOptional();
- String DEFAULT_OPTIONAL_PROPERTY = "defaultOptional"; //$NON-NLS-1$
- boolean DEFAULT_OPTIONAL = true;
-
- Boolean getSpecifiedOptional();
- void setSpecifiedOptional(Boolean newSpecifiedOptional);
- String SPECIFIED_OPTIONAL_PROPERTY = "specifiedOptional"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java
deleted file mode 100644
index 9e7e1afff3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyMapping.java
+++ /dev/null
@@ -1,28 +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.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.2
- * @since 2.0
- */
-public interface OneToManyMapping
- extends MultiRelationshipMapping
-{
- OneToManyRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyRelationshipReference.java
deleted file mode 100644
index 2166851754..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToManyRelationshipReference.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.core.context;
-
-
-/**
- * Represents the {@link RelationshipReference} of a {@link OneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToManyRelationshipReference
- extends OwnableRelationshipReference,
- JoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.java
deleted file mode 100644
index e2c264b0cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneMapping.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.core.context;
-
-
-/**
- * One-to-one mapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OneToOneMapping
- extends SingleRelationshipMapping
-{
- /**
- * covariant override
- */
- OneToOneRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneRelationshipReference.java
deleted file mode 100644
index 582d1b32c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OneToOneRelationshipReference.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.core.context;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link OneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToOneRelationshipReference
- extends OwnableRelationshipReference, JoinColumnEnabledRelationshipReference,
- PrimaryKeyJoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java
deleted file mode 100644
index 01174c2b49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Orderable.java
+++ /dev/null
@@ -1,46 +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.core.context;
-
-/**
- * Multi-valued (1:m, m:m) relationship mappings support ordering.
- * <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 Orderable
- extends JpaContextNode
-{
-
- String getSpecifiedOrderBy();
- void setSpecifiedOrderBy(String orderBy);
- String SPECIFIED_ORDER_BY_PROPERTY = "specifiedOrderBy"; //$NON-NLS-1$
-
- boolean isNoOrdering();
- void setNoOrdering(boolean noOrdering);
- String NO_ORDERING_PROPERTY = "noOrdering"; //$NON-NLS-1$
-
- boolean isPkOrdering();
- void setPkOrdering(boolean pkOrdering);
- String PK_ORDERING_PROPERTY = "pkOrdering"; //$NON-NLS-1$
-
- boolean isCustomOrdering();
- void setCustomOrdering(boolean customOrdering);
- String CUSTOM_ORDERING_PROPERTY = "customOrdering"; //$NON-NLS-1$
-
- interface Owner {
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java
deleted file mode 100644
index 947346a3d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.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.core.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OverrideContainer
- extends JpaContextNode
-{
-
- interface Owner
- {
- /**
- * Return the mapping of the persistent type where the container is defined.
- * (For example, on an entity, this would be the entity. On an embedded, this would
- * be the type mapping where the embedded is defined.)
- */
- TypeMapping getTypeMapping();
-
- /**
- * Return the type mapping that contains the attributes/associations to be overridden.
- * (Though the type mapping may not *directly* own them. i.e. they may be on a supertype
- * mapping.)
- * (For example, on an entity, this would be the supertype mapping of that entity. On
- * an embedded, this would be the target type mapping of the embedded.)
- */
- TypeMapping getOverridableTypeMapping();
-
- /**
- * Return an iterator of all the names of the attributes/associations to be overridden.
- * This is usually just all of the overridable names of the overridable type mapping.
- * @see #getOverridableTypeMapping()
- */
- Iterator<String> allOverridableNames();
-
- /**
- * Return the name of the table which the column belongs to by default
- */
- String getDefaultTableName();
-
- /**
- * return whether the given table cannot be explicitly specified
- * in the column's 'table' element
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * Return the database table for the specified table name
- */
- org.eclipse.jpt.db.Table getDbTable(String tableName);
-
- /**
- * Return a list of table names that are valid for the overrides column, or join columns
- */
- Iterator<String> candidateTableNames();
-
- /**
- * Return a validation message for the column's table not being valid in the context.
- * Use the given text range in the message
- */
- IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange);
-
- /**
- * Return a validation message for the column's name not resolving on the
- * table either specified or default. Use the given text range in the message
- */
- IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OwnableRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OwnableRelationshipReference.java
deleted file mode 100644
index c54bebe030..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OwnableRelationshipReference.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.core.context;
-
-
-/**
- * An <code>OwnableRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may be the owned side of the relationship.
- * (i.e. It may use a "mappedBy" joining strategy.)
- * <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 RelationshipMapping
- * @see RelationshipReference
- *
- * @version 2.2
- * @since 2.2
- */
-public interface OwnableRelationshipReference
- extends RelationshipReference
-{
- /**
- * Return the aggregate (never null) object used to configure the mapped by
- * joining strategy
- */
- MappedByJoiningStrategy getMappedByJoiningStrategy();
-
- /**
- * Return whether the mapped by joining strategy is currently the predominant
- * joining strategy
- */
- boolean usesMappedByJoiningStrategy();
-
- /**
- * Set the mapped by joining strategy as the predominant joining strategy
- */
- void setMappedByJoiningStrategy();
-
- /**
- * Unset the mapped by joining strategy as the predominant joining strategy.
- * This will not set any other joining strategy as the predominant one, so
- * whichever one is also being used (is specified) or the default strategy
- * will apply at that point.
- */
- // TODO remove this API (bug 311945)- wanted to remove it when I fixed bug 311248.
- // API users should just call set on another strategy, this will unset all other strategies
- void unsetMappedByJoiningStrategy();
-
- /**
- * Validates whether the given mapping may own the relationship
- */
- boolean mayBeMappedBy(AttributeMapping mapping);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java
deleted file mode 100644
index 76dd6b5984..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentAttribute.java
+++ /dev/null
@@ -1,97 +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.core.context;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-
-/**
- * Persistent "attribute" (field or 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 2.3
- * @since 2.0
- */
-public interface PersistentAttribute
- extends JpaContextNode, JpaStructureNode, AccessHolder
-{
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the key for the attribute's mapping.
- * The key may be for either the "specified" mapping or, if the "specified"
- * mapping is missing, the "default" mapping.
- */
- String getMappingKey();
-
- /**
- * Return the key for the attribute's "default" mapping.
- */
- String getDefaultMappingKey();
-
- /**
- * Return the attribute's "specified" mapping, or if it is null
- * return the attribute's "default" mapping. Do not return null.
- */
- AttributeMapping getMapping();
- String DEFAULT_MAPPING_PROPERTY = "defaultMapping"; //$NON-NLS-1$
-
- /**
- * Return the attribute's "specified" mapping - could be null.
- */
- AttributeMapping getSpecifiedMapping();
- String SPECIFIED_MAPPING_PROPERTY = "specifiedMapping"; //$NON-NLS-1$
-
- /**
- * Clients should call this method to set the attribute's mapping.
- * Passing in a null key will cause the "specified" mapping to be
- * cleared and the attribute's mapping to be its "default" mapping.
- */
- void setSpecifiedMappingKey(String key);
-
- /**
- * Return the persistent type that owns this attribute
- */
- PersistentType getOwningPersistentType();
-
- /**
- * Return the mapping of the owning persistent type
- */
- TypeMapping getOwningTypeMapping();
-
- /**
- * If the attribute is mapped to a primary key column, return the
- * column's name, otherwise return null.
- */
- String getPrimaryKeyColumnName();
-
- /**
- * Return the resolved, qualified name of the attribute's type
- * (e.g. "java.util.Collection" or "byte[]").
- * Return null if the attribute's type can not be resolved.
- * 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").
- */
- String getTypeName();
-
- /**
- * Return whether this attribute actually has a textual representation
- * in its underlying resource (false = no).
- */
- boolean isVirtual();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java
deleted file mode 100644
index 580b01f628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PersistentType.java
+++ /dev/null
@@ -1,198 +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.core.context;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Context persistent type.
- * <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.0
- */
-public interface PersistentType
- extends JpaContextNode, JpaStructureNode, AccessHolder
-{
-
- // ********** name **********
-
- /**
- * Return the persistent type's [fully-qualified] name.
- * The enclosing type separator is '.', as opposed to '$'.
- * @see #getShortName()
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the persistent type's short name.
- * @see #getName()
- */
- String getShortName();
-
-
- // ********** mapping **********
-
- /**
- * Return the persistent type's mapping.
- * Set the mapping via {@link #setMappingKey(String)}.
- */
- TypeMapping getMapping();
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
-
- String getMappingKey();
-
- void setMappingKey(String key);
-
- boolean isMapped();
-
-
- // ********** attributes **********
-
- /**
- * Return the persistent type's persistent attributes.
- */
- <T extends PersistentAttribute> ListIterator<T> attributes();
- String ATTRIBUTES_LIST = "attributes"; //$NON-NLS-1$
-
- /**
- * Return the number of the persistent type's persistent attributes.
- */
- int attributesSize();
-
- /**
- * Return the names of the persistent type's persistent attributes.
- */
- Iterator<String> attributeNames();
-
- /**
- * Return all the persistent attributes in the persistent type's
- * inheritance hierarchy.
- */
- Iterator<PersistentAttribute> allAttributes();
-
- /**
- * Return the names of all the persistent attributes in the
- * persistent type's hierarchy.
- */
- Iterator<String> allAttributeNames();
-
- /**
- * Return the persistent attribute with the specified name,
- * if it exists locally on the persistent type (as opposed to in its
- * inheritance hierarchy).
- */
- PersistentAttribute getAttributeNamed(String attributeName);
-
- /**
- * Resolve and return the persistent attribute with the specified name, if it
- * is distinct and exists within the context of the persistent type.
- */
- PersistentAttribute resolveAttribute(String attributeName);
-
-
- // ********** inheritance **********
-
- /**
- * Return the "super" {@link PersistentType} from the "persistence"
- * inheritance hierarchy.
- * If the Java inheritance parent is not a {@link PersistentType}, then continue
- * up the hierarchy (the JPA spec allows non-persistent types to be part of the hierarchy.)
- * Return <code>null</code> if the persistent type is the root persistent type.
- * <p>
- * Example:
- * <pre>
- * &#64;Entity
- * public abstract class Model {}
- *
- * public abstract class Animal extends Model {}
- *
- * &#64;Entity
- * public class Cat extends Animal {}
- * </pre>
- * The "super" persistent type of the <code>Cat</code> persistent type is
- * the <code>Model</code> persistent type. The "super" persistent type can
- * be either a Java annotated class or declared in the XML files.
- */
- PersistentType getSuperPersistentType();
- String SUPER_PERSISTENT_TYPE_PROPERTY = "superPersistentType"; //$NON-NLS-1$
-
- /**
- * Return the persistent type's "persistence" inheritance hierarchy,
- * <em>including</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
- */
- Iterator<PersistentType> inheritanceHierarchy();
-
- /**
- * Return the persistent type's "persistence" inheritance hierarchy,
- * <em>excluding</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
- */
- Iterator<PersistentType> ancestors();
-
-
- // ********** validation **********
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-
- // ********** owner **********
-
- /**
- * Return the access type that overrides the client persistent type's
- * access type; <code>null</code> if there is no such access override.
- */
- AccessType getOwnerOverrideAccess();
-
- /**
- * Return the client persistent type's default access type;
- * <code>null</code> if there is no such access default.
- */
- AccessType getOwnerDefaultAccess();
-
-
- // ********** owner interface **********
-
- interface Owner
- extends JpaContextNode
- {
- /**
- * Return the access type that overrides the client persistent type's
- * access type; <code>null</code> if there is no such access override
- */
- AccessType getOverridePersistentTypeAccess();
-
- /**
- * Return the client persistent type's default access type;
- * <code>null</code> if there is no such access default.
- */
- AccessType getDefaultPersistentTypeAccess();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.java
deleted file mode 100644
index ea95bae724..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumn.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.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.0
- * @since 2.0
- */
-public interface PrimaryKeyJoinColumn
- extends BaseJoinColumn
-{
- // nothing yet
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index e25ab2d581..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnEnabledRelationshipReference.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.core.context;
-
-/**
- * A <code>PrimaryKeyJoinColumnEnabledRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link PrimaryKeyJoinColumnJoiningStrategy}
- * <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
- *
- * @see RelationshipMapping
- * @see RelationshipReference
- * @see PrimaryKeyJoinColumn
- */
-public interface PrimaryKeyJoinColumnEnabledRelationshipReference
- extends RelationshipReference
-{
- /**
- * Return the aggregate (never null) object used to configure the primary
- * key join column joining strategy
- */
- PrimaryKeyJoinColumnJoiningStrategy getPrimaryKeyJoinColumnJoiningStrategy();
-
- /**
- * Return whether the primary key join column joining strategy is currently
- * the predominant joining strategy
- */
- boolean usesPrimaryKeyJoinColumnJoiningStrategy();
-
- /**
- * Set the primary key join column joining strategy as the predominant
- * joining strategy
- */
- void setPrimaryKeyJoinColumnJoiningStrategy();
-
- /**
- * Unset the primary key join column joining strategy as the predominant
- * joining strategy.
- * This will not set any other joining strategy as the predominant one, so
- * whichever one is also configured (is specified) or the default strategy
- * will apply at that point.
- */
- // TODO remove this API (bug 311945)- wanted to remove it when I fixed bug 311248.
- // API users should just call set on another strategy, this will unset all other strategies
- void unsetPrimaryKeyJoinColumnJoiningStrategy();
-
- /**
- * Return whether this reference may potentially have a default primary key
- * join column.
- */
- boolean mayHaveDefaultPrimaryKeyJoinColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index 11119b5c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,76 +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.core.context;
-
-import java.util.ListIterator;
-
-
-/**
- * Joining strategy that uses primary key join columns
- * <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
- *
- * @see {@link RelationshipMapping}
- * @see {@link PrimaryKeyJoinColumnEnabledRelationshipReference}
- */
-public interface PrimaryKeyJoinColumnJoiningStrategy
- extends JoiningStrategy
-{
- /**
- * Change notification identifier for "primaryKeyJoinColumns" list
- */
- String PRIMARY_KEY_JOIN_COLUMNS_LIST = "primaryKeyJoinColumns"; //$NON-NLS-1$
-
- /**
- * Return a list iterator of the primary key join columns.
- * This will not be null.
- */
- <T extends PrimaryKeyJoinColumn> ListIterator<T> primaryKeyJoinColumns();
-
- /**
- * Return the number of join columns, both specified and default.
- */
- int primaryKeyJoinColumnsSize();
-
- /**
- * Return whether this has any primary key join columns.
- * (Equivalent to {@link #primaryKeyJoinColumnsSize()} == 0)
- */
- boolean hasPrimaryKeyJoinColumns();
-
- /**
- * Add a specified join column to the join table return the object
- * representing it.
- */
- PrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified join column from the join table.
- */
- void removePrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified join column at the index from the join table.
- */
- void removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn);
-
- /**
- * Move the specified join column from the source index to the target index.
- */
- void movePrimaryKeyJoinColumn(int targetIndex, int sourceIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
deleted file mode 100644
index b4e3869873..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Query.java
+++ /dev/null
@@ -1,100 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface Query
- extends JpaContextNode
-{
- String NAMED_QUERY="namedQuery"; //$NON-NLS-1$
- String NAMED_NATIVE_QUERY="namedNativeQuery"; //$NON-NLS-1$
-
- // **************** name ***************************************************
-
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- String getName();
-
- void setName(String value);
-
-
- //************************ query ***********************
-
- String QUERY_PROPERTY = "query"; //$NON-NLS-1$
-
- String getQuery();
-
- void setQuery(String value);
-
-
- //************************ hints ***********************
-
- String HINTS_LIST = "hints"; //$NON-NLS-1$
-
- /**
- * Return a list iterator of the hints. This will not be null.
- */
- <T extends QueryHint> ListIterator<T> hints();
-
- /**
- * Return the number of hints.
- */
- int hintsSize();
-
- /**
- * Add a hint to the query and return the object representing it.
- */
- QueryHint addHint(int index);
-
- /**
- * Remove the hint from the query.
- */
- void removeHint(int index);
-
- /**
- * Remove the hint at the index from the query.
- */
- void removeHint(QueryHint queryHint);
-
- /**
- * Move the hint from the source index to the target index.
- */
- void moveHint(int targetIndex, int sourceIndex);
-
-
- // **************** validation *********************************************
-
- /**
- * Return whether the query overrides the definition of the given query
- * (e.g. a query defined in orm.xml overrides one defined in java).
- */
- boolean overrides(Query query);
-
- /**
- * Return whether the query is a duplicate of the given query.
- * A query is not a duplicate of another query if is the same exact query,
- * if it is a nameless query (which is an error condition), or if it overrides
- * or is overridden by the other query.
- */
- boolean duplicates(Query query);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryContainer.java
deleted file mode 100644
index 27f4494955..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryContainer.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 QueryContainer
- extends JpaContextNode
-{
-
- // ********** named queries **********
-
- /**
- * Return a list iterator of the named queries.
- * This will not be null.
- */
- <T extends NamedQuery> ListIterator<T> namedQueries();
-
- /**
- * Return the number of named queries.
- */
- int namedQueriesSize();
-
- /**
- * Add a named query to the entity return the object representing it.
- */
- NamedQuery addNamedQuery(int index);
-
- /**
- * Remove the named query at the index from the entity.
- */
- void removeNamedQuery(int index);
-
- /**
- * Remove the named query at from the entity.
- */
- void removeNamedQuery(NamedQuery namedQuery);
-
- /**
- * Move the named query from the source index to the target index.
- */
- void moveNamedQuery(int targetIndex, int sourceIndex);
-
- String NAMED_QUERIES_LIST = "namedQueries"; //$NON-NLS-1$
-
-
- // ********** named native queries **********
-
- /**
- * Return a list iterator of the specified named native queries.
- * This will not be null.
- */
- <T extends NamedNativeQuery> ListIterator<T> namedNativeQueries();
-
- /**
- * Return the number of named native queries.
- */
- int namedNativeQueriesSize();
-
- /**
- * Add a named native query to the entity return the object representing it.
- */
- NamedNativeQuery addNamedNativeQuery(int index);
-
- /**
- * Remove the named native query at the index from the entity.
- */
- void removeNamedNativeQuery(int index);
-
- /**
- * Remove the named native query at from the entity.
- */
- void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery);
-
- /**
- * Move the named native query from the source index to the target index.
- */
- void moveNamedNativeQuery(int targetIndex, int sourceIndex);
-
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueries"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java
deleted file mode 100644
index 56999f1ee0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/QueryHint.java
+++ /dev/null
@@ -1,36 +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.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.2
- * @since 2.0
- */
-public interface QueryHint
- extends JpaContextNode
-{
-
- String getName();
- void setName(String value);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- String getValue();
- void setValue(String value);
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReferenceTable.java
deleted file mode 100644
index fa40c2c6bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReferenceTable.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Common interface for JoinTable and CollectionTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ReferenceTable
- extends Table
-{
-
- PersistentAttribute getPersistentAttribute();
-
- // ********** join columns **********
-
- /**
- * Return the join table's join columns, whether specified or default.
- */
- <T extends JoinColumn> ListIterator<T> joinColumns();
-
- /**
- * Return the number of join columns, whether specified or default.
- */
- int joinColumnsSize();
-
- /**
- * Convert the join table's default join column to a specified join column.
- */
- void convertDefaultToSpecifiedJoinColumn();
-
- /**
- * Return the specified join columns.
- */
- <T extends JoinColumn> ListIterator<T> specifiedJoinColumns();
- String SPECIFIED_JOIN_COLUMNS_LIST = "specifiedJoinColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified join columns.
- */
- int specifiedJoinColumnsSize();
-
- /**
- * Return the default join column or null. A default join column
- * only exists if there are no specified join columns.
- */
- JoinColumn getDefaultJoinColumn();
- String DEFAULT_JOIN_COLUMN = "defaultJoinColumn"; //$NON-NLS-1$
-
- /**
- * Add a specified join column to the join table.
- * Return the newly-created join column.
- */
- JoinColumn addSpecifiedJoinColumn(int index);
-
- /**
- * Remove the join column at the specified index from the join table.
- */
- void removeSpecifiedJoinColumn(int index);
-
- /**
- * Remove the specified join column from the join table.
- */
- void removeSpecifiedJoinColumn(JoinColumn joinColumn);
-
- /**
- * Move a join column from the specified source index to the
- * specified target index.
- */
- void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Return whether the join table has specified join columns.
- */
- boolean hasSpecifiedJoinColumns();
-
- /**
- * Remove all the join table's join columns.
- */
- void clearSpecifiedJoinColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java
deleted file mode 100644
index 3a011bc13c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipMapping.java
+++ /dev/null
@@ -1,71 +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.core.context;
-
-import java.util.Iterator;
-
-/**
- * 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.3
- * @since 2.0
- */
-public interface RelationshipMapping
- extends AttributeMapping, Fetchable
-{
- /**
- * Return the meta-information used to populate the entities of the
- * relationship
- */
- RelationshipReference getRelationshipReference();
-
- /**
- * Return the relationship owner or null if this is the owning side
- * or it is a unidirectional mapping.
- */
- RelationshipMapping getRelationshipOwner();
-
-
- // **************** target entity **************************************
-
- String getTargetEntity();
-
- String getSpecifiedTargetEntity();
- void setSpecifiedTargetEntity(String value);
- String SPECIFIED_TARGET_ENTITY_PROPERTY = "specifiedTargetEntity"; //$NON-NLS-1$
-
- String getDefaultTargetEntity();
- String DEFAULT_TARGET_ENTITY_PROPERTY = "defaultTargetEntity"; //$NON-NLS-1$
-
- Entity getResolvedTargetEntity();
- String RESOLVED_TARGET_ENTITY_PROPERTY = "resolvedTargetEntity"; //$NON-NLS-1$
-
- /**
- * Return all attribute names on the target entity, provided target entity
- * resolves
- */
- Iterator<String> allTargetEntityAttributeNames();
-
- /**
- * Return the char to be used for browsing or creating the target entity IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getTargetEntityEnclosingTypeSeparator();
-
- // **************** cascade **************************************
-
- Cascade getCascade();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipReference.java
deleted file mode 100644
index dff5bab64c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipReference.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.core.context;
-
-/**
- * A <code>RelationshipReference</code> represents the meta-information required
- * to populate the entities involved in a <code>RelationshipMapping</code>. This
- * might includes join table information, join column information, and/or
- * "mappedBy" information, to name a few.
- * <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 RelationshipMapping
- *
- * @version 2.3
- * @since 2.2
- */
-public interface RelationshipReference
- extends JpaContextNode
-{
- RelationshipMapping getRelationshipMapping();
-
- /**
- * Return the TypeMapping that owns this relationship reference
- */
- TypeMapping getTypeMapping();
-
- /**
- * Return the entity that owns the relationship mapping. This is
- * just a convenience method that calls getTypeMapping() and returns
- * null if it is not an Entity
- */
- Entity getEntity();
-
- /**
- * Return whether this is the owning side of the relationship.
- * @see {@link RelationshipMapping#isRelationshipOwner()}
- */
- boolean isRelationshipOwner();
-
- /**
- * Returns whether the given mapping is the owning side of a relationship
- * with this relationship reference
- */
- boolean isOwnedBy(RelationshipMapping mapping);
-
- /**
- * String associated with changes to the predominant strategy property
- */
- final static String PREDOMINANT_JOINING_STRATEGY_PROPERTY =
- "predominantStrategy"; //$NON-NLS-1$
-
- /**
- * Return the predominant joining strategy, this should not be null
- */
- JoiningStrategy getPredominantJoiningStrategy();
-
- /**
- * Return whether the mapping can be overridden with an association override
- */
- boolean isOverridableAssociation();
-
- /**
- * Return whether the parent of this relationship reference is virtual
- * @return
- */
- boolean isParentVirtual();
-
- /**
- * Return whether this relationship is a target foreign key relationship.
- * A one-to-many mapping with a join column will have the foreign key
- * in the target table.
- */
- boolean isTargetForeignKeyRelationship();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java
deleted file mode 100644
index 93364c0aef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SecondaryTable.java
+++ /dev/null
@@ -1,88 +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.core.context;
-
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface SecondaryTable
- extends Table
-{
-
- public Entity getParent();
-
- /**
- * Return a list iterator of the primary key join columns whether specified or default.
- * This will not be null.
- */
- <T extends PrimaryKeyJoinColumn> ListIterator<T> primaryKeyJoinColumns();
- String SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST = "specifiedPrimaryKeyJoinColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of primary key join columns, both specified and default.
- */
- int primaryKeyJoinColumnsSize();
-
- /**
- * Return a list iterator of the specified primary key join columns.
- * This will not be null.
- */
- <T extends PrimaryKeyJoinColumn> ListIterator<T> specifiedPrimaryKeyJoinColumns();
-
- /**
- * Return the number of specified primary key join columns.
- */
- int specifiedPrimaryKeyJoinColumnsSize();
-
- /**
- * Return the default primary key join column or null. A default primary key join column
- * only exists if there are no specified primary key join columns.
- */
- PrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- String DEFAULT_PRIMARY_KEY_JOIN_COLUMN = "defaultPrimaryKeyJoinColumn"; //$NON-NLS-1$
-
- /**
- * Add a specified primary key join column to the secondary table return the object
- * representing it.
- */
- PrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified primary key join column from the secondary table.
- */
- void removeSpecifiedPrimaryKeyJoinColumn(int index);
-
- /**
- * Remove the specified primary key join column at the index from the secondary table.
- */
- void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn);
-
- /**
- * Move the specified primary key join column from the source index to the target index.
- */
- void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Return true if the secondary table exists as specified on the owning object,
- * or false if the secondary table is a result of defaults calculation
- */
- boolean isVirtual();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.java
deleted file mode 100644
index e6389a430f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SequenceGenerator.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.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.2
- * @since 2.0
- */
-public interface SequenceGenerator
- extends Generator
-{
- int DEFAULT_INITIAL_VALUE = 1;
-
-
- // ********** sequence name **********
-
- String getSpecifiedSequenceName();
- void setSpecifiedSequenceName(String value);
- String SPECIFIED_SEQUENCE_NAME_PROPERTY = "specifiedSequenceName"; //$NON-NLS-1$
- String getSequenceName();
- String getDefaultSequenceName();
- String DEFAULT_SEQUENCE_NAME_PROPERTY = "defaultSequenceName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java
deleted file mode 100644
index 3f74c63bbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/SingleRelationshipMapping.java
+++ /dev/null
@@ -1,28 +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.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.2
- * @since 2.0
- */
-public interface SingleRelationshipMapping
- extends RelationshipMapping, Nullable
-{
- // **************** fetch type **************************************
-
- FetchType DEFAULT_FETCH_TYPE = FetchType.EAGER;
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java
deleted file mode 100644
index 477f18823f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Table.java
+++ /dev/null
@@ -1,115 +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.core.context;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface Table
- extends JpaContextNode
-{
-
- // ********** name **********
-
- /**
- * Return the specified name if present, otherwise return the default
- * name.
- */
- String getName();
- String getSpecifiedName();
- void setSpecifiedName(String value);
- String SPECIFIED_NAME_PROPERTY = "specifiedName"; //$NON-NLS-1$
- String getDefaultName();
- String DEFAULT_NAME_PROPERTY = "defaultName"; //$NON-NLS-1$
-
-
- // ********** schema **********
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
-
- // ********** catalog **********
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
-
- // ********** unique constraints **********
-
- <T extends UniqueConstraint> ListIterator<T> uniqueConstraints();
- int uniqueConstraintsSize();
- UniqueConstraint addUniqueConstraint(int index);
- void removeUniqueConstraint(int index);
- void removeUniqueConstraint(UniqueConstraint uniqueConstraint);
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
-
- // ********** database stuff **********
-
- org.eclipse.jpt.db.Table getDbTable();
- Schema getDbSchema();
- Catalog getDbCatalog();
- SchemaContainer getDbSchemaContainer();
-
- /**
- * Return whether the table can be resolved to a table on the database.
- */
- boolean isResolved();
-
- /**
- * Return whether the table's schema can be resolved to a schema on the
- * database.
- */
- boolean hasResolvedSchema();
-
- /**
- * Return whether the table has a catalog and it can be resolved to a
- * catalog on the database.
- */
- boolean hasResolvedCatalog();
-
- /**
- * Return whether the table is specified in the resource.
- */
- boolean isResourceSpecified();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java
deleted file mode 100644
index 0959fe68c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TableGenerator.java
+++ /dev/null
@@ -1,136 +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.core.context;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.db.Table;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface TableGenerator
- extends Generator
-{
- int DEFAULT_INITIAL_VALUE = 0;
-
-
- // ********** table **********
-
- /**
- * Return the specified table if present, otherwise return the default
- * table.
- */
- String getTable();
- String getSpecifiedTable();
- void setSpecifiedTable(String value);
- String SPECIFIED_TABLE_PROPERTY = "specifiedTable"; //$NON-NLS-1$
- String getDefaultTable();
- String DEFAULT_TABLE_PROPERTY = "defaultTable"; //$NON-NLS-1$
-
-
- // ********** schema **********
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
-
- // ********** catalog **********
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
-
- // ********** primary key column name **********
-
- /**
- * Return the specified primary key colum name if present, otherwise return
- * the default primary key colum name.
- */
- String getPkColumnName();
- String getSpecifiedPkColumnName();
- void setSpecifiedPkColumnName(String value);
- String SPECIFIED_PK_COLUMN_NAME_PROPERTY = "specifiedPkColumnName"; //$NON-NLS-1$
- String getDefaultPkColumnName();
- String DEFAULT_PK_COLUMN_NAME_PROPERTY = "defaultPkColumnName"; //$NON-NLS-1$
-
-
- // ********** value column name **********
-
- /**
- * Return the specified value colum name if present, otherwise return
- * the default value colum name.
- */
- String getValueColumnName();
- String getSpecifiedValueColumnName();
- void setSpecifiedValueColumnName(String value);
- String SPECIFIED_VALUE_COLUMN_NAME_PROPERTY = "specifiedValueColumnName"; //$NON-NLS-1$
- String getDefaultValueColumnName();
- String DEFAULT_VALUE_COLUMN_NAME_PROPERTY = "defaultValueColumnName"; //$NON-NLS-1$
-
-
- // ********** primary key column value **********
-
- /**
- * Return the specified primary key colum value if present, otherwise return
- * the default primary key colum value.
- */
- String getPkColumnValue();
- String getSpecifiedPkColumnValue();
- void setSpecifiedPkColumnValue(String value);
- String SPECIFIED_PK_COLUMN_VALUE_PROPERTY = "specifiedPkColummValue"; //$NON-NLS-1$
- String getDefaultPkColumnValue();
- String DEFAULT_PK_COLUMN_VALUE_PROPERTY = "defaultPkColummValue"; //$NON-NLS-1$
-
-
- // ********** unique constraints **********
-
- <T extends UniqueConstraint> ListIterator<T> uniqueConstraints();
- int uniqueConstraintsSize();
- UniqueConstraint addUniqueConstraint(int index);
- void removeUniqueConstraint(int index);
- void removeUniqueConstraint(UniqueConstraint uniqueConstraint);
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
-
- // ********** database stuff **********
-
- /**
- * Return a db Table object with the specified/default table name.
- * This can return null if no Table exists on the database with that name.
- */
- Table getDbTable();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.java
deleted file mode 100644
index 965d773608..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalConverter.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.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 interface TemporalConverter
- extends Converter
-{
- TemporalType getTemporalType();
- void setTemporalType(TemporalType temporalType);
- String TEMPORAL_TYPE_PROPERTY = "temporalType"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java
deleted file mode 100644
index 08900ab1ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TemporalType.java
+++ /dev/null
@@ -1,99 +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.core.context;
-
-/**
- * Temporal 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 2.2
- * @since 2.0
- */
-public enum TemporalType {
-
- DATE(
- org.eclipse.jpt.core.resource.java.TemporalType.DATE,
- org.eclipse.jpt.core.resource.orm.TemporalType.DATE
- ),
- TIME(
- org.eclipse.jpt.core.resource.java.TemporalType.TIME,
- org.eclipse.jpt.core.resource.orm.TemporalType.TIME
- ),
- TIMESTAMP(
- org.eclipse.jpt.core.resource.java.TemporalType.TIMESTAMP,
- org.eclipse.jpt.core.resource.orm.TemporalType.TIMESTAMP
- );
-
-
- private org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType;
- private org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType;
-
- TemporalType(org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType, org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType) {
- if (javaTemporalType == null) {
- throw new NullPointerException();
- }
- if (ormTemporalType == null) {
- throw new NullPointerException();
- }
- this.javaTemporalType = javaTemporalType;
- this.ormTemporalType = ormTemporalType;
- }
-
- public org.eclipse.jpt.core.resource.java.TemporalType getJavaTemporalType() {
- return this.javaTemporalType;
- }
-
- public org.eclipse.jpt.core.resource.orm.TemporalType getOrmTemporalType() {
- return this.ormTemporalType;
- }
-
-
- // ********** static methods **********
-
- public static TemporalType fromJavaResourceModel(org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType) {
- return (javaTemporalType == null) ? null : fromJavaResourceModel_(javaTemporalType);
- }
-
- private static TemporalType fromJavaResourceModel_(org.eclipse.jpt.core.resource.java.TemporalType javaTemporalType) {
- for (TemporalType temporalType : TemporalType.values()) {
- if (temporalType.getJavaTemporalType() == javaTemporalType) {
- return temporalType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.java.TemporalType toJavaResourceModel(TemporalType temporalType) {
- return (temporalType == null) ? null : temporalType.getJavaTemporalType();
- }
-
- public static TemporalType fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType) {
- return (ormTemporalType == null) ? null : fromOrmResourceModel_(ormTemporalType);
- }
-
- private static TemporalType fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.TemporalType ormTemporalType) {
- for (TemporalType temporalType : TemporalType.values()) {
- if (temporalType.getOrmTemporalType() == ormTemporalType) {
- return temporalType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.TemporalType toOrmResourceModel(TemporalType temporalType) {
- return (temporalType == null) ? null : temporalType.getOrmTemporalType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.java
deleted file mode 100644
index 6343f54932..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TransientMapping.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.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.0
- * @since 2.0
- */
-public interface TransientMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java
deleted file mode 100644
index f9979cf5b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/TypeMapping.java
+++ /dev/null
@@ -1,168 +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.core.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.db.Schema;
-
-/**
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit feedback 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.0
- */
-public interface TypeMapping
- extends JpaContextNode {
- /**
- * Return a unique key for the ITypeMapping. If this is defined in an
- * extension they should be equal.
- */
- String getKey();
-
- PersistentType getPersistentType();
-
- boolean isMapped();
-
- /**
- * Return the resolved id class specified on this type mapping, null otherwise
- */
- JavaPersistentType getIdClass();
-
- /**
- * Return the type mapping's primary table name, null if a primary table
- * does not apply.
- */
- String getPrimaryTableName();
-
- /**
- * Return the type mapping's primary database table.
- */
- org.eclipse.jpt.db.Table getPrimaryDbTable();
-
- Schema getDbSchema();
-
- /**
- * Return the type mapping of this type mapping's super type.
- * Return null if this is the root.
- */
- TypeMapping getSuperTypeMapping();
-
- /**
- * Return the type mapping's "persistence" inheritance hierarchy,
- * <em>including</em> the type mapping itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
- */
- Iterator<TypeMapping> inheritanceHierarchy();
-
- /**
- * Return the type mapping's "associated" tables, which includes the primary
- * table and the collection of secondary tables.
- */
- Iterator<Table> associatedTables();
-
- /**
- * Return the type mapping's "associated" tables, which includes the primary
- * table and the collection of secondary tables, as well as all inherited
- * "associated" tables.
- */
- Iterator<Table> associatedTablesIncludingInherited();
-
- /**
- * Return the identifiers of the type mapping's "associated" tables, which
- * includes the primary table and the collection of secondary tables, as
- * well as all the inherited "associated" tables.
- */
- Iterator<String> associatedTableNamesIncludingInherited();
-
- /**
- * return the resolved associated db table with the passed in name
- */
- org.eclipse.jpt.db.Table getDbTable(String tableName);
-
- /**
- * Return whether the specified table is invalid for any annotations
- * associated with the type mapping.
- */
- boolean tableNameIsInvalid(String tableName);
-
- /**
- * A convenience method for getting the attribute mappings from PersistentType.attributes()
- */
- <T extends AttributeMapping> Iterator<T> attributeMappings();
-
- /**
- * Return attribute mappings of a particular mapping type that are declared on this type mapping
- */
- <T extends AttributeMapping> Iterable<T> getAttributeMappings(String mappingKey);
-
- /**
- * Return all the attribute mappings in the type mapping's
- * inheritance hierarchy.
- */
- Iterator<AttributeMapping> allAttributeMappings();
-
- /**
- * Return attribute mappings of a particular mapping type that are declared anywhere on this
- * type mapping's hierarchy
- */
- <T extends AttributeMapping> Iterable<T> getAllAttributeMappings(String mappingKey);
-
- /**
- * Return an Iterator of attribute names that can be overridden by a
- * sub type mapping.
- */
- Iterator<String> overridableAttributeNames();
-
- /**
- * Return an Iterator of all attribute names that can be overridden in this
- * type mapping.
- */
- Iterator<String> allOverridableAttributeNames();
-
- /**
- * Returns the Column of the overridable attribute mapping with the given
- * attribute name. In 2.0 this name could use dot-notation for nested mappings.
- */
- Column resolveOverriddenColumn(String attributeName);
-
-
- RelationshipReference resolveRelationshipReference(String associationOverrideName);
-
- /**
- * Return an Iterator of associations names that can be overridden in this
- * type mapping.
- */
- Iterator<String> overridableAssociationNames();
-
- /**
- * Return an Iterator of all associations names that can be overridden in this
- * type mapping.
- */
- Iterator<String> allOverridableAssociationNames();
-
- /**
- * Return whether the given attribute mapping key is valid for this
- * particular type mapping (for example, id's are not valid for an
- * embeddable type mapping)
- */
- boolean attributeMappingKeyAllowed(String attributeMappingKey);
-
- /**
- * Return whether any database metadata specific validation should occur.
- * (For instance, if the connection is not active, then it should not.)
- */
- boolean shouldValidateAgainstDatabase();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.java
deleted file mode 100644
index 013e467b6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/UniqueConstraint.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.core.context;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface UniqueConstraint
- extends JpaContextNode
-{
-
- // **************** column names **************************************
-
- /**
- * Return a list iterator of the column names.
- * This will not be null.
- */
- ListIterator<String> columnNames();
-
- /**
- * Return the number of column names.
- */
- int columnNamesSize();
-
- /**
- * Add a column name to the list at the given index
- */
- void addColumnName(int index, String columnName);
-
- /**
- * Remove the column name at the given index from the unique constraint
- */
- void removeColumnName(int index);
-
- /**
- * Remove the column name from the unique constraint
- */
- void removeColumnName(String columnName);
-
- /**
- * Move the column name from the source index to the target index.
- */
- void moveColumnName(int targetIndex, int sourceIndex);
- String COLUMN_NAMES_LIST = "columnNames"; //$NON-NLS-1$
-
- /**
- * All containers must implement this interface.
- */
- interface Owner
- {
- Iterator<String> candidateUniqueConstraintColumnNames();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.java
deleted file mode 100644
index 762120b222..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VersionMapping.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.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.2
- * @since 2.0
- */
-public interface VersionMapping
- extends AttributeMapping, ColumnMapping, ConvertibleMapping
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.java
deleted file mode 100644
index bf85a41cf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlContextNode.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.core.context;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.1
- */
-public interface XmlContextNode
- extends JpaContextNode
-{
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
- TextRange getValidationTextRange();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlFile.java
deleted file mode 100644
index c33eff9a96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/XmlFile.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.core.context;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-/**
- * Context representation of any JPA XML file.
- * <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 XmlFile
- extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return the resource model object
- */
- JpaXmlResource getXmlResource();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JarFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JarFile.java
deleted file mode 100644
index 7d6391fe6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JarFile.java
+++ /dev/null
@@ -1,70 +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.core.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.persistence.PersistentTypeContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * A JAR file identified by a <code>persistence.xml</code> <code>jar-file</code> element.
- * Holds persistent types corresponding to all the "persistable" types
- * discovered in the JAR.
- * <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 JarFile
- extends JpaContextNode, JpaStructureNode, PersistentTypeContainer
-{
- /**
- * Return the JAR file's Java persistent types.
- * Return only the types that are annotated with JPA annotations.
- */
- Iterator<JavaPersistentType> javaPersistentTypes();
- String JAVA_PERSISTENT_TYPES_COLLECTION = "javaPersistentTypes"; //$NON-NLS-1$
-
- /**
- * Return the size of the JAR file's Java persistent types.
- */
- int javaPersistentTypesSize();
-
- /**
- * Return the persistent type with the specified name.
- * Return null if the persistent type is not found.
- */
- PersistentType getPersistentType(String typeName);
-
- /**
- * Synchronize the context JAR file to the specified Java package fragment
- * root.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(JavaResourcePackageFragmentRoot jrpfr);
-
- /**
- * Add to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java
deleted file mode 100644
index bc1e8e61eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverride.java
+++ /dev/null
@@ -1,50 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaAssociationOverride
- extends AssociationOverride, JavaOverride
-{
- JavaAssociationOverrideRelationshipReference getRelationshipReference();
-
- JavaAssociationOverride setVirtual(boolean virtual);
-
- AssociationOverrideAnnotation getOverrideAnnotation();
-
- void initialize(AssociationOverrideAnnotation associationOverride);
-
- /**
- * Update the JavaAssociationOverride context model object to match the AssociationOverrideAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(AssociationOverrideAnnotation associationOverride);
-
- JavaAssociationOverride.Owner getOwner();
-
- interface Owner extends AssociationOverride.Owner, JavaOverride.Owner
- {
- //nothing yet
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideContainer.java
deleted file mode 100644
index 77e9593669..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideContainer.java
+++ /dev/null
@@ -1,44 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaAssociationOverrideContainer
- extends AssociationOverrideContainer, JavaOverrideContainer
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> associationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAssociationOverride> virtualAssociationOverrides();
-
- JavaAssociationOverride getAssociationOverrideNamed(String name);
-
- interface Owner extends AssociationOverrideContainer.Owner, JavaOverrideContainer.Owner
- {
- //nothing yet
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideRelationshipReference.java
deleted file mode 100644
index 43b82e9862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAssociationOverrideRelationshipReference.java
+++ /dev/null
@@ -1,46 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-
-/**
- * An <code>AssociationOverrideRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy}
- * <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 RelationshipMapping
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaAssociationOverrideRelationshipReference
- extends AssociationOverrideRelationshipReference, JavaJpaContextNode
-{
- JavaAssociationOverride getAssociationOverride();
-
- JavaJoinColumnInAssociationOverrideJoiningStrategy getJoinColumnJoiningStrategy();
-
- void initialize(AssociationOverrideAnnotation associationOverride);
-
- void update(AssociationOverrideAnnotation associationOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java
deleted file mode 100644
index aee97dc1ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMapping.java
+++ /dev/null
@@ -1,55 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.resource.java.Annotation;
-
-/**
- * Java attribute mapping
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaAttributeMapping
- extends AttributeMapping, JavaJpaContextNode
-{
- /**
- * Covariant override.
- */
- JavaPersistentAttribute getPersistentAttribute();
-
- Annotation getMappingAnnotation();
-
- void initialize(Annotation mappingAnnotation);
-
- /**
- * Update the JavaAttributeMapping context model object to match the JavaResourcePersistentAttribute
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- //TODO want to remove parameter from the update method, but we have to have
- //it because of GenericJavaPersistentAttribute.setSpecifiedMappingKey(), it is unable
- //to call initialize and pass the resource object in before the update is called.
- void update(Annotation mappingAnnotation);
-
- String getAnnotationName();
-
- /**
- * 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();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingDefinition.java
deleted file mode 100644
index 4083181cd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,57 +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.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- * 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 2.3
- * @since 2.3
- */
-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.
- */
- JavaAttributeMapping buildMapping(JavaPersistentAttribute attribute, JpaFactory factory);
-
- /**
- * Return whether this mapping provider should be used for the given {@link JavaPersistentAttribute}
- * in the default (ignoring all mapping annotations) case.
- */
- boolean testDefault(JavaPersistentAttribute persistentAttribute);
-
- /**
- * Return whether this mapping provider should be used for the given {@link JavaPersistentAttribute}
- * in the specified (observing all mapping annotations) case.
- */
- boolean testSpecified(JavaPersistentAttribute persistentAttribute);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.java
deleted file mode 100644
index 273533e423..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverride.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.core.context.java;
-
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaAttributeOverride
- extends AttributeOverride, JavaOverride, JavaBaseColumn.Owner
-{
- JavaColumn getColumn();
-
- JavaAttributeOverride setVirtual(boolean virtual);
-
- AttributeOverrideAnnotation getOverrideAnnotation();
-
- void initialize(AttributeOverrideAnnotation attributeOverride);
-
- /**
- * Update the JavaAttributeOverride context model object to match the AttributeOverrideAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(AttributeOverrideAnnotation attributeOverride);
-
- interface Owner
- extends AttributeOverride.Owner, JavaOverride.Owner
- {
- //nothing yet
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverrideContainer.java
deleted file mode 100644
index 6082847381..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaAttributeOverrideContainer.java
+++ /dev/null
@@ -1,44 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaAttributeOverrideContainer
- extends AttributeOverrideContainer, JavaOverrideContainer
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> attributeOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides();
-
- JavaAttributeOverride getAttributeOverrideNamed(String name);
-
- interface Owner extends AttributeOverrideContainer.Owner, JavaOverrideContainer.Owner
- {
- //nothing yet
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java
deleted file mode 100644
index d07b83693e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseColumn.java
+++ /dev/null
@@ -1,45 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaBaseColumn
- extends BaseColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange getTableTextRange(CompilationUnit astRoot);
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends JavaNamedColumn.Owner, BaseColumn.Owner
- {
- // nothing?
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java
deleted file mode 100644
index eaa8eea00e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,30 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.BaseEmbeddedMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaBaseEmbeddedMapping
- extends JavaAttributeMapping, BaseEmbeddedMapping
-{
- JavaAttributeOverrideContainer getAttributeOverrideContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java
deleted file mode 100644
index ef7015af52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBaseJoinColumn.java
+++ /dev/null
@@ -1,45 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaBaseJoinColumn
- extends BaseJoinColumn, JavaNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends BaseJoinColumn.Owner, JavaNamedColumn.Owner
- {
- // nothing?
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.java
deleted file mode 100644
index 35d43cfa03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaBasicMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaBasicMapping
- extends JavaAttributeMapping, BasicMapping, JavaColumnMapping
-{
- //********* covariant overrides **********
- JavaConverter getConverter();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaCascade.java
deleted file mode 100644
index b04a6e3444..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaCascade.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.core.context.java;
-
-import org.eclipse.jpt.core.context.Cascade;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaCascade
- extends Cascade, JavaJpaContextNode
-{
- void initialize();
-
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java
deleted file mode 100644
index f9371a9afa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumn.java
+++ /dev/null
@@ -1,38 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaColumn
- extends Column, JavaBaseColumn
-{
- void initialize(ColumnAnnotation resourceColumn);
-
- /**
- * Update the JavaColumn context model object to match the ColumnAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(ColumnAnnotation resourceColumn);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java
deleted file mode 100644
index 5766cc9d44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaColumnMapping.java
+++ /dev/null
@@ -1,30 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.ColumnMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaColumnMapping
- extends JavaJpaContextNode, ColumnMapping, JavaBaseColumn.Owner
-{
- JavaColumn getColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.java
deleted file mode 100644
index 6d5604bfbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaConverter.java
+++ /dev/null
@@ -1,36 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaConverter
- extends JavaJpaContextNode, Converter
-{
-
- /**
- * Update the JavaConverter context model object to match the JavaResourcePersistentAttribute
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentAttribute jrpa);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java
deleted file mode 100644
index 1a901b42fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaDiscriminatorColumn.java
+++ /dev/null
@@ -1,46 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaDiscriminatorColumn
- extends JavaNamedColumn, DiscriminatorColumn
-{
- void initialize(DiscriminatorColumnAnnotation resourceColumn);
-
- /**
- * Update the JavaDiscriminatorColumn context model object to match the DiscriminatorColumnAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(DiscriminatorColumnAnnotation resourceColumn);
-
- /**
- * interface allowing columns to be used in multiple places
- */
- interface Owner extends JavaNamedColumn.Owner, DiscriminatorColumn.Owner
- {
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
deleted file mode 100644
index 871dc44a23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddable.java
+++ /dev/null
@@ -1,30 +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.core.context.java;
-
-import org.eclipse.jpt.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.0
- */
-public interface JavaEmbeddable
- extends JavaTypeMapping, Embeddable
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java
deleted file mode 100644
index 5cf80a881f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedIdMapping.java
+++ /dev/null
@@ -1,29 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaEmbeddedIdMapping
- extends JavaBaseEmbeddedMapping, EmbeddedIdMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java
deleted file mode 100644
index e1d7d55b6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEmbeddedMapping.java
+++ /dev/null
@@ -1,29 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaEmbeddedMapping
- extends JavaBaseEmbeddedMapping, EmbeddedMapping
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java
deleted file mode 100644
index acbd1319a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEntity.java
+++ /dev/null
@@ -1,58 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.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.0
- */
-public interface JavaEntity
- extends JavaTypeMapping, Entity
-{
- JavaTable getTable();
-
- JavaIdClassReference getIdClassReference();
-
- JavaDiscriminatorColumn getDiscriminatorColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaSecondaryTable> secondaryTables();
- @SuppressWarnings("unchecked")
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables();
- JavaSecondaryTable addSpecifiedSecondaryTable(int index);
- JavaSecondaryTable addSpecifiedSecondaryTable();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
- JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
-
- JavaAttributeOverrideContainer getAttributeOverrideContainer();
-
- JavaAssociationOverrideContainer getAssociationOverrideContainer();
-
- JavaQueryContainer getQueryContainer();
-
- JavaGeneratorContainer getGeneratorContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.java
deleted file mode 100644
index 819d355b71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaEnumeratedConverter.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.core.context.java;
-
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaEnumeratedConverter
- extends JavaConverter, EnumeratedConverter
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java
deleted file mode 100644
index 8e2967f2e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratedValue.java
+++ /dev/null
@@ -1,46 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaGeneratedValue
- extends GeneratedValue, JavaJpaContextNode
-{
-
- /**
- * Return the (best guess) text location of the generator.
- */
- TextRange getGeneratorTextRange(CompilationUnit astRoot);
-
- void initialize(GeneratedValueAnnotation generatedValueAnnotation);
-
- /**
- * Update the JavaGeneratedValue context model object to match the GeneratedValueAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(GeneratedValueAnnotation generatedValueAnnotation);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java
deleted file mode 100644
index 4752f37eb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGenerator.java
+++ /dev/null
@@ -1,30 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaGenerator
- extends Generator, JavaJpaContextNode
-{
- TextRange getNameTextRange(CompilationUnit astRoot);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.java
deleted file mode 100644
index 01e98a4fe5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaGeneratorContainer.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.core.context.java;
-
-import org.eclipse.jpt.core.context.GeneratorContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaGeneratorContainer
- extends GeneratorContainer, JavaJpaContextNode
-{
- JavaSequenceGenerator getSequenceGenerator();
-
- JavaSequenceGenerator addSequenceGenerator();
-
- JavaTableGenerator getTableGenerator();
-
- JavaTableGenerator addTableGenerator();
-
- void initialize(JavaResourcePersistentMember jrpm);
-
- /**
- * Update the JavaGeneratorContainer context model object to match the JavaResourcePersistentMember
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentMember jrpm);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdClassReference.java
deleted file mode 100644
index dcb98f54de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdClassReference.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.core.context.java;
-
-import org.eclipse.jpt.core.context.IdClassReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaIdClassReference
- extends IdClassReference, JavaJpaContextNode
-{
- void initialize();
-
- void update();
-
- /**
- * Return the fully qualified name of the id class, taking into consideration the default value if applicable
- */
- String getFullyQualifiedIdClassName();
- String FULLY_QUALIFIED_ID_CLASS_PROPERTY = "fullyQualifiedIdClass"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java
deleted file mode 100644
index aaa8e1026d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaIdMapping.java
+++ /dev/null
@@ -1,36 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.IdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaIdMapping
- extends JavaAttributeMapping, IdMapping, JavaColumnMapping
-{
- //********* covariant overrides **********
- JavaGeneratorContainer getGeneratorContainer();
-
- JavaConverter getConverter();
-
- JavaGeneratedValue getGeneratedValue();
- JavaGeneratedValue addGeneratedValue();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.java
deleted file mode 100644
index 46ea9a1f5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumn.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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-
-/**
- * Java join column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaJoinColumn
- extends JoinColumn, JavaBaseJoinColumn, JavaBaseColumn
-{
- /**
- * Initialize the join column from the specified annotation.
- */
- void initialize(JoinColumnAnnotation joinColumnAnnotation);
-
- /**
- * Update the join column from the specified annotation.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(JoinColumnAnnotation joinColumnAnnotation);
-
- interface Owner
- extends JoinColumn.Owner, JavaBaseJoinColumn.Owner, JavaBaseColumn.Owner
- {
- // nothing?
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index 3948078f8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnEnabledRelationshipReference.java
+++ /dev/null
@@ -1,29 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinColumnEnabledRelationshipReference
- extends JavaRelationshipReference, JoinColumnEnabledRelationshipReference
-{
- JavaJoinColumnJoiningStrategy getJoinColumnJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnInAssociationOverrideJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnInAssociationOverrideJoiningStrategy.java
deleted file mode 100644
index 6844fc717c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnInAssociationOverrideJoiningStrategy.java
+++ /dev/null
@@ -1,36 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinColumnInAssociationOverrideJoiningStrategy
- extends JavaJpaContextNode, JavaJoinColumnJoiningStrategy
-{
-
- void initialize(AssociationOverrideAnnotation associationOverride);
-
- void update(AssociationOverrideAnnotation associationOverride);
-
- ListIterator<JavaJoinColumn> joinColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnJoiningStrategy.java
deleted file mode 100644
index e41b6d4afe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnJoiningStrategy.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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-
-/**
- * The java representation of a {@link JoinColumnJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinColumnJoiningStrategy
- extends JavaJoiningStrategy, JoinColumnJoiningStrategy
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
deleted file mode 100644
index 1159aaf97c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTable.java
+++ /dev/null
@@ -1,60 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * Java join table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaJoinTable
- extends JoinTable, JavaReferenceTable
-{
- void initialize(JoinTableAnnotation joinTableAnnotation);
-
- void update(JoinTableAnnotation joinTableAnnotation);
-
-
- // ********** covariant overrides **********
-
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> inverseJoinColumns();
-
- JavaJoinColumn getDefaultInverseJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedInverseJoinColumns();
-
- JavaJoinColumn addSpecifiedInverseJoinColumn(int index);
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableEnabledRelationshipReference.java
deleted file mode 100644
index 707735cdd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableEnabledRelationshipReference.java
+++ /dev/null
@@ -1,29 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinTableEnabledRelationshipReference
- extends JavaRelationshipReference, JoinTableEnabledRelationshipReference
-{
- JavaJoinTableJoiningStrategy getJoinTableJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableJoiningStrategy.java
deleted file mode 100644
index ac5567ae9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,44 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * The java representation of a {@link JoinTableJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinTableJoiningStrategy
- extends JavaJoiningStrategy, JoinTableJoiningStrategy
-{
- JavaJoinTable getJoinTable();
-
- /**
- * Return the join table annotation, use a null object instead of returning null
- * if the join table annotation does not exist.
- */
- JoinTableAnnotation getAnnotation();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoiningStrategy.java
deleted file mode 100644
index 7fc8c57468..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoiningStrategy.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.core.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoiningStrategy
- extends JavaJpaContextNode, JoiningStrategy
-{
- void initialize();
-
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
deleted file mode 100644
index cc2cb390a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJpaContextNode.java
+++ /dev/null
@@ -1,53 +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.core.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaJpaContextNode
- extends JpaContextNode
-{
-
- /**
- * Return the Java code-completion proposals for the specified position
- * in the source code.
- */
- Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot);
-
-
- // ******************** validation ***************************8
-
- /**
- * Adds to the list of current validation messages
- */
- void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-
- TextRange getValidationTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.java
deleted file mode 100644
index 26a8b77684..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaLobConverter.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.core.context.java;
-
-import org.eclipse.jpt.core.context.LobConverter;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaLobConverter
- extends JavaConverter, LobConverter
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.java
deleted file mode 100644
index 26f66d2969..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-
-/**
- * The java representation of a {@link ManyToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaManyToManyMapping
- extends JavaMultiRelationshipMapping, ManyToManyMapping
-{
- ManyToManyAnnotation getMappingAnnotation();
-
- JavaManyToManyRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyRelationshipReference.java
deleted file mode 100644
index aba0f6bf6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToManyRelationshipReference.java
+++ /dev/null
@@ -1,33 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaManyToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaManyToManyRelationshipReference
- extends ManyToManyRelationshipReference, JavaOwnableRelationshipReference,
- JavaJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.java
deleted file mode 100644
index 1323575c3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-
-/**
- * The java representation of a {@link ManyToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaManyToOneMapping
- extends JavaSingleRelationshipMapping, ManyToOneMapping
-{
- ManyToOneAnnotation getMappingAnnotation();
-
- JavaManyToOneRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneRelationshipReference.java
deleted file mode 100644
index 7a06f191dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaManyToOneRelationshipReference.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.core.context.java;
-
-import org.eclipse.jpt.core.context.ManyToOneRelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaManyToOneRelationshipReference
- extends ManyToOneRelationshipReference,
- JavaJoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByJoiningStrategy.java
deleted file mode 100644
index 4ce7a8d87b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByJoiningStrategy.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.core.context.java;
-
-import org.eclipse.jpt.core.context.MappedByJoiningStrategy;
-
-/**
- * The java representation of a {@link MappedByJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaMappedByJoiningStrategy
- extends JavaJoiningStrategy, MappedByJoiningStrategy
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.java
deleted file mode 100644
index 54e56c8431..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedSuperclass.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.core.context.java;
-
-import org.eclipse.jpt.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.0
- */
-public interface JavaMappedSuperclass
- extends JavaTypeMapping, MappedSuperclass
-{
- JavaIdClassReference getIdClassReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java
deleted file mode 100644
index 328425972a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,31 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaMultiRelationshipMapping
- extends JavaRelationshipMapping, MultiRelationshipMapping
-{
- JavaOrderable getOrderable();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java
deleted file mode 100644
index 4069c4ec73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedColumn.java
+++ /dev/null
@@ -1,51 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaNamedColumn
- extends NamedColumn, JavaJpaContextNode
-{
-
- /**
- * Return the (best guess) text location of the column's name.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the column owner's text range. This can be returned by the
- * column when its annotation is not present.
- */
- TextRange getValidationTextRange(CompilationUnit astRoot);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.java
deleted file mode 100644
index 627d961b3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedNativeQuery.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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaNamedNativeQuery
- extends NamedNativeQuery, JavaQuery
-{
-
- ListIterator<JavaQueryHint> hints();
-
- void initialize(NamedNativeQueryAnnotation resourceQuery);
-
- /**
- * Update the JavaNamedNativeQuery context model object to match the NamedNativeQueryAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(NamedNativeQueryAnnotation resourceQuery);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.java
deleted file mode 100644
index 6d6bd8542e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaNamedQuery.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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaNamedQuery
- extends NamedQuery, JavaQuery
-{
-
- ListIterator<JavaQueryHint> hints();
-
- void initialize(NamedQueryAnnotation resourceNamedQuery);
-
- /**
- * Update the JavaNamedQuery context model object to match the NamedQueryAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(NamedQueryAnnotation resourceNamedQuery);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.java
deleted file mode 100644
index 8faa6f3550..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-
-/**
- * The java representation of a {@link OneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaOneToManyMapping
- extends JavaMultiRelationshipMapping, OneToManyMapping
-{
- OneToManyAnnotation getMappingAnnotation();
-
- JavaOneToManyRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyRelationshipReference.java
deleted file mode 100644
index dfe6ea50d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,33 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToManyRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToManyRelationshipReference
- extends OneToManyRelationshipReference, JavaOwnableRelationshipReference,
- JavaJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.java
deleted file mode 100644
index 219741fefc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-/**
- * The java representation of a {@link OneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaOneToOneMapping
- extends JavaSingleRelationshipMapping, OneToOneMapping
-{
- OneToOneAnnotation getMappingAnnotation();
-
- JavaOneToOneRelationshipReference getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneRelationshipReference.java
deleted file mode 100644
index 2c97c14427..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOneToOneRelationshipReference.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.core.context.java;
-
-import org.eclipse.jpt.core.context.OneToOneRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaOneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToOneRelationshipReference
- extends OneToOneRelationshipReference, JavaOwnableRelationshipReference,
- JavaJoinColumnEnabledRelationshipReference,
- JavaPrimaryKeyJoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.java
deleted file mode 100644
index b4a6202575..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOrderable.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.core.context.java;
-
-import org.eclipse.jpt.core.context.Orderable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOrderable
- extends Orderable, JavaJpaContextNode
-{
-
- void initialize();
-
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java
deleted file mode 100644
index 0b27af86cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.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.core.context.java;
-
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOverride
- extends BaseOverride, JavaJpaContextNode
-{
-
- OverrideAnnotation getOverrideAnnotation();
-
- interface Owner extends BaseOverride.Owner
- {
-
- /**
- * Return a prefix (ending in '.') that is allowed to be appended to the override name.
- * Return null if no prefix is supported.
- */
- String getPossiblePrefix();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverrideContainer.java
deleted file mode 100644
index 1b039a842b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverrideContainer.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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.OverrideContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOverrideContainer
- extends OverrideContainer, JavaJpaContextNode
-{
-
- void initialize(JavaResourcePersistentMember jrpm);
-
- /**
- * Update the JavaAttributeOverrideContainer context model object to match the JavaResourcePersistentMember
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentMember jrpm);
-
- interface Owner extends OverrideContainer.Owner
- {
- TextRange getValidationTextRange(CompilationUnit astRoot);
-
- /**
- * This is necessary for JPA 2.0. Return a prefix (ending in '.') that should be written
- * to the java source when an override is specified.
- */
- String getWritePrefix();
-
- /**
- * This is necessary for JPA 2.0. Return a prefix (ending in '.') that is allowed to be appended to the override name.
- * Return null if no prefix is supported. "map." and "key." are the prefixes supported in JPA 2.0.
- */
- String getPossiblePrefix();
-
- /**
- * This is necessary for JPA 2.0 where Override annotation can have a prefix that distinguishes them.
- * Return whether the given overrideName that might have a prefix is relevant to this particular override
- * container. "map." and "key." are the prefixes supported in JPA 2.0.
- */
- boolean isRelevant(String overrideName);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOwnableRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOwnableRelationshipReference.java
deleted file mode 100644
index 1e03908b3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOwnableRelationshipReference.java
+++ /dev/null
@@ -1,32 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.OwnableRelationshipReference;
-import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOwnableRelationshipReference
- extends JavaRelationshipReference, OwnableRelationshipReference
-{
- OwnableRelationshipMappingAnnotation getMappingAnnotation();
-
- JavaMappedByJoiningStrategy getMappedByJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java
deleted file mode 100644
index 2e7cbcb17a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentAttribute.java
+++ /dev/null
@@ -1,181 +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.core.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * Java persistent attribute (field or 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 2.3
- * @since 2.0
- */
-public interface JavaPersistentAttribute
- extends PersistentAttribute, JavaJpaContextNode
-{
- /**
- * covariant override
- */
- JavaAttributeMapping getMapping();
-
- /**
- * covariant override
- */
- JavaAttributeMapping getSpecifiedMapping();
-
- /**
- * Return the attribute's default mapping.
- */
- JavaAttributeMapping getDefaultMapping();
-
- /**
- * Update the context persistent attribute to match its
- * resource persistent attribute (passed in to the constructor).
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-
- /**
- * Return the "resource" persistent attribute.
- */
- JavaResourcePersistentAttribute getResourcePersistentAttribute();
-
- /**
- * Return whether the specified mapping is the attribute's default mapping.
- */
- boolean mappingIsDefault(JavaAttributeMapping mapping);
-
- /**
- * Return whether the attribute contains the given offset into the text file.
- */
- boolean contains(int offset, CompilationUnit astRoot);
-
- /**
- * Return the embeddable (type mapping) corresponding to the persistent
- * attribute's type. Return null if it is not found.
- */
- Embeddable getEmbeddable();
-
- /**
- * Return whether the attribute is a field (as opposed to a property).
- */
- boolean isField();
-
- /**
- * Return whether the attribute is a property (as opposed to a field).
- */
- boolean isProperty();
-
- /**
- * Return whether the attribute is 'public', which is problematic for fields.
- */
- boolean isPublic();
-
- /**
- * Return whether the attribute is 'final', which is problematic.
- */
- boolean isFinal();
-
- /**
- * Return whether the attribute's type is valid for a default Basic mapping.
- */
- boolean typeIsBasic();
-
- /**
- * Return the attribute's type name if it is valid as a target type
- * (i.e. the type is neither an array nor a "container").
- */
- String getSingleReferenceTargetTypeName();
-
- /**
- * If the attribute's type is an appropriate "container" type,
- * return the type parameter that can be used as a target type.
- * Return null if the attribute is not a container or if the type
- * parameter is not valid as a target type (i.e. it is either
- * an array or a "container").
- */
- String getMultiReferenceTargetTypeName();
-
- /**
- * If the attribute's type is a map type,
- * return the type parameter that can be used as a key type.
- * Return null if the attribute is not a map or if the type
- * parameter is not valid as a key type (i.e. it is either
- * an array or a "container").
- */
- String getMultiReferenceMapKeyTypeName();
-
- /**
- * Return the JpaContainer that corresponds to this attribute's type.
- * Return a null implementation if the type is not a container (map or collection)
- */
- JpaContainer getJpaContainer();
-
- /**
- * JPA container interface (and null implementation)
- */
- interface JpaContainer {
- String getTypeName();
- boolean isContainer();
- boolean isMap();
- String getMultiReferenceTargetTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute);
- String getMultiReferenceMapKeyTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute);
- String getMetamodelContainerFieldTypeName();
- String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping);
-
- final class Null implements JpaContainer {
- public static final JpaContainer INSTANCE = new Null();
- public static JpaContainer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public String getTypeName() {
- return null;
- }
- public boolean isContainer() {
- return false;
- }
- public boolean isMap() {
- return false;
- }
- public String getMultiReferenceTargetTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return null;
- }
- public String getMultiReferenceMapKeyTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return null;
- }
- public String getMetamodelContainerFieldTypeName() {
- return JPA2_0.COLLECTION_ATTRIBUTE;
- }
- public String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping) {
- return null;
- }
- @Override
- public String toString() {
- return "JpaContainer.Null"; //$NON-NLS-1$
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java
deleted file mode 100644
index dad99b0b66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPersistentType.java
+++ /dev/null
@@ -1,69 +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.core.context.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Context Java persistent type.
- * <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.0
- */
-public interface JavaPersistentType
- extends PersistentType, JavaJpaContextNode
-{
- // ********** covariant overrides **********
-
- JavaTypeMapping getMapping();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPersistentAttribute> attributes();
-
- JavaPersistentAttribute getAttributeNamed(String attributeName);
-
-
- // ********** Java **********
-
- /**
- * Return whether any attribute in this persistent type is annotated
- */
- boolean hasAnyAnnotatedAttributes();
-
- /**
- * Return the Java resource persistent type.
- */
- JavaResourcePersistentType getResourcePersistentType();
-
-
- // ********** updating **********
-
- /**
- * Synchronize the Java persistent type with the specified resource type.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(JavaResourcePersistentType jrpt);
-
- /**
- * Re-synchronize the Java persistent type with its resource type.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java
deleted file mode 100644
index adf8b4425f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,38 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaPrimaryKeyJoinColumn
- extends PrimaryKeyJoinColumn, JavaBaseJoinColumn
-{
- void initialize(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumn);
-
- /**
- * Update the JavaPrimaryKeyJoinColumn context model object to match the PrimaryKeyJoinColumnAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumn);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index 11c28c88ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnEnabledRelationshipReference.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.core.context.java;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumnEnabledRelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaPrimaryKeyJoinColumnEnabledRelationshipReference
- extends JavaRelationshipReference,
- PrimaryKeyJoinColumnEnabledRelationshipReference
-{
- JavaPrimaryKeyJoinColumnJoiningStrategy getPrimaryKeyJoinColumnJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index 9530c4093c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnJoiningStrategy.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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumnJoiningStrategy;
-
-/**
- * The java representation of a {@link PrimaryKeyJoinColumnJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaPrimaryKeyJoinColumnJoiningStrategy
- extends JavaJoiningStrategy, PrimaryKeyJoinColumnJoiningStrategy
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- JavaPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
deleted file mode 100644
index 6d3d6e5548..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQuery.java
+++ /dev/null
@@ -1,41 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaQuery
- extends Query, JavaJpaContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaQueryHint> hints();
-
- JavaQueryHint addHint(int index);
-
-
- // **************** validation *********************************************
-
- TextRange getNameTextRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.java
deleted file mode 100644
index 7aa11f8585..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryContainer.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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.QueryContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaQueryContainer
- extends QueryContainer, JavaJpaContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedQuery> namedQueries();
-
- JavaNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaNamedNativeQuery> namedNativeQueries();
-
- JavaNamedNativeQuery addNamedNativeQuery(int index);
-
- void initialize(JavaResourcePersistentMember jrpm);
-
- /**
- * Update the JavaGeneratorContainer context model object to match the JavaResourcePersistentMember
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentMember jrpm);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
deleted file mode 100644
index a9304c5b5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaQueryHint.java
+++ /dev/null
@@ -1,37 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaQueryHint
- extends QueryHint, JavaJpaContextNode
-{
- void initialize(QueryHintAnnotation queryHintResource);
-
- /**
- * Update the JavaQueryHint context model object to match the QueryHintAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(QueryHintAnnotation queryHintResource);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReferenceTable.java
deleted file mode 100644
index ba7c1b075e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReferenceTable.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.ReferenceTable;
-
-/**
- * Java reference table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaReferenceTable
- extends ReferenceTable, JavaJpaContextNode
-{
-
- // ********** covariant overrides **********
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
deleted file mode 100644
index 4f35ea5e7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipMapping.java
+++ /dev/null
@@ -1,41 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaRelationshipMapping
- extends JavaAttributeMapping, RelationshipMapping
-{
- RelationshipMappingAnnotation getMappingAnnotation();
-
- JavaCascade getCascade();
-
- /**
- * If the target entity is specified, this will return it fully qualified. If not
- * specified, it returns the default target entity, which is always fully qualified
- */
- String getFullyQualifiedTargetEntity();
- String FULLY_QUALIFIED_TARGET_ENTITY_PROPERTY = "fullyQualifiedTargetEntity"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipReference.java
deleted file mode 100644
index 862818cbcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationshipReference.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.core.context.java;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaRelationshipReference
- extends JavaJpaContextNode, RelationshipReference
-{
- JavaRelationshipMapping getRelationshipMapping();
-
- void initialize();
-
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java
deleted file mode 100644
index 79113c3483..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSecondaryTable.java
+++ /dev/null
@@ -1,58 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaSecondaryTable
- extends SecondaryTable, JavaJpaContextNode
-{
-
- void initialize(SecondaryTableAnnotation secondaryTableResource);
-
- /**
- * Update the JavaSecondaryTable context model object to match the SecondaryTableAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(SecondaryTableAnnotation secondaryTableResource);
-
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
-
- JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java
deleted file mode 100644
index 5e58c1fb85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSequenceGenerator.java
+++ /dev/null
@@ -1,39 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.31
- * @since 2.0
- */
-public interface JavaSequenceGenerator
- extends JavaGenerator, SequenceGenerator
-{
-
- void initialize(SequenceGeneratorAnnotation generatorResource);
-
- /**
- * Update the JavaSequenceGenerator context model object to match the SequenceGeneratorAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(SequenceGeneratorAnnotation generatorResource);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.java
deleted file mode 100644
index d01f78e0f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaSingleRelationshipMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaSingleRelationshipMapping
- extends JavaRelationshipMapping, SingleRelationshipMapping
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.java
deleted file mode 100644
index 309b8a36b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaStructureNodes.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.core.context.java;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaStructureNodes
-{
- String COMPILATION_UNIT_ID =
- JptCorePlugin.PLUGIN_ID + ".java.compilationUnit"; //$NON-NLS-1$
-
- String PERSISTENT_TYPE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentType"; //$NON-NLS-1$
-
- String PERSISTENT_ATTRIBUTE_ID =
- JptCorePlugin.PLUGIN_ID + ".java.persistentAttribute"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java
deleted file mode 100644
index 213ec051ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTable.java
+++ /dev/null
@@ -1,46 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaTable
- extends Table, JavaJpaContextNode
-{
- void initialize(JavaResourcePersistentMember jrpm);
-
- /**
- * Update the JavaTable context model object to match the JavaResourcePersistentMember
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentMember jrpm);
-
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java
deleted file mode 100644
index 2fcbdbcd69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTableGenerator.java
+++ /dev/null
@@ -1,47 +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.core.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaTableGenerator
- extends JavaGenerator, TableGenerator
-{
- void initialize(TableGeneratorAnnotation resourceGenerator);
-
- /**
- * Update the JavaTableGenerator context model object to match the TableGeneratorAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(TableGeneratorAnnotation resourceGenerator);
-
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.java
deleted file mode 100644
index 39293637a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTemporalConverter.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.core.context.java;
-
-import org.eclipse.jpt.core.context.TemporalConverter;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaTemporalConverter
- extends JavaConverter, TemporalConverter
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java
deleted file mode 100644
index fe5f0f8073..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTransientMapping.java
+++ /dev/null
@@ -1,30 +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.core.context.java;
-
-import org.eclipse.jpt.core.context.TransientMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaTransientMapping
- extends JavaAttributeMapping, TransientMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java
deleted file mode 100644
index 0ad4045ff1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMapping.java
+++ /dev/null
@@ -1,52 +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.core.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Java type mapping (Entity, MappedSuperclass, 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.3
- * @since 2.0
- */
-public interface JavaTypeMapping
- extends TypeMapping, JavaJpaContextNode
-{
- void initialize(JavaResourcePersistentType jrpt);
-
- /**
- * Update the context Java type mapping to match the resource model.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(JavaResourcePersistentType jrpt);
-
- String getAnnotationName();
-
- Iterable<String> getSupportingAnnotationNames();
-
-
- // ********** covariant overrides **********
-
- JavaPersistentType getPersistentType();
-
- @SuppressWarnings("unchecked")
- Iterator<JavaAttributeMapping> attributeMappings();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingDefinition.java
deleted file mode 100644
index f2ee474101..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaTypeMappingDefinition.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-
-/**
- * Map a string key to a type 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 2.3
- * @since 2.3
- */
-public interface JavaTypeMappingDefinition
-{
- /**
- * Return the type mapping's key.
- */
- String getKey();
-
- /**
- * Return the type mapping's Java annotation name.
- */
- String getAnnotationName();
-
- /**
- * Build a Java type mapping for the specified type. Use the specified
- * factory for creation so extenders can simply override the appropriate
- * creation method instead of building a provider for the same key.
- */
- public JavaTypeMapping buildMapping(JavaPersistentType type, JpaFactory factory);
-
- /**
- * Return whether this mapping definition should be used for the given {@link JavaPersistentType},
- * considering all annotations.
- */
- boolean test(JavaPersistentType persistentType);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.java
deleted file mode 100644
index c4b3beaeaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaUniqueConstraint.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.core.context.java;
-
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaUniqueConstraint
- extends UniqueConstraint, JavaJpaContextNode
-{
- void initialize(UniqueConstraintAnnotation uniqueConstraintAnnotation);
-
- /**
- * Update the JavaUniqueConstraint context model object to match the UniqueConstraintAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(UniqueConstraintAnnotation uniqueConstraintAnnotation);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.java
deleted file mode 100644
index d4f8c23ea5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVersionMapping.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.core.context.java;
-
-import org.eclipse.jpt.core.context.VersionMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JavaVersionMapping
- extends JavaAttributeMapping, VersionMapping, JavaColumnMapping
-{
- //********* covariant overrides **********
- JavaConverter getConverter();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullDefaultJavaAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullDefaultJavaAttributeMappingDefinition.java
deleted file mode 100644
index 3652abfc11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullDefaultJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,80 +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.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-
-/**
- * This mapping definition implementation is used to describe the default mapping for
- * a java attribute when no other mapping applies.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NullDefaultJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final NullDefaultJavaAttributeMappingDefinition INSTANCE =
- new NullDefaultJavaAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private NullDefaultJavaAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- /**
- * Default mappings should never be null
- */
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaNullAttributeMapping(parent);
- }
-
- /**
- * This is typically the final test, so it should always apply
- */
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return true;
- }
-
- /**
- * Obviously, always false
- */
- public boolean testSpecified(JavaPersistentAttribute persistentAttribute) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullJavaTypeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullJavaTypeMappingDefinition.java
deleted file mode 100644
index 6a67609eb7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullJavaTypeMappingDefinition.java
+++ /dev/null
@@ -1,76 +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.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This mapping definition implementation is used to create a JavaNullAttributeMapping.
- * A JavaNullAttributeMapping should be used when no "mapping" annotation
- * exists on a Java 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 2.3
- * @since 2.3
- */
-public class NullJavaTypeMappingDefinition
- implements JavaTypeMappingDefinition
-{
- // singleton
- private static final NullJavaTypeMappingDefinition INSTANCE =
- new NullJavaTypeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private NullJavaTypeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return null;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- public JavaTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaNullTypeMapping(parent);
- }
-
- /**
- * This is typically the final test, so it should always apply
- */
- public boolean test(JavaPersistentType persistentType) {
- return true;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getAnnotationName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingDefinition.java
deleted file mode 100644
index 3250c31390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/NullSpecifiedJavaAttributeMappingDefinition.java
+++ /dev/null
@@ -1,80 +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.core.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-
-/**
- * This mapping definition implementation is used to describe the specified mapping for
- * a java attribute when no other mapping applies.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NullSpecifiedJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final NullSpecifiedJavaAttributeMappingDefinition INSTANCE =
- new NullSpecifiedJavaAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private NullSpecifiedJavaAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- /**
- * There is no specified mapping in this case, attributes should revert to the default
- */
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return null;
- }
-
- /**
- * Obviously false
- */
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return false;
- }
-
- /**
- * This is typically the final test, so it should always apply
- */
- public boolean testSpecified(JavaPersistentAttribute persistentAttribute) {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java
deleted file mode 100644
index 5388264bbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/EntityMappings.java
+++ /dev/null
@@ -1,169 +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.core.context.orm;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.persistence.PersistentTypeContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * Context <code>orm.xml</code> entity mappings.
- * Context model corresponding to the
- * XML resource model {@link XmlEntityMappings},
- * which corresponds to the <code>entity-mappings</code> element
- * in the <code>orm.xml</code> file.
- * <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.0
- */
-public interface EntityMappings
- extends MappingFileRoot, JpaStructureNode, PersistentType.Owner, PersistentTypeContainer
-{
- XmlEntityMappings getXmlEntityMappings();
-
- String getVersion();
-
- String getDescription();
- void setDescription(String newDescription);
- String DESCRIPTION_PROPERTY = "description"; //$NON-NLS-1$
-
- String getPackage();
- void setPackage(String newPackage);
- String PACKAGE_PROPERTY = "package"; //$NON-NLS-1$
-
- /**
- * Return the specified access if present, otherwise return the default
- * access.
- */
- AccessType getAccess();
- AccessType getSpecifiedAccess();
- void setSpecifiedAccess(AccessType access);
- String SPECIFIED_ACCESS_PROPERTY = "specifiedAccess"; //$NON-NLS-1$
- AccessType getDefaultAccess();
- String DEFAULT_ACCESS_PROPERTY = "defaultAccess"; //$NON-NLS-1$
-
- /**
- * Return the database schema container, which can be either a catalog or,
- * if the database does not support catalogs, the database itself.
- */
- SchemaContainer getDbSchemaContainer();
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String catalog);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
- Catalog getDbCatalog();
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String schema);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
- Schema getDbSchema();
-
- PersistenceUnitMetadata getPersistenceUnitMetadata();
-
- ListIterable<OrmPersistentType> getPersistentTypes();
- int getPersistentTypesSize();
- OrmPersistentType addPersistentType(String mappingKey, String className);
- void removePersistentType(int index);
- void removePersistentType(OrmPersistentType persistentType);
- //void movePersistentType(int targetIndex, int sourceIndex);
- boolean containsPersistentType(String fullyQualifiedTypeName);
- /**
- * Return the {@link OrmPersistentType) listed in this mapping file
- * with the given fully qualified type name. Return null if none exists.
- */
- OrmPersistentType getPersistentType(String fullyQualifiedTypeName);
- String PERSISTENT_TYPES_LIST = "persistentTypes"; //$NON-NLS-1$
-
- ListIterable<OrmSequenceGenerator> getSequenceGenerators();
- int getSequenceGeneratorsSize();
- OrmSequenceGenerator addSequenceGenerator(int index);
- void removeSequenceGenerator(int index);
- void removeSequenceGenerator(OrmSequenceGenerator sequenceGenerator);
- void moveSequenceGenerator(int targetIndex, int sourceIndex);
- String SEQUENCE_GENERATORS_LIST = "sequenceGenerators"; //$NON-NLS-1$
-
- ListIterable<OrmTableGenerator> getTableGenerators();
- int getTableGeneratorsSize();
- OrmTableGenerator addTableGenerator(int index);
- void removeTableGenerator(int index);
- void removeTableGenerator(OrmTableGenerator tableGenerator);
- void moveTableGenerator(int targetIndex, int sourceIndex);
- String TABLE_GENERATORS_LIST = "tableGenerators"; //$NON-NLS-1$
-
- OrmQueryContainer getQueryContainer();
-
- OrmPersistenceUnitDefaults getPersistenceUnitDefaults();
-
- /**
- * Return the default package to be used for persistent types in this context
- */
- String getDefaultPersistentTypePackage();
-
- /**
- * Return the default metadata complete value for persistent types in this context
- */
- boolean isDefaultPersistentTypeMetadataComplete();
-
- void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping);
-
- boolean containsOffset(int textOffset);
-
- /**
- * Return the JavaResourcePersistentType for the given class name found in the JPA project.
- * First look for one with this exact class name (since it might be fully qualified)
- * and then prepend the default package name and attempt to resolve.
- *
- * @see getPackage()
- */
- JavaResourcePersistentType resolveJavaResourcePersistentType(String className);
-
- /**
- * Return the PersistentType for the given class name found in the persistence unit.
- * First look for one with this exact class name (since it might be fully qualified)
- * and then prepend the default package name and attempt to resolve.
- *
- * @see getPackage()
- */
- PersistentType resolvePersistentType(String className);
-
- /**
- * Update the EntityMappings context model object to match the XmlEntityMappings
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/MappingFileDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/MappingFileDefinition.java
deleted file mode 100644
index 91a011ce13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/MappingFileDefinition.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.core.context.orm;
-
-import org.eclipse.jpt.core.ResourceDefinition;
-
-/**
- * A JPA platform can support multiple mapping files. Each will
- * have a unique resource type and must be defined with a mapping file definition.
- * <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 MappingFileDefinition
- extends ResourceDefinition
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/NullOrmAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/NullOrmAttributeMappingDefinition.java
deleted file mode 100644
index 560716988f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/NullOrmAttributeMappingDefinition.java
+++ /dev/null
@@ -1,67 +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.core.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NullOrmAttributeMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new NullOrmAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private NullOrmAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public OrmAttributeMapping buildContextMapping(OrmPersistentAttribute parent, XmlAttributeMapping resourceMapping, OrmXmlContextNodeFactory factory) {
- return factory.buildOrmNullAttributeMapping(parent, (XmlNullAttributeMapping) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
deleted file mode 100644
index c882aebc5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmAssociationOverride
- extends AssociationOverride, XmlContextNode
-{
- OrmAssociationOverrideRelationshipReference getRelationshipReference();
-
- OrmAssociationOverride setVirtual(boolean virtual);
-
- /**
- * Update the OrmAssociationOverride context model object to match the XmlAssociationOverride
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlAssociationOverride associationOverride);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideContainer.java
deleted file mode 100644
index 0561132934..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideContainer.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmAssociationOverrideContainer
- extends AssociationOverrideContainer, OrmOverrideContainer
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> associationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAssociationOverride> virtualAssociationOverrides();
-
- OrmAssociationOverride getAssociationOverrideNamed(String name);
-
- void update();
-
- interface Owner extends AssociationOverrideContainer.Owner, OrmOverrideContainer.Owner
- {
- EList<XmlAssociationOverride> getResourceAssociationOverrides();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideRelationshipReference.java
deleted file mode 100644
index 4647f38698..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverrideRelationshipReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- * An <code>AssociationOverrideRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a {@link JoinColumnJoiningStrategy}.
- * This cannot be an OrmRelationshipReference because referenced mapping comes
- * from another class, the class of the attribute that the association override
- * points to by name.
- * <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 RelationshipMapping
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmAssociationOverrideRelationshipReference
- extends AssociationOverrideRelationshipReference, XmlContextNode
-{
- OrmAssociationOverride getAssociationOverride();
-
- OrmJoinColumnInAssociationOverrideJoiningStrategy getJoinColumnJoiningStrategy();
-
- void update(XmlAssociationOverride xao) ;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
deleted file mode 100644
index 041497ffdc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMapping.java
+++ /dev/null
@@ -1,95 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.3
- */
-public interface OrmAttributeMapping
- extends AttributeMapping, XmlContextNode
-{
- OrmPersistentAttribute getPersistentAttribute();
-
- XmlAttributeMapping getResourceAttributeMapping();
-
- String getName();
- void setName(String newName);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Attributes are a sequence in the orm schema. We must keep
- * the list of attributes in the appropriate order so the wtp xml
- * translators will write them to the xml in that order and they
- * will adhere to the schema.
- *
- * Each concrete subclass of XmlAttributeMapping must implement this
- * method and return an int that matches it's order in the schema
- * @return
- */
- int getXmlSequence();
-
- void addToResourceModel(Attributes resourceAttributes);
-
- void removeFromResourceModel(Attributes resourceAttributes);
-
- void initializeOn(OrmAttributeMapping newMapping);
-
- void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping);
-
- void initializeFromOrmBasicMapping(OrmBasicMapping oldMapping);
-
- void initializeFromOrmIdMapping(OrmIdMapping oldMapping);
-
- void initializeFromOrmTransientMapping(OrmTransientMapping oldMapping);
-
- void initializeFromOrmEmbeddedMapping(OrmEmbeddedMapping oldMapping);
-
- void initializeFromOrmEmbeddedIdMapping(OrmEmbeddedIdMapping oldMapping);
-
- void initializeFromOrmVersionMapping(OrmVersionMapping oldMapping);
-
- void initializeFromOrmOneToManyMapping(OrmOneToManyMapping oldMapping);
-
- void initializeFromOrmManyToOneMapping(OrmManyToOneMapping oldMapping);
-
- void initializeFromOrmOneToOneMapping(OrmOneToOneMapping oldMapping);
-
- void initializeFromOrmManyToManyMapping(OrmManyToManyMapping oldMapping);
-
- boolean contains(int textOffset);
-
- TextRange getSelectionTextRange();
-
- TextRange getNameTextRange();
-
- //******************* initialization/updating *******************
-
- /**
- * Update the OrmAttributeMapping context model object to match the
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingDefinition.java
deleted file mode 100644
index 18b3cb276d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeMappingDefinition.java
+++ /dev/null
@@ -1,57 +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.core.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-/**
- * Part of mechanism to extend the types of ORM attribute mappings.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmAttributeMappingDefinition
-{
- /**
- * Return the mapping key associated with this provider
- * @see {@link MappingKeys}
- */
- String getKey();
-
- /**
- * Build a resource mapping
- */
- XmlAttributeMapping buildResourceMapping(EFactory factory);
-
- /**
- * Build a virtual resource mapping
- */
- XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory);
-
- /**
- * Build a context mapping
- */
- OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
deleted file mode 100644
index d048c8c965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmAttributeOverride
- extends AttributeOverride, XmlContextNode
-{
- OrmColumn getColumn();
-
- OrmAttributeOverride setVirtual(boolean virtual);
-
- /**
- * Update the OrmAttributeOverride context model object to match the XmlAttributeOverride
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlAttributeOverride attributeOverride);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverrideContainer.java
deleted file mode 100644
index cac3ec0d97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverrideContainer.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmAttributeOverrideContainer
- extends AttributeOverrideContainer, OrmOverrideContainer
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> attributeOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides();
-
- OrmAttributeOverride getAttributeOverrideNamed(String name);
-
- void update();
-
- void initializeFromAttributeOverrideContainer(OrmAttributeOverrideContainer oldContainer);
-
- interface Owner extends AttributeOverrideContainer.Owner, OrmOverrideContainer.Owner
- {
-
- /**
- * Build a virtual xml column based on the overridable column.
- */
- XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete);
-
- EList<XmlAttributeOverride> getResourceAttributeOverrides();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java
deleted file mode 100644
index 6c9d885736..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseColumn.java
+++ /dev/null
@@ -1,45 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmBaseColumn
- extends BaseColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the column's table.
- */
- TextRange getTableTextRange();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends OrmNamedColumn.Owner, BaseColumn.Owner
- {
- // nothing?
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.java
deleted file mode 100644
index 7638e2626d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseEmbeddedMapping.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.BaseEmbeddedMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmBaseEmbeddedMapping
- extends BaseEmbeddedMapping, OrmAttributeMapping
-{
- OrmAttributeOverrideContainer getAttributeOverrideContainer();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java
deleted file mode 100644
index f404197482..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBaseJoinColumn.java
+++ /dev/null
@@ -1,43 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmBaseJoinColumn extends BaseJoinColumn, OrmNamedColumn
-{
-
- /**
- * Return the (best guess) text location of the referenced column name
- */
- TextRange getReferencedColumnNameTextRange();
-
- /**
- * interface allowing join columns to be used in multiple places
- * (e.g. 1:1 mappings and join tables)
- */
- interface Owner extends BaseJoinColumn.Owner, OrmNamedColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java
deleted file mode 100644
index 027ace4d11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmBasicMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmBasicMapping
- extends BasicMapping, OrmAttributeMapping, OrmColumnMapping
-{
-
- //********* covariant overrides **********
- OrmConverter getConverter();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmCascade.java
deleted file mode 100644
index d1eb3c522d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmCascade.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Cascade;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmCascade
- extends Cascade
-{
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java
deleted file mode 100644
index 353a9d26c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumn.java
+++ /dev/null
@@ -1,53 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmColumn
- extends Column, OrmBaseColumn
-{
-
- void initializeFrom(Column oldColumn);
- void initialize(XmlColumn column);
-
- /**
- * Update the OrmColumn context model object to match the XmlColumn
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlColumn column);
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends OrmBaseColumn.Owner
- {
- XmlColumn getResourceColumn();
-
- void addResourceColumn();
-
- void removeResourceColumn();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java
deleted file mode 100644
index f4f285f278..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmColumnMapping.java
+++ /dev/null
@@ -1,31 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.ColumnMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmColumnMapping
- extends ColumnMapping, OrmColumn.Owner
-{
-
- OrmColumn getColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.java
deleted file mode 100644
index 414ca1910a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmConverter.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmConverter
- extends XmlContextNode, Converter
-{
- /**
- * Update the OrmConverter context model object to match the XmlConvertibleMapping
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java
deleted file mode 100644
index 310d0f9f34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmDiscriminatorColumn.java
+++ /dev/null
@@ -1,48 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmDiscriminatorColumn
- extends DiscriminatorColumn, OrmNamedColumn
-{
- void initialize(XmlEntity entity);
-
- /**
- * Update the OrmDiscriminatorColumn context model object to match the XmlEntity
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEntity entity);
-
- XmlDiscriminatorColumn getResourceColumn();
-
- /**
- * interface allowing columns to be used in multiple places
- */
- interface Owner extends OrmNamedColumn.Owner, DiscriminatorColumn.Owner
- {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java
deleted file mode 100644
index f09bf2a1c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddable.java
+++ /dev/null
@@ -1,36 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmEmbeddable
- extends Embeddable, OrmTypeMapping
-{
- /**
- * Return the Java Embeddable this ORM Embeddable corresponds to.
- * Return null if there is no java persistent type or it is not an embeddable.
- */
- JavaEmbeddable getJavaEmbeddable();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.java
deleted file mode 100644
index 61d1628703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedIdMapping.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmEmbeddedIdMapping
- extends EmbeddedIdMapping, OrmBaseEmbeddedMapping
-{
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java
deleted file mode 100644
index 5628568100..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEmbeddedMapping.java
+++ /dev/null
@@ -1,29 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmEmbeddedMapping
- extends EmbeddedMapping, OrmBaseEmbeddedMapping
-{
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java
deleted file mode 100644
index a9a02387fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmEntity.java
+++ /dev/null
@@ -1,101 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmEntity
- extends Entity, OrmTypeMapping
-{
- /**
- * Return a list iterator of the virtual(not specified) secondary tables.
- * This will not be null.
- */
- ListIterator<OrmSecondaryTable> virtualSecondaryTables();
- String VIRTUAL_SECONDARY_TABLES_LIST = "virtualSecondaryTables"; //$NON-NLS-1$
-
- /**
- * Return the number of virtual secondary tables.
- */
- int virtualSecondaryTablesSize();
-
- /**
- * Return whether the entity contains the given secondary table in its list of
- * virtual secondary tables
- */
- boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable);
-
- /**
- * Return true if there are no virtual secondary tables on the orm entity.
- * This is used to determine whether you can add specified secondary tables.
- * You must first make sure all virtual secondary tables have been specified
- * in xml before adding more. This is because adding one secondary table to xml
- * will override all the secondary tables specified in the java entity
- */
- boolean secondaryTablesDefinedInXml();
-
- /**
- * If true, then all virtual secondary tables are added in as specified secondary tables to the xml.
- * If false, then all the specified secondary tables are remvoed from the xml.
- */
- void setSecondaryTablesDefinedInXml(boolean defineInXml);
-
- /**
- * Return the Java Entity this ORM Entity corresponds to. Return null if there is no
- * java entity.
- */
- JavaEntity getJavaEntity();
-
- //************ covariant overrides *************
-
- OrmTable getTable();
-
- OrmIdClassReference getIdClassReference();
-
- OrmDiscriminatorColumn getDiscriminatorColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmSecondaryTable> secondaryTables();
- @SuppressWarnings("unchecked")
- ListIterator<OrmSecondaryTable> specifiedSecondaryTables();
- OrmSecondaryTable addSpecifiedSecondaryTable(int index);
- OrmSecondaryTable addSpecifiedSecondaryTable();
-
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
- ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns();
- String DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST = "defaultPrimaryKeyJoinColumns"; //$NON-NLS-1$
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
- OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
-
- OrmAttributeOverrideContainer getAttributeOverrideContainer();
-
- OrmAssociationOverrideContainer getAssociationOverrideContainer();
-
- OrmQueryContainer getQueryContainer();
-
- OrmGeneratorContainer getGeneratorContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java
deleted file mode 100644
index 48e9d36da4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratedValue.java
+++ /dev/null
@@ -1,43 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmGeneratedValue
- extends GeneratedValue, XmlContextNode
-{
- /**
- * Return the (best guess) text location of the generator.
- */
- TextRange getGeneratorTextRange();
-
- /**
- * Update the OrmGeneratedValue context model object to match the XmlGeneratedValue
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlGeneratedValue generatedValue);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.java
deleted file mode 100644
index bb20a975ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGenerator.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmGenerator
- extends Generator
-{
- // **************** validation *********************************************
-
- TextRange getNameTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorContainer.java
deleted file mode 100644
index caf5ee6625..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmGeneratorContainer.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.GeneratorContainer;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmGeneratorContainer
- extends GeneratorContainer, XmlContextNode
-{
- OrmSequenceGenerator getSequenceGenerator();
-
- OrmSequenceGenerator addSequenceGenerator();
-
- OrmTableGenerator getTableGenerator();
-
- OrmTableGenerator addTableGenerator();
-
- void update();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdClassReference.java
deleted file mode 100644
index 29130b5174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdClassReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.IdClassReference;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmIdClassReference
- extends IdClassReference, XmlContextNode
-{
- void update(JavaIdClassReference javaIdClassReference);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java
deleted file mode 100644
index c4c8464381..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmIdMapping.java
+++ /dev/null
@@ -1,35 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.IdMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmIdMapping
- extends IdMapping, OrmColumnMapping, OrmAttributeMapping
-{
-
- //********* covariant overrides **********
- OrmGeneratorContainer getGeneratorContainer();
-
- OrmConverter getConverter();
-
- OrmGeneratedValue getGeneratedValue();
- OrmGeneratedValue addGeneratedValue();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java
deleted file mode 100644
index 09be95b903..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumn.java
+++ /dev/null
@@ -1,47 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-
-/**
- * orm.xml join column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmJoinColumn
- extends JoinColumn, OrmBaseJoinColumn, OrmBaseColumn
-{
- /**
- * Initialize the join column from the specified old join column.
- */
- void initializeFrom(JoinColumn oldJoinColumn);
-
- /**
- * Update the join column from the specified XML.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(XmlJoinColumn xmlJoinColumn);
-
- interface Owner
- extends JoinColumn.Owner, OrmBaseJoinColumn.Owner, OrmBaseColumn.Owner
- {
- // nothing?
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index dd6828b024..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnEnabledRelationshipReference.java
+++ /dev/null
@@ -1,32 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinColumnEnabledRelationshipReference
- extends OrmRelationshipReference, JoinColumnEnabledRelationshipReference
-{
- XmlJoinColumnsMapping getResourceMapping();
-
- OrmJoinColumnJoiningStrategy getJoinColumnJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnInAssociationOverrideJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnInAssociationOverrideJoiningStrategy.java
deleted file mode 100644
index 34e7cd6768..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnInAssociationOverrideJoiningStrategy.java
+++ /dev/null
@@ -1,32 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinColumnInAssociationOverrideJoiningStrategy
- extends XmlContextNode, OrmJoinColumnJoiningStrategy
-{
- void update(XmlAssociationOverride xao);
-
- ListIterator<OrmJoinColumn> joinColumns();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnJoiningStrategy.java
deleted file mode 100644
index 70be6e22ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnJoiningStrategy.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-
-/**
- * The orm.xml representation of a {@link JoinColumnJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinColumnJoiningStrategy
- extends OrmJoiningStrategy, JoinColumnJoiningStrategy
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.java
deleted file mode 100644
index 636afcc586..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTable.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinTable;
-
-/**
- * orm.xml join table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmJoinTable
- extends JoinTable, OrmReferenceTable
-{
- void update();
-
- void initializeFrom(JoinTable oldJoinTable);
-
-
- // ********** covariant overrides **********
-
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> inverseJoinColumns();
-
- OrmJoinColumn getDefaultInverseJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedInverseJoinColumns();
-
- OrmJoinColumn addSpecifiedInverseJoinColumn(int index);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableEnabledRelationshipReference.java
deleted file mode 100644
index 5df53d84ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableEnabledRelationshipReference.java
+++ /dev/null
@@ -1,32 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinTableEnabledRelationshipReference
- extends OrmRelationshipReference, JoinTableEnabledRelationshipReference
-{
- XmlJoinTableMapping getResourceMapping();
-
- OrmJoinTableJoiningStrategy getJoinTableJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableJoiningStrategy.java
deleted file mode 100644
index 242600a7a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableJoiningStrategy.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-
-/**
- * The orm.xml representation of a {@link JoinTableJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinTableJoiningStrategy
- extends OrmJoiningStrategy, JoinTableJoiningStrategy
-{
- OrmJoinTable getJoinTable();
-
- OrmJoinTable addJoinTable();
-
- XmlJoinTable getResourceJoinTable();
-
- XmlJoinTable addResourceJoinTable();
-
- void removeResourceJoinTable();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoiningStrategy.java
deleted file mode 100644
index 1d19ee2dd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoiningStrategy.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-
-/**
- * The orm.xml representation of a {@link JoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoiningStrategy
- extends XmlContextNode, JoiningStrategy
-{
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
deleted file mode 100644
index c915e4eeab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-/**
- * The orm.xml representation of a {@link ManyToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmManyToManyMapping
- extends ManyToManyMapping, OrmMultiRelationshipMapping
-{
- XmlManyToMany getResourceAttributeMapping();
-
- OrmManyToManyRelationshipReference getRelationshipReference();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyRelationshipReference.java
deleted file mode 100644
index 10dc2028d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToManyRelationshipReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-
-/**
- * Represents the {@link RelationshipReference} of an {@link OrmManyToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmManyToManyRelationshipReference
- extends ManyToManyRelationshipReference, OrmOwnableRelationshipReference,
- OrmJoinTableEnabledRelationshipReference
-{
- XmlManyToMany getResourceMapping();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java
deleted file mode 100644
index 2e6eea9772..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-/**
- * The orm.xml representation of a {@link ManyToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmManyToOneMapping
- extends ManyToOneMapping, OrmSingleRelationshipMapping
-{
- XmlManyToOne getResourceAttributeMapping();
-
- OrmManyToOneRelationshipReference getRelationshipReference();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneRelationshipReference.java
deleted file mode 100644
index 3b25b53a47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmManyToOneRelationshipReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.ManyToOneRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-/**
- * Represents the {@link RelationshipReference} of an {@link OrmManyToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmManyToOneRelationshipReference
- extends ManyToOneRelationshipReference,
- OrmJoinColumnEnabledRelationshipReference
-{
- XmlManyToOne getResourceMapping();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByJoiningStrategy.java
deleted file mode 100644
index d58a803dbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByJoiningStrategy.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.MappedByJoiningStrategy;
-
-/**
- * The orm.xml representation of a {@link MappedByJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmMappedByJoiningStrategy
- extends OrmJoiningStrategy, MappedByJoiningStrategy
-{
- //nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.java
deleted file mode 100644
index 63a6326825..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedSuperclass.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmMappedSuperclass
- extends MappedSuperclass, OrmTypeMapping
-{
- /**
- * Return the Java Mapped Superclass this ORM MappedSuperclass corresponds to.
- * Return null if there is no java persistent type or it is not a mapped superclass.
- */
- JavaMappedSuperclass getJavaMappedSuperclass();
-
- OrmIdClassReference getIdClassReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.java
deleted file mode 100644
index a8aa7857fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMultiRelationshipMapping.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.MultiRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping;
-
-/**
- * ORM multi-valued (1:m, m:m) relationship 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.0
- */
-public interface OrmMultiRelationshipMapping
- extends OrmRelationshipMapping, MultiRelationshipMapping
-{
- AbstractXmlMultiRelationshipMapping getResourceAttributeMapping();
-
-
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java
deleted file mode 100644
index 733695757f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedColumn.java
+++ /dev/null
@@ -1,51 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmNamedColumn
- extends NamedColumn, XmlContextNode
-{
-
- /**
- * Return the (best guess) text location of the column's name.
- */
- TextRange getNameTextRange();
-
- /**
- * interface allowing columns to be used in multiple places
- * (e.g. basic mappings and attribute overrides)
- */
- interface Owner extends NamedColumn.Owner
- {
- /**
- * Return the column owner's text range. This can be returned by the
- * column when its annotation is not present.
- */
- TextRange getValidationTextRange();
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.java
deleted file mode 100644
index fc936cabb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedNativeQuery.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmNamedNativeQuery
- extends OrmQuery, NamedNativeQuery
-{
- ListIterator<OrmQueryHint> hints();
-
- /**
- * Update the OrmNamedNativeQuery context model object to match the XmlNamedNativeQuery
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlNamedNativeQuery resourceQuery);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.java
deleted file mode 100644
index 76422f6732..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmNamedQuery.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmNamedQuery
- extends OrmQuery, NamedQuery
-{
- ListIterator<OrmQueryHint> hints();
-
- /**
- * Update the OrmNamedQuery context model object to match the XmlNamedQuery
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlNamedQuery queryResource);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java
deleted file mode 100644
index e1af03d9c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-/**
- * The orm.xml representation of a {@link OneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmOneToManyMapping
- extends OneToManyMapping, OrmMultiRelationshipMapping
-{
- XmlOneToMany getResourceAttributeMapping();
-
- OrmOneToManyRelationshipReference getRelationshipReference();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyRelationshipReference.java
deleted file mode 100644
index f8b5b1dd02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToManyRelationshipReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OneToManyRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-/**
- * Represents the {@link RelationshipReference} of an {@link OrmOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOneToManyRelationshipReference
- extends OneToManyRelationshipReference, OrmOwnableRelationshipReference,
- OrmJoinTableEnabledRelationshipReference
-{
- XmlOneToMany getResourceMapping();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java
deleted file mode 100644
index c358f85837..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-/**
- * The orm.xml representation of a {@link OneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmOneToOneMapping
- extends OneToOneMapping, OrmSingleRelationshipMapping
-{
- XmlOneToOne getResourceAttributeMapping();
-
- OrmOneToOneRelationshipReference getRelationshipReference();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneRelationshipReference.java
deleted file mode 100644
index 6168db0fc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOneToOneRelationshipReference.java
+++ /dev/null
@@ -1,36 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OneToOneRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-/**
- * Represents the {@link RelationshipReference} of an {@link OrmOneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOneToOneRelationshipReference
- extends OneToOneRelationshipReference,
- OrmOwnableRelationshipReference,
- OrmJoinColumnEnabledRelationshipReference,
- OrmPrimaryKeyJoinColumnEnabledRelationshipReference
-{
- XmlOneToOne getResourceMapping();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java
deleted file mode 100644
index e76573a137..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOrderable.java
+++ /dev/null
@@ -1,32 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOrderable
- extends Orderable, XmlContextNode
-{
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverrideContainer.java
deleted file mode 100644
index 7547c3343c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverrideContainer.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OverrideContainer;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOverrideContainer
- extends
- OverrideContainer,
- XmlContextNode
-{
-
- void update();
-
- interface Owner extends OverrideContainer.Owner
- {
- OrmTypeMapping getTypeMapping();
-
- TextRange getValidationTextRange();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOwnableRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOwnableRelationshipReference.java
deleted file mode 100644
index 227a0690c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOwnableRelationshipReference.java
+++ /dev/null
@@ -1,32 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.OwnableRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlMappedByMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOwnableRelationshipReference
- extends OrmRelationshipReference, OwnableRelationshipReference
-{
- XmlMappedByMapping getResourceMapping();
-
- OrmMappedByJoiningStrategy getMappedByJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java
deleted file mode 100644
index db9401c3a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,76 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.MappingFilePersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-/**
- * Context <code>orm.xml</code> persistence unit defaults.
- * Context model corresponding to the
- * XML resource model {@link XmlPersistenceUnitDefaults},
- * which corresponds to the <code>persistence-unit-defaults</code> element
- * in the <code>orm.xml</code> file.
- * <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 OrmPersistenceUnitDefaults
- extends XmlContextNode, MappingFilePersistenceUnitDefaults
-{
- AccessType getAccess();
- void setAccess(AccessType value);
- String ACCESS_PROPERTY = "access"; //$NON-NLS-1$
-
- SchemaContainer getDbSchemaContainer();
-
- /**
- * Return the specified catalog if present, otherwise return the default catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String newSpecifiedCatalog);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
- Catalog getDbCatalog();
-
- /**
- * Return the specified schema if present, otherwise return the default schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String newSpecifiedSchema);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
- Schema getDbSchema();
-
- boolean isCascadePersist();
- void setCascadePersist(boolean value);
- String CASCADE_PERSIST_PROPERTY = "cascadePersist"; //$NON-NLS-1$
-
- /**
- * Update the ORM persistence unit defaults context model to match the resource model.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
deleted file mode 100644
index 6d4a9ee181..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentAttribute.java
+++ /dev/null
@@ -1,118 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-/**
- * ORM persistent attribute
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmPersistentAttribute
- extends PersistentAttribute, XmlContextNode
-{
-
- // ********** covariant overrides **********
-
- OrmAttributeMapping getMapping();
-
- OrmAttributeMapping getSpecifiedMapping();
-
- OrmTypeMapping getOwningTypeMapping();
-
- OrmPersistentType getOwningPersistentType();
-
-
- // ********** java persistent attribute **********
-
- JavaPersistentAttribute getJavaPersistentAttribute();
- String JAVA_PERSISTENT_ATTRIBUTE_PROPERTY = "javaPersistentAttribute"; //$NON-NLS-1$
-
-
- // ********** virtual <-> specified **********
-
- /**
- * Make the persistent attribute virtual. The attribute will be removed
- * from the list of specified persistent attributes on the {@link OrmPersistentType}
- * and removed from the orm.xml file.
- *
- * If the persistent attribute is already virtual, an IllegalStateException is thrown
- * @see PersistentAttribute#isVirtual()
- */
- void makeVirtual();
-
- /**
- * Take a virtual persistent attribute and specify it.
- * The attribute will be added to the list of specified persistent attributes
- * and added to the orm.xml file. The mappingKey will remain the same.
- *
- * If the persistent attribute is already specified, an IllegalStateException is thrown
- * @see PersistentAttribute#isVirtual()
- */
- void makeSpecified();
-
- /**
- * Take a virtual persistent attribute and specify it.
- * The attribute will be added to the list of specified persistent attributes
- * and added to the orm.xml file. The mappingKey will determine the type of mapping added
- * instead of the mappingKey already on the persistent attribute
- *
- * If the persistent attribute is already specified, an IllegalStateException is thrown
- * @see PersistentAttribute#isVirtual()
- */
- void makeSpecified(String mappingKey);
-
-
- // ********** miscellaneous **********
-
- boolean contains(int textOffset);
-
- void nameChanged(String oldName, String newName);
-
- // ********** updating **********
-
- /**
- * Update the OrmPersistentAttribute context model object to match the
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
-
- /**
- * interface allowing persistent attributes to be used in multiple places
- * (e.g. virtual and specified orm persistent attributes)
- */
- interface Owner
- {
- /**
- * Return the java persistent attribute that corresponds (same name and access type)
- * to the given ormPersistentAttribute or null if none exists.
- */
- JavaPersistentAttribute findJavaPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute);
-
- /**
- * Update the java persistent attribute if necessary, if it is owned by this object,
- * it needs to be updated.
- */
- void updateJavaPersistentAttribute();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java
deleted file mode 100644
index 98dd9f9e97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPersistentType.java
+++ /dev/null
@@ -1,148 +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.core.context.orm;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-
-/**
- * Context <code>orm.xml</code> persistent type.
- * <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.0
- */
-public interface OrmPersistentType
- extends PersistentType, PersistentType.Owner, XmlContextNode
-{
- // ********** covariant overrides **********
-
- EntityMappings getParent();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPersistentAttribute> attributes();
-
- OrmPersistentAttribute getAttributeNamed(String attributeName);
-
- OrmTypeMapping getMapping();
-
-
- //***************** specified attributes ***********************************
-
- /**
- * Return a read only iterator of the specified {@link OrmPersistentAttribute}s.
- */
- ListIterator<OrmPersistentAttribute> specifiedAttributes();
-
- /**
- * Return the number of specified {@link OrmPersistentAttribute}s.
- */
- int specifiedAttributesSize();
-
- //TODO these are currently only used by tests, possibly remove them. OrmPersistenAttributes.setVirtual(boolean) is used by the UI
- OrmPersistentAttribute addSpecifiedAttribute(String mappingKey, String attributeName);
-
- void removeSpecifiedAttribute(OrmPersistentAttribute specifiedAttribute);
-
-
- //***************** virtual attributes *************************************
-
- String VIRTUAL_ATTRIBUTES_LIST = "virtualAttributes"; //$NON-NLS-1$
-
- /**
- * Return a read only iterator of the virtual orm persistent attributes. These
- * are attributes that exist in the underyling java class, but are not specified
- * in the orm.xml
- */
- ListIterator<OrmPersistentAttribute> virtualAttributes();
-
- /**
- * Return the number of virtual orm persistent attributes. These are attributes that
- * exist in the underyling java class, but are not specified in the orm.xml
- */
- int virtualAttributesSize();
-
- /**
- * Return whether this persistent type contains the given virtual persistent attribute.
- */
- boolean containsVirtualAttribute(OrmPersistentAttribute ormPersistentAttribute);
-
- /**
- * Remove the given specified orm persistent attribute from the orm.xml. The attribute
- * will be removed from the orm.xml and moved from the list of specified attributes
- * to the list of virtual attributes.
- */
- void makeAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute);
-
- /**
- * Add the given virtual orm persistent attribute to the orm.xml. The attribute will
- * be added to the orm.xml and moved from the list of virtual attributes to the list
- * of specified attributes
- */
- void makeAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute);
-
- /**
- * Add the given virtual orm persistent attribute to the orm.xml with a mapping of
- * type mappingKey. The attribute will be added to the orm.xml and moved from
- * the list of virtual attributes to the list of specified attributes
- */
- void makeAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute, String mappingKey);
-
-
- //******************* mapping morphing *******************
-
- void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping);
-
-
- //******************* updating *******************
-
- /**
- * Update the OrmPersistentType context model object to match the
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
-
- boolean contains(int textOffset);
-
- /**
- * Return whether the persistent type applies to the
- * specified type.
- */
- boolean isFor(String typeName);
-
- void classChanged(String oldClass, String newClass);
-
- /**
- * Return the Java persistent type that is referred to by this orm.xml persistent type.
- * If there is no underlying java persistent type, then null is returned.
- */
- JavaPersistentType getJavaPersistentType();
- String JAVA_PERSISTENT_TYPE_PROPERTY = "javaPersistentType"; //$NON-NLS-1$
-
- /**
- * Return the persistent type's default package.
- */
- String getDefaultPackage();
-
- /**
- * Return whether the persistent type is default metadata complete.
- */
- boolean isDefaultMetadataComplete();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.java
deleted file mode 100644
index e7d0fc2736..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumn.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmPrimaryKeyJoinColumn
- extends PrimaryKeyJoinColumn, OrmBaseJoinColumn
-{
- /**
- * Update the OrmPrimaryKeyJoinColumn context model object to match the XmlPrimaryKeyJoinColumn
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlPrimaryKeyJoinColumn column);
-
- void initializeFrom(PrimaryKeyJoinColumn oldPkJoinColumn);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnEnabledRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnEnabledRelationshipReference.java
deleted file mode 100644
index b63fbb7cee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnEnabledRelationshipReference.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumnEnabledRelationshipReference;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmPrimaryKeyJoinColumnEnabledRelationshipReference
- extends OrmRelationshipReference,
- PrimaryKeyJoinColumnEnabledRelationshipReference
-{
- OrmPrimaryKeyJoinColumnJoiningStrategy getPrimaryKeyJoinColumnJoiningStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index 79ec8474e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnJoiningStrategy.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumnJoiningStrategy;
-
-/**
- * The orm.xml representation of a {@link PrimaryKeyJoinColumnJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmPrimaryKeyJoinColumnJoiningStrategy
- extends OrmJoiningStrategy, PrimaryKeyJoinColumnJoiningStrategy
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.java
deleted file mode 100644
index d4b72f8f46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQuery.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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmQuery
- extends Query, XmlContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmQueryHint> hints();
-
- OrmQueryHint addHint(int index);
-
-
- // **************** validation *********************************************
-
- TextRange getNameTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryContainer.java
deleted file mode 100644
index 4b628b21aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryContainer.java
+++ /dev/null
@@ -1,43 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.QueryContainer;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- * The orm.xml representation of a {@link PrimaryKeyJoinColumnJoiningStrategy}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmQueryContainer
- extends QueryContainer, XmlContextNode
-{
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedQuery> namedQueries();
-
- OrmNamedQuery addNamedQuery(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmNamedNativeQuery> namedNativeQueries();
-
- OrmNamedNativeQuery addNamedNativeQuery(int index);
-
- void update();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java
deleted file mode 100644
index f3145d897c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmQueryHint.java
+++ /dev/null
@@ -1,36 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
-*/
-public interface OrmQueryHint
- extends QueryHint, XmlContextNode
-{
- /**
- * Update the OrmQueryHint context model object to match the XmlQueryHint
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlQueryHint resourceQueryHint);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReferenceTable.java
deleted file mode 100644
index 424756b74c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReferenceTable.java
+++ /dev/null
@@ -1,48 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.ReferenceTable;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- * orm.xml join table and collection table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmReferenceTable
- extends ReferenceTable, XmlContextNode
-{
- // ********** covariant overrides **********
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.java
deleted file mode 100644
index 944f7997a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipMapping.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCascade2_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.
- *
- * @version 2.3
- * @since 2.0
- */
-public interface OrmRelationshipMapping
- extends OrmAttributeMapping, RelationshipMapping
-{
- OrmRelationshipReference getRelationshipReference();
-
- OrmCascade2_0 getCascade();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipReference.java
deleted file mode 100644
index c173b932d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationshipReference.java
+++ /dev/null
@@ -1,45 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.XmlContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmRelationshipReference
- extends XmlContextNode, RelationshipReference
-{
- OrmRelationshipMapping getRelationshipMapping();
-
- OrmJoiningStrategy getPredominantJoiningStrategy();
-
- void update();
-
- void initializeOn(OrmRelationshipReference newRelationshipReference);
-
- void initializeFromOwnableRelationshipReference(
- OrmOwnableRelationshipReference oldRelationshipReference);
-
- void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference);
-
- void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java
deleted file mode 100644
index f504c4ee2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSecondaryTable.java
+++ /dev/null
@@ -1,60 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmSecondaryTable
- extends SecondaryTable, XmlContextNode
-{
-
- /**
- * Update the OrmSecondaryTable context model object to match the XmlSecondaryTable
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlSecondaryTable secondaryTable);
-
- void initializeFrom(SecondaryTable oldSecondaryTable);
-
-
- //************ covariant overrides *************
-
- OrmEntity getParent();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn();
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns();
-
- OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index);
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.java
deleted file mode 100644
index 85f240c2a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSequenceGenerator.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmSequenceGenerator
- extends SequenceGenerator, OrmGenerator, XmlContextNode
-{
-
- /**
- * Update the OrmSequenceGenerator context model object to match the XmlSequenceGenerator
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlSequenceGenerator sequenceGenerator);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.java
deleted file mode 100644
index 7e80f571b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmSingleRelationshipMapping.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.core.context.orm;
-
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmSingleRelationshipMapping
- extends OrmRelationshipMapping, SingleRelationshipMapping
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java
deleted file mode 100644
index b5ae82faa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmStructureNodes.java
+++ /dev/null
@@ -1,35 +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.core.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmStructureNodes
-{
-
- String ENTITY_MAPPINGS_ID = JptCorePlugin.PLUGIN_ID + ".orm.entityMappings"; //$NON-NLS-1$
-
- String PERSISTENT_TYPE_ID = JptCorePlugin.PLUGIN_ID + ".orm.persistentType"; //$NON-NLS-1$
-
- String PERSISTENT_ATTRIBUTE_ID = JptCorePlugin.PLUGIN_ID + ".orm.persistentAttribute"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java
deleted file mode 100644
index 818ac502c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTable.java
+++ /dev/null
@@ -1,48 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmTable
- extends Table, XmlContextNode
-{
- void initialize(XmlEntity resourceEntity);
-
- /**
- * Update the OrmTable context model object to match the XmlEntity
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlEntity resourceEntity);
-
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java
deleted file mode 100644
index a9854b507b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTableGenerator.java
+++ /dev/null
@@ -1,46 +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.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmTableGenerator
- extends TableGenerator, OrmGenerator, XmlContextNode
-{
-
- /**
- * Update the OrmTableGenerator context model object to match the XmlTableGenerator
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlTableGenerator tableGenerator);
-
- //****************** covariant overrides *******************
-
- @SuppressWarnings("unchecked")
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java
deleted file mode 100644
index 02f13b50d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTransientMapping.java
+++ /dev/null
@@ -1,29 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.TransientMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmTransientMapping
- extends TransientMapping, OrmAttributeMapping
-{
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java
deleted file mode 100644
index dbb68f8532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMapping.java
+++ /dev/null
@@ -1,91 +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.core.context.orm;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmTypeMapping
- extends TypeMapping, XmlContextNode
-{
-
- String getClass_();
- void setClass(String newClass);
- String CLASS_PROPERTY = "class"; //$NON-NLS-1$
-
-
- boolean isMetadataComplete();
- Boolean getSpecifiedMetadataComplete();
- void setSpecifiedMetadataComplete(Boolean newSpecifiedMetadataComplete);
- String SPECIFIED_METADATA_COMPLETE_PROPERTY = "specifiedMetadataComplete"; //$NON-NLS-1$
-
- boolean isDefaultMetadataComplete();
- String DEFAULT_METADATA_COMPLETE_PROPERTY = "defaultMetadataComplete"; //$NON-NLS-1$
-
-
- /**
- * type mappings are a sequence in the orm schema. We must keep
- * the list of type mappings in the appropriate order so the wtp xml
- * translators will write them to the xml in that order and they
- * will adhere to the schema.
- *
- * Each concrete subclass of XmlTypeMapping must implement this
- * method and return an int that matches it's order in the schema
- * @return
- */
- int getXmlSequence();
-
- void addToResourceModel(XmlEntityMappings entityMappings);
-
- void removeFromResourceModel(XmlEntityMappings entityMappings);
-
- void initializeFrom(OrmTypeMapping oldMapping);
-
- XmlTypeMapping getResourceTypeMapping();
-
- TextRange getSelectionTextRange();
-
- TextRange getClassTextRange();
-
- TextRange getAttributesTextRange();
-
- boolean containsOffset(int textOffset);
-
- /**
- * Update the OrmTypeMapping context model object to match the
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
- // ********** covariant overrides **********
-
- OrmPersistentType getPersistentType();
-
- @SuppressWarnings("unchecked")
- Iterator<OrmAttributeMapping> attributeMappings();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingDefinition.java
deleted file mode 100644
index 5b2229ea75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmTypeMappingDefinition.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-
-/**
- * Part of mechanism to extend the types of ORM type mappings.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmTypeMappingDefinition
-{
- /**
- * Return the mapping key associated with this provider
- * @see {@link MappingKeys}
- */
- String getKey();
-
- /**
- * Build a resource mapping
- */
- XmlTypeMapping buildResourceMapping(EFactory factory);
-
- /**
- * Build a context mapping
- */
- OrmTypeMapping buildContextMapping(
- OrmPersistentType parent,
- XmlTypeMapping resourceMapping,
- OrmXmlContextNodeFactory factory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.java
deleted file mode 100644
index aa64860cdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmUniqueConstraint.java
+++ /dev/null
@@ -1,36 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmUniqueConstraint
- extends UniqueConstraint, XmlContextNode
-{
- /**
- * Update the OrmUniqueConstraint context model object to match the XmlUniqueConstraint
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlUniqueConstraint uniqueConstraint);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java
deleted file mode 100644
index 6450000b3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVersionMapping.java
+++ /dev/null
@@ -1,33 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.VersionMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrmVersionMapping
- extends VersionMapping, OrmColumnMapping, OrmAttributeMapping
-{
-
- //********* covariant overrides **********
- OrmConverter getConverter();
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java
deleted file mode 100644
index 89f1a24a74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXml.java
+++ /dev/null
@@ -1,41 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.MappingFile;
-
-/**
- * JPA <code>orm.xml</code> file.
- * <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.0
- */
-public interface OrmXml
- extends MappingFile
-{
- // ********** entity mappings **********
-
- /**
- * String constant associated with changes to the entity-mappings property
- */
- public final static String ENTITY_MAPPINGS_PROPERTY = "entityMappings"; //$NON-NLS-1$
-
- /**
- * Return the content represented by the root of the <code>orm.xml</code> file.
- * This may be null.
- */
- EntityMappings getEntityMappings();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
deleted file mode 100644
index 9a6c76f34c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,195 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmXmlContextNodeFactory
-{
- // ********** ORM Context Model **********
-
- EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings entityMappings);
-
- PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent);
-
- OrmPersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent);
-
- OrmPersistentType buildOrmPersistentType(EntityMappings parent, XmlTypeMapping resourceMapping);
-
- OrmEntity buildOrmEntity(OrmPersistentType parent, XmlEntity resourceMapping);
-
- OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent, XmlMappedSuperclass resourceMapping);
-
- OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent, XmlEmbeddable resourceMapping);
-
- OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, XmlAttributeMapping resourceMapping);
-
- OrmTable buildOrmTable(OrmEntity parent);
-
- OrmSecondaryTable buildOrmSecondaryTable(OrmEntity parent, XmlSecondaryTable xmlSecondaryTable);
-
- OrmPrimaryKeyJoinColumn buildOrmPrimaryKeyJoinColumn(XmlContextNode parent, OrmBaseJoinColumn.Owner owner, XmlPrimaryKeyJoinColumn resourcePkJoinColumn);
-
- OrmJoinTable buildOrmJoinTable(OrmJoinTableJoiningStrategy parent, XmlJoinTable resourceJoinTable);
-
- OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn resourceJoinColumn);
-
- OrmAttributeOverrideContainer buildOrmAttributeOverrideContainer(XmlContextNode parent, OrmAttributeOverrideContainer.Owner owner);
-
- OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(XmlContextNode parent, OrmAssociationOverrideContainer.Owner owner);
-
- OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride);
-
- OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride associationOverride);
-
- OrmAssociationOverrideRelationshipReference buildOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, XmlAssociationOverride associationOverride);
-
- OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmDiscriminatorColumn.Owner owner);
-
- OrmColumn buildOrmColumn(XmlContextNode parent, OrmColumn.Owner owner);
-
- OrmGeneratedValue buildOrmGeneratedValue(XmlContextNode parent, XmlGeneratedValue resourceGeneratedValue);
-
- OrmGeneratorContainer buildOrmGeneratorContainer(XmlContextNode parent, XmlGeneratorContainer resourceGeneratorContainer);
-
- OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator);
-
- OrmTableGenerator buildOrmTableGenerator(XmlContextNode parent, XmlTableGenerator resourceTableGenerator);
-
- OrmQueryContainer buildOrmQueryContainer(XmlContextNode parent, XmlQueryContainer resourceQueryContainer);
-
- OrmNamedNativeQuery buildOrmNamedNativeQuery(XmlContextNode parent, XmlNamedNativeQuery resourceNamedQuery);
-
- OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery);
-
- OrmQueryHint buildOrmQueryHint(OrmQuery parent, XmlQueryHint resourceQueryhint);
-
- OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent, XmlBasic resourceMapping);
-
- OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany resourceMapping);
-
- OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany resourceMapping);
-
- OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping);
-
- OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping);
-
- OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId resourceMapping);
-
- OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded resourceMapping);
-
- OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, XmlId resourceMapping);
-
- OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent, XmlTransient resourceMapping);
-
- OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent, XmlVersion resourceMapping);
-
- OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping);
-
- OrmAttributeMapping buildUnsupportedOrmAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping);
-
- OrmUniqueConstraint buildOrmUniqueConstraint(XmlContextNode parent, UniqueConstraint.Owner owner, XmlUniqueConstraint resourceUniqueConstraint);
-
- OrmConverter buildOrmEnumeratedConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping);
-
- OrmConverter buildOrmTemporalConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping);
-
- OrmConverter buildOrmLobConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping);
-
- OrmConverter buildOrmNullConverter(OrmAttributeMapping parent);
-
- OrmOrderable buildOrmOrderable(OrmAttributeMapping parent, Orderable.Owner owner);
-
- // ********** ORM Virtual Resource Model **********
-
- XmlAssociationOverride buildVirtualXmlAssociationOverride(String name, OrmTypeMapping parent, JoiningStrategy joiningStrategy);
-
- XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping);
-
- XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping);
-
- XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping);
-
- XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping);
-
- XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping);
-
- XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping);
-
- XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping);
-
- XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping);
-
- XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping);
-
- XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping);
-
- XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlDefinition.java
deleted file mode 100644
index abb7f62627..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlDefinition.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.core.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmXmlDefinition
- extends MappingFileDefinition
-{
- /**
- * Return the factory for building xml resource nodes
- */
- EFactory getResourceNodeFactory();
-
- /**
- * Return the factory for building xml context nodes
- */
- OrmXmlContextNodeFactory getContextNodeFactory();
-
-
- // ********** ORM type/attribute mappings **********
-
- /**
- * Return an {@link OrmTypeMappingDefinition} for the given type mapping key.
- * Throws an {@link IllegalArgumentException} if the mapping key is not supported.
- *
- * @param mappingKey The type mapping key
- * @return The mapping provider for the given mapping key
- */
- OrmTypeMappingDefinition getOrmTypeMappingDefinition(String mappingKey);
-
- /**
- * Return an {@link OrmAttributeMappingDefinition} for the given attribute mapping key.
- * This must not return null. (@see {@link NullOrmAttributeMappingDefinition})
- * Throws an {@link IllegalArgumentException} if the mapping key is not supported.
- *
- * @param mappingKey The attribute mapping key
- * @return The mapping definition for the given mapping key
- */
- OrmAttributeMappingDefinition getOrmAttributeMappingDefinition(String mappingKey);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
deleted file mode 100644
index 4aeed8a4b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/PersistenceUnitMetadata.java
+++ /dev/null
@@ -1,55 +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.core.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-
-/**
- * Context <code>orm.xml</code> persistence unit metadata.
- * Context model corresponding to the
- * XML resource model {@link XmlPersistenceUnitMetadata},
- * which corresponds to the <code>persistence-unit-metadata</code> element
- * in the <code>orm.xml</code> file.
- * <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.0
- */
-public interface PersistenceUnitMetadata
- extends XmlContextNode
-{
- EntityMappings getParent();
-
- XmlEntityMappings getXmlEntityMappings();
-
- boolean isXmlMappingMetadataComplete();
- void setXmlMappingMetadataComplete(boolean value);
- String XML_MAPPING_METADATA_COMPLETE_PROPERTY = "xmlMappingMetadataComplete"; //$NON-NLS-1$
-
- OrmPersistenceUnitDefaults getPersistenceUnitDefaults();
-
- XmlPersistenceUnitMetadata getXmlPersistenceUnitMetadata();
-
- XmlPersistenceUnitMetadata buildXmlPersistenceUnitMetadata();
-
- /**
- * Update the persistence unit metadata context model to match the resource model.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/UnsupportedOrmAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/UnsupportedOrmAttributeMappingDefinition.java
deleted file mode 100644
index 243d482d43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/UnsupportedOrmAttributeMappingDefinition.java
+++ /dev/null
@@ -1,67 +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.core.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 UnsupportedOrmAttributeMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new UnsupportedOrmAttributeMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private UnsupportedOrmAttributeMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- throw new UnsupportedOperationException();
- }
-
- public OrmAttributeMapping buildContextMapping(OrmPersistentAttribute parent, XmlAttributeMapping resourceMapping, OrmXmlContextNodeFactory factory) {
- return factory.buildUnsupportedOrmAttributeMapping(parent, (XmlNullAttributeMapping) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping, OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
deleted file mode 100644
index e7f3f4a46d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/ClassRef.java
+++ /dev/null
@@ -1,108 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-
-/**
- * Context model corresponding to the XML resource model
- * {@link XmlJavaClassRef}, which corresponds to the <code>class<code> element
- * in the <code>persistence.xml</code> file.
- * This is also used for "implied" class refs; i.e. class refs that are not
- * explicitly listed in the <code>persistence.xml</code> file.
- * <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.0
- */
-public interface ClassRef
- extends XmlContextNode, JpaStructureNode, PersistentType.Owner
-{
- /**
- * Return whether the class ref is a reference to the specified type.
- */
- boolean isFor(String typeName);
-
- /**
- * Return true if the mapping file ref is "virtual";
- * return false if the mapping file ref is represented by an entry in the
- * persistence.xml file.
- */
- boolean isVirtual();
-
- XmlJavaClassRef getResourceClassRef();
-
- // **************** class name *********************************************
-
- /**
- * String constant associated with changes to the class name
- */
- final static String CLASS_NAME_PROPERTY = "className"; //$NON-NLS-1$
-
- /**
- * Return the class name of the class ref.
- */
- String getClassName();
-
- /**
- * Set the class name of the class ref.
- */
- void setClassName(String className);
-
-
- // **************** java persistent type ***********************************
-
- /**
- * String constant associated with changes to the java persistent type
- */
- final static String JAVA_PERSISTENT_TYPE_PROPERTY = "javaPersistentType"; //$NON-NLS-1$
-
- /**
- * Return the JavaPersistentType that corresponds to this IClassRef.
- * This can be null.
- * This is not settable by users of this API.
- */
- JavaPersistentType getJavaPersistentType();
-
-
- // **************** update **************************************
-
- /**
- * Update the ClassRef context model object to match the XmlJavaClassRef
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update();
-
- /**
- * Update the ClassRef context model object to match the className. This is used
- * for impliedClassRefs in the PersistenceUnit.
- * see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(String className);
-
-
- // *************************************************************************
-
- /**
- * Return whether the text representation of this persistence unit contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/JarFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/JarFileRef.java
deleted file mode 100644
index 4bb8fce0b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/JarFileRef.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.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JarFile;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-
-/**
- * Context model corresponding to the
- * XML resource model {@link XmlJarRef},
- * which corresponds to the <code>jar-file</code>
- * element in the <code>persistence.xml</code> file.
- * <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 JarFileRef
- extends XmlContextNode, JpaStructureNode, PersistentTypeContainer
-{
- // **************** file name **********************************************
-
- /**
- * String constant associated with changes to the file name.
- */
- String FILE_NAME_PROPERTY = "fileName"; //$NON-NLS-1$
-
- /**
- * Return the file name of the jar file ref.
- */
- String getFileName();
-
- /**
- * Set the file name of the jar file ref.
- */
- void setFileName(String fileName);
-
-
- // **************** JAR file ***********************************************
-
- /**
- * String constant associated with changes to the JAR file.
- */
- String JAR_FILE_PROPERTY = "jarFile"; //$NON-NLS-1$
-
- /**
- * Return the JAR file ref's JAR file corresponding to the file name.
- */
- JarFile getJarFile();
-
-
- // **************** updating ***********************************************
-
- /**
- * Update the context JAR file ref to match the specified XML JAR file ref.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(XmlJarFileRef xmlJarFileRef);
-
-
- // **************** queries ************************************************
-
- /**
- * Return the persistent type, as listed in the JAR file,
- * with the specified name. Return null if it does not exists.
- */
- PersistentType getPersistentType(String typeName);
-
- /**
- * Return whether the text representation of the JAR file ref contains
- * the specified text offset.
- */
- boolean containsOffset(int textOffset);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
deleted file mode 100644
index 52b0e62e4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/MappingFileRef.java
+++ /dev/null
@@ -1,109 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.MappingFilePersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-
-/**
- * Context model corresponding to the
- * XML resource model {@link XmlMappingFileRef},
- * which corresponds to the <code>mapping-file</code> element
- * in the <code>persistence.xml</code> file.
- * <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.0
- */
-public interface MappingFileRef
- extends XmlContextNode, JpaStructureNode, PersistentTypeContainer
-{
- // ********** file name **********
-
- /**
- * String constant associated with changes to the file name.
- */
- String FILE_NAME_PROPERTY = "fileName"; //$NON-NLS-1$
-
- /**
- * Return the file name of the mapping file ref.
- */
- String getFileName();
-
- /**
- * Set the file name of the mapping file ref.
- */
- void setFileName(String fileName);
-
-
- // ********** mapping file (orm.xml) **********
-
- /**
- * String constant associated with changes to the mapping file.
- */
- String MAPPING_FILE_PROPERTY = "mappingFile"; //$NON-NLS-1$
-
- /**
- * Return mapping file corresponding to the mapping file ref's file name.
- */
- MappingFile getMappingFile();
-
-
- // ********** updating **********
-
- /**
- * Update the mapping file ref context model to match the specified
- * resource model. The refs are ordered within the <code>persistence.xml</code>
- * file, so they are updated sequentially, in place, not matched up by name
- * (i.e. the resource model can change).
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update(XmlMappingFileRef mappingFileRef);
-
-
- // ********** queries **********
-
- /**
- * Return whether the mapping file ref is "implied" by, or explicitly
- * specified in, the <code>persistence.xml</code>.
- */
- boolean isImplied();
-
- /**
- * Return the mapping file's persistence unit defaults.
- */
- MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults();
-
- /**
- * Return whether the mapping file's persistence unit defaults exist.
- */
- boolean persistenceUnitDefaultsExists();
-
- /**
- * Return the persistent type, as listed in the mapping file,
- * with the specified name. Return null if it does not exists.
- */
- PersistentType getPersistentType(String typeName);
-
- /**
- * Return whether the specified text offset is within
- * the text representation of the mapping file.
- */
- boolean containsOffset(int textOffset);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
deleted file mode 100644
index 685e24e13b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/Persistence.java
+++ /dev/null
@@ -1,102 +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.core.context.persistence;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-
-/**
- * The <code>persistence</code> element in the JPA <code>persistence.xml</code> file.
- * <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.0
- */
-public interface Persistence
- extends XmlContextNode, JpaStructureNode
-{
- /**
- * Return the resource model object associated with this context model object
- */
- XmlPersistence getXmlPersistence();
-
- /**
- * Covariant override.
- */
- PersistenceXml getParent();
-
- // **************** persistence units **************************************
-
- /**
- * String constant associated with changes to the persistence units list
- */
- String PERSISTENCE_UNITS_LIST = "persistenceUnits"; //$NON-NLS-1$
-
- /**
- * Return an iterator on the list of persistence units.
- * This will not be null.
- */
- ListIterator<PersistenceUnit> persistenceUnits();
-
- /**
- * Return the size of the persistence unit list.
- * @return
- */
- int persistenceUnitsSize();
-
- /**
- * Add a persistence unit to the persistence node and return the object
- * representing it.
- */
- PersistenceUnit addPersistenceUnit();
-
- /**
- * Add a persistence unit to the persistence node at the specified index and
- * return the object representing it.
- */
- PersistenceUnit addPersistenceUnit(int index);
-
- /**
- * Remove the persistence unit from the persistence node.
- */
- void removePersistenceUnit(PersistenceUnit persistenceUnit);
-
- /**
- * Remove the persistence unit at the specified index from the persistence node.
- */
- void removePersistenceUnit(int index);
-
-
- // **************** updating ***********************************************
-
- /**
- * Update the Persistence context model object to match the XmlPersistence
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlPersistence persistence);
-
-
- // **************** text range *********************************************
-
- /**
- * Return whether the text representation of this persistence contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.java
deleted file mode 100644
index 5fa79280e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceStructureNodes.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.core.context.persistence;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface PersistenceStructureNodes
-{
- String PREFIX = JptCorePlugin.PLUGIN_ID_ + "persistence"; //$NON-NLS-1$
- String PREFIX_ = PREFIX + '.';
-
- String PERSISTENCE_ID = PREFIX_ + "persistence"; //$NON-NLS-1$
- String PERSISTENCE_UNIT_ID = PREFIX_ + "persistenceUnit"; //$NON-NLS-1$
- String CLASS_REF_ID = PREFIX_ + "classRef"; //$NON-NLS-1$
- String MAPPING_FILE_REF_ID = PREFIX_ + "mappingFileRef"; //$NON-NLS-1$
- String JAR_FILE_REF_ID = PREFIX_ + "jarFileRef"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java
deleted file mode 100644
index f7e3c23bfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnit.java
+++ /dev/null
@@ -1,709 +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.core.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-/**
- * Context model corresponding to the XML resource model {@link XmlPersistenceUnit},
- * which corresponds to the <code>persistence-unit</code> element in the
- * <code>persistence.xml</code> file.
- * <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.0
- */
-public interface PersistenceUnit
- extends XmlContextNode, JpaStructureNode
-{
- /**
- * Covariant override.
- */
- Persistence getParent();
-
-
- // ********** name **********
-
- /**
- * String constant associated with changes to the persistence unit's name.
- */
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's name.
- */
- String getName();
-
- /**
- * Set the persistence unit's name.
- */
- void setName(String name);
-
-
- // ********** transaction type **********
-
- /**
- * Return the persistence unit's transaction type,
- * whether specified or defaulted.
- */
- PersistenceUnitTransactionType getTransactionType();
-
- /**
- * String constant associated with changes to the persistence unit's
- * specified transaction type
- */
- String SPECIFIED_TRANSACTION_TYPE_PROPERTY = "specifiedTransactionType"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's specified transaction type.
- */
- PersistenceUnitTransactionType getSpecifiedTransactionType();
-
- /**
- * Set the persistence unit's specified transaction type.
- */
- void setSpecifiedTransactionType(PersistenceUnitTransactionType transactionType);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default transaction type (not typically changed).
- */
- String DEFAULT_TRANSACTION_TYPE_PROPERTY = "defaultTransactionType"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's default transaction type.
- */
- PersistenceUnitTransactionType getDefaultTransactionType();
-
-
- // ********** description **********
-
- /**
- * String constant associated with changes to the persistence unit's description.
- */
- String DESCRIPTION_PROPERTY = "description"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's description.
- */
- String getDescription();
-
- /**
- * Set the persistence unit's description.
- */
- void setDescription(String description);
-
-
- // ********** provider **********
-
- /**
- * String constant associated with changes to the persistence unit's provider.
- */
- String PROVIDER_PROPERTY = "provider"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's provider.
- */
- String getProvider();
-
- /**
- * Set the persistence unit's provider.
- */
- void setProvider(String provider);
-
-
- // ********** JTA data source **********
-
- /**
- * String constant associated with changes to the persistence unit's JTA data source
- */
- String JTA_DATA_SOURCE_PROPERTY = "jtaDataSource"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's JTA data source.
- */
- String getJtaDataSource();
-
- /**
- * Set the persistence unit's JTA data source.
- */
- void setJtaDataSource(String jtaDataSource);
-
-
- // ********** non-JTA data source **********
-
- /**
- * String constant associated with changes to the persistence unit's non-JTA data source
- */
- String NON_JTA_DATA_SOURCE_PROPERTY = "nonJtaDataSource"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's non-JTA data source.
- */
- String getNonJtaDataSource();
-
- /**
- * Set the persistence unit's non-JTA data source.
- */
- void setNonJtaDataSource(String nonJtaDataSource);
-
-
- // ********** mapping file refs **********
-
- /**
- * Return the persistence unit's list of mapping file refs,
- * both specified and implied.
- */
- ListIterator<MappingFileRef> mappingFileRefs();
-
- /**
- * Return the size of the persistence unit's list of mapping file refs,
- * both specified and implied.
- */
- int mappingFileRefsSize();
-
- /**
- * Return all the mapping file refs, both specified and implied,
- * containing the specified type.
- */
- Iterator<MappingFileRef> mappingFileRefsContaining(String typeName);
-
-
- // ********** specified mapping file refs **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * specified mapping file refs.
- */
- String SPECIFIED_MAPPING_FILE_REFS_LIST = "specifiedMappingFileRefs"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's list of specified mapping file refs.
- */
- ListIterator<MappingFileRef> specifiedMappingFileRefs();
-
- /**
- * Return the size of the persistence unit's list of specified mapping file refs.
- */
- int specifiedMappingFileRefsSize();
-
- /**
- * Add a new specified mapping file ref to the persistence unit;
- * return the newly-created mapping file ref.
- */
- MappingFileRef addSpecifiedMappingFileRef();
-
- /**
- * Add a new specified mapping file ref to the persistence unit at the specified index;
- * return the newly-created mapping file ref.
- */
- MappingFileRef addSpecifiedMappingFileRef(int index);
-
- /**
- * Remove the specified mapping file ref from the persistence unit.
- */
- void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef);
-
- /**
- * Remove the specified mapping file ref at the specified index from the persistence unit.
- */
- void removeSpecifiedMappingFileRef(int index);
-
-
- // ********** implied mapping file ref **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * implied mapping file ref.
- */
- String IMPLIED_MAPPING_FILE_REF_PROPERTY = "impliedMappingFileRef"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's implied mapping file ref.
- */
- MappingFileRef getImpliedMappingFileRef();
-
-
- // ********** jar file refs **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * JAR file refs.
- */
- String JAR_FILE_REFS_LIST = "jarFileRefs"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's list of JAR file refs.
- */
- ListIterator<JarFileRef> jarFileRefs();
-
- /**
- * Return the size of the persistence unit's list of JAR file refs.
- */
- int jarFileRefsSize();
-
- /**
- * Add a new JAR file ref to the persistence unit;
- * return the newly-created JAR file ref.
- */
- JarFileRef addJarFileRef();
-
- /**
- * Add a new JAR file ref to the persistence unit at the specified index;
- * return the newly-created JAR file ref.
- */
- JarFileRef addJarFileRef(int index);
-
- /**
- * Remove the specified JAR file ref from the persistence unit.
- */
- void removeJarFileRef(JarFileRef jarFileRef);
-
- /**
- * Remove the JAR file ref at the specified index from the persistence unit.
- */
- void removeJarFileRef(int index);
-
-
- // ********** class refs **********
-
- /**
- * Return the persistence unit's list of class refs,
- * both specified and implied.
- */
- Iterator<ClassRef> classRefs();
-
- /**
- * Return the size of the persistence unit's list of class refs,
- * both specified and implied.
- */
- int classRefsSize();
-
-
- // ********** specified class refs **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * specified class refs.
- */
- String SPECIFIED_CLASS_REFS_LIST = "specifiedClassRefs"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's list of specified class refs.
- */
- ListIterator<ClassRef> specifiedClassRefs();
-
- /**
- * Return the size of the persistence unit's list of specified mapping file refs.
- */
- int specifiedClassRefsSize();
-
- /**
- * Add a new specified class ref to the persistence unit;
- * return the newly-created class ref.
- */
- ClassRef addSpecifiedClassRef();
-
- /**
- * Add a new specified class ref to the persistence unit at the specified index;
- * return the newly-created class ref.
- */
- ClassRef addSpecifiedClassRef(int index);
-
- /**
- * Remove the specified class ref from the persistence unit.
- */
- void removeSpecifiedClassRef(ClassRef classRef);
-
- /**
- * Remove the specified class ref at the specified index from the persistence unit.
- */
- void removeSpecifiedClassRef(int index);
-
-
- // ********** implied class refs **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * implied class refs.
- */
- String IMPLIED_CLASS_REFS_COLLECTION = "impliedClassRefs"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's list of implied class refs.
- */
- Iterator<ClassRef> impliedClassRefs();
-
- /**
- * Return the size of the persistence unit's list of implied class refs.
- */
- int impliedClassRefsSize();
-
-
- // ********** exclude unlisted classes **********
-
- /**
- * Return whether the persistence unit excludes unlisted classes.
- */
- boolean excludesUnlistedClasses();
-
- /**
- * String constant associated with changes to the persistence unit's
- * "exclude unlisted classes" flag.
- */
- String SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY = "specifiedExcludeUnlistedClasses"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's specified "exclude unlisted classes" flag.
- */
- Boolean getSpecifiedExcludeUnlistedClasses();
-
- /**
- * Set the persistence unit's specified "exclude unlisted classes" flag.
- */
- void setSpecifiedExcludeUnlistedClasses(Boolean excludeUnlistedClasses);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default "exclude unlisted classes" flag (not typically changed).
- */
- String DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY = "defaultExcludeUnlistedClasses"; //$NON-NLS-1$
-
- /**
- * Return whether the persistence unit excludes unlisted classes by default.
- */
- boolean getDefaultExcludeUnlistedClasses();
-
-
- // ********** properties **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * properties.
- */
- String PROPERTIES_LIST = "properties"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's list of properties.
- */
- ListIterator<Property> properties();
-
- /**
- * Return the size of the persistence unit's list of properties.
- */
- int propertiesSize();
-
- /**
- * Return the *first* property in the persistence unit's property list with
- * the specified name. Return null if the list does not contain a property
- * with the specified name.
- */
- Property getProperty(String propertyName);
-
- /**
- * Return the persistence unit's properties with names beginning with the
- * specified prefix.
- */
- Iterator<Property> propertiesWithNamePrefix(String propertyNamePrefix);
-
- /**
- * Add a new property to the persistence unit;
- * return the newly-created property.
- */
- Property addProperty();
-
- /**
- * Add a new property to the persistence unit at the specified index;
- * return the newly-created property.
- */
- Property addProperty(int index);
-
- /**
- * Set the value of the *first* property in the persistence unit's property
- * list with the specified name to the specified value, creating a new
- * property if one does not already exist. If a property exists and the
- * specified value is null, the existing property is removed.
- */
- void setProperty(String propertyName, String value);
-
- /**
- * Set the value of the property with the specified name, creating a new
- * property if one does not exist or if the specified flag indicates
- * duplicate property names are allowed. If a property exists and duplicate
- * values are not allowed and the specified value is null, the existing
- * property is removed.
- */
- void setProperty(String propertyName, String value, boolean duplicatePropertyNamesAllowed);
-
- /**
- * Remove the specified property from the persistence unit.
- */
- void removeProperty(Property property);
-
- /**
- * Remove the *first* property in the persistence unit's property list
- * with the specified name.
- */
- void removeProperty(String propertyName);
-
- /**
- * Remove the *first* property in the persistence unit's property list
- * with the specified name and value, allowing the removal of properties
- * with duplicate property names.
- */
- void removeProperty(String propertyName, String value);
-
- /**
- * Call back method for Property name changing.
- */
- void propertyNameChanged(String oldPropertyName, String newPropertyName, String value);
-
- /**
- * Call back method for Property value changing.
- */
- void propertyValueChanged(String propertyName, String newValue);
-
- /**
- * Simple property interface.
- */
- interface Property
- extends XmlContextNode
- {
- PersistenceUnit getParent();
-
- @SuppressWarnings("hiding")
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
- String getName();
- void setName(String name);
-
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
- void setValue(String value);
- String getValue();
-
- XmlProperty getXmlProperty();
- void update();
- }
-
- // ********** ORM persistence unit defaults **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * default access type.
- */
- String DEFAULT_ACCESS_PROPERTY = "defaultAccess"; //$NON-NLS-1$
-
- /**
- * Return the default access type from the first persistence unit defaults
- * found in the persistence unit's list of mapping files.
- */
- AccessType getDefaultAccess();
-
- /**
- * String constant associated with changes to the persistence unit's
- * default database catalog.
- */
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
- /**
- * Return the default database catalog from the first persistence unit defaults
- * found in the persistence unit's list of mapping files.
- */
- String getDefaultCatalog();
-
- /**
- * String constant associated with changes to the persistence unit's
- * default database schema.
- */
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
- /**
- * Return the default database schema from the first persistence unit defaults
- * found in the persistence unit's list of mapping files.
- */
- String getDefaultSchema();
-
- /**
- * String constant associated with changes to the persistence unit's
- * default "cascade persist" flag.
- */
- String DEFAULT_CASCADE_PERSIST_PROPERTY = "defaultCascadePersist"; //$NON-NLS-1$
-
- /**
- * Return the default "cascade persist" flag from the first persistence unit defaults
- * found in the persistence unit's list of mapping files.
- */
- boolean getDefaultCascadePersist();
-
-
- // ********** generators **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * list of "global" generators.
- * NB: There are no granular list change notifications; only a "list changed"
- * notification when the list is rebuilt at the finish of the persistence
- * unit's "update".
- */
- String GENERATORS_LIST = "generators"; //$NON-NLS-1$
-
- /**
- * Return the list of generators defined within the persistence unit's scope,
- * including generators with duplicate names.
- */
- ListIterator<Generator> generators();
-
- /**
- * Return the size of the list of generators defined within the persistence unit's scope,
- * including generators with duplicate names.
- */
- int generatorsSize();
-
- /**
- * Add the specified generator (that is defined elsewhere) to the
- * list of generators defined within the persistence unit's scope.
- * NB: This is to be called by every generator during "update".
- * This method does not directly generate a change notification.
- * The change notification is fired at the end of the persistence unit's
- * "update", once all the generators have added themselves.
- */
- void addGenerator(Generator generator);
-
- /**
- * Return the names of the generators defined in the persistence
- * unit's scope, with duplicates removed.
- */
- String[] uniqueGeneratorNames();
-
-
- // ********** queries **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * list of "global" queries.
- * NB: There are no granular list change notifications; only a "list changed"
- * notification when the list is rebuilt at the finish of the persistence
- * unit's "update".
- */
- String QUERIES_LIST = "queries"; //$NON-NLS-1$
-
- /**
- * Return the list of queries defined within the persistence unit's scope,
- * including queries with duplicate names.
- */
- ListIterator<Query> queries();
-
- /**
- * Return the size of the list of queries defined within the persistence unit's scope,
- * including queries with duplicate names.
- */
- int queriesSize();
-
- /**
- * Add the specified query (that is defined elsewhere) to the
- * list of queries defined within the persistence unit's scope.
- * NB: This is to be called by every query during "update".
- * This method does not directly generate a change notification.
- * The change notification is fired at the end of the persistence unit's
- * "update", once all the queries have added themselves.
- */
- void addQuery(Query query);
-
-
- // ********** root entities **********
-
- /**
- * The entity with the given name is a root entity that has sub entities.
- * This will be stored by the persistence unit so that the entity can later
- * call {@link #entityIsRootWithSubEntities(String)}
- */
- void addRootEntityWithSubEntities(String entityName);
-
- /**
- * Return whether the entity with the given name is a root entity
- * that also has sub entities.
- * @see #addRootEntityWithSubEntities(String)
- */
- boolean entityIsRootWithSubEntities(String entityName);
-
-
- // ********** updating **********
-
- /**
- * Update the PersistenceUnit context model object to match the XmlPersistenceUnit
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlPersistenceUnit persistenceUnit);
-
-
- // ********** misc **********
-
- /**
- * Return the persistent type specified in the persistence unit with the
- * specified name.
- */
- PersistentType getPersistentType(String typeName);
-
- /**
- * Return whether the persistence unit specifies a persistent type with the
- * specified name (i.e. the type is listed either in the persistence unit's
- * list of specified classes or in one of the persistent unit's mapping files).
- */
- boolean specifiesPersistentType(String typeName);
-
- /**
- * Return the entity specified in the persistence unit with the
- * specified name. Return null if there is no persistent type
- * with the specified name or if the persistent type is not mapped as an
- * entity.
- * @see org.eclipse.jpt.core.MappingKeys#ENTITY_TYPE_MAPPING_KEY
- */
- Entity getEntity(String typeName);
-
-
- // **************** validation *********************************************
-
- /**
- * Return the embeddable specified in the persistence unit with the
- * specified name. Return null if there is no persistent type
- * with the specified name or if the persistent type is not mapped as an
- * embeddable.
- * @see org.eclipse.jpt.core.MappingKeys#EMBEDDABLE_TYPE_MAPPING_KEY
- */
- Embeddable getEmbeddable(String typeName);
-
- /**
- * Return whether the text representation of this persistence unit contains
- * the given text offset
- */
- boolean containsOffset(int textOffset);
-
- /**
- * Return whether any database metadata specific validation should occur.
- * (For instance, if the connection is not active, then it should not.)
- */
- boolean shouldValidateAgainstDatabase();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitProperties.java
deleted file mode 100644
index ec987bc355..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitProperties.java
+++ /dev/null
@@ -1,57 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.model.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 2.3
- * @since 2.3
- */
-public interface PersistenceUnitProperties extends Model
-{
- /**
- * Method used for identifying the given property.
- */
- boolean itemIsProperty(PersistenceUnit.Property item);
-
- /**
- * Returns the property name used for change notification of the given property.
- */
- String propertyIdOf(PersistenceUnit.Property property);
-
- /**
- * Return the PersistenceUnit of this Properties.
- */
- PersistenceUnit getPersistenceUnit();
-
- /**
- * Return the JPA project the PersistenceUnit belongs to.
- */
- JpaProject getJpaProject();
-
- /**
- * A Property with the given name had its value changed
- */
- void propertyValueChanged(String propertyName, String newValue);
-
- /**
- * A Property with the given name was removed
- */
- void propertyRemoved(String propertyName);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
deleted file mode 100644
index f5f9a0e242..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,61 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 enum PersistenceUnitTransactionType
-{
- /** Corresponds to JTA transaction type */
- JTA,
-
- /** Corresponds to RESOURCE_LOCAL transaction type */
- RESOURCE_LOCAL;
-
- public static PersistenceUnitTransactionType fromXmlResourceModel(XmlPersistenceUnitTransactionType transactionType) {
- if (transactionType == null) {
- return null;
- }
- switch (transactionType) {
- case JTA:
- return JTA;
- case RESOURCE_LOCAL:
- return RESOURCE_LOCAL;
- default:
- throw new IllegalArgumentException("unknown transaction type: " + transactionType); //$NON-NLS-1$
- }
- }
-
- public static XmlPersistenceUnitTransactionType toXmlResourceModel(PersistenceUnitTransactionType transactionType) {
- if (transactionType == null) {
- return null;
- }
- switch (transactionType) {
- case JTA:
- return XmlPersistenceUnitTransactionType.JTA;
- case RESOURCE_LOCAL:
- return XmlPersistenceUnitTransactionType.RESOURCE_LOCAL;
- default:
- throw new IllegalArgumentException("unknown transaction type: " + transactionType); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java
deleted file mode 100644
index bc702a4554..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXml.java
+++ /dev/null
@@ -1,50 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.context.XmlFile;
-
-/**
- * JPA <code>persistence.xml</code> file.
- * <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.0
- */
-public interface PersistenceXml
- extends XmlFile
-{
- // ********** persistence **********
-
- /**
- * String constant associated with changes to the persistence property
- */
- public final static String PERSISTENCE_PROPERTY = "persistence"; //$NON-NLS-1$
-
- /**
- * Return the content represented by the root of the <code>persistence.xml</code> file.
- * This may be null.
- */
- Persistence getPersistence();
-
-
- // ********** updating **********
-
- /**
- * Update the context persistence XML model to match its resource file.
- * @see org.eclipse.jpt.core.JpaProject#update()
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlContextNodeFactory.java
deleted file mode 100644
index e4882cd113..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,69 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.context.java.JarFile;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-/**
- * Interface used by persistence unit to gather up persistent types.
- * <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 PersistenceXmlContextNodeFactory
-{
- Persistence buildPersistence(PersistenceXml parent, XmlPersistence resourcePersistence);
-
- PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit resourcePersistenceUnit);
-
- /**
- * Build a "specified" mapping file ref.
- */
- MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef);
-
- /**
- * Build a "implied" mapping file ref.
- */
- MappingFileRef buildImpliedMappingFileRef(PersistenceUnit parent);
-
- /**
- * Build a "specified" class ref.
- */
- ClassRef buildClassRef(PersistenceUnit parent, XmlJavaClassRef xmlClassRef);
-
- /**
- * Build an "implied" class ref.
- */
- ClassRef buildClassRef(PersistenceUnit parent, String className);
-
- JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef);
-
- JarFile buildJarFile(JarFileRef parent, JavaResourcePackageFragmentRoot jarResourcePackageFragmentRoot);
-
- PersistenceUnit.Property buildProperty(PersistenceUnit parent, XmlProperty property);
-
- PersistenceUnitProperties buildConnection(PersistenceUnit parent);
-
- PersistenceUnitProperties buildOptions(PersistenceUnit parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlDefinition.java
deleted file mode 100644
index 9243e35e63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistenceXmlDefinition.java
+++ /dev/null
@@ -1,32 +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.core.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.ResourceDefinition;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 PersistenceXmlDefinition
- extends ResourceDefinition
-{
- PersistenceXmlContextNodeFactory getContextNodeFactory();
-
- EFactory getResourceNodeFactory();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistentTypeContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistentTypeContainer.java
deleted file mode 100644
index c48b80ab22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/persistence/PersistentTypeContainer.java
+++ /dev/null
@@ -1,33 +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.core.context.persistence;
-
-import org.eclipse.jpt.core.context.PersistentType;
-
-/**
- * Interface used by persistence unit to gather up persistent types.
- * <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 PersistentTypeContainer {
-
- /**
- * Return the container's persistent types.
- */
- Iterable<? extends PersistentType> getPersistentTypes();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaAnnotationDefintionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaAnnotationDefintionProvider.java
deleted file mode 100644
index 90bc29d85a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaAnnotationDefintionProvider.java
+++ /dev/null
@@ -1,101 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-public abstract class AbstractJpaAnnotationDefintionProvider
- implements JpaAnnotationDefinitionProvider
-{
- private AnnotationDefinition[] typeAnnotationDefinitions;
-
- private AnnotationDefinition[] typeMappingAnnotationDefinitions;
-
- private AnnotationDefinition[] attributeAnnotationDefinitions;
-
-
- protected AbstractJpaAnnotationDefintionProvider() {
- super();
- }
-
- // ********** type annotation definitions **********
-
- public synchronized Iterator<AnnotationDefinition> typeAnnotationDefinitions() {
- if (this.typeAnnotationDefinitions == null) {
- this.typeAnnotationDefinitions = this.buildTypeAnnotationDefinitions();
- }
- return new ArrayIterator<AnnotationDefinition>(this.typeAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildTypeAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addTypeAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Subclasses must override this to specify type annotation definitions.
- */
- protected void addTypeAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
- // no op
- }
-
- // ********** type mapping annotation definitions **********
-
- public synchronized Iterator<AnnotationDefinition> typeMappingAnnotationDefinitions() {
- if (this.typeMappingAnnotationDefinitions == null) {
- this.typeMappingAnnotationDefinitions = this.buildTypeMappingAnnotationDefinitions();
- }
- return new ArrayIterator<AnnotationDefinition>(this.typeMappingAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildTypeMappingAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addTypeMappingAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Subclasses must override this to specify type mapping annotation
- * definitions.
- */
- protected void addTypeMappingAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
- // no op
- }
-
- // ********** attribute annotation definitions **********
-
- public synchronized Iterator<AnnotationDefinition> attributeAnnotationDefinitions() {
- if (this.attributeAnnotationDefinitions == null) {
- this.attributeAnnotationDefinitions = this.buildAttributeAnnotationDefinitions();
- }
- return new ArrayListIterator<AnnotationDefinition>(this.attributeAnnotationDefinitions);
- }
-
- protected AnnotationDefinition[] buildAttributeAnnotationDefinitions() {
- ArrayList<AnnotationDefinition> definitions = new ArrayList<AnnotationDefinition>();
- this.addAttributeAnnotationDefinitionsTo(definitions);
- return definitions.toArray(new AnnotationDefinition[definitions.size()]);
- }
-
- /**
- * Subclasses must override this to specify attribute annotation
- * definitions.
- */
- protected void addAttributeAnnotationDefinitionsTo(@SuppressWarnings("unused") List<AnnotationDefinition> definitions) {
- // no op
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java
deleted file mode 100644
index 95fba5f9e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaFactory.java
+++ /dev/null
@@ -1,408 +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.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaEnumeratedConverter;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaLobConverter;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaTemporalConverter;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn.Owner;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.core.internal.jpa1.GenericJpaDataSource;
-import org.eclipse.jpt.core.internal.jpa1.GenericJpaFile;
-import org.eclipse.jpt.core.internal.jpa1.GenericJpaProject;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericRootContextNode;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAssociationOverride;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAttributeOverride;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaBasicMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEmbeddable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEmbeddedMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEntity;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEnumeratedConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaGeneratedValue;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaGeneratorContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaIdMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaJoinColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaJoinTable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaLobConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaManyToManyMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaManyToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaMappedSuperclass;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNamedNativeQuery;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNamedQuery;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaNullConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToManyMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaOrderable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPersistentType;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaQueryContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaQueryHint;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaSecondaryTable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaSequenceGenerator;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaTable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaTableGenerator;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaTemporalConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaTransientMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaUniqueConstraint;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaVersionMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.VirtualAssociationOverride1_0Annotation;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXml;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistenceXml;
-import org.eclipse.jpt.core.internal.jpa2.GenericJpaDatabaseIdentifierAdapter;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-
-/**
- * Central class that allows extenders to easily replace implementations of
- * various Dali interfaces.
- */
-public abstract class AbstractJpaFactory
- implements JpaFactory2_0
-{
- protected AbstractJpaFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- public JpaProject buildJpaProject(JpaProject.Config config) {
- return new GenericJpaProject(config);
- }
-
- public MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType) {
- return null;
- }
-
- public JpaDataSource buildJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
- return new GenericJpaDataSource(jpaProject, connectionProfileName);
- }
-
- public DatabaseIdentifierAdapter buildDatabaseIdentifierAdapter(JpaDataSource dataSource) {
- return new GenericJpaDatabaseIdentifierAdapter(dataSource);
- }
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file, IContentType contentType, JpaResourceModel resourceModel) {
- return new GenericJpaFile(jpaProject, file, contentType, resourceModel);
- }
-
-
- // ********** Context Nodes **********
-
- public JpaRootContextNode buildRootContextNode(JpaProject parent) {
- return new GenericRootContextNode(parent);
- }
-
-
- // ********** XML Context Model **********
-
- public PersistenceXml buildPersistenceXml(JpaRootContextNode parent, JpaXmlResource resource) {
- return new GenericPersistenceXml(parent, resource);
- }
-
- public OrmXml buildMappingFile(MappingFileRef parent, JpaXmlResource resource) {
- return new GenericOrmXml(parent, resource);
- }
-
-
- // ********** Java Context Model **********
-
- public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourcePersistentType jrpt) {
- return new GenericJavaPersistentType(owner, jrpt);
- }
-
- public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
- return new GenericJavaPersistentAttribute(parent, jrpa);
- }
-
- public JavaTypeMapping buildJavaNullTypeMapping(JavaPersistentType parent) {
- return new JavaNullTypeMapping(parent);
- }
-
- public JavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new GenericJavaEntity(parent);
- }
-
- public JavaMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent) {
- return new GenericJavaMappedSuperclass(parent);
- }
-
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
- return new GenericJavaEmbeddable(parent);
- }
-
- public JavaTable buildJavaTable(JavaEntity parent) {
- return new GenericJavaTable(parent);
- }
-
- public JavaColumn buildJavaColumn(JavaJpaContextNode parent, JavaBaseColumn.Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- public JavaDiscriminatorColumn buildJavaDiscriminatorColumn(JavaEntity parent, JavaDiscriminatorColumn.Owner owner) {
- return new GenericJavaDiscriminatorColumn(parent, owner);
- }
-
- public JavaJoinColumn buildJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- return new GenericJavaJoinColumn(parent, owner);
- }
-
- public JavaJoinTable buildJavaJoinTable(JavaJoinTableJoiningStrategy parent) {
- return new GenericJavaJoinTable(parent);
- }
-
- public JavaSecondaryTable buildJavaSecondaryTable(JavaEntity parent) {
- return new GenericJavaSecondaryTable(parent);
- }
-
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new GenericJavaBasicMapping(parent);
- }
-
- public JavaEmbeddedIdMapping buildJavaEmbeddedIdMapping(JavaPersistentAttribute parent) {
- return new GenericJavaEmbeddedIdMapping(parent);
- }
-
- public JavaEmbeddedMapping buildJavaEmbeddedMapping(JavaPersistentAttribute parent) {
- return new GenericJavaEmbeddedMapping(parent);
- }
-
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new GenericJavaIdMapping(parent);
- }
-
- public JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaManyToManyMapping(parent);
- }
-
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaManyToOneMapping(parent);
- }
-
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToManyMapping(parent);
- }
-
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToOneMapping(parent);
- }
-
- public JavaTransientMapping buildJavaTransientMapping(JavaPersistentAttribute parent) {
- return new GenericJavaTransientMapping(parent);
- }
-
- public JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent) {
- return new GenericJavaVersionMapping(parent);
- }
-
- public JavaAttributeMapping buildJavaNullAttributeMapping(JavaPersistentAttribute parent) {
- return new GenericJavaNullAttributeMapping(parent);
- }
-
- public JavaGeneratorContainer buildJavaGeneratorContainer(JavaJpaContextNode parent) {
- return new GenericJavaGeneratorContainer(parent);
- }
-
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
- return new GenericJavaSequenceGenerator(parent);
- }
-
- public JavaTableGenerator buildJavaTableGenerator(JavaJpaContextNode parent) {
- return new GenericJavaTableGenerator(parent);
- }
-
- public JavaGeneratedValue buildJavaGeneratedValue(JavaIdMapping parent) {
- return new GenericJavaGeneratedValue(parent);
- }
-
- public JavaPrimaryKeyJoinColumn buildJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner) {
- return new GenericJavaPrimaryKeyJoinColumn(parent, owner);
- }
-
- public JavaAttributeOverrideContainer buildJavaAttributeOverrideContainer(JavaJpaContextNode parent, JavaAttributeOverrideContainer.Owner owner) {
- return new GenericJavaAttributeOverrideContainer(parent, owner);
- }
-
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaJpaContextNode parent, JavaAssociationOverrideContainer.Owner owner) {
- return new GenericJavaAssociationOverrideContainer(parent, owner);
- }
-
- public JavaAttributeOverride buildJavaAttributeOverride(JavaAttributeOverrideContainer parent, JavaAttributeOverride.Owner owner) {
- return new GenericJavaAttributeOverride(parent, owner);
- }
-
- public JavaAssociationOverride buildJavaAssociationOverride(JavaAssociationOverrideContainer parent, JavaAssociationOverride.Owner owner) {
- return new GenericJavaAssociationOverride(parent, owner);
- }
-
- public JavaAssociationOverrideRelationshipReference buildJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent) {
- return new GenericJavaAssociationOverrideRelationshipReference(parent);
- }
-
- public AssociationOverrideAnnotation buildJavaVirtualAssociationOverrideAnnotation(JavaResourcePersistentMember jrpm, String name, JoiningStrategy joiningStrategy) {
- return new VirtualAssociationOverride1_0Annotation(jrpm, name, joiningStrategy);
- }
-
- public JavaQueryContainer buildJavaQueryContainer(JavaJpaContextNode parent) {
- return new GenericJavaQueryContainer(parent);
- }
-
- public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedQuery(parent);
- }
-
- public JavaNamedNativeQuery buildJavaNamedNativeQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedNativeQuery(parent);
- }
-
- public JavaQueryHint buildJavaQueryHint(JavaQuery parent) {
- return new GenericJavaQueryHint(parent);
- }
-
- public JavaUniqueConstraint buildJavaUniqueConstraint(JavaJpaContextNode parent, UniqueConstraint.Owner owner) {
- return new GenericJavaUniqueConstraint(parent, owner);
- }
-
- public JavaEnumeratedConverter buildJavaEnumeratedConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- return new GenericJavaEnumeratedConverter(parent, jrpa);
- }
-
- public JavaTemporalConverter buildJavaTemporalConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- return new GenericJavaTemporalConverter(parent, jrpa);
- }
-
- public JavaLobConverter buildJavaLobConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- return new GenericJavaLobConverter(parent, jrpa);
- }
-
- public JavaConverter buildJavaNullConverter(JavaAttributeMapping parent) {
- return new GenericJavaNullConverter(parent);
- }
-
- public JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Orderable.Owner owner) {
- return new GenericJavaOrderable(parent, owner);
- }
-
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner) {
- throw new UnsupportedOperationException();
- }
-
- public JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent) {
- throw new UnsupportedOperationException();
- }
-
- public JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- throw new UnsupportedOperationException();
- }
-
- public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
- throw new UnsupportedOperationException();
- }
-
- public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
- throw new UnsupportedOperationException();
- }
-
- public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
- throw new UnsupportedOperationException();
- }
-
- public JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent) {
- throw new UnsupportedOperationException();
- }
-
- public JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, Owner owner) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.java
deleted file mode 100644
index f970808600..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaNode.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.core.internal;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.CallbackChangeSupport;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-
-/**
- * Some common Dali behavior:<ul>
- * <li>containment hierarchy
- * <li>Eclipse adaptable
- * <li>update triggers
- * </ul>
- */
-public abstract class AbstractJpaNode
- extends AbstractModel
- implements JpaNode
-{
- private final JpaNode parent;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJpaNode(JpaNode parent) {
- super();
- this.checkParent(parent);
- this.parent = parent;
- }
-
- protected void checkParent(JpaNode 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 CallbackChangeSupport(this, this.buildChangeSupportListener());
- }
-
- protected CallbackChangeSupport.Listener buildChangeSupportListener() {
- return new CallbackChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractJpaNode.this.aspectChanged(aspectName);
- }
- };
- }
-
-
- // ********** IAdaptable implementation **********
-
- @SuppressWarnings("rawtypes")
- public Object getAdapter(Class adapter) {
- return Platform.getAdapterManager().getAdapter(this, adapter);
- }
-
-
- // ********** JpaNode implementation **********
-
- public JpaNode getParent() {
- return this.parent;
- }
-
- public IResource getResource() {
- return this.parent.getResource();
- }
-
- public JpaProject getJpaProject() {
- return this.parent.getJpaProject();
- }
-
-
- // ********** convenience methods **********
-
- protected JpaPlatform getJpaPlatform() {
- return this.getJpaProject().getJpaPlatform();
- }
-
- protected JpaPlatform.Version getJpaPlatformVersion() {
- return this.getJpaPlatform().getJpaVersion();
- }
-
- protected boolean isJpa2_0Compatible() {
- return JptCorePlugin.nodeIsJpa2_0Compatible(this);
- }
-
- protected JpaFactory getJpaFactory() {
- return this.getJpaPlatform().getJpaFactory();
- }
-
- protected JpaPlatformVariation getJpaPlatformVariation() {
- return this.getJpaPlatform().getJpaVariation();
- }
-
- protected JpaFile getJpaFile(IFile file) {
- return this.getJpaProject().getJpaFile(file);
- }
-
- protected JpaDataSource getDataSource() {
- return this.getJpaProject().getDataSource();
- }
-
- protected Database getDatabase() {
- return this.getDataSource().getDatabase();
- }
-
- protected boolean connectionProfileIsActive() {
- return this.getDataSource().connectionProfileIsActive();
- }
-
- /**
- * Pre-condition: specified catalog <em>identifier</em> is not null.
- * NB: Do not use the catalog <em>name</em>.
- */
- protected Catalog getDbCatalog(String catalog) {
- Database database = this.getDatabase();
- return (database == null) ? null : database.getCatalogForIdentifier(catalog);
- }
-
-
- // ********** 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.getJpaProject().update();
- }
- }
-
- private boolean aspectTriggersUpdate(String aspectName) {
- return ! this.aspectDoesNotTriggerUpdate(aspectName);
- }
-
- private boolean aspectDoesNotTriggerUpdate(String aspectName) {
- return 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 AbstractJpaNode>, HashSet<String>> nonUpdateAspectNameSets = new HashMap<Class<? extends AbstractJpaNode>, HashSet<String>>();
-
- protected void addNonUpdateAspectNamesTo(@SuppressWarnings("unused") Set<String> nonUpdateAspectNames) {
- // when you override this method, don't forget to include:
- // super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaPlatformProvider.java
deleted file mode 100644
index 09ae889b1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaPlatformProvider.java
+++ /dev/null
@@ -1,188 +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.core.internal;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.context.java.NullDefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.NullJavaTypeMappingDefinition;
-import org.eclipse.jpt.core.context.java.NullSpecifiedJavaAttributeMappingDefinition;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public abstract class AbstractJpaPlatformProvider
- implements JpaPlatformProvider
-{
- private JpaResourceModelProvider[] resourceModelProviders;
-
- private JavaTypeMappingDefinition[] javaTypeMappingDefinitions;
-
- private JavaAttributeMappingDefinition[] specifiedJavaAttributeMappingDefinitions;
-
- private JavaAttributeMappingDefinition[] defaultJavaAttributeMappingDefinitions;
-
- private ResourceDefinition[] resourceDefinitions;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractJpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public ListIterator<JpaResourceModelProvider> resourceModelProviders() {
- return new ArrayListIterator<JpaResourceModelProvider>(getResourceModelProviders());
- }
-
- protected synchronized JpaResourceModelProvider[] getResourceModelProviders() {
- if (this.resourceModelProviders == null) {
- this.resourceModelProviders = this.buildResourceModelProviders();
- }
- return this.resourceModelProviders;
- }
-
- protected abstract JpaResourceModelProvider[] buildResourceModelProviders();
-
-
- // ********** Java type mappings **********
-
- public ListIterator<JavaTypeMappingDefinition> javaTypeMappingDefinitions() {
- return new ArrayListIterator<JavaTypeMappingDefinition>(getJavaTypeMappingDefinitions());
- }
-
- protected synchronized JavaTypeMappingDefinition[] getJavaTypeMappingDefinitions() {
- if (this.javaTypeMappingDefinitions == null) {
- this.javaTypeMappingDefinitions = this.buildJavaTypeMappingDefinitions();
- }
- return this.javaTypeMappingDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for analyzing the mapping of a type 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.
- * Extenders may either overwrite this method or {@link #buildNonNullJavaTypeMappingDefinitions()}.
- * Doing the former places the additional requirement on the extender to provide a "null"
- * mapping definition (@see {@link NullJavaTypeMappingDefinition}.)
- */
- protected JavaTypeMappingDefinition[] buildJavaTypeMappingDefinitions() {
- return ArrayTools.add(
- buildNonNullJavaTypeMappingDefinitions(),
- NullJavaTypeMappingDefinition.instance());
- }
-
- /**
- * No-op implementation of this method.
- * @see #buildJavaTypeMappingDefinitions()
- */
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- return new JavaTypeMappingDefinition[0];
- }
-
-
- // ********** Java attribute mappings **********
-
- public ListIterator<JavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions() {
- return new ArrayListIterator<JavaAttributeMappingDefinition>(getDefaultJavaAttributeMappingDefinitions());
- }
-
- protected synchronized JavaAttributeMappingDefinition[] getDefaultJavaAttributeMappingDefinitions() {
- if (this.defaultJavaAttributeMappingDefinitions == null) {
- this.defaultJavaAttributeMappingDefinitions = this.buildDefaultJavaAttributeMappingDefinitions();
- }
- return this.defaultJavaAttributeMappingDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for analyzing the default mapping of an attribute
- * in the absence of any annotations. The order is important, as once a mapping definition tests
- * positively for a given attribute, all following mapping definitions are ignored.
- * Extenders may either overwrite this method or
- * {@link #buildNonNullDefaultJavaAttributeMappingDefinitions()}.
- * Doing the former places the additional requirement on the extender to provide a "null"
- * mapping definition (@see {@link NullDefaultJavaAttributeMappingDefinition}.)
- */
- protected JavaAttributeMappingDefinition[] buildDefaultJavaAttributeMappingDefinitions() {
- return ArrayTools.add(
- buildNonNullDefaultJavaAttributeMappingDefinitions(),
- NullDefaultJavaAttributeMappingDefinition.instance());
- }
-
- /**
- * No-op implementation of this method.
- * @see #buildDefaultJavaAttributeMappingDefinitions()
- */
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- return new JavaAttributeMappingDefinition[0];
- }
-
- public ListIterator<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions() {
- return new ArrayListIterator<JavaAttributeMappingDefinition>(
- getSpecifiedJavaAttributeMappingDefinitions());
- }
-
- protected synchronized JavaAttributeMappingDefinition[] getSpecifiedJavaAttributeMappingDefinitions() {
- if (this.specifiedJavaAttributeMappingDefinitions == null) {
- this.specifiedJavaAttributeMappingDefinitions = this.buildSpecifiedJavaAttributeMappingDefinitions();
- }
- return this.specifiedJavaAttributeMappingDefinitions;
- }
-
- /**
- * Return an array of 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
- * positively for a given attribute, all following mapping definitions are ignored.
- * Extenders may either overwrite this method or
- * {@link #buildNonNullSpecifiedJavaAttributeMappingDefinitions()}.
- * Doing the former places the additional requirement on the extender to provide a "null"
- * mapping definition (@see {@link NullSpecifiedJavaAttributeMappingDefinition}.)
- */
- protected JavaAttributeMappingDefinition[] buildSpecifiedJavaAttributeMappingDefinitions() {
- return ArrayTools.add(
- buildNonNullSpecifiedJavaAttributeMappingDefinitions(),
- NullSpecifiedJavaAttributeMappingDefinition.instance());
- }
-
- /**
- * No-op implementation of this method.
- * @see #buildSpecifiedJavaAttributeMappingDefinitions()
- */
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- return new JavaAttributeMappingDefinition[0];
- }
-
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java
deleted file mode 100644
index e33e50703a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractJpaProject.java
+++ /dev/null
@@ -1,1672 +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.core.internal;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-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.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.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.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JpaResourceModelListener;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPersistentTypeCache;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceCompilationUnit;
-import org.eclipse.jpt.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.core.jpa2.context.JpaRootContextNode2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentTypeCache;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.BitTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.ThreadLocalCommandExecutor;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jst.j2ee.model.internal.validation.ValidationCancelledException;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * JPA project. Holds all the JPA stuff.
- *
- * The JPA platform provides the hooks for vendor-specific stuff.
- *
- * The JPA 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 JPA spec, using the "resource" model as an adapter to the Eclipse
- * resources).
- *
- * The data source is an adapter to the DTP meta-data model.
- */
-public abstract class AbstractJpaProject
- extends AbstractJpaNode
- implements JpaProject2_0
-{
- /**
- * The Eclipse project corresponding to the JPA project.
- */
- protected final IProject project;
-
- /**
- * The vendor-specific JPA platform that builds the JPA project
- * and all its contents.
- */
- protected final JpaPlatform jpaPlatform;
-
- /**
- * The JPA files associated with the JPA project:
- * persistence.xml
- * orm.xml
- * java
- */
- protected final Vector<JpaFile> jpaFiles = new Vector<JpaFile>();
-
- /**
- * 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 JpaResourceModelListener resourceModelListener;
-
- /**
- * The root of the model representing the collated resources associated with
- * the JPA project.
- */
- protected final JpaRootContextNode rootContextNode;
-
- /**
- * A pluggable updater that can be used to "update" the JPA project either
- * synchronously or asynchronously (or not at all). A synchronous updater
- * is the default, allowing a newly-constructed JPA 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 "updates" occur.
- * Clients will need to explicitly configure the updater if they require
- * something other than a synchronous updater.
- */
- protected Updater updater;
-
- /**
- * The data source that wraps the DTP model.
- */
- // TODO move to persistence unit... :-(
- protected final JpaDataSource dataSource;
-
- /**
- * A catalog name used to override the connection's default catalog.
- */
- protected String userOverrideDefaultCatalog;
-
- /**
- * A schema name used to override the connection's default schema.
- */
- protected String userOverrideDefaultSchema;
-
- /**
- * Flag indicating whether the project should "discover" annotated
- * classes automatically, as opposed to requiring the classes to be
- * listed in persistence.xml.
- */
- protected boolean discoversAnnotatedClasses;
-
- /**
- * Support for modifying documents shared with the UI.
- */
- protected final ThreadLocalCommandExecutor modifySharedDocumentCommandExecutor;
-
- /**
- * The name of the Java project source folder that holds the generated
- * metamodel. If the name is <code>null</code> the metamodel is not
- * generated.
- */
- protected String metamodelSourceFolderName;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractJpaProject(JpaProject.Config config) {
- super(null); // JPA project is the root of the containment tree
- if ((config.getProject() == null) || (config.getJpaPlatform() == null)) {
- throw new NullPointerException();
- }
- this.project = config.getProject();
- this.jpaPlatform = config.getJpaPlatform();
- this.dataSource = this.getJpaFactory().buildJpaDataSource(this, config.getConnectionProfileName());
- this.userOverrideDefaultCatalog = config.getUserOverrideDefaultCatalog();
- this.userOverrideDefaultSchema = config.getUserOverrideDefaultSchema();
- this.discoversAnnotatedClasses = config.discoverAnnotatedClasses();
-
- 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();
-
- if (this.isJpa2_0Compatible()) {
- this.metamodelSourceFolderName = ((JpaProject2_0.Config) config).getMetamodelSourceFolderName();
- if (this.metamodelSoureFolderNameIsInvalid()) {
- this.metamodelSourceFolderName = null;
- }
- }
-
- this.rootContextNode = this.buildRootContextNode();
-
- // "update" the project before returning
- this.setUpdater_(new SynchronousJpaProjectUpdater(this));
-
- // 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 JpaResourceModelListener buildResourceModelListener() {
- return new DefaultResourceModelListener();
- }
-
- protected InitialResourceProxyVisitor buildInitialResourceProxyVisitor() {
- return new InitialResourceProxyVisitor();
- }
-
- protected JavaResourcePersistentTypeCache buildExternalJavaResourcePersistentTypeCache() {
- return new BinaryPersistentTypeCache(this.jpaPlatform.getAnnotationProvider());
- }
-
- protected JpaRootContextNode buildRootContextNode() {
- return this.getJpaFactory().buildRootContextNode(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 :
- AbstractJpaProject.this.addJpaFile_((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 JpaProject getJpaProject() {
- 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 JpaPlatform getJpaPlatform() {
- return this.jpaPlatform;
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<JavaResourceCompilationUnit> getCombinedJavaResourceCompilationUnits() {
- return new CompositeIterable<JavaResourceCompilationUnit>(
- this.getInternalJavaResourceCompilationUnits(),
- this.getExternalJavaResourceCompilationUnits()
- );
- }
-
-
- // ********** database **********
-
- @Override
- public JpaDataSource getDataSource() {
- return this.dataSource;
- }
-
- public ConnectionProfile getConnectionProfile() {
- return this.dataSource.getConnectionProfile();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDefaultDbCatalog() {
- String catalog = this.getDefaultCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- public String getDefaultCatalog() {
- String catalog = this.getUserOverrideDefaultCatalog();
- return (catalog != null) ? catalog : this.getDatabaseDefaultCatalog();
- }
-
- protected String getDatabaseDefaultCatalog() {
- Database db = this.getDatabase();
- return (db == null ) ? null : db.getDefaultCatalogIdentifier();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDefaultDbSchemaContainer() {
- String catalog = this.getDefaultCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- public Schema getDefaultDbSchema() {
- SchemaContainer sc = this.getDefaultDbSchemaContainer();
- return (sc == null) ? null : sc.getSchemaForIdentifier(this.getDefaultSchema());
- }
-
- public String getDefaultSchema() {
- String schema = this.getUserOverrideDefaultSchema();
- if (schema != null) {
- return schema;
- }
-
- String catalog = this.getDefaultCatalog();
- if (catalog == null) {
- // if there is no default catalog (either user-override or database-determined),
- // the database probably does not support catalogs;
- // return the database's default schema
- return this.getDatabaseDefaultSchema();
- }
-
- Catalog dbCatalog = this.getDbCatalog(catalog);
- if (dbCatalog != null) {
- return dbCatalog.getDefaultSchemaIdentifier();
- }
-
- // if we could not find a catalog on the database that matches the default
- // catalog name, return the database's default schema(?) - hmmm
- return this.getDatabaseDefaultSchema();
- }
-
- protected String getDatabaseDefaultSchema() {
- Database db = this.getDatabase();
- return (db == null ) ? null : db.getDefaultSchemaIdentifier();
- }
-
-
- // ********** user override default catalog **********
-
- public String getUserOverrideDefaultCatalog() {
- return this.userOverrideDefaultCatalog;
- }
-
- public void setUserOverrideDefaultCatalog(String catalog) {
- String old = this.userOverrideDefaultCatalog;
- this.userOverrideDefaultCatalog = catalog;
- JptCorePlugin.setUserOverrideDefaultCatalog(this.project, catalog);
- this.firePropertyChanged(USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
-
- // ********** user override default schema **********
-
- public String getUserOverrideDefaultSchema() {
- return this.userOverrideDefaultSchema;
- }
-
- public void setUserOverrideDefaultSchema(String schema) {
- String old = this.userOverrideDefaultSchema;
- this.userOverrideDefaultSchema = schema;
- JptCorePlugin.setUserOverrideDefaultSchema(this.project, schema);
- this.firePropertyChanged(USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
-
- // ********** discover annotated classes **********
-
- public boolean discoversAnnotatedClasses() {
- return this.discoversAnnotatedClasses;
- }
-
- public void setDiscoversAnnotatedClasses(boolean discoversAnnotatedClasses) {
- boolean old = this.discoversAnnotatedClasses;
- this.discoversAnnotatedClasses = discoversAnnotatedClasses;
- JptCorePlugin.setDiscoverAnnotatedClasses(this.project, discoversAnnotatedClasses);
- this.firePropertyChanged(DISCOVERS_ANNOTATED_CLASSES_PROPERTY, old, discoversAnnotatedClasses);
- }
-
-
- // ********** JPA files **********
-
- public Iterator<JpaFile> jpaFiles() {
- return this.getJpaFiles().iterator();
- }
-
- protected Iterable<JpaFile> getJpaFiles() {
- return new LiveCloneIterable<JpaFile>(this.jpaFiles); // read-only
- }
-
- public int jpaFilesSize() {
- return this.jpaFiles.size();
- }
-
- protected Iterable<JpaFile> getJpaFiles(final IContentType contentType) {
- return new FilteringIterable<JpaFile>(this.getJpaFiles()) {
- @Override
- protected boolean accept(JpaFile jpaFile) {
- return jpaFile.getContentType().isKindOf(contentType);
- }
- };
- }
-
- @Override
- public JpaFile getJpaFile(IFile file) {
- for (JpaFile jpaFile : this.getJpaFiles()) {
- if (jpaFile.getFile().equals(file)) {
- return jpaFile;
- }
- }
- return null;
- }
-
- /**
- * Add a JPA file for the specified file, if appropriate.
- * Return true if a JPA File was created and added, false otherwise
- */
- protected boolean addJpaFile(IFile file) {
- JpaFile jpaFile = this.addJpaFile_(file);
- if (jpaFile != null) {
- this.fireItemAdded(JPA_FILES_COLLECTION, jpaFile);
- return true;
- }
- return false;
- }
-
- /**
- * Add a JPA file for the specified file, if appropriate, without firing
- * an event; useful during construction.
- * Return the new JPA file, null if it was not created.
- */
- protected JpaFile addJpaFile_(IFile file) {
- if ( ! this.getJavaProject().isOnClasspath(file)) {
- return null; // the file must be on the Java classpath
- }
-
- JpaFile jpaFile = null;
- try {
- jpaFile = this.getJpaPlatform().buildJpaFile(this, file);
- }
- catch (Exception e) {
- //log any developer exceptions and don't build a JpaFile rather
- //than completely failing to build the JpaProject
- JptCorePlugin.log(e);
- }
- if (jpaFile == null) {
- return null;
- }
- jpaFile.getResourceModel().addResourceModelListener(this.resourceModelListener);
- this.jpaFiles.add(jpaFile);
- return jpaFile;
- }
-
- /**
- * Remove the JPA file corresponding to the specified IFile, if it exists.
- * Return true if a JPA File was removed, false otherwise
- */
- protected boolean removeJpaFile(IFile file) {
- JpaFile jpaFile = this.getJpaFile(file);
- if (jpaFile != null) { // a JpaFile is not added for every IFile
- this.removeJpaFile(jpaFile);
- return true;
- }
- return false;
- }
-
- /**
- * Stop listening to the JPA file and remove it.
- */
- protected void removeJpaFile(JpaFile jpaFile) {
- jpaFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- if ( ! this.removeItemFromCollection(jpaFile, this.jpaFiles, JPA_FILES_COLLECTION)) {
- throw new IllegalArgumentException(jpaFile.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 SourceCompilationUnit(
- 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 JpaRootContextNode getRootContextNode() {
- return this.rootContextNode;
- }
-
-
- // ********** utility **********
-
- public IFile convertToPlatformFile(String fileName) {
- return JptCorePlugin.getPlatformFile(this.project, fileName);
- }
-
-
- // ********** XML files **********
-
- public JpaXmlResource getPersistenceXmlResource() {
- return (JpaXmlResource) this.getResourceModel(
- JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH,
- JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE
- );
- }
-
- public JpaXmlResource getDefaultOrmXmlResource() {
- return this.getMappingFileXmlResource(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- public JpaXmlResource getMappingFileXmlResource(String fileName) {
- return (JpaXmlResource) this.getResourceModel(fileName, JptCorePlugin.MAPPING_FILE_CONTENT_TYPE);
- }
-
- /**
- * 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(String fileName, IContentType contentType) {
- IFile file = this.convertToPlatformFile(fileName);
- 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 Iterator<String> annotatedJavaSourceClassNames() {
- return this.getAnnotatedJavaSourceClassNames().iterator();
- }
-
- protected Iterable<String> getAnnotatedJavaSourceClassNames() {
- return new TransformationIterable<JavaResourcePersistentType, String>(this.getInternalAnnotatedSourceJavaResourcePersistentTypes()) {
- @Override
- protected String transform(JavaResourcePersistentType jrpType) {
- return jrpType.getQualifiedName();
- }
- };
- }
-
- /**
- * return only those valid annotated Java resource persistent types that are part of the
- * JPA project, ignoring those in JARs referenced in persistence.xml
- * @see org.eclipse.jpt.core.internal.utility.jdt.JPTTools#typeIsPersistable(org.eclipse.jpt.core.internal.utility.jdt.JPTTools.TypeAdapter)
- */
- protected Iterable<JavaResourcePersistentType> getInternalAnnotatedSourceJavaResourcePersistentTypes() {
- return new FilteringIterable<JavaResourcePersistentType>(this.getInternalSourceJavaResourcePersistentTypes()) {
- @Override
- protected boolean accept(JavaResourcePersistentType jrpType) {
- return jrpType.isPersistable() && jrpType.isAnnotated(); // i.e. the type is valid and has a valid type annotation
- }
- };
- }
-
- public Iterator<String> mappedJavaSourceClassNames() {
- return this.getMappedJavaSourceClassNames().iterator();
- }
-
- protected Iterable<String> getMappedJavaSourceClassNames() {
- return new TransformationIterable<JavaResourcePersistentType, String>(this.getInternalMappedSourceJavaResourcePersistentTypes()) {
- @Override
- protected String transform(JavaResourcePersistentType jrpType) {
- return jrpType.getQualifiedName();
- }
- };
- }
-
- /**
- * return only those valid "mapped" (i.e. annotated with @Entity, @Embeddable, etc.) Java
- * resource persistent types that are part of the JPA project, ignoring those in JARs
- * referenced in persistence.xml
- */
- protected Iterable<JavaResourcePersistentType> getInternalMappedSourceJavaResourcePersistentTypes() {
- return new FilteringIterable<JavaResourcePersistentType>(this.getInternalAnnotatedSourceJavaResourcePersistentTypes()) {
- @Override
- protected boolean accept(JavaResourcePersistentType jrpType) {
- return jrpType.isMapped(); // i.e. the type is already persistable and annotated
- }
- };
- }
-
- /**
- * return only those Java resource persistent types that are
- * part of the JPA project, ignoring those in JARs referenced in persistence.xml
- */
- protected Iterable<JavaResourcePersistentType2_0> getInternalSourceJavaResourcePersistentTypes2_0() {
- return new SubIterableWrapper<JavaResourcePersistentType, JavaResourcePersistentType2_0>(this.getInternalSourceJavaResourcePersistentTypes());
- }
-
- /**
- * return only those Java resource persistent types that are
- * part of the JPA project, ignoring those in JARs referenced in persistence.xml
- */
- protected Iterable<JavaResourcePersistentType> getInternalSourceJavaResourcePersistentTypes() {
- return new CompositeIterable<JavaResourcePersistentType>(this.getInternalSourceJavaResourcePersistentTypeSets());
- }
-
- /**
- * return only those Java resource persistent types that are
- * part of the JPA project, ignoring those in JARs referenced in persistence.xml
- */
- protected Iterable<Iterable<JavaResourcePersistentType>> getInternalSourceJavaResourcePersistentTypeSets() {
- return new TransformationIterable<JavaResourceCompilationUnit, Iterable<JavaResourcePersistentType>>(this.getInternalJavaResourceCompilationUnits()) {
- @Override
- protected Iterable<JavaResourcePersistentType> transform(final JavaResourceCompilationUnit compilationUnit) {
- return new Iterable<JavaResourcePersistentType>() {
- public Iterator<JavaResourcePersistentType> iterator() {
- return compilationUnit.persistentTypes(); // *all* the types in the compilation unit
- }
- };
- }
- };
- }
-
- protected Iterable<JavaResourceCompilationUnit> getInternalJavaResourceCompilationUnits() {
- return new TransformationIterable<JpaFile, JavaResourceCompilationUnit>(this.getJavaSourceJpaFiles()) {
- @Override
- protected JavaResourceCompilationUnit transform(JpaFile jpaFile) {
- return (JavaResourceCompilationUnit) jpaFile.getResourceModel();
- }
- };
- }
-
- /**
- * return JPA files with Java source "content"
- */
- protected Iterable<JpaFile> getJavaSourceJpaFiles() {
- return this.getJpaFiles(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
-
- // ********** Java resource persistent type look-up **********
-
- public JavaResourcePersistentType getJavaResourcePersistentType(String typeName) {
- for (JavaResourcePersistentType jrpType : this.getPersistableJavaResourcePersistentTypes()) {
- if (jrpType.getQualifiedName().equals(typeName)) {
- return jrpType;
- }
- }
- // if we don't have a type already, try to build new one from the project classpath
- return this.buildPersistableExternalJavaResourcePersistentType(typeName);
- }
-
- /**
- * return *all* the "persistable" Java resource persistent types, including those in JARs referenced in
- * persistence.xml
- * @see org.eclipse.jpt.core.internal.utility.jdt.JPTTools#typeIsPersistable(org.eclipse.jpt.core.internal.utility.jdt.JPTTools.TypeAdapter)
- */
- protected Iterable<JavaResourcePersistentType> getPersistableJavaResourcePersistentTypes() {
- return new FilteringIterable<JavaResourcePersistentType>(this.getJavaResourcePersistentTypes()) {
- @Override
- protected boolean accept(JavaResourcePersistentType jrpType) {
- return jrpType.isPersistable();
- }
- };
- }
-
- /**
- * return *all* the Java resource persistent types, including those in JARs referenced in
- * persistence.xml
- */
- protected Iterable<JavaResourcePersistentType> getJavaResourcePersistentTypes() {
- return new CompositeIterable<JavaResourcePersistentType>(this.getJavaResourcePersistentTypeSets());
- }
-
- /**
- * return *all* the Java resource persistent types, including those in JARs referenced in
- * persistence.xml
- */
- protected Iterable<Iterable<JavaResourcePersistentType>> getJavaResourcePersistentTypeSets() {
- return new TransformationIterable<JavaResourceNode.Root, Iterable<JavaResourcePersistentType>>(this.getJavaResourceNodeRoots()) {
- @Override
- protected Iterable<JavaResourcePersistentType> transform(final JavaResourceNode.Root root) {
- return new Iterable<JavaResourcePersistentType>() {
- public Iterator<JavaResourcePersistentType> iterator() {
- return root.persistentTypes(); // *all* the types held by the root
- }
- };
- }
- };
- }
-
- @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);
- }
-
-
- // ********** metamodel **********
-
- public Iterable<JavaResourcePersistentType2_0> getGeneratedMetamodelTopLevelTypes() {
- if (this.metamodelSourceFolderName == null) {
- return EmptyIterable.instance();
- }
- final IPackageFragmentRoot genSourceFolder = this.getMetamodelPackageFragmentRoot();
- return new FilteringIterable<JavaResourcePersistentType2_0>(this.getInternalSourceJavaResourcePersistentTypes2_0()) {
- @Override
- protected boolean accept(JavaResourcePersistentType2_0 jrpt) {
- return jrpt.isGeneratedMetamodelTopLevelType(genSourceFolder);
- }
- };
- }
-
- public JavaResourcePersistentType2_0 getGeneratedMetamodelTopLevelType(IFile file) {
- JavaResourceCompilationUnit jrcu = this.getJavaResourceCompilationUnit(file);
- if (jrcu == null) {
- return null; // hmmm...
- }
- // TODO add API to JRCU to get top-level persistent type
- Iterator<JavaResourcePersistentType> types = jrcu.persistentTypes();
- if ( ! types.hasNext()) {
- return null; // no types in the file
- }
- JavaResourcePersistentType2_0 jrpt = (JavaResourcePersistentType2_0) types.next();
- return jrpt.isGeneratedMetamodelTopLevelType() ? jrpt : null;
- }
-
- protected JavaResourceCompilationUnit getJavaResourceCompilationUnit(IFile file) {
- return (JavaResourceCompilationUnit) this.getResourceModel(file, JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
- public String getMetamodelSourceFolderName() {
- return this.metamodelSourceFolderName;
- }
-
- public void setMetamodelSourceFolderName(String metamodelSourceFolderName) {
- String old = this.metamodelSourceFolderName;
- this.metamodelSourceFolderName = metamodelSourceFolderName;
- if (this.attributeValueHasChanged(old, metamodelSourceFolderName)) {
- JptCorePlugin.setMetamodelSourceFolderName(this.project, metamodelSourceFolderName);
- this.firePropertyChanged(METAMODEL_SOURCE_FOLDER_NAME_PROPERTY, old, metamodelSourceFolderName);
- if (metamodelSourceFolderName == null) {
- this.disposeMetamodel();
- } else {
- this.initializeMetamodel();
- }
- }
- }
-
- public void initializeMetamodel() {
- if (this.isJpa2_0Compatible()) {
- ((JpaRootContextNode2_0) this.rootContextNode).initializeMetamodel();
- }
- }
-
- /**
- * Synchronize the metamodel for 2.0-compatible JPA projects.
- */
- public void synchronizeMetamodel() {
- if (this.isJpa2_0Compatible()) {
- if (this.metamodelSourceFolderName != null) {
- ((JpaRootContextNode2_0) this.rootContextNode).synchronizeMetamodel();
- }
- }
- }
-
- public void disposeMetamodel() {
- if (this.isJpa2_0Compatible()) {
- ((JpaRootContextNode2_0) this.rootContextNode).disposeMetamodel();
- }
- }
-
- public IPackageFragmentRoot getMetamodelPackageFragmentRoot() {
- return this.getJavaProject().getPackageFragmentRoot(this.getMetaModelSourceFolder());
- }
-
- protected IFolder getMetaModelSourceFolder() {
- return this.getProject().getFolder(this.metamodelSourceFolderName);
- }
-
- /**
- * If the metamodel source folder is no longer a Java project source
- * folder, clear it out.
- */
- protected void checkMetamodelSourceFolderName() {
- if (this.metamodelSoureFolderNameIsInvalid()) {
- this.setMetamodelSourceFolderName(null);
- }
- }
-
- protected boolean metamodelSoureFolderNameIsInvalid() {
- return ! this.metamodelSourceFolderNameIsValid();
- }
-
- protected boolean metamodelSourceFolderNameIsValid() {
- return CollectionTools.contains(this.getJavaSourceFolderNames(), this.metamodelSourceFolderName);
- }
-
-
- // ********** 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());
- }
-
-
- // ********** 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.checkMetamodelSourceFolderName();
- this.update(this.getInternalJavaResourceCompilationUnits());
- } else {
- // TODO see if changed project is on our classpath?
- this.update(this.getExternalJavaResourceCompilationUnits());
- }
- }
-
- /**
- * Loop through all our JPA files, remove any that are no longer on the
- * classpath.
- */
- protected void removeDeadJpaFiles() {
- for (JpaFile jpaFile : this.getJpaFiles()) {
- if (this.jpaFileIsDead(jpaFile)) {
- this.removeJpaFile(jpaFile);
- }
- }
- }
-
- protected boolean jpaFileIsDead(JpaFile jpaFile) {
- return ! this.jpaFileIsAlive(jpaFile);
- }
-
- /**
- * 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 jpaFileIsAlive(JpaFile jpaFile) {
- IFile file = jpaFile.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 update(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 Iterator<IMessage> validationMessages(IReporter reporter) {
- List<IMessage> messages = new ArrayList<IMessage>();
- this.validate(messages, reporter);
- return messages.iterator();
- }
-
- protected void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- this.validateConnection(messages);
- this.rootContextNode.validate(messages, reporter);
- }
-
- protected void validateConnection(List<IMessage> messages) {
- String cpName = this.dataSource.getConnectionProfileName();
- if (StringTools.stringIsEmpty(cpName)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PROJECT_NO_CONNECTION,
- this
- )
- );
- return;
- }
- ConnectionProfile cp = this.dataSource.getConnectionProfile();
- if (cp == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PROJECT_INVALID_CONNECTION,
- new String[] {cpName},
- this
- )
- );
- return;
- }
- if (cp.isInactive()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PROJECT_INACTIVE_CONNECTION,
- new String[] {cpName},
- this
- )
- );
- }
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- this.updater.stop();
- this.dataSource.dispose();
- // the XML resources are held indefinitely by the WTP translator framework,
- // so we better remove our listener or the JPA project will not be GCed
- for (JpaFile jpaFile : this.getJpaFiles()) {
- jpaFile.getResourceModel().removeResourceModelListener(this.resourceModelListener);
- }
- }
-
-
- // ********** resource model listener **********
-
- protected class DefaultResourceModelListener
- implements JpaResourceModelListener
- {
- protected DefaultResourceModelListener() {
- super();
- }
-
- public void resourceModelChanged(JpaResourceModel jpaResourceModel) {
-// String msg = Thread.currentThread() + " resource model change: " + jpaResourceModel;
-// System.out.println(msg);
-// new Exception(msg).printStackTrace(System.out);
- AbstractJpaProject.this.synchronizeContextModel(jpaResourceModel);
- }
-
- public void resourceModelReverted(JpaResourceModel jpaResourceModel) {
- IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
- AbstractJpaProject.this.removeJpaFile(file);
- AbstractJpaProject.this.addJpaFile(file);
- }
-
- public void resourceModelUnloaded(JpaResourceModel jpaResourceModel) {
- IFile file = WorkbenchResourceHelper.getFile((JpaXmlResource)jpaResourceModel);
- AbstractJpaProject.this.removeJpaFile(file);
- }
- }
-
-
- // ********** 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 AbstractJpaProject.this.synchronizeJpaFiles(file, deltaKind);
- }
- };
- }
-
- /**
- * Internal resource delta visitor callback.
- * Return true if a JpaFile was either added or removed.
- */
- protected boolean synchronizeJpaFiles(IFile file, int deltaKind) {
- switch (deltaKind) {
- case IResourceDelta.ADDED :
- return this.addJpaFile(file);
- case IResourceDelta.REMOVED :
- return this.removeJpaFile(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) {
- JpaFile jpaFile = this.getJpaFile(file);
- if (jpaFile == null) {
- // the file might have changed its content to something that we are interested in
- return this.addJpaFile(file);
- }
-
- if (jpaFile.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.removeJpaFile(jpaFile);
- this.addJpaFile(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 AbstractJpaProject.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 **********
-
- // TODO ...
- protected void synchronizeContextModel(@SuppressWarnings("unused") JpaResourceModel jpaResourceModel) {
- this.synchronizeContextModel();
- }
-
- public void synchronizeContextModel() {
- this.update();
- }
-
-
- // ********** project "update" **********
-
- public Updater getUpdater() {
- return this.updater;
- }
-
- public void setUpdater(Updater updater) {
- if (updater == null) {
- throw new NullPointerException();
- }
- this.updater.stop();
- this.setUpdater_(updater);
- }
-
- protected void setUpdater_(Updater updater) {
- this.updater = updater;
- this.updater.start();
- }
-
- /**
- * Delegate to the updater so clients can configure how updates occur.
- */
- public void update() {
- this.updater.update();
- }
-
- /**
- * Called by the updater.
- */
- public IStatus update(IProgressMonitor monitor) {
- this.update_(monitor);
- return Status.OK_STATUS;
- }
-
- protected void update_(IProgressMonitor monitor) {
- this.rootContextNode.update(monitor);
- this.rootContextNode.postUpdate();
- }
-
- /**
- * Also called by the updater.
- */
- public void updateQuiesced() {
- this.synchronizeMetamodel();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractSynchronizerJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractSynchronizerJpaProjectUpdater.java
deleted file mode 100644
index 462af6962c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AbstractSynchronizerJpaProjectUpdater.java
+++ /dev/null
@@ -1,67 +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.core.internal;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.synchronizers.CallbackSynchronizer;
-
-/**
- * Adapt the "callback synchronizer" interface to the JPA project "updater"
- * interface.
- * <p>
- * Subclasses are to build the appropriate callback synchronizer.
- */
-public abstract class AbstractSynchronizerJpaProjectUpdater
- implements JpaProject.Updater
-{
- protected final JpaProject jpaProject;
- protected final CallbackSynchronizer synchronizer;
-
-
- protected AbstractSynchronizerJpaProjectUpdater(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.synchronizer = this.buildSynchronizer();
- this.synchronizer.addListener(this.buildCallbackSynchronizerListener());
- }
-
- protected abstract CallbackSynchronizer buildSynchronizer();
-
- protected CallbackSynchronizer.Listener buildCallbackSynchronizerListener() {
- return new CallbackSynchronizer.Listener() {
- public void synchronizationQuiesced(CallbackSynchronizer s) {
- AbstractSynchronizerJpaProjectUpdater.this.jpaProject.updateQuiesced();
- }
- };
- }
-
-
- // ********** JpaProject.Updater implementation **********
-
- public void start() {
- this.synchronizer.start();
- }
-
- // recursion: we come back here if IJpaProject#update() is called again, during the "update"
- public void update() {
- this.synchronizer.synchronize();
- }
-
- public void stop() {
- this.synchronizer.stop();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.synchronizer);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
deleted file mode 100644
index a0f67a1386..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/AsynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,61 +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.core.internal;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.utility.CallbackJobSynchronizer;
-import org.eclipse.jpt.core.internal.utility.JobCommand;
-import org.eclipse.jpt.utility.internal.synchronizers.CallbackSynchronizer;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Adapt the "callback synchronizer" interface to the JPA project "updater"
- * interface.
- * <p>
- * This updater will "update" the JPA project in an Eclipse job that executes
- * in a separate thread allowing calls to {@link JpaProject.Updater#update()}
- * to return immediately.
- */
-public class AsynchronousJpaProjectUpdater
- extends AbstractSynchronizerJpaProjectUpdater
-{
- public AsynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super(jpaProject);
- }
-
- @Override
- protected CallbackSynchronizer buildSynchronizer() {
- return new CallbackJobSynchronizer(
- this.buildJobName(),
- this.buildJobCommand(),
- this.buildJobSchedulingRule()
- );
- }
-
- protected String buildJobName() {
- return NLS.bind(JptCoreMessages.UPDATE_JOB_NAME, this.jpaProject.getName());
- }
-
- protected JobCommand buildJobCommand() {
- return new JobCommand() {
- public IStatus execute(IProgressMonitor monitor) {
- return AsynchronousJpaProjectUpdater.this.jpaProject.update(monitor);
- }
- };
- }
-
- protected ISchedulingRule buildJobSchedulingRule() {
- return this.jpaProject.getProject();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericEntityGeneratorDatabaseAnnotationNameBuilder.java
deleted file mode 100644
index 1c51869848..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericEntityGeneratorDatabaseAnnotationNameBuilder.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.core.internal;
-
-import org.eclipse.jpt.core.EntityGeneratorDatabaseAnnotationNameBuilder;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Singleton that delegates to the db object passed in.
- */
-public final class GenericEntityGeneratorDatabaseAnnotationNameBuilder
- implements EntityGeneratorDatabaseAnnotationNameBuilder
-{
- public static final EntityGeneratorDatabaseAnnotationNameBuilder INSTANCE
- = new GenericEntityGeneratorDatabaseAnnotationNameBuilder();
-
- public static EntityGeneratorDatabaseAnnotationNameBuilder instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private GenericEntityGeneratorDatabaseAnnotationNameBuilder() {
- super();
- }
-
- public String buildTableAnnotationName(String entityName, Table table) {
- return table.getIdentifier(entityName);
- }
-
- public String buildColumnAnnotationName(String attributeName, Column column) {
- return column.getIdentifier(attributeName);
- }
-
- public String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey) {
- return foreignKey.getJoinColumnAnnotationIdentifier(attributeName);
- }
-
- public String buildJoinColumnAnnotationName(Column column) {
- return column.getIdentifier();
- }
-
- public String buildJoinTableAnnotationName(Table table) {
- return table.getIdentifier();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 72d17468fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,146 +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.core.internal;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AssociationOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.BasicAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedIdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EntityAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EnumeratedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.GeneratedValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdClassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.InheritanceAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.LobAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MapKeyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MappedSuperclassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OrderByAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTablesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SequenceGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TemporalAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TransientAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.VersionAnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-
-public class GenericJpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE =
- new GenericJpaAnnotationDefinitionProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure singleton usage
- */
- protected GenericJpaAnnotationDefinitionProvider() {
- super();
- }
-
-
- @Override
- protected void addTypeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(DiscriminatorColumnAnnotationDefinition.instance());
- definitions.add(DiscriminatorValueAnnotationDefinition.instance());
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(IdClassAnnotationDefinition.instance());
- definitions.add(InheritanceAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- definitions.add(NamedQueryAnnotationDefinition.instance());
- definitions.add(NamedQueriesAnnotationDefinition.instance());
- definitions.add(NamedNativeQueryAnnotationDefinition.instance());
- definitions.add(NamedNativeQueriesAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SecondaryTableAnnotationDefinition.instance());
- definitions.add(SecondaryTablesAnnotationDefinition.instance());
- definitions.add(SequenceGeneratorAnnotationDefinition.instance());
- definitions.add(TableAnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- }
-
- @Override
- protected void addTypeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- }
-
- @Override
- protected void addAttributeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(AssociationOverrideAnnotationDefinition.instance());
- definitions.add(AssociationOverridesAnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(BasicAnnotationDefinition.instance());
- definitions.add(ColumnAnnotationDefinition.instance());
- definitions.add(EmbeddedAnnotationDefinition.instance());
- definitions.add(EmbeddedIdAnnotationDefinition.instance());
- definitions.add(EnumeratedAnnotationDefinition.instance());
- definitions.add(GeneratedValueAnnotationDefinition.instance());
- definitions.add(IdAnnotationDefinition.instance());
- definitions.add(JoinColumnAnnotationDefinition.instance());
- definitions.add(JoinColumnsAnnotationDefinition.instance());
- definitions.add(JoinTableAnnotationDefinition.instance());
- definitions.add(LobAnnotationDefinition.instance());
- definitions.add(ManyToManyAnnotationDefinition.instance());
- definitions.add(ManyToOneAnnotationDefinition.instance());
- definitions.add(MapKeyAnnotationDefinition.instance());
- definitions.add(OneToManyAnnotationDefinition.instance());
- definitions.add(OneToOneAnnotationDefinition.instance());
- definitions.add(OrderByAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SequenceGeneratorAnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- definitions.add(TemporalAnnotationDefinition.instance());
- definitions.add(TransientAnnotationDefinition.instance());
- definitions.add(VersionAnnotationDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationProvider.java
deleted file mode 100644
index 07794ca782..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaAnnotationProvider.java
+++ /dev/null
@@ -1,163 +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.core.internal;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 class GenericJpaAnnotationProvider
- implements JpaAnnotationProvider
-{
- private final JpaAnnotationDefinitionProvider[] annotationDefinitionProviders;
-
- public GenericJpaAnnotationProvider(JpaAnnotationDefinitionProvider... annotationDefinitionProviders) {
- super();
- this.annotationDefinitionProviders = annotationDefinitionProviders;
- }
-
-
- // ********** convenience methods **********
-
- protected Iterator<String> annotationNames(Iterator<AnnotationDefinition> annotationDefinitions) {
- return new TransformationIterator<AnnotationDefinition, String>(annotationDefinitions) {
- @Override
- protected String transform(AnnotationDefinition annotationDefinition) {
- return annotationDefinition.getAnnotationName();
- }
- };
- }
-
- protected AnnotationDefinition selectAnnotationDefinition(Iterator<AnnotationDefinition> annotationDefinitions, String annotationName) {
- while (annotationDefinitions.hasNext()) {
- AnnotationDefinition annotationDefinition = annotationDefinitions.next();
- if (annotationDefinition.getAnnotationName().equals(annotationName)) {
- return annotationDefinition;
- }
- }
- return null;
- }
-
-
- // ********** annotation definition providers **********
-
- protected ListIterator<JpaAnnotationDefinitionProvider> annotationDefinitionProviders() {
- return new ArrayListIterator<JpaAnnotationDefinitionProvider>(this.annotationDefinitionProviders);
- }
-
-
- // ********** type annotations **********
-
- public Iterator<String> typeAnnotationNames() {
- return this.annotationNames(this.typeAnnotationDefinitions());
- }
-
- protected Iterator<AnnotationDefinition> typeAnnotationDefinitions() {
- return new CompositeIterator<AnnotationDefinition> (
- new TransformationIterator<JpaAnnotationDefinitionProvider, Iterator<AnnotationDefinition>>(this.annotationDefinitionProviders()) {
- @Override
- protected Iterator<AnnotationDefinition> transform(JpaAnnotationDefinitionProvider annotationDefinitionProvider) {
- return annotationDefinitionProvider.typeAnnotationDefinitions();
- }
- }
- );
- }
-
- public Iterator<String> typeMappingAnnotationNames() {
- return this.annotationNames(typeMappingAnnotationDefinitions());
- }
-
- protected Iterator<AnnotationDefinition> typeMappingAnnotationDefinitions() {
- return new CompositeIterator<AnnotationDefinition> (
- new TransformationIterator<JpaAnnotationDefinitionProvider, Iterator<AnnotationDefinition>>(this.annotationDefinitionProviders()) {
- @Override
- protected Iterator<AnnotationDefinition> transform(JpaAnnotationDefinitionProvider annotationDefinitionProvider) {
- return annotationDefinitionProvider.typeMappingAnnotationDefinitions();
- }
- }
- );
- }
-
- public Annotation buildTypeAnnotation(JavaResourcePersistentType parent, Type type, String annotationName) {
- return this.getTypeAnnotationDefinition(annotationName).buildAnnotation(parent, type);
- }
-
- public Annotation buildTypeAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- return this.getTypeAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
- }
-
- protected AnnotationDefinition getTypeAnnotationDefinition(String annotationName) {
- AnnotationDefinition annotationDefinition = this.selectAnnotationDefinition(this.typeAnnotationDefinitions(), annotationName);
- if (annotationDefinition == null) {
- throw new IllegalArgumentException("unsupported type annotation: " + annotationName); //$NON-NLS-1$
- }
- return annotationDefinition;
- }
-
- public Annotation buildNullTypeAnnotation(JavaResourcePersistentType parent, String annotationName) {
- return this.getTypeAnnotationDefinition(annotationName).buildNullAnnotation(parent);
- }
-
-
- // ********** attribute annotations **********
-
- public Iterator<String> attributeAnnotationNames() {
- return this.annotationNames(attributeAnnotationDefinitions());
- }
-
- protected Iterator<AnnotationDefinition> attributeAnnotationDefinitions() {
- return new CompositeIterator<AnnotationDefinition> (
- new TransformationIterator<JpaAnnotationDefinitionProvider, Iterator<AnnotationDefinition>>(this.annotationDefinitionProviders()) {
- @Override
- protected Iterator<AnnotationDefinition> transform(JpaAnnotationDefinitionProvider annotationDefinitionProvider) {
- return annotationDefinitionProvider.attributeAnnotationDefinitions();
- }
- }
- );
- }
-
- public Annotation buildAttributeAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, String annotationName) {
- return this.getAttributeAnnotationDefinition(annotationName).buildAnnotation(parent, attribute);
- }
-
- public Annotation buildAttributeAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- return this.getAttributeAnnotationDefinition(jdtAnnotation.getElementName()).buildAnnotation(parent, jdtAnnotation);
- }
-
- public Annotation buildNullAttributeAnnotation(JavaResourcePersistentAttribute parent, String annotationName) {
- return this.getAttributeAnnotationDefinition(annotationName).buildNullAnnotation(parent);
- }
-
- protected AnnotationDefinition getAttributeAnnotationDefinition(String annotationName) {
- AnnotationDefinition annotationDefinition = this.selectAnnotationDefinition(this.attributeAnnotationDefinitions(), annotationName);
- if (annotationDefinition == null) {
- throw new IllegalArgumentException("unsupported attribute annotation: " + annotationName); //$NON-NLS-1$
- }
- return annotationDefinition;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java
deleted file mode 100644
index baa7ffbfde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatform.java
+++ /dev/null
@@ -1,253 +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.core.internal;
-
-import java.util.ListIterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.EntityGeneratorDatabaseAnnotationNameBuilder;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.core.internal.utility.jdt.DefaultAnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Tools;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class GenericJpaPlatform
- implements JpaPlatform
-{
- private final String id;
-
- private final Version jpaVersion;
-
- private final JpaFactory jpaFactory;
-
- private final JpaAnnotationProvider annotationProvider;
-
- private final JpaPlatformProvider platformProvider;
-
- private final JpaPlatformVariation jpaVariation;
-
-
- public GenericJpaPlatform(String id, Version jpaVersion, JpaFactory jpaFactory, JpaAnnotationProvider jpaAnnotationProvider, JpaPlatformProvider platformProvider, JpaPlatformVariation jpaVariation) {
- super();
- this.id = id;
- this.jpaVersion = jpaVersion;
- this.jpaFactory = jpaFactory;
- this.annotationProvider = jpaAnnotationProvider;
- this.jpaVariation = jpaVariation;
- this.platformProvider = platformProvider;
- }
-
-
- public String getId() {
- return this.id;
- }
-
- public Version getJpaVersion() {
- return this.jpaVersion;
- }
-
- // ********** factory **********
-
- public JpaFactory getJpaFactory() {
- return this.jpaFactory;
- }
-
-
- // ********** platform providers **********
-
- protected JpaPlatformProvider getPlatformProvider() {
- return this.platformProvider;
- }
-
-
- // ********** JPA file/resource models **********
-
- public JpaFile buildJpaFile(JpaProject jpaProject, IFile file) {
- IContentType contentType = PlatformTools.getContentType(file);
- return (contentType == null) ? null : this.buildJpaFile(jpaProject, file, contentType);
- }
-
- protected JpaFile buildJpaFile(JpaProject jpaProject, IFile file, IContentType contentType) {
- JpaResourceModel resourceModel = this.buildResourceModel(jpaProject, file, contentType);
- return (resourceModel == null) ? null : this.jpaFactory.buildJpaFile(jpaProject, file, contentType, resourceModel);
- }
-
- protected JpaResourceModel buildResourceModel(JpaProject jpaProject, IFile file, IContentType contentType) {
- JpaResourceModelProvider provider = this.getResourceModelProvider(contentType);
- return (provider == null) ? null : provider.buildResourceModel(jpaProject, 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 JpaResourceModelProvider getResourceModelProvider(IContentType contentType) {
- for (JpaResourceModelProvider provider : CollectionTools.iterable(resourceModelProviders())) {
- if (contentType.equals(provider.getContentType())) {
- return provider;
- }
- }
- return null;
- }
-
- protected ListIterator<JpaResourceModelProvider> resourceModelProviders() {
- return this.platformProvider.resourceModelProviders();
- }
-
-
- // ********** Java annotations **********
-
- public JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return DefaultAnnotationEditFormatter.instance();
- }
-
-
- // ********** Java type mappings **********
-
- public JavaTypeMappingDefinition getJavaTypeMappingDefinition(JavaPersistentType type) {
- for (JavaTypeMappingDefinition definition :
- CollectionTools.iterable(javaTypeMappingDefinitions())) {
- if (definition.test(type)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all types"); //$NON-NLS-1$
- }
-
- public JavaTypeMappingDefinition getJavaTypeMappingDefinition(String mappingKey) {
- for (JavaTypeMappingDefinition definition :
- CollectionTools.iterable(javaTypeMappingDefinitions())) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- protected ListIterator<JavaTypeMappingDefinition> javaTypeMappingDefinitions() {
- return this.platformProvider.javaTypeMappingDefinitions();
- }
-
-
- // ********** Java attribute mappings **********
-
- public JavaAttributeMappingDefinition getDefaultJavaAttributeMappingDefinition(
- JavaPersistentAttribute attribute) {
- for (JavaAttributeMappingDefinition definition :
- CollectionTools.iterable(defaultJavaAttributeMappingDefinitions())) {
- if (definition.testDefault(attribute)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all attributes"); //$NON-NLS-1$
- }
-
- protected ListIterator<JavaAttributeMappingDefinition> defaultJavaAttributeMappingDefinitions() {
- return this.platformProvider.defaultJavaAttributeMappingDefinitions();
- }
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(
- JavaPersistentAttribute attribute) {
- for (JavaAttributeMappingDefinition definition :
- CollectionTools.iterable(specifiedJavaAttributeMappingDefinitions())) {
- if (definition.testSpecified(attribute)) {
- return definition;
- }
- }
- throw new IllegalStateException("There must be a mapping definition for all attributes"); //$NON-NLS-1$
- }
-
- protected ListIterator<JavaAttributeMappingDefinition> specifiedJavaAttributeMappingDefinitions() {
- return this.platformProvider.specifiedJavaAttributeMappingDefinitions();
- }
-
- public JavaAttributeMappingDefinition getSpecifiedJavaAttributeMappingDefinition(String mappingKey) {
- for (JavaAttributeMappingDefinition definition :
- CollectionTools.iterable(specifiedJavaAttributeMappingDefinitions())) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
-
- // ********** resource types and definitions **********
-
- public boolean supportsResourceType(JpaResourceType resourceType) {
- for (ResourceDefinition resourceDefinition : CollectionTools.iterable(resourceDefinitions())) {
- if (resourceDefinition.getResourceType().equals(resourceType)) {
- return true;
- }
- }
- return false;
- }
-
- public ResourceDefinition getResourceDefinition(JpaResourceType resourceType) {
- for (ResourceDefinition resourceDefinition : CollectionTools.iterable(resourceDefinitions())) {
- if (resourceDefinition.getResourceType().equals(resourceType)) {
- return resourceDefinition;
- }
- }
- throw new IllegalArgumentException("Illegal resource type: " + resourceType); //$NON-NLS-1$
- }
-
- protected ListIterator<ResourceDefinition> resourceDefinitions() {
- return this.platformProvider.resourceDefinitions();
- }
-
- public JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- return this.platformProvider.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** database **********
-
- public ConnectionProfileFactory getConnectionProfileFactory() {
- return JptDbPlugin.instance().getConnectionProfileFactory();
- }
-
- public EntityGeneratorDatabaseAnnotationNameBuilder getEntityGeneratorDatabaseAnnotationNameBuilder() {
- return GenericEntityGeneratorDatabaseAnnotationNameBuilder.instance();
- }
-
-
- // ********** validation **********
-
- public JpaPlatformVariation getJpaVariation() {
- return this.jpaVariation;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformFactory.java
deleted file mode 100644
index dbd21b794c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformFactory.java
+++ /dev/null
@@ -1,97 +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.core.internal;
-
-import java.util.Comparator;
-
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.jpa1.GenericJpaFactory;
-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 GenericJpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public GenericJpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- this.buildJpaVersion(),
- new GenericJpaFactory(),
- new GenericJpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider.instance()),
- GenericJpaPlatformProvider.instance(),
- this.buildJpaPlatformVariation());
- }
-
-
- private JpaPlatform.Version buildJpaVersion() {
- return new SimpleVersion(JptCorePlugin.JPA_FACET_VERSION_1_0);
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.MAYBE;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- };
- }
-
-
- public static class SimpleVersion implements JpaPlatform.Version {
- protected final String jpaVersion;
-
- public static final Comparator<String> JPA_VERSION_COMPARATOR = new DefaultVersionComparator();
-
- public SimpleVersion(String jpaVersion) {
- super();
- this.jpaVersion = jpaVersion;
- }
-
- /**
- * The generic platform's version is the same as the JPA version.
- */
- public String getVersion() {
- return this.getJpaVersion();
- }
-
- public String getJpaVersion() {
- return this.jpaVersion;
- }
-
- /**
- * For now, generic platforms are backward-compatible.
- */
- public boolean isCompatibleWithJpaVersion(String version) {
- return JPA_VERSION_COMPARATOR.compare(this.jpaVersion, version) >= 0;
- }
-
- @Override
- public String toString() {
- return "JPA version: " + this.getJpaVersion(); //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformProvider.java
deleted file mode 100644
index 751b62c1da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/GenericJpaPlatformProvider.java
+++ /dev/null
@@ -1,144 +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.core.internal;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class GenericJpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "generic"; //$NON-NLS-1$
-
- // singleton
- private static final JpaPlatformProvider INSTANCE =
- new GenericJpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private GenericJpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()};
- }
-
-
- // ********** Java type mappings **********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (toplink) uses
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********** Java attribute mappings **********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (toplink) uses
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (eclipselink) uses
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaOneToManyMappingDefinition.instance(),
- JavaOneToOneMappingDefinition.instance()};
- }
-
-
- // ********** Mapping Files **********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- return new ResourceDefinition[] {
- GenericPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JarResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JarResourceModelProvider.java
deleted file mode 100644
index 1347db8270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JarResourceModelProvider.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.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPackageFragmentRoot;
-
-/**
- * JAR files
- */
-public class JarResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new JarResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JarResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCorePlugin.JAR_CONTENT_TYPE;
- }
-
- /**
- * NB: Despite the check in GenericJpaProject.addJpaFile_(IFile),
- * we can get here and
- * the PFR will be null if the JAR is underneath a directory on the
- * classpath but the JAR itself is not on the classpath.
- * Returning null should be OK.
- */
- public JpaResourceModel buildResourceModel(JpaProject jpaProject, IFile file) {
- IPackageFragmentRoot pfr = JavaCore.createJarPackageFragmentRootFrom(file);
- return (pfr ==null) ? null : new BinaryPackageFragmentRoot(pfr, jpaProject.getJpaPlatform().getAnnotationProvider());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaResourceModelProvider.java
deleted file mode 100644
index 5d87c03086..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JavaResourceModelProvider.java
+++ /dev/null
@@ -1,57 +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.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.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-
-/**
- * Java source code
- */
-public class JavaResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new JavaResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JavaResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE;
- }
-
- public JavaResourceCompilationUnit buildResourceModel(JpaProject jpaProject, IFile file) {
- return new SourceCompilationUnit(
- JavaCore.createCompilationUnitFrom(file),
- jpaProject.getJpaPlatform().getAnnotationProvider(),
- jpaProject.getJpaPlatform().getAnnotationEditFormatter(),
- jpaProject.getModifySharedDocumentCommandExecutor()
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java
deleted file mode 100644
index 40081ca6fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformRegistry.java
+++ /dev/null
@@ -1,276 +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.core.internal;
-
-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.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Singleton registry for storing all the registered JPA platform configuration
- * elements and instantiating JPA platforms from them.
- */
-public class JpaPlatformRegistry {
-
- private final HashMap<String, IConfigurationElement> jpaPlatformConfigurationElements;
-
-
- // singleton
- private static final JpaPlatformRegistry INSTANCE = new JpaPlatformRegistry();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformRegistry instance() {
- return INSTANCE;
- }
-
- private static final String EXTENSION_ID = "jpaPlatforms"; //$NON-NLS-1$
- private static final String PLATFORM_ELEMENT_NAME = "jpaPlatform"; //$NON-NLS-1$
- private static final String ID_ATTRIBUTE_NAME = "id"; //$NON-NLS-1$
- private static final String LABEL_ATTRIBUTE_NAME = "label"; //$NON-NLS-1$
- private static final String FACTORY_CLASS_ATTRIBUTE_NAME = "factoryClass"; //$NON-NLS-1$
- private static final String JPA_FACET_VERSION_ATTRIBUTE_NAME = "jpaFacetVersion"; //$NON-NLS-1$
- private static final String DEFAULT_ATTRIBUTE_NAME = "default"; //$NON-NLS-1$
-
-
- // ********** constructor/initialization **********
-
- /**
- * ensure single instance
- */
- private JpaPlatformRegistry() {
- super();
- this.jpaPlatformConfigurationElements = this.buildJpaPlatformConfigurationElements();
- }
-
-
- private HashMap<String, IConfigurationElement> buildJpaPlatformConfigurationElements() {
- HashMap<String, IConfigurationElement> configElements = new HashMap<String, IConfigurationElement>();
- for (IConfigurationElement configElement : this.getConfigElements()) {
- this.addConfigElementTo(configElement, configElements);
- }
- return configElements;
- }
-
- /**
- * Return the configuration elements from the Eclipse platform extension
- * registry.
- */
- private Iterable<IConfigurationElement> getConfigElements() {
- return new CompositeIterable<IConfigurationElement>(
- new TransformationIterable<IExtension, Iterable<IConfigurationElement>>(this.getExtensions()) {
- @Override
- protected Iterable<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterable(extension.getConfigurationElements());
- }
- }
- );
- }
-
- private Iterable<IExtension> getExtensions() {
- return CollectionTools.iterable(this.getExtensionPoint().getExtensions());
- }
-
- private IExtensionPoint getExtensionPoint() {
- return Platform.getExtensionRegistry().getExtensionPoint(JptCorePlugin.PLUGIN_ID, EXTENSION_ID);
- }
-
- private void addConfigElementTo(IConfigurationElement configElement, HashMap<String, IConfigurationElement> configElements) {
- if ( ! configElement.getName().equals(PLATFORM_ELEMENT_NAME)) {
- return;
- }
- if ( ! this.configElementIsValid(configElement)) {
- return;
- }
-
- String id = configElement.getAttribute(ID_ATTRIBUTE_NAME);
- IConfigurationElement prev = configElements.put(id, configElement);
- if (prev != null) {
- configElements.put(id, prev); // replace previous(?)
- this.logDuplicatePlatform(prev, configElement, id);
- }
- }
-
- /**
- * check *all* attributes before returning
- */
- private boolean configElementIsValid(IConfigurationElement configElement) {
- boolean valid = true;
- if (configElement.getAttribute(ID_ATTRIBUTE_NAME) == null) {
- this.logMissingAttribute(configElement, ID_ATTRIBUTE_NAME);
- valid = false;
- }
- if (configElement.getAttribute(LABEL_ATTRIBUTE_NAME) == null) {
- this.logMissingAttribute(configElement, LABEL_ATTRIBUTE_NAME);
- valid = false;
- }
- if (configElement.getAttribute(FACTORY_CLASS_ATTRIBUTE_NAME) == null) {
- this.logMissingAttribute(configElement, FACTORY_CLASS_ATTRIBUTE_NAME);
- valid = false;
- }
- return valid;
- }
-
-
- // ********** public methods **********
-
- /**
- * Return the IDs for the registered JPA platforms.
- * This does not activate any of the JPA platforms' plug-ins.
- */
- public Iterable<String> getJpaPlatformIds() {
- return this.jpaPlatformConfigurationElements.keySet();
- }
-
- /**
- * Return whether the platform id is registered
- */
- public boolean containsPlatform(String platformId) {
- return this.jpaPlatformConfigurationElements.containsKey(platformId);
- }
-
- /**
- * Return the label for the JPA platform with the specified ID.
- * This does not activate the JPA platform's plug-in.
- */
- public String getJpaPlatformLabel(String id) {
- return this.jpaPlatformConfigurationElements.get(id).getAttribute(LABEL_ATTRIBUTE_NAME);
- }
-
- /**
- * Return whether the platform represented by the given id supports the specified JPA facet version.
- * This does not active the JPA platform's plug-in.
- */
- public boolean platformSupportsJpaFacetVersion(String platformId, String jpaFacetVersion) {
- IConfigurationElement configElement = this.jpaPlatformConfigurationElements.get(platformId);
- return configElementSupportsJpaFacetVersion(configElement, jpaFacetVersion);
- }
-
- boolean configElementSupportsJpaFacetVersion(IConfigurationElement configElement, String jpaFacetVersion) {
-
- // config element supports version if it explicitly sets it to that version
- // or if it specifies no version at all
- String ver = configElement.getAttribute(JPA_FACET_VERSION_ATTRIBUTE_NAME);
- return (ver == null) || ver.equals(jpaFacetVersion);
- }
-
- /**
- * Return the IDs for the registered JPA platforms that support the
- * specified JPA facet version.
- * This does not activate the JPA platforms' plug-in.
- */
- public Iterable<String> getJpaPlatformIdsForJpaFacetVersion(final String jpaFacetVersion) {
- return new TransformationIterable<IConfigurationElement, String>(this.getConfigurationElementsForJpaFacetVersion(jpaFacetVersion)) {
- @Override
- protected String transform(IConfigurationElement configElement) {
- return configElement.getAttribute(ID_ATTRIBUTE_NAME);
- }
- };
- }
-
- private Iterable<IConfigurationElement> getConfigurationElementsForJpaFacetVersion(final String jpaFacetVersion) {
- return new FilteringIterable<IConfigurationElement>(this.jpaPlatformConfigurationElements.values()) {
- @Override
- protected boolean accept(IConfigurationElement configElement) {
- return configElementSupportsJpaFacetVersion(configElement, jpaFacetVersion);
- }
- };
- }
-
- /**
- * Return the ID for a JPA platform registered as a default platform.
- * Returns null if there are no such registered platforms.
- * Returns the first platform ID if there are multiple such registered platforms.
- */
- public String getDefaultJpaPlatformId(String jpaFacetVersion) {
- for (Map.Entry<String, IConfigurationElement> entry: this.jpaPlatformConfigurationElements.entrySet()) {
- String defaultFlag = entry.getValue().getAttribute(DEFAULT_ATTRIBUTE_NAME);
- String platformId = entry.getKey();
- if ((defaultFlag != null) && defaultFlag.equals("true")
- && platformSupportsJpaFacetVersion(platformId, jpaFacetVersion)) { //$NON-NLS-1$
- return platformId;
- }
- }
- return null;
- }
-
- /**
- * Return a new JPA platform for the specified ID.
- * NB: This should only be called when instantiating a JPA platform
- * when building a new JPA project.
- * Unlike other registry methods, invoking this method may activate
- * the plug-in.
- */
- public JpaPlatform getJpaPlatform(IProject project) {
- String id = JptCorePlugin.getJpaPlatformId(project);
- IConfigurationElement configElement = this.jpaPlatformConfigurationElements.get(id);
- if (configElement == null) {
- this.log(JptCoreMessages.PLATFORM_ID_DOES_NOT_EXIST, id, project.getName());
- return null;
- }
- JpaPlatformFactory platformFactory;
- try {
- platformFactory = (JpaPlatformFactory) configElement.createExecutableExtension(FACTORY_CLASS_ATTRIBUTE_NAME);
- } catch (CoreException ex) {
- this.logFailedInstantiation(configElement, ex);
- throw new IllegalArgumentException(id);
- }
- return platformFactory.buildJpaPlatform(id);
- }
-
-
- // ********** errors **********
-
- private void logMissingAttribute(IConfigurationElement configElement, String attributeName) {
- this.log(JptCoreMessages.REGISTRY_MISSING_ATTRIBUTE,
- configElement.getName(),
- configElement.getContributor().getName(),
- attributeName
- );
- }
-
- private void logDuplicatePlatform(IConfigurationElement prevConfigElement, IConfigurationElement newConfigElement, String id) {
- this.log(JptCoreMessages.REGISTRY_DUPLICATE,
- prevConfigElement.getContributor().getName(),
- newConfigElement.getContributor().getName(),
- ID_ATTRIBUTE_NAME,
- PLATFORM_ELEMENT_NAME,
- id
- );
- }
-
- private void logFailedInstantiation(IConfigurationElement configElement, CoreException ex) {
- this.log(JptCoreMessages.REGISTRY_FAILED_INSTANTIATION,
- configElement.getAttribute(FACTORY_CLASS_ATTRIBUTE_NAME),
- configElement.getName(),
- configElement.getContributor().getName()
- );
- JptCorePlugin.log(ex);
- }
-
- private void log(String msg, Object... bindings) {
- JptCorePlugin.log(NLS.bind(msg, bindings));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.java
deleted file mode 100644
index cf4f51e897..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaPlatformTester.java
+++ /dev/null
@@ -1,40 +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.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.core.JptCorePlugin;
-
-public class JpaPlatformTester extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (! property.equals("jpaPlatform")) { //$NON-NLS-1$
- return false;
- }
-
- String platformId = null;
-
- if (receiver instanceof IResource) {
- platformId = platformId(((IResource) receiver).getProject());
- }
- else if (receiver instanceof IJavaElement) {
- platformId = platformId(((IJavaElement) receiver).getResource().getProject());
- }
-
-
- return platformId == null ? false : platformId.equals(expectedValue);
- }
-
- private String platformId(IProject project) {
- return (project == null) ? null : JptCorePlugin.getJpaPlatformId(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaTester.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaTester.java
deleted file mode 100644
index cb32a9531c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaTester.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/******************************************************************************
- * Copyright (c) 2008 BEA Systems, Inc 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:
- * Konstantin Komissarchik - initial implementation and ongoing maintenance
- * Oracle - copied and modified from org.eclipse.wst.common.project.facet.core.internal.FacetedProjectPropertyTester
- ******************************************************************************/
-package org.eclipse.jpt.core.internal;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-
-public class JpaTester extends PropertyTester {
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (!property.equals("projectFacet")) { //$NON-NLS-1$
- return false;
- }
- if (receiver instanceof IJavaElement) {
- IProject project = ((IJavaElement) receiver).getResource().getProject();
- if (project != null) {
-
- String val = (String) expectedValue;
- int colon = val.indexOf( ':' );
- String facetID;
- String facetVer;
- if( colon == -1 || colon == val.length() - 1 ) {
- facetID = val;
- facetVer = null;
- } else {
- facetID = val.substring( 0, colon );
- facetVer = val.substring( colon + 1 );
- }
- try {
- return FacetedProjectFramework.hasProjectFacet( project, facetID, facetVer );
- } catch (CoreException e) {
- JptCorePlugin.log(e.getStatus());
- return false;
- }
- }
- }
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java
deleted file mode 100644
index ec15ff5a9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JptCoreMessages.java
+++ /dev/null
@@ -1,70 +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.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali core.
- */
-public class JptCoreMessages {
-
- public static String NONE;
- public static String VALIDATE_JOB;
- public static String VALIDATE_PROJECT_NOT_SPECIFIED;
- public static String VALIDATE_SOURCE_FOLDER_NOT_SPECIFIED;
- public static String VALIDATE_SOURCE_FOLDER_ILLEGAL;
- public static String VALIDATE_SOURCE_FOLDER_DOES_NOT_EXIST;
- public static String VALIDATE_SOURCE_FOLDER_NOT_IN_PROJECT;
- public static String VALIDATE_SOURCE_FOLDER_NOT_SOURCE_FOLDER;
- public static String VALIDATE_FILE_PATH_NOT_SPECIFIED;
- public static String VALIDATE_FILE_ALREADY_EXISTS;
- public static String VALIDATE_FILE_VERSION_NOT_SUPPORTED;
- public static String VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION;
- public static String VALIDATE_PERSISTENCE_UNIT_DOES_NOT_SPECIFIED;
- public static String VALIDATE_PERSISTENCE_UNIT_NOT_IN_PROJECT;
- public static String VALIDATE_PLATFORM_NOT_SPECIFIED;
- public static String VALIDATE_PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION;
- public static String VALIDATE_CONNECTION_NOT_SPECIFIED;
- public static String VALIDATE_CONNECTION_INVALID;
- public static String VALIDATE_CONNECTION_NOT_CONNECTED;
- public static String VALIDATE_DEFAULT_CATALOG_NOT_SPECIFIED;
- public static String VALIDATE_CONNECTION_DOESNT_CONTAIN_CATALOG;
- public static String VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED;
- public static String VALIDATE_CONNECTION_DOESNT_CONTAIN_SCHEMA;
- public static String VALIDATE_RUNTIME_NOT_SPECIFIED;
- public static String VALIDATE_RUNTIME_DOES_NOT_SUPPORT_EJB_30;
- public static String VALIDATE_LIBRARY_NOT_SPECIFIED;
- public static String SYNCHRONIZE_CLASSES_JOB;
- public static String SYNCHRONIZING_CLASSES_TASK;
- public static String INVALID_PERSISTENCE_XML_CONTENT;
- public static String ERROR_SYNCHRONIZING_CLASSES_COULD_NOT_VALIDATE;
- public static String ERROR_WRITING_FILE;
- public static String REGISTRY_MISSING_ATTRIBUTE;
- public static String REGISTRY_DUPLICATE;
- public static String REGISTRY_FAILED_INSTANTIATION;
- public static String UPDATE_JOB_NAME;
- public static String PLATFORM_ID_DOES_NOT_EXIST;
- public static String DALI_EVENT_HANDLER_THREAD_NAME;
- public static String PREFERENCES_FLUSH_JOB_NAME;
- public static String KEY_CLASSES_VALIDATOR__CLASS_NOT_FOUND;
-
-
- private static final String BUNDLE_NAME = "jpa_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptCoreMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptCoreMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmResourceModelProvider.java
deleted file mode 100644
index 037784f18c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/OrmResourceModelProvider.java
+++ /dev/null
@@ -1,50 +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.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.orm.OrmXmlResourceProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-/**
- * orm.xml
- */
-public class OrmResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new OrmResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrmResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- public JpaXmlResource buildResourceModel(JpaProject jpaProject, IFile file) {
- return OrmXmlResourceProvider.getXmlResourceProvider(file).getXmlResource();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceResourceModelProvider.java
deleted file mode 100644
index 1e12878e0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/PersistenceResourceModelProvider.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.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceXmlResourceProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-/**
- * persistence.xml
- */
-public class PersistenceResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new PersistenceResourceModelProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PersistenceResourceModelProvider() {
- super();
- }
-
- public IContentType getContentType() {
- return JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE;
- }
-
- public JpaXmlResource buildResourceModel(JpaProject jpaProject, IFile file) {
- return PersistenceXmlResourceProvider.getXmlResourceProvider(file).getXmlResource();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java
deleted file mode 100644
index fa80271fb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ProjectAdapterFactory.java
+++ /dev/null
@@ -1,62 +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.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * [Double-duty] factory to build adapters for either standard projects or
- * Java projects:
- * - JPA project
- *
- * See org.eclipse.jpt.core plugin.xml.
- */
-public class ProjectAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaProject.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("unchecked") Class adapterType) {
- if (adaptableObject instanceof IProject) {
- return this.getAdapter((IProject) adaptableObject, adapterType);
- }
- if (adaptableObject instanceof IJavaProject) {
- return this.getAdapter((IJavaProject) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IProject project, Class <?>adapterType) {
- if (adapterType == JpaProject.class) {
- return this.getJpaProject(project);
- }
- return null;
- }
-
- private Object getAdapter(IJavaProject javaProject, Class <?>adapterType) {
- if (adapterType == JpaProject.class) {
- return this.getJpaProject(javaProject.getProject());
- }
- return null;
- }
-
- private JpaProject getJpaProject(IProject project) {
- return JptCorePlugin.getJpaProject(project);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ResourceAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ResourceAdapterFactory.java
deleted file mode 100644
index 45fa245e63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/ResourceAdapterFactory.java
+++ /dev/null
@@ -1,49 +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.core.internal;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.IResourcePart;
-
-/**
- * Factory to build adapters for Eclipse resources:
- * - resource part
- *
- * See org.eclipse.jpt.core plugin.xml.
- */
-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("unchecked") 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java
deleted file mode 100644
index 2433fa229e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SimpleJpaProjectConfig.java
+++ /dev/null
@@ -1,94 +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.core.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Straightforward implementation of the JPA project config.
- */
-public class SimpleJpaProjectConfig implements JpaProject2_0.Config {
- protected IProject project;
- protected JpaPlatform jpaPlatform;
- protected String connectionProfileName;
- protected String userOverrideDefaultCatalog;
- protected String userOverrideDefaultSchema;
- protected boolean discoverAnnotatedClasses;
- protected String metamodelSourceFolderName;
-
- public SimpleJpaProjectConfig() {
- super();
- }
-
- public IProject getProject() {
- return this.project;
- }
-
- public void setProject(IProject project) {
- this.project = project;
- }
-
- public JpaPlatform getJpaPlatform() {
- return this.jpaPlatform;
- }
-
- public void setJpaPlatform(JpaPlatform jpaPlatform) {
- this.jpaPlatform = jpaPlatform;
- }
-
- public String getConnectionProfileName() {
- return this.connectionProfileName;
- }
-
- public void setConnectionProfileName(String connectionProfileName) {
- this.connectionProfileName = connectionProfileName;
- }
-
- public String getUserOverrideDefaultSchema() {
- return this.userOverrideDefaultSchema;
- }
-
- public void setUserOverrideDefaultSchema(String userOverrideDefaultSchema) {
- this.userOverrideDefaultSchema = userOverrideDefaultSchema;
- }
-
- public String getUserOverrideDefaultCatalog() {
- return this.userOverrideDefaultCatalog;
- }
-
- public void setUserOverrideDefaultCatalog(String userOverrideDefaultCatalog) {
- this.userOverrideDefaultCatalog = userOverrideDefaultCatalog;
- }
-
- public boolean discoverAnnotatedClasses() {
- return this.discoverAnnotatedClasses;
- }
-
- public void setDiscoverAnnotatedClasses(boolean discoverAnnotatedClasses) {
- this.discoverAnnotatedClasses = discoverAnnotatedClasses;
- }
-
- public String getMetamodelSourceFolderName() {
- return this.metamodelSourceFolderName;
- }
-
- public void setMetamodelSourceFolderName(String metamodelSourceFolderName) {
- this.metamodelSourceFolderName = metamodelSourceFolderName;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.project.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java
deleted file mode 100644
index 314b92e8d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/SynchronousJpaProjectUpdater.java
+++ /dev/null
@@ -1,49 +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.core.internal;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.synchronizers.CallbackSynchronizer;
-import org.eclipse.jpt.utility.internal.synchronizers.CallbackSynchronousSynchronizer;
-
-/**
- * Adapt the "callback synchronizer" interface to the JPA project "updater"
- * interface.
- * <p>
- * This updater will "update" the JPA project immediately and not return until
- * the "update" and all resulting "updates" are complete. This implementation
- * should be used sparingly and for as short a time as possible, as it increases
- * the probability of deadlocks. A deadlock can occur when a JPA project is
- * updated from multiple threads and various resources are locked in varying
- * orders.
- */
-public class SynchronousJpaProjectUpdater
- extends AbstractSynchronizerJpaProjectUpdater
-{
- public SynchronousJpaProjectUpdater(JpaProject jpaProject) {
- super(jpaProject);
- }
-
- @Override
- protected CallbackSynchronizer buildSynchronizer() {
- return new CallbackSynchronousSynchronizer(this.buildCommand());
- }
-
- protected Command buildCommand() {
- return new Command() {
- public void execute() {
- SynchronousJpaProjectUpdater.this.jpaProject.update(new NullProgressMonitor());
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java
deleted file mode 100644
index 5ee3fc9ab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractJpaContextNode.java
+++ /dev/null
@@ -1,108 +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.core.internal.context;
-
-import org.eclipse.jpt.core.JpaNode;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.AbstractJpaNode;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-public abstract class AbstractJpaContextNode
- extends AbstractJpaNode
- implements JpaContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractJpaContextNode(JpaNode parent) {
- super(parent);
- }
-
-
- // ********** JpaNode implentation **********
-
- /**
- * covariant override
- */
- @Override
- public JpaContextNode getParent() {
- return (JpaContextNode) super.getParent();
- }
-
-
- // ********** JpaContextNode implementation **********
-
- public JpaResourceType getResourceType() {
- return getParent().getResourceType();
- }
-
- /**
- * Overridden in {@link org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnit}
- * to return itself.
- * Overridden in {@link org.eclipse.jpt.core.internal.jpa1.context.GenericRootContextNode}
- * to return null.
- */
- public PersistenceUnit getPersistenceUnit() {
- return this.getParent().getPersistenceUnit();
- }
-
- /**
- * Overridden in {@link org.eclipse.jpt.core.internal.context.orm.AbstractEntityMappings}
- * to return itself.
- * Overridden in {@link org.eclipse.jpt.core.internal.jpa1.context.GenericRootContextNode}
- * to return null.
- */
- public MappingFileRoot getMappingFileRoot() {
- return this.getParent().getMappingFileRoot();
- }
-
- public Schema getContextDefaultDbSchema() {
- SchemaContainer dbSchemaContainer = this.getContextDefaultDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getContextDefaultSchema());
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getContextDefaultDbSchemaContainer() {
- String catalog = this.getContextDefaultCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- protected String getContextDefaultSchema() {
- MappingFileRoot mfr = this.getMappingFileRoot();
- return (mfr != null) ? mfr.getSchema() : this.getPersistenceUnit().getDefaultSchema();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getContextDefaultDbCatalog() {
- String catalog = this.getContextDefaultCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- protected String getContextDefaultCatalog() {
- MappingFileRoot mfr = this.getMappingFileRoot();
- return (mfr != null) ? mfr.getCatalog() : this.getPersistenceUnit().getDefaultCatalog();
- }
-
- public void postUpdate() {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java
deleted file mode 100644
index 66eec94d9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/AbstractXmlContextNode.java
+++ /dev/null
@@ -1,44 +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.core.internal.context;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.XmlContextNode;
-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 AbstractXmlContextNode
- extends AbstractJpaContextNode
- implements XmlContextNode
-{
-
- // ********** constructor **********
-
- protected AbstractXmlContextNode(JpaContextNode parent) {
- super(parent);
- }
-
-
- // ********** validation **********
-
- /**
- * All subclass implementations {@link #validate(List<IMessage>)}
- * should be preceded by a "super" call to this method
- */
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/EntityTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/EntityTextRangeResolver.java
deleted file mode 100644
index 694feefb54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/EntityTextRangeResolver.java
+++ /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
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context;
-
-
-public interface EntityTextRangeResolver
- extends PrimaryKeyTextRangeResolver
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java
deleted file mode 100644
index 106fc8d1e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/MappingTools.java
+++ /dev/null
@@ -1,288 +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.core.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.ReferenceTable;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.jpa2.context.AttributeMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.CollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * Gather some of the behavior common to the Java and XML models. :-(
- */
-public class MappingTools {
-
- /**
- * Default join table name from the JPA spec:<br>
- * "The concatenated names of the two associated primary
- * entity tables, separated by a underscore."
- * <pre>
- * [owning table name]_[target table name]
- * </pre>
- * <strong>NB:</strong> The <em>names</em> are concatenated,
- * <em>not</em> the <em>identifiers</em>.
- * E.g. the join table for <code>"Foo"</code> and <code>"baR"</code>
- * (where the "delimited" identifier is required) is:
- * <pre>
- * "Foo_baR"
- * </pre>
- * not
- * <pre>
- * "Foo"_"baR"
- * </pre>
- * As a result, we cannot honestly calculate the default name without a
- * database connection. We need the database to convert the resulting name
- * to an identifier appropriate to the current database.
- */
- public static String buildJoinTableDefaultName(RelationshipReference relationshipReference) {
- if (relationshipReference.getJpaProject().getDataSource().connectionProfileIsActive()) {
- return buildDbJoinTableDefaultName(relationshipReference);
- }
- // continue with a "best effort":
- String owningTableName = relationshipReference.getTypeMapping().getPrimaryTableName();
- if (owningTableName == null) {
- return null;
- }
- RelationshipMapping relationshipMapping = relationshipReference.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- String targetTableName = targetEntity.getPrimaryTableName();
- if (targetTableName == null) {
- return null;
- }
- return owningTableName + '_' + targetTableName;
- }
-
- /**
- * Use the database to build a more accurate default name.
- */
- protected static String buildDbJoinTableDefaultName(RelationshipReference relationshipReference) {
- Table owningTable = relationshipReference.getTypeMapping().getPrimaryDbTable();
- if (owningTable == null) {
- return null;
- }
- RelationshipMapping relationshipMapping = relationshipReference.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- Table targetTable = targetEntity.getPrimaryDbTable();
- if (targetTable == null) {
- return null;
- }
- String name = owningTable.getName() + '_' + targetTable.getName();
- return owningTable.getDatabase().convertNameToIdentifier(name);
- }
-
- /**
- * Default collection table name from the JPA spec:<br>
- * "The concatenation of the name of the containing entity and
- * the name of the collection attribute, separated by an underscore."
- * <pre>
- * [owning entity name]_[attribute name]
- * </pre>
- */
- public static String buildCollectionTableDefaultName(ElementCollectionMapping2_0 mapping) {
- Entity entity = mapping.getEntity();
- if (entity == null) {
- return null;
- }
- String owningEntityName = entity.getName();
- String attributeName = mapping.getName();
- return owningEntityName + '_' + attributeName;
- }
-
- /**
- * Return the join column's default name;
- * which is typically
- * [attribute name]_[referenced column name]
- * But, if we don't have an attribute name (e.g. in a unidirectional
- * OneToMany or ManyToMany) is
- * [target entity name]_[referenced column name]
- *
- * @see #buildJoinTableDefaultName(RelationshipMapping)
- */
- public static String buildJoinColumnDefaultName(JoinColumn joinColumn, JoinColumn.Owner owner) {
- if (owner.joinColumnsSize() != 1) {
- return null;
- }
- String prefix = owner.getAttributeName();
- if (prefix == null) {
- Entity targetEntity = owner.getRelationshipTarget();
- if (targetEntity == null) {
- return null;
- }
- prefix = targetEntity.getName();
- }
- // not sure which of these is correct...
- // (the spec implies that the referenced column is always the
- // primary key column of the target entity)
- // Column targetColumn = joinColumn.getTargetPrimaryKeyDbColumn();
- String targetColumnName = joinColumn.getReferencedColumnName();
- if (targetColumnName == null) {
- return null;
- }
- String name = prefix + '_' + targetColumnName;
- // not sure which of these is correct...
- // converting the name to an identifier will result in the identifier
- // being delimited nearly every time (at least on non-Sybase/MS
- // databases); but that probably is not the intent of the spec...
- // return targetColumn.getDatabase().convertNameToIdentifier(name);
- return name;
- }
-
- /**
- * If appropriate, return the name of the single primary key column of the
- * relationship target.
- * Spec states:<br>
- * "The same name as the primary key column of the referenced table."<br>
- * We are assuming that the primary key column is defined by the mappings instead of the database.
- */
- public static String buildJoinColumnDefaultReferencedColumnName(JoinColumn.Owner joinColumnOwner) {
- if (joinColumnOwner.joinColumnsSize() != 1) {
- return null;
- }
- Entity targetEntity = joinColumnOwner.getRelationshipTarget();
- if (targetEntity == null) {
- return null;
- }
- return targetEntity.getPrimaryKeyColumnName();
- }
-
- public static ColumnMapping getColumnMapping(String attributeName, PersistentType persistentType) {
- if (attributeName == null || persistentType == null) {
- return null;
- }
- for (Iterator<PersistentAttribute> stream = persistentType.allAttributes(); stream.hasNext(); ) {
- PersistentAttribute persAttribute = stream.next();
- if (attributeName.equals(persAttribute.getName())) {
- if (persAttribute.getMapping() instanceof ColumnMapping) {
- return (ColumnMapping) persAttribute.getMapping();
- }
- // keep looking or return null???
- }
- }
- return null;
- }
-
- public static RelationshipMapping getRelationshipMapping(String attributeName, TypeMapping typeMapping) {
- if (attributeName == null || typeMapping == null) {
- return null;
- }
- for (Iterator<AttributeMapping> stream = typeMapping.allAttributeMappings(); stream.hasNext(); ) {
- AttributeMapping attributeMapping = stream.next();
- if (attributeName.equals(attributeMapping.getName())) {
- if (attributeMapping instanceof RelationshipMapping) {
- return (RelationshipMapping) attributeMapping;
- }
- // keep looking or return null???
- }
- }
- return null;
- }
-
- public static void convertReferenceTableDefaultToSpecifiedJoinColumn(ReferenceTable referenceTable) {
- JoinColumn defaultJoinColumn = referenceTable.getDefaultJoinColumn();
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
- JoinColumn joinColumn = referenceTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- public static void convertJoinTableDefaultToSpecifiedInverseJoinColumn(JoinTable joinTable) {
- JoinColumn defaultInverseJoinColumn = joinTable.getDefaultInverseJoinColumn();
- if (defaultInverseJoinColumn != null) {
- String columnName = defaultInverseJoinColumn.getDefaultName();
- String referencedColumnName = defaultInverseJoinColumn.getDefaultReferencedColumnName();
- JoinColumn joinColumn = joinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
- public static String getMetamodelFieldMapKeyTypeName(CollectionMapping2_0 mapping) {
- PersistentType targetType = mapping.getResolvedTargetType();
- String mapKey = mapping.getMapKey();
- if (mapKey == null || targetType == null) {
- String mapKeyClass = mapping.getMapKeyClass();
- return mapKeyClass != null ? mapKeyClass : MetamodelField.DEFAULT_TYPE_NAME;
- }
- PersistentAttribute mapKeyAttribute = targetType.resolveAttribute(mapKey);
- if (mapKeyAttribute == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- AttributeMapping2_0 mapKeyMapping = (AttributeMapping2_0) mapKeyAttribute.getMapping();
- if (mapKeyMapping == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- return mapKeyMapping.getMetamodelTypeName();
- }
-
- public static Column resolveOverridenColumn(TypeMapping overridableTypeMapping, String attributeOverrideName) {
- if (overridableTypeMapping != null) {
- for (TypeMapping typeMapping : CollectionTools.iterable(overridableTypeMapping.inheritanceHierarchy())) {
- Column column = typeMapping.resolveOverriddenColumn(attributeOverrideName);
- if (column != null) {
- return column;
- }
- }
- }
- return null;
- }
-
- public static RelationshipReference resolveRelationshipReference(TypeMapping overridableTypeMapping, String associationOverrideName) {
- if (overridableTypeMapping != null) {
- for (TypeMapping typeMapping : CollectionTools.iterable(overridableTypeMapping.inheritanceHierarchy())) {
- RelationshipReference relationshipReference = typeMapping.resolveRelationshipReference(associationOverrideName);
- if (relationshipReference != null) {
- return relationshipReference;
- }
- }
- }
- return null;
- }
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private MappingTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PersistentAttributePropertyTester.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PersistentAttributePropertyTester.java
deleted file mode 100644
index 80ee5ff187..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PersistentAttributePropertyTester.java
+++ /dev/null
@@ -1,59 +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.core.internal.context;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-
-public class PersistentAttributePropertyTester extends PropertyTester
-{
- public static final String IS_MAPPED = "isMapped";
-
- public static final String IS_VIRTUAL = "isVirtual";
-
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- if (IS_MAPPED.equals(property)) {
- Boolean expectedIsMapped;
-
- try {
- expectedIsMapped = (Boolean) expectedValue;
- }
- catch (ClassCastException cce) {
- return false;
- }
-
- Boolean actualIsMapped = ((PersistentAttribute) receiver).getMappingKey() != MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
-
- return actualIsMapped == expectedIsMapped;
- }
- else if (IS_VIRTUAL.equals(property)) {
- Boolean expectedIsVirtual;
-
- try {
- expectedIsVirtual = (Boolean) expectedValue;
- }
- catch (ClassCastException cce) {
- return false;
- }
-
- Boolean actualIsVirtual = false;
- if (receiver instanceof OrmPersistentAttribute) {
- actualIsVirtual = ((OrmPersistentAttribute) receiver).isVirtual();
- }
-
- return actualIsVirtual == expectedIsVirtual;
- }
-
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyTextRangeResolver.java
deleted file mode 100644
index b49f38ba14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyTextRangeResolver.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context;
-
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Interface to resolve text ranges on persistent type mappings that can define primary keys
- */
-public interface PrimaryKeyTextRangeResolver
-{
- TextRange getTypeMappingTextRange();
-
- TextRange getIdClassTextRange();
-
- TextRange getAttributeMappingTextRange(String attributeName);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyValidator.java
deleted file mode 100644
index c4e0a6c9fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/PrimaryKeyValidator.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context;
-
-import java.util.List;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public interface PrimaryKeyValidator
-{
- void validate(List<IMessage> messages, IReporter reporter);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAssociationOverrideRelationshipReference.java
deleted file mode 100644
index 50b0229ea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAssociationOverrideRelationshipReference.java
+++ /dev/null
@@ -1,171 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnInAssociationOverrideJoiningStrategy;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaAssociationOverrideRelationshipReference extends AbstractJavaJpaContextNode
- implements JavaAssociationOverrideRelationshipReference
-{
-
- // cache the strategy for property change notification
- protected JoiningStrategy cachedPredominantJoiningStrategy;
-
- protected final JavaJoinColumnInAssociationOverrideJoiningStrategy joinColumnJoiningStrategy;
-
- protected AbstractJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent) {
- super(parent);
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- }
-
- protected JavaJoinColumnInAssociationOverrideJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericJavaJoinColumnInAssociationOverrideJoiningStrategy(this);
- }
-
- @Override
- public JavaAssociationOverride getParent() {
- return (JavaAssociationOverride) super.getParent();
- }
-
- public JavaAssociationOverride getAssociationOverride() {
- return getParent();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public TypeMapping getTypeMapping() {
- return getAssociationOverride().getOwner().getTypeMapping();
- }
-
- public Entity getEntity() {
- TypeMapping typeMapping = getTypeMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
- // **************** RelationshipMapping implementation *******************************
-
- public boolean isParentVirtual() {
- return getAssociationOverride().isVirtual();
- }
-
- // **************** predominant joining strategy ***************************
-
- public JoiningStrategy getPredominantJoiningStrategy() {
- return this.cachedPredominantJoiningStrategy;
- }
-
- protected void setPredominantJoiningStrategy(JoiningStrategy newJoiningStrategy) {
- JoiningStrategy oldJoiningStrategy = this.cachedPredominantJoiningStrategy;
- this.cachedPredominantJoiningStrategy = newJoiningStrategy;
- firePropertyChanged(PREDOMINANT_JOINING_STRATEGY_PROPERTY, oldJoiningStrategy, newJoiningStrategy);
- }
-
- public void initialize(AssociationOverrideAnnotation associationOverride) {
- initializeJoiningStrategies(associationOverride);
- this.cachedPredominantJoiningStrategy = calculatePredominantJoiningStrategy();
- }
-
- protected void initializeJoiningStrategies(AssociationOverrideAnnotation associationOverride) {
- this.joinColumnJoiningStrategy.initialize(associationOverride);
- }
-
- public void update(AssociationOverrideAnnotation associationOverride) {
- updateJoiningStrategies(associationOverride);
- setPredominantJoiningStrategy(calculatePredominantJoiningStrategy());
- }
-
- protected void updateJoiningStrategies(AssociationOverrideAnnotation associationOverride) {
- this.joinColumnJoiningStrategy.update(associationOverride);
- }
-
- protected abstract JoiningStrategy calculatePredominantJoiningStrategy();
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.joinColumnJoiningStrategy.javaCompletionProposals(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.joinColumnJoiningStrategy.validate(messages, reporter, astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAssociationOverride().getValidationTextRange(astRoot);
- }
-
- // **************** join columns *******************************************
-
-
- public JavaJoinColumnInAssociationOverrideJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.addStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return false;
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return getAssociationOverride().getOwner().getRelationshipMapping(getAssociationOverride().getName());
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return getRelationshipMapping().isOwnedBy(mapping);
- }
-
- public boolean isRelationshipOwner() {
- return getRelationshipMapping().isRelationshipOwner();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
deleted file mode 100644
index fe0ab53a8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMapping.java
+++ /dev/null
@@ -1,293 +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.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.SimpleMetamodelField;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.AttributeMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java attribute mapping
- */
-public abstract class AbstractJavaAttributeMapping<T extends Annotation>
- extends AbstractJavaJpaContextNode
- implements JavaAttributeMapping, AttributeMapping2_0
-{
- protected T mappingAnnotation;
-
- protected Vector<String> supportingAnnotationNames;
-
-
- protected AbstractJavaAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @SuppressWarnings("unchecked")
- public void initialize(Annotation annotation) {
- this.mappingAnnotation = (T) annotation;
- this.initialize();
- }
-
- protected void initialize() {
- // do nothing by default
- }
-
- @SuppressWarnings("unchecked")
- public void update(Annotation annotation) {
- this.mappingAnnotation = (T) annotation;
- this.update();
- }
-
- protected void update() {
- // do nothing by default
- }
-
- @Override
- public JavaPersistentAttribute getParent() {
- return (JavaPersistentAttribute) super.getParent();
- }
-
- public JavaPersistentAttribute getPersistentAttribute() {
- return this.getParent();
- }
-
- protected JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.getParent().getResourcePersistentAttribute();
- }
-
- public T getMappingAnnotation() {
- return this.mappingAnnotation;
- }
-
- /**
- * the persistent attribute can tell whether there is a "specified" mapping
- * or a "default" one
- */
- public boolean isDefault() {
- return this.getPersistentAttribute().mappingIsDefault(this);
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return this.getTypeMapping().shouldValidateAgainstDatabase();
- }
-
- public TypeMapping getTypeMapping() {
- return this.getPersistentAttribute().getOwningTypeMapping();
- }
-
- public String getName() {
- return this.getPersistentAttribute().getName();
- }
-
- public Table getDbTable(String tableName) {
- return this.getTypeMapping().getDbTable(tableName);
- }
-
- public String getPrimaryKeyColumnName() {
- return null;
- }
-
- public boolean isOverridableAttributeMapping() {
- return false;
- }
-
- public boolean isOverridableAssociationMapping() {
- return false;
- }
-
- public boolean isRelationshipOwner() {
- return false;
- }
-
- public boolean isOwnedBy(AttributeMapping mapping) {
- return false;
- }
-
- public Iterator<String> allMappingNames() {
- return new SingleElementIterator<String>(getName());
- }
-
- public AttributeMapping resolveAttributeMapping(String name) {
- if (getName().equals(name)) {
- return this;
- }
- return null;
- }
-
- public Iterator<String> allOverrideableAttributeMappingNames() {
- if (isOverridableAttributeMapping()) {
- return new SingleElementIterator<String>(getName());
- }
- return EmptyIterator.<String> instance();
- }
-
- public Iterator<String> allOverrideableAssociationMappingNames() {
- if (isOverridableAssociationMapping()) {
- return new SingleElementIterator<String>(getName());
- }
- return EmptyIterator.<String> instance();
- }
-
- public Column resolveOverriddenColumn(String attributeName) {
- ColumnMapping columnMapping = this.resolveColumnMapping(attributeName);
- return columnMapping == null ? null : columnMapping.getColumn();
- }
-
- protected ColumnMapping resolveColumnMapping(String name) {
- AttributeMapping attributeMapping = resolveAttributeMapping(name);
- if (attributeMapping != null && attributeMapping.isOverridableAttributeMapping()) {
- return (ColumnMapping) attributeMapping;
- }
- return null;
- }
-
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- RelationshipMapping relationshipMapping = this.resolveRelationshipMapping(attributeName);
- return relationshipMapping == null ? null : relationshipMapping.getRelationshipReference();
- }
-
- protected RelationshipMapping resolveRelationshipMapping(String name) {
- AttributeMapping attributeMapping = resolveAttributeMapping(name);
- if (attributeMapping != null && attributeMapping.isOverridableAssociationMapping()) {
- return (RelationshipMapping) attributeMapping;
- }
- return null;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** supporting annotation names **********
-
- public Iterable<String> getSupportingAnnotationNames() {
- if (this.supportingAnnotationNames == null) {
- this.supportingAnnotationNames = this.buildSupportingAnnotationNames();
- }
- return this.supportingAnnotationNames;
- }
-
- protected Vector<String> buildSupportingAnnotationNames() {
- Vector<String> names = new Vector<String>();
- this.addSupportingAnnotationNamesTo(names);
- return names;
- }
-
- protected void addSupportingAnnotationNamesTo(@SuppressWarnings("unused") Vector<String> names) {
- // the default is none
- }
-
-
- // ********** metamodel **********
-
- public MetamodelField getMetamodelField() {
- return new SimpleMetamodelField(
- this.getMetamodelFieldModifiers(),
- this.getMetamodelFieldTypeName(),
- this.getMetamodelFieldTypeArgumentNames(),
- this.getMetamodelFieldName()
- );
- }
-
- protected Iterable<String> getMetamodelFieldModifiers() {
- return STANDARD_METAMODEL_FIELD_MODIFIERS;
- }
-
- /**
- * most mappings are "singular"
- */
- protected String getMetamodelFieldTypeName() {
- return JPA2_0.SINGULAR_ATTRIBUTE;
- }
-
- protected final Iterable<String> getMetamodelFieldTypeArgumentNames() {
- ArrayList<String> typeArgumentNames = new ArrayList<String>(3);
- typeArgumentNames.add(this.getTypeMapping().getPersistentType().getName());
- this.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- return typeArgumentNames;
- }
-
- /**
- * by default, we add only the mapping's attribute type name;
- * but collection relationship mappings will also need to add the key type
- * name if the "collection" is of type java.util.Map
- */
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- typeArgumentNames.add(this.getMetamodelTypeName());
- }
-
- public String getMetamodelTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelTypeName();
- }
-
- protected String getMetamodelFieldName() {
- return this.getName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateMappingType(messages, astRoot);
- }
-
- protected void validateMappingType(List<IMessage> messages, CompilationUnit astRoot) {
- if ( ! this.getTypeMapping().attributeMappingKeyAllowed(this.getKey())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getMappingAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getMappingAnnotationTextRange(CompilationUnit astRoot) {
- return (this.mappingAnnotation == null) ? null : this.mappingAnnotation.getTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMappingDefinition.java
deleted file mode 100644
index 46bbad8953..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaAttributeMappingDefinition.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-public abstract class AbstractJavaAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- protected AbstractJavaAttributeMappingDefinition() {
- super();
- }
-
-
- /**
- * Default implementation. Override if the mapping definition applies in the annotationless case.
- */
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return false;
- }
-
- /**
- * Default implementation. Override if the mapping definition needs to do more analysis.
- */
- public boolean testSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourcePersistentAttribute().getAnnotation(getAnnotationName())
- != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java
deleted file mode 100644
index 4557566d07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseColumn.java
+++ /dev/null
@@ -1,328 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaBaseColumn<T extends BaseColumnAnnotation> extends AbstractJavaNamedColumn<T>
- implements JavaBaseColumn
-{
-
- protected String specifiedTable;
-
- protected String defaultTable;
-
- protected Boolean specifiedUnique;
-
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
- protected AbstractJavaBaseColumn(JavaJpaContextNode parent, JavaBaseColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- protected void initialize(T column) {
- super.initialize(column);
- this.defaultTable = this.buildDefaultTableName();
- this.specifiedTable = this.getResourceTable();
- this.specifiedUnique = this.getResourceUnique();
- this.specifiedNullable = this.getResourceNullable();
- this.specifiedInsertable = this.getResourceInsertable();
- this.specifiedUpdatable = this.getResourceUpdatable();
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- this.setDefaultTable(this.buildDefaultTableName());
- this.setSpecifiedTable_(this.getResourceTable());
- this.setSpecifiedUnique_(this.getResourceUnique());
- this.setSpecifiedNullable_(this.getResourceNullable());
- this.setSpecifiedInsertable_(this.getResourceInsertable());
- this.setSpecifiedUpdatable_(this.getResourceUpdatable());
- }
-
- @Override
- public JavaBaseColumn.Owner getOwner() {
- return (JavaBaseColumn.Owner) super.getOwner();
- }
-
- //************** BaseColumn implementation *******************
-
- //************** table *******************
-
- @Override
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- getResourceColumn().setTable(newSpecifiedTable);
- firePropertyChanged(BaseColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(BaseColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String newDefaultTable) {
- String oldDefaultTable = this.defaultTable;
- this.defaultTable = newDefaultTable;
- firePropertyChanged(BaseColumn.DEFAULT_TABLE_PROPERTY, oldDefaultTable, newDefaultTable);
- }
-
- protected String getResourceTable() {
- return getResourceColumn().getTable();
- }
-
- public boolean tableNameIsInvalid() {
- return getOwner().tableNameIsInvalid(getTable());
- }
-
- //************** unique *******************
-
- public boolean isUnique() {
- return (this.getSpecifiedUnique() == null) ? this.isDefaultUnique() : this.getSpecifiedUnique().booleanValue();
- }
-
- public boolean isDefaultUnique() {
- return BaseColumn.DEFAULT_UNIQUE;
- }
-
- public Boolean getSpecifiedUnique() {
- return this.specifiedUnique;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- this.getResourceColumn().setUnique(newSpecifiedUnique);
- firePropertyChanged(BaseColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedUnique_(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- firePropertyChanged(BaseColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- protected Boolean getResourceUnique() {
- return getResourceColumn().getUnique();
- }
-
- //************** nullable *******************
-
- public boolean isNullable() {
- return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
- }
-
- public boolean isDefaultNullable() {
- return BaseColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- this.getResourceColumn().setNullable(newSpecifiedNullable);
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- protected Boolean getResourceNullable() {
- return getResourceColumn().getNullable();
- }
-
- //************** insertable *******************
-
- public boolean isInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
- }
-
- public boolean isDefaultInsertable() {
- return BaseColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- protected Boolean getResourceInsertable() {
- return getResourceColumn().getInsertable();
- }
-
- //************** updatable *******************
-
- public boolean isUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
- }
-
- public boolean isDefaultUpdatable() {
- return BaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- protected Boolean getResourceUpdatable() {
- return getResourceColumn().getUpdatable();
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceColumn().getTableTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return getResourceColumn().tableTouches(pos, astRoot);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- private Iterator<String> candidateTableNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateTableNames(), filter);
- }
-
- private Iterator<String> javaCandidateTableNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateTableNames(filter));
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos, astRoot)) {
- return this.javaCandidateTableNames(filter);
- }
- return null;
- }
-
- protected String buildDefaultTableName() {
- return this.getOwner().getDefaultTableName();
- }
-
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (this.validateTable(messages, astRoot)) {
- super.validate(messages, reporter, astRoot);
- }
- }
-
- /**
- * Return true if the table is valid and no messages are logged
- */
- protected boolean validateTable(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.tableNameIsInvalid()) {
- messages.add(this.getOwner().buildTableNotValidMessage(this, this.getTableTextRange(astRoot)));
- return false;
- }
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
deleted file mode 100644
index e50c6e21b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,344 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaBaseEmbeddedMapping<T extends Annotation>
- extends AbstractJavaAttributeMapping<T>
- implements JavaBaseEmbeddedMapping
-{
- protected final JavaAttributeOverrideContainer attributeOverrideContainer;
-
- private Embeddable targetEmbeddable;
-
-
- protected AbstractJavaBaseEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.attributeOverrideContainer =
- this.getJpaFactory().buildJavaAttributeOverrideContainer(
- this,
- buildAttributeOverrideContainerOwner());
- }
-
-
- protected JavaAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() {
- return new AttributeOverrideContainerOwner();
- }
-
- public JavaAttributeOverrideContainer getAttributeOverrideContainer() {
- return this.attributeOverrideContainer;
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return this.targetEmbeddable;
- }
-
-
- //****************** JavaAttributeMapping implementation *******************
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.ATTRIBUTE_OVERRIDE);
- names.add(JPA.ATTRIBUTE_OVERRIDES);
- }
-
- public Embeddable getTargetEmbeddable() {
- return this.targetEmbeddable;
- }
-
- protected void setTargetEmbeddable_(Embeddable newTargetEmbeddable) {
- Embeddable oldTargetEmbeddable = this.targetEmbeddable;
- this.targetEmbeddable = newTargetEmbeddable;
- firePropertyChanged(TARGET_EMBEDDABLE_PROPERTY, oldTargetEmbeddable, newTargetEmbeddable);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.attributeOverrideContainer.initialize(this.getResourcePersistentAttribute());
- this.targetEmbeddable = this.getPersistentAttribute().getEmbeddable();
- }
-
- @Override
- protected void update() {
- super.update();
- setTargetEmbeddable_(this.getPersistentAttribute().getEmbeddable());
- this.attributeOverrideContainer.update(this.getResourcePersistentAttribute());
- }
-
- protected Iterator<AttributeMapping> embeddableAttributeMappings() {
- Embeddable targetEmbeddable = getTargetEmbeddable();
- if (targetEmbeddable != null && targetEmbeddable != getPersistentAttribute().getOwningTypeMapping()) {
- return targetEmbeddable.attributeMappings();
- }
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> allOverrideableAttributeMappingNames() {
- return this.isJpa2_0Compatible() ?
- this.embeddableOverrideableAttributeMappingNames() :
- super.allOverrideableAttributeMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- }
- );
- }
-
- @Override
- public Iterator<String> allOverrideableAssociationMappingNames() {
- return this.isJpa2_0Compatible() ?
- this.embeddableOverrideableAssociationMappingNames() :
- super.allOverrideableAssociationMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- }
- );
- }
-
- protected Iterator<String> embeddableOverrideableMappingNames(Transformer<AttributeMapping, Iterator<String>> transformer) {
- return new TransformationIterator<String, String>(
- new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.embeddableAttributeMappings(), transformer)))
- {
- @Override
- protected String transform(String next) {
- return getName() + '.' + next;
- }
- };
- }
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AttributeOverride override = getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- if (this.getTargetEmbeddable() == null) {
- return null;
- }
- return this.getTargetEmbeddable().resolveOverriddenColumn(attributeName);
- }
- }
- }
- return null;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
-
- result = getAttributeOverrideContainer().javaCompletionProposals(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 (validateTargetEmbeddable(messages, reporter, astRoot)) {
- validateOverrides(messages, reporter, astRoot);
- }
- }
-
- protected boolean validateTargetEmbeddable(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (getTargetEmbeddable() == null) {
- String targetEmbeddableTypeName = getPersistentAttribute().getTypeName();
- // if the type isn't resolveable, there'll already be a java error
- if (targetEmbeddableTypeName != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE,
- new String[] {targetEmbeddableTypeName},
- this,
- this.getValidationTextRange(astRoot)));
- }
- return false;
- }
- return true;
- }
-
- protected void validateOverrides(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- getAttributeOverrideContainer().validate(messages, reporter, astRoot);
- }
-
- //********** AttributeOverrideContainer.Owner implementation *********
-
- protected class AttributeOverrideContainerOwner
- implements JavaAttributeOverrideContainer.Owner
- {
- public TypeMapping getTypeMapping() {
- return AbstractJavaBaseEmbeddedMapping.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaBaseEmbeddedMapping.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : allOverridableAttributeNames_(typeMapping);
- }
-
- /* assumes the type mapping is not null */
- protected Iterator<String> allOverridableAttributeNames_(TypeMapping typeMapping) {
- return typeMapping.allOverridableAttributeNames();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getPossiblePrefix() {
- return null;
- }
-
- public String getWritePrefix() {
- return null;
- }
-
- public boolean isRelevant(String overrideName) {
- //no prefix, so always true
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaBaseEmbeddedMapping.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBasicMapping.java
deleted file mode 100644
index a0d62b63c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBasicMapping.java
+++ /dev/null
@@ -1,311 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaBasicMapping
- extends AbstractJavaAttributeMapping<BasicAnnotation>
- implements JavaBasicMapping
-{
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected final JavaColumn column;
-
- protected JavaConverter converter;
-
- protected final JavaConverter nullConverter;
-
- protected AbstractJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = getJpaFactory().buildJavaColumn(this, this);
- this.nullConverter = getJpaFactory().buildJavaNullConverter(this);
- this.converter = this.nullConverter;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.column.initialize(this.getResourceColumn());
- this.converter = this.buildConverter(this.getResourceConverterType());
- this.specifiedFetch = this.getResourceFetch();
- this.specifiedOptional = this.getResourceOptional();
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) getResourcePersistentAttribute().getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** AttributeMapping implementation ***************
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- //************** JavaAttributeMapping implementation ***************
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.COLUMN);
- names.add(JPA.LOB);
- names.add(JPA.TEMPORAL);
- names.add(JPA.ENUMERATED);
- }
-
- public String getDefaultColumnName() {
- return getName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- //************** BasicMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.mappingAnnotation.setFetch(FetchType.toJavaResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- public boolean isOptional() {
- return (this.getSpecifiedOptional() == null) ? this.isDefaultOptional() : this.getSpecifiedOptional().booleanValue();
- }
-
- public boolean isDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- this.mappingAnnotation.setOptional(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- protected void setSpecifiedOptional_(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- public JavaConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- JavaConverter oldConverter = this.converter;
- JavaConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- @Override
- protected void update() {
- super.update();
- this.column.update(this.getResourceColumn());
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update(this.getResourcePersistentAttribute());
- }
- else {
- JavaConverter javaConverter = buildConverter(getResourceConverterType());
- setConverter(javaConverter);
- }
- this.setSpecifiedFetch_(this.getResourceFetch());
- this.setSpecifiedOptional_(this.getResourceOptional());
- }
-
- protected FetchType getResourceFetch() {
- return FetchType.fromJavaResourceModel(this.mappingAnnotation.getFetch());
- }
-
- protected Boolean getResourceOptional() {
- return this.mappingAnnotation.getOptional();
- }
-
- protected JavaConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.ENUMERATED_CONVERTER)) {
- return getJpaFactory().buildJavaEnumeratedConverter(this, this.getResourcePersistentAttribute());
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.getResourcePersistentAttribute());
- }
- if (this.valuesAreEqual(converterType, Converter.LOB_CONVERTER)) {
- return getJpaFactory().buildJavaLobConverter(this, this.getResourcePersistentAttribute());
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.getResourcePersistentAttribute().getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME) != null) {
- return Converter.ENUMERATED_CONVERTER;
- }
- if (this.getResourcePersistentAttribute().getAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- if (this.getResourcePersistentAttribute().getAnnotation(LobAnnotation.ANNOTATION_NAME) != null) {
- return Converter.LOB_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = getConverter().javaCompletionProposals(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.getColumn().validate(messages, reporter, astRoot);
- this.getConverter().validate(messages, reporter, astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEmbeddable.java
deleted file mode 100644
index 0bcff08ea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEmbeddable.java
+++ /dev/null
@@ -1,51 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-
-
-public abstract class AbstractJavaEmbeddable
- extends AbstractJavaTypeMapping
- implements JavaEmbeddable
-{
- protected AbstractJavaEmbeddable(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java
deleted file mode 100644
index 0e0f414c74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java
+++ /dev/null
@@ -1,1882 +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.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.JpaPlatformVariation.Supported;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericEntityPrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaEntity
- extends AbstractJavaTypeMapping
- implements JavaEntity, JavaCacheableHolder2_0
-{
- protected String specifiedName;
-
- protected String defaultName;
-
- protected final JavaIdClassReference idClassReference;
-
- protected final JavaTable table;
-
- protected boolean specifiedTableIsAllowed;
-
- protected boolean tableIsUndefined;
-
- protected final List<JavaSecondaryTable> specifiedSecondaryTables;
-
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected InheritanceType specifiedInheritanceStrategy;
-
- protected InheritanceType defaultInheritanceStrategy;
-
- protected String defaultDiscriminatorValue;
-
- protected String specifiedDiscriminatorValue;
-
- protected boolean specifiedDiscriminatorValueIsAllowed;
-
- protected boolean discriminatorValueIsUndefined;
-
- protected final JavaDiscriminatorColumn discriminatorColumn;
-
- protected boolean specifiedDiscriminatorColumnIsAllowed;
-
- protected boolean discriminatorColumnIsUndefined;
-
- protected final JavaAttributeOverrideContainer attributeOverrideContainer;
-
- protected final JavaAssociationOverrideContainer associationOverrideContainer;
-
- protected final JavaQueryContainer queryContainer;
-
- protected final JavaGeneratorContainer generatorContainer;
-
- protected Entity rootEntity;
-
-
- protected AbstractJavaEntity(JavaPersistentType parent) {
- super(parent);
- this.idClassReference = buildIdClassReference();
- this.table = this.getJpaFactory().buildJavaTable(this);
- this.discriminatorColumn = buildJavaDiscriminatorColumn();
- this.specifiedSecondaryTables = new ArrayList<JavaSecondaryTable>();
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- this.attributeOverrideContainer =
- getJpaFactory().buildJavaAttributeOverrideContainer(this, new AttributeOverrideContainerOwner());
- this.associationOverrideContainer =
- getJpaFactory().buildJavaAssociationOverrideContainer(this, new AssociationOverrideContainerOwner());
- this.queryContainer = getJpaFactory().buildJavaQueryContainer(this);
- this.generatorContainer = getJpaFactory().buildJavaGeneratorContainer(this);
- }
-
- protected JavaIdClassReference buildIdClassReference() {
- return new GenericJavaIdClassReference(this);
- }
-
- protected JavaBaseJoinColumn.Owner buildPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected JavaDiscriminatorColumn buildJavaDiscriminatorColumn() {
- return this.getJpaFactory().buildJavaDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected JavaDiscriminatorColumn.Owner buildDiscriminatorColumnOwner() {
- return new JavaDiscriminatorColumn.Owner(){
- public String getDefaultTableName() {
- return AbstractJavaEntity.this.getPrimaryTableName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractJavaEntity.this.getDbTable(tableName);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractJavaEntity.this;
- }
-
- public String getDefaultColumnName() {
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getName()
- :
- discriminatorColumnIsUndefined()?
- null
- :
- DiscriminatorColumn.DEFAULT_NAME;
- }
-
- public int getDefaultLength() {
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getLength()
- :
- discriminatorColumnIsUndefined()?
- 0//TODO think i want to return null here
- :
- DiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getDiscriminatorType()
- :
- discriminatorColumnIsUndefined()?
- null
- :
- DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.DISCRIMINATOR_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- };
- }
-
- @Override
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- super.initialize(resourcePersistentType);
-
- this.specifiedName = this.getResourceName();
- this.defaultName = this.getResourceDefaultName();
- this.idClassReference.initialize();
- this.rootEntity = calculateRootEntity();
- this.defaultInheritanceStrategy = this.buildDefaultInheritanceStrategy();
- this.specifiedInheritanceStrategy = this.getResourceInheritanceStrategy(getResourceInheritance());
- this.specifiedDiscriminatorValueIsAllowed = this.buildSpecifiedDiscriminatorValueIsAllowed();
- this.discriminatorValueIsUndefined = this.buildDiscriminatorValueIsUndefined();
- this.specifiedDiscriminatorValue = this.getResourceDiscriminatorValue().getValue();
- this.defaultDiscriminatorValue = this.buildDefaultDiscriminatorValue();
- this.specifiedDiscriminatorColumnIsAllowed = this.buildSpecifiedDiscriminatorColumnIsAllowed();
- this.discriminatorColumnIsUndefined = this.buildDiscriminatorColumnIsUndefined();
- this.discriminatorColumn.initialize(this.getResourceDiscriminatorColumn());
- this.specifiedTableIsAllowed = this.buildSpecifiedTableIsAllowed();
- this.tableIsUndefined = this.buildTableIsUndefined();
- this.table.initialize(resourcePersistentType);
- this.initializeSecondaryTables();
- this.generatorContainer.initialize(resourcePersistentType);
- this.queryContainer.initialize(resourcePersistentType);
- this.initializePrimaryKeyJoinColumns();
- this.initializeDefaultPrimaryKeyJoinColumn();
- this.attributeOverrideContainer.initialize(resourcePersistentType);
- this.associationOverrideContainer.initialize(resourcePersistentType);
- }
-
- protected void initializeSecondaryTables() {
- for (Iterator<NestableAnnotation> stream =
- this.javaResourcePersistentType.annotations(
- SecondaryTableAnnotation.ANNOTATION_NAME,
- SecondaryTablesAnnotation.ANNOTATION_NAME);
- stream.hasNext(); ) {
- this.specifiedSecondaryTables.add(
- buildSecondaryTable((SecondaryTableAnnotation) stream.next()));
- }
- }
-
- protected void initializePrimaryKeyJoinColumns() {
- for (Iterator<NestableAnnotation> stream =
- this.javaResourcePersistentType.annotations(
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- stream.hasNext(); ) {
- this.specifiedPrimaryKeyJoinColumns.add(
- buildPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) stream.next()));
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn() {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(this.javaResourcePersistentType));
- }
-
- //query for the inheritance resource every time on setters.
- //call one setter and the inheritanceResource could change.
- //You could call more than one setter before this object has received any notification
- //from the java resource model
- protected InheritanceAnnotation getResourceInheritance() {
- return (InheritanceAnnotation) this.javaResourcePersistentType.
- getNonNullAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
- }
-
- protected DiscriminatorValueAnnotation getResourceDiscriminatorValue() {
- return (DiscriminatorValueAnnotation) this.javaResourcePersistentType.
- getNonNullAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
- }
-
- protected DiscriminatorColumnAnnotation getResourceDiscriminatorColumn() {
- return (DiscriminatorColumnAnnotation) this.javaResourcePersistentType.
- getNonNullAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME);
- }
-
- @Override
- protected EntityAnnotation getResourceMappingAnnotation() {
- return (EntityAnnotation) super.getResourceMappingAnnotation();
- }
-
- // **************** AttributeOverrideContainer.Owner impl *****************
-
- public TypeMapping getTypeMapping() {
- return this;
- }
-
- public TypeMapping getOverridableTypeMapping() {
- PersistentType superPersistentType = getPersistentType().getSuperPersistentType();
- return superPersistentType == null ? null : superPersistentType.getMapping();
- }
-
-
- // **************** TypeMapping implementation ****************************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
- @Override
- public String getPrimaryTableName() {
- return this.getTable().getName();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getPrimaryDbTable() {
- return getTable().getDbTable();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- // matching database objects and identifiers is database platform-specific
- return this.getDataSource().selectDatabaseObjectForIdentifier(this.getAssociatedDbTablesIncludingInherited(), tableName);
- }
-
- protected Iterable<org.eclipse.jpt.db.Table> getAssociatedDbTablesIncludingInherited() {
- return new FilteringIterable<org.eclipse.jpt.db.Table>(this.getAssociatedDbTablesIncludingInherited_()) {
- @Override
- protected boolean accept(org.eclipse.jpt.db.Table t) {
- return t != null;
- }
- };
- }
-
- protected Iterable<org.eclipse.jpt.db.Table> getAssociatedDbTablesIncludingInherited_() {
- return new TransformationIterable<Table, org.eclipse.jpt.db.Table>(this.getAssociatedTablesIncludingInherited()) {
- @Override
- protected org.eclipse.jpt.db.Table transform(Table t) {
- return t.getDbTable();
- }
- };
- }
-
- @Override
- public Schema getDbSchema() {
- return getTable().getDbSchema();
- }
-
-
- //****************** JavaTypeMapping implementation *******************
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return SUPPORTING_ANNOTATION_NAMES;
- }
- protected static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- JPA.TABLE,
- JPA.SECONDARY_TABLE,
- JPA.SECONDARY_TABLES,
- JPA.PRIMARY_KEY_JOIN_COLUMN,
- JPA.PRIMARY_KEY_JOIN_COLUMNS,
- JPA.ID_CLASS,
- JPA.INHERITANCE,
- JPA.DISCRIMINATOR_VALUE,
- JPA.DISCRIMINATOR_COLUMN,
- JPA.SEQUENCE_GENERATOR,
- JPA.TABLE_GENERATOR,
- JPA.NAMED_QUERY,
- JPA.NAMED_QUERIES,
- JPA.NAMED_NATIVE_QUERY,
- JPA.NAMED_NATIVE_QUERIES,
- JPA.SQL_RESULT_SET_MAPPING,
- JPA.EXCLUDE_DEFAULT_LISTENERS,
- JPA.EXCLUDE_SUPERCLASS_LISTENERS,
- JPA.ENTITY_LISTENERS,
- JPA.PRE_PERSIST,
- JPA.POST_PERSIST,
- JPA.PRE_REMOVE,
- JPA.POST_REMOVE,
- JPA.PRE_UPDATE,
- JPA.POST_UPDATE,
- JPA.POST_LOAD,
- JPA.ATTRIBUTE_OVERRIDE,
- JPA.ATTRIBUTE_OVERRIDES,
- JPA.ASSOCIATION_OVERRIDE,
- JPA.ASSOCIATION_OVERRIDES
- };
- protected static final Iterable<String> SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
-
- // **************** name **************************************************
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? this.getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- this.getResourceMappingAnnotation().setName(newSpecifiedName);
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected/*private-protected*/ void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
-
- // **************** id class **********************************************
-
- public JavaIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
-
- // **************** table *************************************************
-
- public JavaTable getTable() {
- return this.table;
- }
-
- public ListIterator<JavaSecondaryTable> specifiedSecondaryTables() {
- return new CloneListIterator<JavaSecondaryTable>(this.specifiedSecondaryTables);
- }
-
- public int specifiedSecondaryTablesSize() {
- return this.specifiedSecondaryTables.size();
- }
-
- public JavaSecondaryTable addSpecifiedSecondaryTable(int index) {
- JavaSecondaryTable secondaryTable = getJpaFactory().buildJavaSecondaryTable(this);
- this.specifiedSecondaryTables.add(index, secondaryTable);
- SecondaryTableAnnotation secondaryTableResource =
- (SecondaryTableAnnotation) this.javaResourcePersistentType.
- addAnnotation(
- index, SecondaryTableAnnotation.ANNOTATION_NAME,
- SecondaryTablesAnnotation.ANNOTATION_NAME);
- secondaryTable.initialize(secondaryTableResource);
- fireItemAdded(SPECIFIED_SECONDARY_TABLES_LIST, index, secondaryTable);
- return secondaryTable;
- }
-
- public JavaSecondaryTable addSpecifiedSecondaryTable() {
- return this.addSpecifiedSecondaryTable(this.specifiedSecondaryTables.size());
- }
-
- protected void addSpecifiedSecondaryTable(int index, JavaSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.specifiedSecondaryTables, SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- protected void addSpecifiedSecondaryTable(JavaSecondaryTable secondaryTable) {
- this.addSpecifiedSecondaryTable(this.specifiedSecondaryTables.size(), secondaryTable);
- }
-
- public void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable) {
- this.removeSpecifiedSecondaryTable(this.specifiedSecondaryTables.indexOf(secondaryTable));
- }
-
- public void removeSpecifiedSecondaryTable(int index) {
- JavaSecondaryTable removedSecondaryTable = this.specifiedSecondaryTables.remove(index);
- this.javaResourcePersistentType.removeAnnotation(
- index, SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(SPECIFIED_SECONDARY_TABLES_LIST, index, removedSecondaryTable);
- }
-
- protected void removeSpecifiedSecondaryTable_(JavaSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.specifiedSecondaryTables, SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedSecondaryTables, targetIndex, sourceIndex);
- this.javaResourcePersistentType.moveAnnotation(
- targetIndex, sourceIndex, SecondaryTablesAnnotation.ANNOTATION_NAME);
- fireItemMoved(SPECIFIED_SECONDARY_TABLES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaSecondaryTable> secondaryTables() {
- return specifiedSecondaryTables();
- }
-
- public int secondaryTablesSize() {
- return specifiedSecondaryTablesSize();
- }
-
- public InheritanceType getInheritanceStrategy() {
- return (this.getSpecifiedInheritanceStrategy() == null) ? this.getDefaultInheritanceStrategy() : this.getSpecifiedInheritanceStrategy();
- }
-
- public InheritanceType getDefaultInheritanceStrategy() {
- return this.defaultInheritanceStrategy;
- }
-
- protected void setDefaultInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.defaultInheritanceStrategy;
- this.defaultInheritanceStrategy = newInheritanceType;
- firePropertyChanged(DEFAULT_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public InheritanceType getSpecifiedInheritanceStrategy() {
- return this.specifiedInheritanceStrategy;
- }
-
- public void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- getResourceInheritance().setStrategy(InheritanceType.toJavaResourceModel(newInheritanceType));
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedInheritanceStrategy_(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public JavaDiscriminatorColumn getDiscriminatorColumn() {
- return this.discriminatorColumn;
- }
-
- public String getDefaultDiscriminatorValue() {
- return this.defaultDiscriminatorValue;
- }
-
- protected void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) {
- String oldDefaultDiscriminatorValue = this.defaultDiscriminatorValue;
- this.defaultDiscriminatorValue = newDefaultDiscriminatorValue;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, oldDefaultDiscriminatorValue, newDefaultDiscriminatorValue);
- }
-
- public String getSpecifiedDiscriminatorValue() {
- return this.specifiedDiscriminatorValue;
- }
-
- public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- getResourceDiscriminatorValue().setValue(newSpecifiedDiscriminatorValue);
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedDiscriminatorValue_(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- public String getDiscriminatorValue() {
- return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue();
- }
-
- public boolean specifiedDiscriminatorValueIsAllowed() {
- return this.specifiedDiscriminatorValueIsAllowed;
- }
-
- protected void setSpecifiedDiscriminatorValueIsAllowed(boolean specifiedDiscriminatorValueIsAllowed) {
- boolean old = this.specifiedDiscriminatorValueIsAllowed;
- this.specifiedDiscriminatorValueIsAllowed = specifiedDiscriminatorValueIsAllowed;
- firePropertyChanged(Entity.SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY, old, specifiedDiscriminatorValueIsAllowed);
- }
-
- public boolean discriminatorValueIsUndefined() {
- return this.discriminatorValueIsUndefined;
- }
-
- protected void setDiscriminatorValueIsUndefined(boolean discriminatorValueIsUndefined) {
- boolean old = this.discriminatorValueIsUndefined;
- this.discriminatorValueIsUndefined = discriminatorValueIsUndefined;
- firePropertyChanged(DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY, old, discriminatorValueIsUndefined);
- }
-
- public boolean specifiedDiscriminatorColumnIsAllowed() {
- return this.specifiedDiscriminatorColumnIsAllowed;
- }
-
- protected void setSpecifiedDiscriminatorColumnIsAllowed(boolean specifiedDiscriminatorColumnIsAllowed) {
- boolean old = this.specifiedDiscriminatorColumnIsAllowed;
- this.specifiedDiscriminatorColumnIsAllowed = specifiedDiscriminatorColumnIsAllowed;
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY, old, specifiedDiscriminatorColumnIsAllowed);
- }
-
- public boolean discriminatorColumnIsUndefined() {
- return this.discriminatorColumnIsUndefined;
- }
-
- protected void setDiscriminatorColumnIsUndefined(boolean discriminatorColumnIsUndefined) {
- boolean old = this.discriminatorColumnIsUndefined;
- this.discriminatorColumnIsUndefined = discriminatorColumnIsUndefined;
- firePropertyChanged(DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY, old, discriminatorColumnIsUndefined);
- }
-
- public boolean specifiedTableIsAllowed() {
- return this.specifiedTableIsAllowed;
- }
-
- protected void setSpecifiedTableIsAllowed(boolean specifiedTableIsAllowed) {
- boolean old = this.specifiedTableIsAllowed;
- this.specifiedTableIsAllowed = specifiedTableIsAllowed;
- firePropertyChanged(SPECIFIED_TABLE_IS_ALLOWED_PROPERTY, old, specifiedTableIsAllowed);
- }
-
- public boolean tableIsUndefined() {
- return this.tableIsUndefined;
- }
-
- protected void setTableIsUndefined(boolean tableIsUndefined) {
- boolean old = this.tableIsUndefined;
- this.tableIsUndefined = tableIsUndefined;
- firePropertyChanged(TABLE_IS_UNDEFINED_PROPERTY, old, tableIsUndefined);
- }
-
- public JavaGeneratorContainer getGeneratorContainer() {
- return this.generatorContainer;
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumns() : this.defaultPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- return this.defaultPrimaryKeyJoinColumn;
- }
-
- protected void setDefaultPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn newPkJoinColumn) {
- JavaPrimaryKeyJoinColumn oldPkJoinColumn = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = newPkJoinColumn;
- firePropertyChanged(DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldPkJoinColumn, newPkJoinColumn);
- }
-
- protected ListIterator<JavaPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- if (this.defaultPrimaryKeyJoinColumn != null) {
- return new SingleElementListIterator<JavaPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultPrimaryKeyJoinColumnsSize() {
- return (this.defaultPrimaryKeyJoinColumn == null) ? 0 : 1;
- }
-
- public JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn oldDefaultPkJoinColumn = this.getDefaultPrimaryKeyJoinColumn();
- if (oldDefaultPkJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultPrimaryKeyJoinColumn = null;
- }
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, buildPrimaryKeyJoinColumnOwner());
- this.specifiedPrimaryKeyJoinColumns.add(index, primaryKeyJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource =
- (PrimaryKeyJoinColumnAnnotation) this.javaResourcePersistentType.
- addAnnotation(
- index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- primaryKeyJoinColumn.initialize(pkJoinColumnResource);
- this.fireItemAdded(SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, primaryKeyJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return primaryKeyJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.addSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.size(), primaryKeyJoinColumn);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(primaryKeyJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(this.javaResourcePersistentType));
- }
- this.javaResourcePersistentType.removeAnnotation(
- index, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- fireItemRemoved(SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (this.defaultPrimaryKeyJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_JOIN_COLUMN, null, this.defaultPrimaryKeyJoinColumn);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- this.javaResourcePersistentType.moveAnnotation(
- targetIndex, sourceIndex, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- moveItemInList(targetIndex, sourceIndex, this.specifiedPrimaryKeyJoinColumns, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public JavaAttributeOverrideContainer getAttributeOverrideContainer() {
- return this.attributeOverrideContainer;
- }
-
- public JavaAssociationOverrideContainer getAssociationOverrideContainer() {
- return this.associationOverrideContainer;
- }
-
- public JavaQueryContainer getQueryContainer() {
- return this.queryContainer;
- }
-
- public Entity getParentEntity() {
- for (Iterator<PersistentType> stream = getPersistentType().ancestors(); stream.hasNext();) {
- TypeMapping typeMapping = stream.next().getMapping();
- if (typeMapping instanceof Entity) {
- return (Entity) typeMapping;
- }
- }
- return null;
- }
-
- public Entity getRootEntity() {
- return this.rootEntity;
- }
-
- public boolean isRoot() {
- return this == this.getRootEntity();
- }
-
- /**
- * Return whether the entity is a descendant in (as opposed to the root of)
- * an inheritance hierarchy.
- */
- protected boolean isDescendant() {
- return ! this.isRoot();
- }
-
- /**
- * Table name defaults to the entity name.
- * If the entity is part of a single table inheritance hierarchy, table
- * name defaults to the root entity's table name.
- * If the entity is abstract and part of a table per class
- * inheritance hierarchy, the table name defaults to null, no table applies
- */
- public String getDefaultTableName() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getName()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getName();
- }
-
- public String getDefaultSchema() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getSchema()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getContextDefaultSchema();
- }
-
- public String getDefaultCatalog() {
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getCatalog()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getContextDefaultCatalog();
- }
-
- /**
- * Return whether the entity is a descendant of the root entity
- * of a "single table" inheritance hierarchy.
- */
- protected boolean isSingleTableDescendant() {
- return (this.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE)
- && this.isDescendant();
- }
-
- /**
- * Return whether the entity is the top of an inheritance hierarchy
- * and has no descendants and no specified inheritance strategy has been defined.
- */
- protected boolean isRootNoDescendantsNoStrategyDefined() {
- return isRoot() && !getPersistenceUnit().entityIsRootWithSubEntities(this.getName()) && getSpecifiedInheritanceStrategy() == null;
- }
-
- /**
- * Return whether the entity is abstract and is a part of a
- * "table per class" inheritance hierarchy.
- */
- protected boolean isAbstractTablePerClass() {
- return isAbstract() && isTablePerClass();
- }
-
- /**
- * Return whether the entity is a part of a "table per class"
- * inheritance hierarchy.
- */
- protected boolean isTablePerClass() {
- return (this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS);
- }
-
- /**
- * Return whether the entity is a part of a "table per class"
- * inheritance hierarchy.
- */
- protected boolean isTablePerClassDescendant() {
- return isTablePerClass() && isDescendant();
- }
-
- /**
- * Return whether the type is abstract.
- */
- protected boolean isAbstract() {
- return this.javaResourcePersistentType.isAbstract();
- }
-
- public String getPrimaryKeyColumnName() {
- return getPrimaryKeyColumnName(this);
- }
-
- /**
- * Convenience implementation that is shared with ORM.
- */
- public static String getPrimaryKeyColumnName(Entity entity) {
- String pkColumnName = null;
- for (Iterator<PersistentAttribute> stream = entity.getPersistentType().allAttributes(); stream.hasNext(); ) {
- PersistentAttribute attribute = stream.next();
- String current = attribute.getPrimaryKeyColumnName();
- if (current != null) {
- // 229423 - if the attribute is a primary key, but it has an attribute override,
- // use the override column instead
- AttributeOverride attributeOverride = entity.getAttributeOverrideContainer().getAttributeOverrideNamed(attribute.getName());
- if (attributeOverride != null) {
- current = attributeOverride.getColumn().getName();
- }
- }
- if (pkColumnName == null) {
- pkColumnName = current;
- }
- else if (current != null) {
- // if we encounter a composite primary key, return null
- return null;
- }
- }
- // if we encounter only a single primary key column name, return it
- return pkColumnName;
- }
-
- public PersistentAttribute getIdAttribute() {
- Iterable<AttributeMapping> idAttributeMappings = getAllAttributeMappings(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- if (CollectionTools.size(idAttributeMappings) != 1) {
- return null;
- }
- return idAttributeMappings.iterator().next().getPersistentAttribute();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- if (tableIsUndefined()) {
- return false;
- }
- return ! CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return super.shouldValidateAgainstDatabase() && ! isAbstractTablePerClass();
- }
-
- @Override
- public Iterator<Table> associatedTables() {
- return new CompositeIterator<Table>(this.getTable(), this.secondaryTables());
- }
-
- @Override
- public Iterator<Table> associatedTablesIncludingInherited() {
- return this.getAssociatedTablesIncludingInherited().iterator();
- }
-
- protected Iterable<Table> getAssociatedTablesIncludingInherited() {
- return new CompositeIterable<Table>(new TransformationIterable<TypeMapping, Iterable<Table>>(this.getInheritanceHierarchy()) {
- @Override
- protected Iterable<Table> transform(TypeMapping mapping) {
- return new FilteringIterable<Table>(CollectionTools.iterable(mapping.associatedTables())) {
- @Override
- protected boolean accept(Table o) {
- return true;
- //TODO
- //filtering these out so as to avoid the duplicate table, root and children share the same table
- //return !(o instanceof SingleTableInheritanceChildTableImpl);
- }
- };
- }
- });
- }
-
- @Override
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return this.nonNullTableNames(this.associatedTablesIncludingInherited());
- }
-
- protected Iterator<String> nonNullTableNames(Iterator<Table> tables) {
- return new FilteringIterator<String>(this.tableNames(tables)) {
- @Override
- protected boolean accept(String o) {
- return o != null;
- }
- };
- }
-
- protected Iterator<String> tableNames(Iterator<Table> tables) {
- return new TransformationIterator<Table, String>(tables) {
- @Override
- protected String transform(Table t) {
- return t.getName();
- }
- };
- }
-
- /**
- * Return an iterator of Entities, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- protected Iterator<TypeMapping> ancestors() {
- return new TransformationIterator<PersistentType, TypeMapping>(getPersistentType().ancestors()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- if (!isTablePerClass()) {
- return EmptyIterator.instance();
- }
- return super.overridableAttributeNames();
- }
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- AttributeOverride override = getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- return super.resolveOverriddenColumn(attributeName);
- }
-
- @Override
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- AssociationOverride override = getAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getRelationshipReference();
- }
- return super.resolveRelationshipReference(attributeName);
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- if (!isTablePerClass()) {
- return EmptyIterator.instance();
- }
- return super.overridableAssociationNames();
- }
-
- public AttributeMapping resolveAttributeMapping(String name) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(this.allAttributeMappings())) {
- AttributeMapping resolvedMapping = attributeMapping.resolveAttributeMapping(name);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- return null;
- }
-
- @Override
- public void update(JavaResourcePersistentType resourcePersistentType) {
- super.update(resourcePersistentType);
- setSpecifiedName_(getResourceName());
- setDefaultName(getResourceDefaultName());
- this.idClassReference.update();
- updateRootEntity();
- updateInheritance(getResourceInheritance());
- updateDiscriminatorColumn();
- updateDiscriminatorValue(getResourceDiscriminatorValue());
- setSpecifiedTableIsAllowed(buildSpecifiedTableIsAllowed());
- setTableIsUndefined(buildTableIsUndefined());
- updateTable();
- updateSecondaryTables();
- this.generatorContainer.update(resourcePersistentType);
- this.queryContainer.update(resourcePersistentType);
- updateSpecifiedPrimaryKeyJoinColumns();
- updateDefaultPrimaryKeyJoinColumn();
- this.attributeOverrideContainer.update(resourcePersistentType);
- this.associationOverrideContainer.update(resourcePersistentType);
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- postUpdateDiscriminatorColumn();
- postUpdateDiscriminatorValue();
- this.associationOverrideContainer.postUpdate();
- }
-
- protected String getResourceName() {
- return this.getResourceMappingAnnotation().getName();
- }
-
- protected String getResourceDefaultName() {
- return this.javaResourcePersistentType.getName();
- }
-
- protected void updateTable() {
- getTable().update(this.javaResourcePersistentType);
- }
-
- protected void updateInheritance(InheritanceAnnotation inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.getResourceInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
- }
-
- protected InheritanceType getResourceInheritanceStrategy(InheritanceAnnotation inheritanceResource) {
- return InheritanceType.fromJavaResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType buildDefaultInheritanceStrategy() {
- return this.isRoot() ? InheritanceType.SINGLE_TABLE : this.getRootEntity().getInheritanceStrategy();
- }
-
- protected void updateRootEntity() {
- //I am making an assumption here that we don't need property change notification for rootEntity, this might be wrong
- this.rootEntity = calculateRootEntity();
- if (this.rootEntity != this) {
- this.rootEntity.addSubEntity(this);
- }
- }
-
- protected Entity calculateRootEntity() {
- Entity root = this;
- for (Iterator<TypeMapping> stream = inheritanceHierarchy(); stream.hasNext();) {
- TypeMapping typeMapping = stream.next();
- if (typeMapping instanceof Entity) {
- root = (Entity) typeMapping;
- }
- }
- return root;
- }
-
- public void addSubEntity(Entity subEntity) {
- getPersistenceUnit().addRootEntityWithSubEntities(getName());
- }
-
- protected void updateDiscriminatorColumn() {
- this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
- getDiscriminatorColumn().update(this.getResourceDiscriminatorColumn());
- }
-
- protected void postUpdateDiscriminatorColumn() {
- this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
- this.getDiscriminatorColumn().postUpdate();
- }
-
- protected void updateDiscriminatorValue(DiscriminatorValueAnnotation discriminatorValueResource) {
- this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
- this.setSpecifiedDiscriminatorValue_(discriminatorValueResource.getValue());
- }
-
- protected void postUpdateDiscriminatorValue() {
- this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
- this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
- }
-
- /**
- * From the Spec:
- * If the DiscriminatorValue annotation is not specified, a
- * provider-specific function to generate a value representing
- * the entity type is used for the value of the discriminator
- * column. If the DiscriminatorType is STRING, the discriminator
- * value default is the entity name.
- *
- * TODO extension point for provider-specific function?
- */
- protected String buildDefaultDiscriminatorValue() {
- if (discriminatorValueIsUndefined()) {
- return null;
- }
- if (this.getDiscriminatorType() != DiscriminatorType.STRING) {
- return null;
- }
- return this.getName();
- }
-
- protected DiscriminatorType getDiscriminatorType() {
- return this.getDiscriminatorColumn().getDiscriminatorType();
- }
-
- protected boolean buildSpecifiedDiscriminatorValueIsAllowed() {
- return !isTablePerClass() && !isAbstract();
- }
-
- protected boolean buildDiscriminatorValueIsUndefined() {
- return isTablePerClass() || isAbstract() || isRootNoDescendantsNoStrategyDefined();
- }
-
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return !isTablePerClass() && isRoot();
- }
-
- protected boolean buildDiscriminatorColumnIsUndefined() {
- return isTablePerClass() || isRootNoDescendantsNoStrategyDefined();
- }
-
- protected boolean buildSpecifiedTableIsAllowed() {
- return !isAbstractTablePerClass() && !isSingleTableDescendant();
- }
-
- protected boolean buildTableIsUndefined() {
- return isAbstractTablePerClass();
- }
-
- protected void updateSecondaryTables() {
- ListIterator<JavaSecondaryTable> secondaryTables = specifiedSecondaryTables();
- Iterator<NestableAnnotation> resourceSecondaryTables =
- this.javaResourcePersistentType.annotations(
- SecondaryTableAnnotation.ANNOTATION_NAME, SecondaryTablesAnnotation.ANNOTATION_NAME);
-
- while (secondaryTables.hasNext()) {
- JavaSecondaryTable secondaryTable = secondaryTables.next();
- if (resourceSecondaryTables.hasNext()) {
- secondaryTable.update((SecondaryTableAnnotation) resourceSecondaryTables.next());
- }
- else {
- removeSpecifiedSecondaryTable_(secondaryTable);
- }
- }
-
- while (resourceSecondaryTables.hasNext()) {
- addSpecifiedSecondaryTable(buildSecondaryTable((SecondaryTableAnnotation) resourceSecondaryTables.next()));
- }
- }
-
- protected JavaSecondaryTable buildSecondaryTable(SecondaryTableAnnotation secondaryTableResource) {
- JavaSecondaryTable secondaryTable = getJpaFactory().buildJavaSecondaryTable(this);
- secondaryTable.initialize(secondaryTableResource);
- return secondaryTable;
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns() {
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- Iterator<NestableAnnotation> resourcePrimaryKeyJoinColumns =
- this.javaResourcePersistentType.annotations(
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- while (primaryKeyJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update((PrimaryKeyJoinColumnAnnotation) resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn((PrimaryKeyJoinColumnAnnotation) resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation primaryKeyJoinColumnResource) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, buildPrimaryKeyJoinColumnOwner());
- primaryKeyJoinColumn.initialize(primaryKeyJoinColumnResource);
- return primaryKeyJoinColumn;
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn() {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- this.setDefaultPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(this.javaResourcePersistentType)));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumnAnnotation(this.javaResourcePersistentType));
- }
- }
-
-
- //******************** Code Completion *************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getTable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaSecondaryTable sTable : CollectionTools.iterable(this.secondaryTables())) {
- result = sTable.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- for (JavaPrimaryKeyJoinColumn column : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- result = this.getAttributeOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getAssociationOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getDiscriminatorColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getGeneratorContainer().javaCompletionProposals(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);
-
- validatePrimaryKey(messages, reporter, astRoot);
- validateTable(messages, reporter, astRoot);
- for (Iterator<JavaSecondaryTable> stream = this.specifiedSecondaryTables(); stream.hasNext();) {
- stream.next().validate(messages, reporter, astRoot);
- }
- validateInheritance(messages, reporter, astRoot);
- getGeneratorContainer().validate(messages, reporter, astRoot);
- getQueryContainer().validate(messages, reporter, astRoot);
- getAttributeOverrideContainer().validate(messages, reporter, astRoot);
- getAssociationOverrideContainer().validate(messages, reporter, astRoot);
- }
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- buildPrimaryKeyValidator(astRoot).validate(messages, reporter);
- }
-
- protected PrimaryKeyValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new GenericEntityPrimaryKeyValidator(this, buildTextRangeResolver(astRoot));
- }
-
- protected PrimaryKeyTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaEntityTextRangeResolver(this, astRoot);
- }
-
- protected void validateTable(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (isAbstractTablePerClass()) {
- if (this.table.isResourceSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE,
- new String[] {this.getName()},
- this,
- this.getTable().getValidationTextRange(astRoot)
- )
- );
- }
- return;
- }
- if (isSingleTableDescendant()) {
- if (this.table.isResourceSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE,
- new String[] {this.getName()},
- this,
- this.getTable().getValidationTextRange(astRoot)
- )
- );
- }
- return;
- }
- this.table.validate(messages, reporter, astRoot);
- }
-
- protected void validateInheritance(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- validateInheritanceStrategy(messages, astRoot);
- validateDiscriminatorColumn(messages, reporter, astRoot);
- validateDiscriminatorValue(messages, astRoot);
- }
-
- protected void validateDiscriminatorColumn(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (specifiedDiscriminatorColumnIsAllowed() && !discriminatorColumnIsUndefined()) {
- getDiscriminatorColumn().validate(messages, reporter, astRoot);
- }
- else if (getDiscriminatorColumn().isResourceSpecified()) {
- if (!isRoot()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorColumnTextRange(astRoot)
- )
- );
- }
- else if (isTablePerClass()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorColumnTextRange(astRoot)
- )
- );
- }
- }
- }
-
- protected void validateDiscriminatorValue(List<IMessage> messages, CompilationUnit astRoot) {
- if (discriminatorValueIsUndefined() && getSpecifiedDiscriminatorValue() != null) {
- if (isAbstract()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorValueTextRange(astRoot)
- )
- );
- }
- else if (isTablePerClass()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorValueTextRange(astRoot)
- )
- );
- }
- }
- }
-
- protected void validateInheritanceStrategy(List<IMessage> messages, CompilationUnit astRoot) {
- Supported tablePerConcreteClassInheritanceIsSupported = getJpaPlatformVariation().getTablePerConcreteClassInheritanceIsSupported();
- if (tablePerConcreteClassInheritanceIsSupported == Supported.YES) {
- return;
- }
- if ((getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS) && isRoot()) {
- if (tablePerConcreteClassInheritanceIsSupported == Supported.NO) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM,
- new String[] {this.getName()},
- this,
- this.getInheritanceStrategyTextRange(astRoot)
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM,
- new String[] {this.getName()},
- this,
- this.getInheritanceStrategyTextRange(astRoot)
- )
- );
- }
- }
- }
-
- protected TextRange getDiscriminatorValueTextRange(CompilationUnit astRoot) {
- return getResourceDiscriminatorValue().getTextRange(astRoot);
- }
-
- protected TextRange getDiscriminatorColumnTextRange(CompilationUnit astRoot) {
- return getDiscriminatorColumn().getValidationTextRange(astRoot);
- }
-
- protected TextRange getInheritanceStrategyTextRange(CompilationUnit astRoot) {
- return getResourceInheritance().getStrategyTextRange(astRoot);
- }
-
-
- // ********** association override container owner **********
-
- protected class AssociationOverrideContainerOwner
- implements JavaAssociationOverrideContainer.Owner
- {
- public TypeMapping getTypeMapping() {
- return AbstractJavaEntity.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaEntity.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractJavaEntity.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return AbstractJavaEntity.this.associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractJavaEntity.this.getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return AbstractJavaEntity.this.getPrimaryTableName();
- }
-
- public String getPossiblePrefix() {
- return null;
- }
-
- public String getWritePrefix() {
- return null;
- }
-
- public boolean isRelevant(String overrideName) {
- //no prefix, so always true
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {overrideName, column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
- }
-
- //********** AttributeOverrideContainer.Owner implementation *********
-
- protected class AttributeOverrideContainerOwner
- implements JavaAttributeOverrideContainer.Owner
- {
- public TypeMapping getTypeMapping() {
- return AbstractJavaEntity.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaEntity.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : allOverridableAttributeNames_(typeMapping);
- }
-
- /* assumes the type mapping is not null */
- protected Iterator allOverridableAttributeNames_(TypeMapping typeMapping) {
- final Collection mappedByRelationshipAttributes = CollectionTools.collection(
- new TransformationIterator<SingleRelationshipMapping2_0, String>(getMapsIdRelationships()) {
- @Override
- protected String transform(SingleRelationshipMapping2_0 next) {
- return next.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue();
- }
- });
- return new FilteringIterator<String>(typeMapping.allOverridableAttributeNames()) {
- @Override
- protected boolean accept(String o) {
- if (mappedByRelationshipAttributes.isEmpty()) {
- return true;
- }
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (o.indexOf('.') > 0) ?
- o.substring(0, o.indexOf('.'))
- : o;
- return ! mappedByRelationshipAttributes.contains(qualifier);
- }
- };
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractJavaEntity.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return AbstractJavaEntity.this.associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractJavaEntity.this.getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return AbstractJavaEntity.this.getPrimaryTableName();
- }
-
- public String getPossiblePrefix() {
- return null;
- }
-
- public String getWritePrefix() {
- return null;
- }
-
- public boolean isRelevant(String overrideName) {
- //no prefix, so always true
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
- }
-
-
- // ********** pk join column owner **********
-
- protected class PrimaryKeyJoinColumnOwner implements JavaBaseJoinColumn.Owner
- {
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaEntity.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractJavaEntity.this;
- }
-
- public String getDefaultTableName() {
- return AbstractJavaEntity.this.getPrimaryTableName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractJavaEntity.this.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity parentEntity = AbstractJavaEntity.this.getParentEntity();
- return (parentEntity == null) ? null : parentEntity.getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return AbstractJavaEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractJavaEntity.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- Entity parentEntity = AbstractJavaEntity.this.getParentEntity();
- return (parentEntity == null) ? getPrimaryKeyColumnName() : parentEntity.getPrimaryKeyColumnName();
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java
deleted file mode 100644
index 1b7acb4051..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaGenerator.java
+++ /dev/null
@@ -1,209 +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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.java.JavaGenerator;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- *
- */
-public abstract class AbstractJavaGenerator
- extends AbstractJavaJpaContextNode
- implements JavaGenerator
-{
- protected String name;
-
- protected Integer specifiedInitialValue;
-
- protected Integer specifiedAllocationSize;
-
- protected GeneratorAnnotation resourceGenerator;
-
-
- protected AbstractJavaGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
- protected GeneratorAnnotation getResourceGenerator() {
- return this.resourceGenerator;
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.resourceGenerator.setName(name);
- this.firePropertyChanged(Generator.NAME_PROPERTY, old, name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(Generator.NAME_PROPERTY, old, name);
- }
-
-
- // ********** initial value **********
-
- public int getInitialValue() {
- return (this.specifiedInitialValue != null) ? this.specifiedInitialValue.intValue() : this.getDefaultInitialValue();
- }
-
- public Integer getSpecifiedInitialValue() {
- return this.specifiedInitialValue;
- }
-
- public void setSpecifiedInitialValue(Integer specifiedInitialValue) {
- Integer old = this.specifiedInitialValue;
- this.specifiedInitialValue = specifiedInitialValue;
- this.resourceGenerator.setInitialValue(specifiedInitialValue);
- this.firePropertyChanged(Generator.SPECIFIED_INITIAL_VALUE_PROPERTY, old, specifiedInitialValue);
- }
-
- protected void setSpecifiedInitialValue_(Integer specifiedInitialValue) {
- Integer old = this.specifiedInitialValue;
- this.specifiedInitialValue = specifiedInitialValue;
- this.firePropertyChanged(Generator.SPECIFIED_INITIAL_VALUE_PROPERTY, old, specifiedInitialValue);
- }
-
-
- // ********** allocation size **********
-
- public int getAllocationSize() {
- return (this.specifiedAllocationSize != null) ? this.specifiedAllocationSize.intValue() : this.getDefaultAllocationSize();
- }
-
- public Integer getSpecifiedAllocationSize() {
- return this.specifiedAllocationSize;
- }
-
- public void setSpecifiedAllocationSize(Integer specifiedAllocationSize) {
- Integer old = this.specifiedAllocationSize;
- this.specifiedAllocationSize = specifiedAllocationSize;
- this.resourceGenerator.setAllocationSize(specifiedAllocationSize);
- this.firePropertyChanged(Generator.SPECIFIED_ALLOCATION_SIZE_PROPERTY, old, specifiedAllocationSize);
- }
-
- protected void setSpecifiedAllocationSize_(Integer specifiedAllocationSize) {
- Integer old = this.specifiedAllocationSize;
- this.specifiedAllocationSize = specifiedAllocationSize;
- this.firePropertyChanged(Generator.SPECIFIED_ALLOCATION_SIZE_PROPERTY, old, specifiedAllocationSize);
- }
-
- public int getDefaultAllocationSize() {
- return Generator.DEFAULT_ALLOCATION_SIZE;
- }
-
-
- // ********** text ranges **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getSelectionTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange(CompilationUnit astRoot) {
- return this.resourceGenerator.getTextRange(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.resourceGenerator.getNameTextRange(astRoot);
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(GeneratorAnnotation generatorAnnotation) {
- this.resourceGenerator = generatorAnnotation;
- this.name = generatorAnnotation.getName();
- this.specifiedInitialValue = generatorAnnotation.getInitialValue();
- this.specifiedAllocationSize = generatorAnnotation.getAllocationSize();
- }
-
- protected void update(GeneratorAnnotation generatorAnnotation) {
- this.resourceGenerator = generatorAnnotation;
- this.setName_(generatorAnnotation.getName());
- this.setSpecifiedInitialValue_(generatorAnnotation.getInitialValue());
- this.setSpecifiedAllocationSize_(generatorAnnotation.getAllocationSize());
- getPersistenceUnit().addGenerator(this);
- }
-
-
- // ********** database stuff **********
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- protected abstract String getSchema();
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- protected abstract String getCatalog();
-
-
- // ********** misc **********
-
- public boolean isVirtual() {
- return false;
- }
-
- public boolean overrides(Generator generator) {
- // java is at the base of the tree
- return false;
- }
-
- public boolean duplicates(Generator other) {
- return (this != other)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(other.getName())
- && ! this.overrides(other)
- && ! other.overrides(this);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMapping.java
deleted file mode 100644
index 68f52fe35e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMapping.java
+++ /dev/null
@@ -1,472 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.IdMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-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 abstract class AbstractJavaIdMapping
- extends AbstractJavaAttributeMapping<IdAnnotation>
- implements JavaIdMapping, IdMapping2_0
-{
- protected final JavaColumn column;
-
- /* 2.0 feature - a relationship may map this id */
- protected boolean mappedByRelationship;
-
- protected JavaGeneratedValue generatedValue;
-
- protected final JavaGeneratorContainer generatorContainer;
-
- protected JavaConverter converter;
-
- protected final JavaConverter nullConverter;
-
-
- protected AbstractJavaIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = this.getJpaFactory().buildJavaColumn(this, this);
- this.generatorContainer = this.buildGeneratorContainer();
- this.nullConverter = getJpaFactory().buildJavaNullConverter(this);
- this.converter = this.nullConverter;
- }
-
-
- @Override
- protected void initialize() {
- super.initialize();
- this.column.initialize(this.getResourceColumn());
- this.mappedByRelationship = calculateMappedByRelationship();
- this.generatorContainer.initialize(this.getResourcePersistentAttribute());
- this.initializeGeneratedValue();
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
- protected void initializeGeneratedValue() {
- GeneratedValueAnnotation resourceGeneratedValue = this.getResourceGeneratedValue();
- if (resourceGeneratedValue != null) {
- this.generatedValue = this.buildGeneratedValue(resourceGeneratedValue);
- }
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) this.getResourcePersistentAttribute().
- getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- protected boolean isColumnSpecified() {
- return getResourcePersistentAttribute().getAnnotation(ColumnAnnotation.ANNOTATION_NAME) != null;
- }
-
- private JavaGeneratorContainer buildGeneratorContainer() {
- return this.getJpaFactory().buildJavaGeneratorContainer(this);
- }
-
-
- //************** JavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return IdAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.COLUMN);
- names.add(JPA.GENERATED_VALUE);
- names.add(JPA.TEMPORAL);
- names.add(JPA.TABLE_GENERATOR);
- names.add(JPA.SEQUENCE_GENERATOR);
- }
-
-
- //************** NamedColumn.Owner implementation ***************
-
- public String getDefaultColumnName() {
- return (isMappedByRelationship() && ! isColumnSpecified()) ? null : getName();
- }
-
-
- //************** BaseColumn.Owner implementation ***************
-
- public String getDefaultTableName() {
- return (isMappedByRelationship() && ! isColumnSpecified()) ? null : getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
-
- //************** IdMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public JavaGeneratedValue addGeneratedValue() {
- if (getGeneratedValue() != null) {
- throw new IllegalStateException("gemeratedValue already exists"); //$NON-NLS-1$
- }
- this.generatedValue = getJpaFactory().buildJavaGeneratedValue(this);
- GeneratedValueAnnotation generatedValueResource =
- (GeneratedValueAnnotation) getResourcePersistentAttribute().
- addAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- this.generatedValue.initialize(generatedValueResource);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, null, this.generatedValue);
- return this.generatedValue;
- }
-
- public void removeGeneratedValue() {
- if (getGeneratedValue() == null) {
- throw new IllegalStateException("gemeratedValue does not exist, cannot be removed"); //$NON-NLS-1$
- }
- JavaGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = null;
- getResourcePersistentAttribute().removeAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, null);
- }
-
- public JavaGeneratedValue getGeneratedValue() {
- return this.generatedValue;
- }
-
- protected void setGeneratedValue(JavaGeneratedValue newGeneratedValue) {
- JavaGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = newGeneratedValue;
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, newGeneratedValue);
- }
-
- public JavaGeneratorContainer getGeneratorContainer() {
- return this.generatorContainer;
- }
-
- public JavaConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- JavaConverter oldConverter = this.converter;
- JavaConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- @Override
- protected void update() {
- super.update();
- this.column.update(this.getResourceColumn());
- setMappedByRelationship(calculateMappedByRelationship());
- this.generatorContainer.update(this.getResourcePersistentAttribute());
- this.updateGeneratedValue();
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update(this.getResourcePersistentAttribute());
- }
- else {
- JavaConverter javaConverter = buildConverter(getResourceConverterType());
- setConverter(javaConverter);
- }
- }
-
- protected void updateGeneratedValue() {
- GeneratedValueAnnotation resourceGeneratedValue = getResourceGeneratedValue();
- if (resourceGeneratedValue == null) {
- if (getGeneratedValue() != null) {
- setGeneratedValue(null);
- }
- }
- else {
- if (getGeneratedValue() == null) {
- setGeneratedValue(buildGeneratedValue(resourceGeneratedValue));
- }
- else {
- getGeneratedValue().update(resourceGeneratedValue);
- }
- }
- }
-
- protected JavaGeneratedValue buildGeneratedValue(GeneratedValueAnnotation resourceGeneratedValue) {
- JavaGeneratedValue gv = getJpaFactory().buildJavaGeneratedValue(this);
- gv.initialize(resourceGeneratedValue);
- return gv;
- }
-
- protected TableGeneratorAnnotation getResourceTableGenerator() {
- return (TableGeneratorAnnotation) this.getResourcePersistentAttribute().
- getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected SequenceGeneratorAnnotation getResourceSequenceGenerator() {
- return (SequenceGeneratorAnnotation) this.getResourcePersistentAttribute().
- getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected GeneratedValueAnnotation getResourceGeneratedValue() {
- return (GeneratedValueAnnotation) this.getResourcePersistentAttribute().
- getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME);
- }
-
- protected JavaConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.getResourcePersistentAttribute());
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.getResourcePersistentAttribute().getAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
-
- // **************** IdMapping2_0 impl *************************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (getName().equals(each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue())) {
- return true;
- }
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // ********** code assist **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.generatorTouches(pos, astRoot)) {
- result = this.persistenceGeneratorNames(filter);
- if (result != null) {
- return result;
- }
- }
- result = this.getGeneratorContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = getConverter().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** code assist: generator
-
- protected boolean generatorTouches(int pos, CompilationUnit astRoot) {
- if (getResourceGeneratedValue() != null) {
- return this.getResourceGeneratedValue().generatorTouches(pos, astRoot);
- }
- return false;
- }
-
- protected Iterator<String> persistenceGeneratorNames() {
- if(this.getPersistenceUnit().generatorsSize() == 0) {
- return EmptyIterator.<String> instance();
- }
- return CollectionTools.iterator(this.getPersistenceUnit().uniqueGeneratorNames());
- }
-
- private Iterator<String> generatorNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.persistenceGeneratorNames(), filter);
- }
-
- protected Iterator<String> persistenceGeneratorNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.generatorNames(filter));
- }
-
-
- // *************************************************************************
-
- @Override
- public String getPrimaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
-
- //*********** Validation ************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // [JPA 2.0] if the column is specified, or if the id is not mapped by a relationship,
- // then the column is validated.
- // (In JPA 1.0, the column will always be validated, since the id is never mapped by a
- // relationship)
- if (isColumnSpecified() || ! isMappedByRelationship()) {
- this.getColumn().validate(messages, reporter, astRoot);
- }
-
- // [JPA 2.0] if the column is specified and the id is mapped by a relationship,
- // then that is an error
- // (In JPA 1.0, this will never be the case, since the id is never mapped by a relationship)
- if (isColumnSpecified() && isMappedByRelationship()) {
- messages.add(
- buildMessage(
- JpaValidationMessages.ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED,
- new String[] {},
- getColumn().getValidationTextRange(astRoot)));
- }
-
- if (this.getGeneratedValue() != null) {
- this.getGeneratedValue().validate(messages, reporter, astRoot);
- }
- this.getGeneratorContainer().validate(messages, reporter, astRoot);
- this.getConverter().validate(messages, reporter, astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- /* TODO - move to AbstractOrmAttributeMapping? */
- protected IMessage buildMessage(String msgID, String[] params, TextRange textRange) {
- PersistentAttribute attribute = getPersistentAttribute();
- String attributeDesc = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
-
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- ArrayTools.add(params, 0, attributeDesc),
- this,
- textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMappingDefinition.java
deleted file mode 100644
index 06fce4be77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaIdMappingDefinition.java
+++ /dev/null
@@ -1,38 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-
-public abstract class AbstractJavaIdMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- protected AbstractJavaIdMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return IdAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaIdMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.java
deleted file mode 100644
index 2b5c4f6017..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.java
+++ /dev/null
@@ -1,242 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy
- extends AbstractJavaJoinColumnJoiningStrategy
-{
-
- protected AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy(JavaJoinColumnEnabledRelationshipReference parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- @Override
- public JavaJoinColumnEnabledRelationshipReference getRelationshipReference() {
- return (JavaJoinColumnEnabledRelationshipReference) super.getRelationshipReference();
- }
-
- @Override
- public JavaRelationshipMapping getRelationshipMapping() {
- return getRelationshipReference().getRelationshipMapping();
- }
-
- protected abstract Entity getRelationshipTargetEntity();
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY;
- }
-
- public boolean isOverridableAssociation() {
- return true;
- }
-
- protected JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute().getResourcePersistentAttribute();
- }
-
- @Override
- protected Iterator<JoinColumnAnnotation> joinColumnAnnotations() {
- return new TransformationIterator<NestableAnnotation, JoinColumnAnnotation>(
- this.getResourcePersistentAttribute().annotations(
- JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)) {
- @Override
- protected JoinColumnAnnotation transform(NestableAnnotation next) {
- return (JoinColumnAnnotation) next;
- }
- };
- }
-
- @Override
- protected JoinColumnAnnotation buildNullJoinColumnAnnotation() {
- return new NullJoinColumnAnnotation(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected JoinColumnAnnotation addAnnotation(int index) {
- return (JoinColumnAnnotation) this.getResourcePersistentAttribute().
- addAnnotation(
- index,
- JoinColumnAnnotation.ANNOTATION_NAME,
- JoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- @Override
- protected void removeAnnotation(int index) {
- this.getResourcePersistentAttribute().
- removeAnnotation(
- index,
- JoinColumnAnnotation.ANNOTATION_NAME,
- JoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- @Override
- protected void moveAnnotation(int targetIndex, int sourceIndex) {
- this.getResourcePersistentAttribute().
- moveAnnotation(
- targetIndex,
- sourceIndex,
- JoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getRelationshipReference().getValidationTextRange(astRoot);
- }
-
-
- protected class JoinColumnOwner
- implements JavaJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getTableName();
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public String getAttributeName() {
- return getRelationshipMapping().getName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getRelationshipSource();
- }
-
- public Entity getRelationshipTarget() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getRelationshipTargetEntity();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public Iterator<String> candidateTableNames() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.candidateTableNames();
- }
-
- public Table getDbTable(String tableName) {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getReferencedColumnDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.defaultJoinColumn == joinColumn;
- }
-
- public int joinColumnsSize() {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnJoiningStrategy.java
deleted file mode 100644
index cdc459610b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,325 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaJoinColumnJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaJoinColumnJoiningStrategy
-{
- protected JavaJoinColumn defaultJoinColumn;
-
- protected final Vector<JavaJoinColumn> specifiedJoinColumns = new Vector<JavaJoinColumn>();
- protected final JavaJoinColumn.Owner joinColumnOwner;
-
-
- protected AbstractJavaJoinColumnJoiningStrategy(JoinColumnEnabledRelationshipReference parent) {
- super(parent);
- this.joinColumnOwner = this.buildJoinColumnOwner();
- }
-
- protected abstract JavaJoinColumn.Owner buildJoinColumnOwner();
-
- public void initializeFrom(JoinColumnJoiningStrategy oldStrategy) {
- for (JoinColumn joinColumn : CollectionTools.iterable(oldStrategy.joinColumns())) {
- JoinColumn newJoinColumn = this.addSpecifiedJoinColumn(this.specifiedJoinColumnsSize());
- newJoinColumn.setSpecifiedName(joinColumn.getName());
- newJoinColumn.setSpecifiedReferencedColumnName(joinColumn.getReferencedColumnName());
- }
- }
-
- @Override
- public JoinColumnEnabledRelationshipReference getParent() {
- return (JoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public JoinColumnEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public String getTableName() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? false : typeMapping.tableNameIsInvalid(tableName);
- }
-
- protected Iterator<String> candidateTableNames() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? EmptyIterator.<String> instance() : typeMapping.associatedTableNamesIncludingInherited();
- }
-
- public void addStrategy() {
- if (specifiedJoinColumnsSize() == 0) {
- addSpecifiedJoinColumn(0);
- }
- }
-
- public void removeStrategy() {
- for (JoinColumn each : CollectionTools.iterable(specifiedJoinColumns())) {
- removeSpecifiedJoinColumn(each);
- }
- }
-
- public Table getReferencedColumnDbTable() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getPrimaryDbTable();
- }
-
- // **************** join columns *******************************************
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.hasSpecifiedJoinColumns() ?
- this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.hasSpecifiedJoinColumns() ?
- this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
-
- // **************** default join column ************************************
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn column) {
- JavaJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = column;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, old, column);
- }
-
- protected ListIterator<JavaJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
-
- // **************** specified join columns *********************************
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return ! this.specifiedJoinColumns.isEmpty();
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- // Clear out the default now so it doesn't get removed during an update and
- // cause change notifications to be sent to the UI in the wrong order.
- JavaJoinColumn oldDefault = this.defaultJoinColumn;
- this.defaultJoinColumn = null;
-
- JavaJoinColumn joinColumn = this.getJpaFactory().buildJavaJoinColumn(this, this.joinColumnOwner);
- this.specifiedJoinColumns.add(index, joinColumn);
- JoinColumnAnnotation joinColumnAnnotation = this.addAnnotation(index);
- joinColumn.initialize(joinColumnAnnotation);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
-
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, oldDefault, null);
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(JavaJoinColumn joinColumn) {
- addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if (this.specifiedJoinColumns.isEmpty()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = buildJoinColumn(buildNullJoinColumnAnnotation());
- }
- removeAnnotation(index);
- fireItemRemoved(SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(JavaJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- moveAnnotation(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected abstract JoinColumnAnnotation addAnnotation(int index);
-
- protected abstract void removeAnnotation(int index);
-
- protected abstract void moveAnnotation(int targetIndex, int sourceIndex);
-
- protected abstract Iterator<JoinColumnAnnotation> joinColumnAnnotations();
-
- protected abstract JoinColumnAnnotation buildNullJoinColumnAnnotation();
-
-
- // **************** resource => context ************************************
-
- public void initialize() {
- initializeSpecifiedJoinColumns();
- initializeDefaultJoinColumn();
- }
-
- protected void initializeSpecifiedJoinColumns() {
- Iterator<JoinColumnAnnotation> annotations = joinColumnAnnotations();
- while (annotations.hasNext()) {
- this.specifiedJoinColumns.add(buildJoinColumn(annotations.next()));
- }
- }
-
- public void initializeDefaultJoinColumn() {
- if (mayHaveDefaultJoinColumn()) {
- this.defaultJoinColumn =
- buildJoinColumn(buildNullJoinColumnAnnotation());
- }
- }
-
- public void update() {
- updateSpecifiedJoinColumns();
- updateDefaultJoinColumn();
- }
-
- protected void updateSpecifiedJoinColumns() {
- ListIterator<JavaJoinColumn> joinColumns = specifiedJoinColumns();
- Iterator<JoinColumnAnnotation> resourceJoinColumns = joinColumnAnnotations();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (resourceJoinColumns.hasNext()) {
- joinColumn.update(resourceJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (resourceJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn(resourceJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn() {
- if (mayHaveDefaultJoinColumn()) {
- JoinColumnAnnotation nullAnnotation = buildNullJoinColumnAnnotation();
- if (this.defaultJoinColumn == null) {
- setDefaultJoinColumn(this.buildJoinColumn(nullAnnotation));
- }
- this.defaultJoinColumn.update(nullAnnotation);
- }
- else {
- if (this.defaultJoinColumn != null) {
- setDefaultJoinColumn(null);
- }
- }
- }
-
- protected boolean mayHaveDefaultJoinColumn() {
- return getRelationshipReference().mayHaveDefaultJoinColumn()
- && ! hasSpecifiedJoinColumns();
- }
-
- protected JavaJoinColumn buildJoinColumn(JoinColumnAnnotation joinColumnResource) {
- JavaJoinColumn joinColumn = getJpaFactory().buildJavaJoinColumn(this, this.joinColumnOwner);
- joinColumn.initialize(joinColumnResource);
- return joinColumn;
- }
-
-
- // **************** Java completion proposals ******************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.javaCompletionProposals(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);
- for (Iterator<JavaJoinColumn> stream = this.joinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinTableJoiningStrategy.java
deleted file mode 100644
index b0a729d6a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,173 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaJoinTableJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaJoinTableJoiningStrategy
-{
- protected JavaJoinTable joinTable;
-
-
- protected AbstractJavaJoinTableJoiningStrategy(JoinTableEnabledRelationshipReference parent) {
- super(parent);
- }
-
-
- @Override
- public JoinTableEnabledRelationshipReference getParent() {
- return (JoinTableEnabledRelationshipReference) super.getParent();
- }
-
- public JoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public String getTableName() {
- return getJoinTable().getName();
- }
-
- public Table getDbTable(String tableName) {
- return getJoinTable().getDbTable();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getTableName(), tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.DOES_NOT_MATCH_JOIN_TABLE;
- }
-
- public String getJoinTableDefaultName() {
- return MappingTools.buildJoinTableDefaultName(this.getRelationshipReference());
- }
-
- public void addStrategy() {
- if (this.joinTable == null) {
- this.joinTable = getJpaFactory().buildJavaJoinTable(this);
- addAnnotation();
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, null, this.joinTable);
- }
- }
-
- public void removeStrategy() {
- if (this.joinTable != null) {
- JavaJoinTable oldJoinTable = this.joinTable;
- this.joinTable = null;
- removeAnnotation();
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, oldJoinTable, null);
- }
- }
-
- public void initializeFrom(JoinTableJoiningStrategy oldStrategy) {
- JoinTable oldJoinTable = oldStrategy.getJoinTable();
- if (oldJoinTable != null) {
- this.addStrategy();
- this.getJoinTable().setSpecifiedCatalog(oldJoinTable.getSpecifiedCatalog());
- this.getJoinTable().setSpecifiedSchema(oldJoinTable.getSpecifiedSchema());
- this.getJoinTable().setSpecifiedName(oldJoinTable.getSpecifiedName());
- }
- }
-
-
- // **************** join table *********************************************
-
- public JavaJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- protected void setJoinTable_(JavaJoinTable newJoinTable) {
- JavaJoinTable oldJoinTable = this.joinTable;
- this.joinTable = newJoinTable;
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, oldJoinTable, newJoinTable);
- }
-
- protected abstract JoinTableAnnotation addAnnotation();
-
- protected abstract void removeAnnotation();
-
- protected boolean mayHaveJoinTable() {
- return getAnnotation().isSpecified()
- || getRelationshipReference().mayHaveDefaultJoinTable();
- }
-
-
- // **************** resource => context ************************************
-
- public void initialize() {
- JoinTableAnnotation annotation = getAnnotation();
- if (mayHaveJoinTable()) {
- this.joinTable = getJpaFactory().buildJavaJoinTable(this);
- this.joinTable.initialize(annotation);
- }
- }
-
- public void update() {
- JoinTableAnnotation annotation = getAnnotation();
- if (mayHaveJoinTable()) {
- if (this.joinTable == null) {
- setJoinTable_(getJpaFactory().buildJavaJoinTable(this));
- }
- this.joinTable.update(annotation);
- }
- else {
- if (this.joinTable != null) {
- // no annotation, so no clean up
- setJoinTable_(null);
- }
- }
- }
-
- // **************** Java completion proposals ******************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null && this.joinTable != null) {
- result = this.joinTable.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (this.joinTable != null) {
- this.joinTable.validate(messages, reporter, astRoot);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
deleted file mode 100644
index 8a55d4a316..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaJpaContextNode.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.jpt.utility.Filter;
-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 AbstractJavaJpaContextNode
- extends AbstractJpaContextNode
- implements JavaJpaContextNode
-{
- // ********** constructor **********
-
- protected AbstractJavaJpaContextNode(JpaContextNode parent) {
- super(parent);
- }
-
- @Override
- public JpaResourceType getResourceType() {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- if (this.connectionProfileIsActive()) {
- Iterator<String> result = this.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * This method is called if the database is connected, allowing us to
- * get candidates from the various database tables etc.
- * This method should NOT be cascaded to "child" objects; it should
- * only return candidates for the current object. The cascading is
- * handled by #javaCompletionProposals(int, Filter, CompilationUnit).
- */
- @SuppressWarnings("unused")
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- return null;
- }
-
- // ********** validation **********
-
- /**
- * 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToManyMapping.java
deleted file mode 100644
index 87f4be9190..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToManyMapping.java
+++ /dev/null
@@ -1,46 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-
-
-public abstract class AbstractJavaManyToManyMapping
- extends AbstractJavaMultiRelationshipMapping<ManyToMany2_0Annotation>
- implements JavaManyToManyMapping2_0
-{
- protected AbstractJavaManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaRelationshipReference buildRelationshipReference() {
- return new GenericJavaManyToManyRelationshipReference(this);
- }
-
- public String getAnnotationName() {
- return ManyToManyAnnotation.ANNOTATION_NAME;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public JavaManyToManyRelationshipReference getRelationshipReference() {
- return (JavaManyToManyRelationshipReference) super.getRelationshipReference();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneMapping.java
deleted file mode 100644
index 38b7e7d227..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneMapping.java
+++ /dev/null
@@ -1,50 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-
-
-public abstract class AbstractJavaManyToOneMapping
- extends AbstractJavaSingleRelationshipMapping<ManyToOne2_0Annotation>
- implements JavaManyToOneMapping2_0
-{
- protected AbstractJavaManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ManyToOneAnnotation.ANNOTATION_NAME;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public JavaManyToOneRelationshipReference2_0 getRelationshipReference() {
- return (JavaManyToOneRelationshipReference2_0) super.getRelationshipReference();
- }
-
- @Override
- protected Boolean getResourceOptional() {
- return this.mappingAnnotation.getOptional();
- }
-
- @Override
- protected void setResourceOptional(Boolean newOptional) {
- this.mappingAnnotation.setOptional(newOptional);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneRelationshipReference.java
deleted file mode 100644
index 314634870b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaManyToOneRelationshipReference.java
+++ /dev/null
@@ -1,158 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaManyToOneRelationshipReference
- extends AbstractJavaRelationshipReference
- implements JavaManyToOneRelationshipReference2_0
-{
- protected final JavaJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
- protected final JavaJoinTableJoiningStrategy joinTableJoiningStrategy;
-
-
- protected AbstractJavaManyToOneRelationshipReference(JavaManyToOneMapping parent) {
- super(parent);
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
-
- protected JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericJavaJoinColumnJoiningStrategy(this);
- }
-
- protected abstract JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy();
-
- @Override
- public JavaManyToOneMapping getRelationshipMapping() {
- return (JavaManyToOneMapping) getParent();
- }
-
- public boolean isRelationshipOwner() {
- return true;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return false;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.joinColumnJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinTableJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** join columns *******************************************
-
- public JavaJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- // join columns are default (and only, so far) strategy, so no need
- // to add to resource model
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return this.getJoinTableJoiningStrategy().getJoinTable() == null;
- }
-
-
- // **************** join table *********************************************
-
- public JavaJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return false;
- }
-
- // **************** resource => context ************************************
-
- @Override
- protected void initializeJoiningStrategies() {
- this.joinTableJoiningStrategy.initialize();
- // initialize join column strategy last, as the existence of a default
- // join column is dependent on the other mechanisms (join table) not
- // being specified
- this.joinColumnJoiningStrategy.initialize();
- }
-
- @Override
- protected void updateJoiningStrategies() {
- this.joinTableJoiningStrategy.update();
- // update join column strategy last, as the existence of a default join
- // column is dependent on the other mechanisms (join table) not being
- // specified
- this.joinColumnJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinColumnJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinTableJoiningStrategy.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappedSuperclass.java
deleted file mode 100644
index 1896ae1ebc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappedSuperclass.java
+++ /dev/null
@@ -1,129 +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.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaMappedSuperclass extends AbstractJavaTypeMapping
- implements JavaMappedSuperclass
-{
- protected final JavaIdClassReference idClassReference;
-
-
- protected AbstractJavaMappedSuperclass(JavaPersistentType parent) {
- super(parent);
- this.idClassReference = buildIdClassReference();
- }
-
-
- protected GenericJavaIdClassReference buildIdClassReference() {
- return new GenericJavaIdClassReference(this);
- }
-
- public JavaIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- @Override
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return SUPPORTING_ANNOTATION_NAMES;
- }
-
- protected static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- JPA.ID_CLASS,
- JPA.EXCLUDE_DEFAULT_LISTENERS,
- JPA.EXCLUDE_SUPERCLASS_LISTENERS,
- JPA.ENTITY_LISTENERS,
- JPA.PRE_PERSIST,
- JPA.POST_PERSIST,
- JPA.PRE_REMOVE,
- JPA.POST_REMOVE,
- JPA.PRE_UPDATE,
- JPA.POST_UPDATE,
- JPA.POST_LOAD
- };
-
- protected static final Iterable<String> SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-
- @Override
- public void initialize(JavaResourcePersistentType persistentTypeResource) {
- super.initialize(persistentTypeResource);
- this.idClassReference.initialize();
- }
-
- @Override
- public void update(JavaResourcePersistentType persistentTypeResource) {
- super.update(persistentTypeResource);
- this.idClassReference.update();
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validatePrimaryKey(messages, reporter, astRoot);
- }
-
- protected void validatePrimaryKey(
- List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
-
- buildPrimaryKeyValidator(astRoot).validate(messages, reporter);
- }
-
- protected PrimaryKeyValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new GenericMappedSuperclassPrimaryKeyValidator(this, buildTextRangeResolver(astRoot));
- // TODO - JPA 2.0 validation
- }
-
- protected PrimaryKeyTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaMappedSuperclassTextRangeResolver(this, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
deleted file mode 100644
index 9715f819df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
+++ /dev/null
@@ -1,860 +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.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaOrderable;
-import org.eclipse.jpt.core.context.java.JavaOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaMapKeyColumn2_0;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java multi-relationship (m:m, 1:m) mapping
- */
-public abstract class AbstractJavaMultiRelationshipMapping<T extends RelationshipMapping2_0Annotation>
- extends AbstractJavaRelationshipMapping<T>
- implements JavaMultiRelationshipMapping, JavaCollectionMapping2_0
-{
- protected final JavaOrderable orderable;
-
- protected Embeddable resolvedTargetEmbeddable;
-
- protected Type valueType;
- protected Type keyType;
-
- protected String specifiedMapKey;
- protected boolean noMapKey = false;
- protected boolean pkMapKey = false;
- protected boolean customMapKey = false;
-
- protected String specifiedMapKeyClass;
- protected String defaultMapKeyClass;
- protected String fullyQualifiedMapKeyClass;
- protected PersistentType resolvedMapKeyType;
- protected Embeddable resolvedMapKeyEmbeddable;
- protected Entity resolvedMapKeyEntity;
-
- protected final JavaColumn mapKeyColumn;
-
- protected final JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer;
-
- protected AbstractJavaMultiRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.orderable = this.buildOrderable();
- this.mapKeyColumn = this.buildMapKeyColumn();
- this.mapKeyAttributeOverrideContainer = this.getJpaFactory().buildJavaAttributeOverrideContainer(this, new MapKeyAttributeOverrideContainerOwner());
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.orderable.initialize();
- this.resolvedTargetType = this.resolveTargetType();
- this.resolvedTargetEmbeddable = this.resolveTargetEmbeddable();
- this.initializeValueType();
- this.defaultMapKeyClass = this.buildDefaultMapKeyClass();
- this.specifiedMapKeyClass = this.getResourceMapKeyClass();
- this.fullyQualifiedMapKeyClass = this.buildFullyQualifiedMapKeyClass();
- this.resolvedMapKeyType = this.resolveMapKeyType();//no need for change notification, use resolved target embeddable change notification instead?
- this.resolvedMapKeyEmbeddable = this.resolveMapKeyEmbeddable();
- this.resolvedMapKeyEntity = this.resolveMapKeyEntity();
- this.initializeKeyType();
- this.initializeMapKey();
- this.initializeMapKeyColumn();
- this.mapKeyAttributeOverrideContainer.initialize(getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.orderable.update();
- this.resolvedTargetType = this.resolveTargetType();//no need for change notification, use resolved target embeddable change notification instead?
- this.resolvedTargetEmbeddable = this.resolveTargetEmbeddable();
- this.updateValueType();
- this.setDefaultMapKeyClass(this.buildDefaultMapKeyClass());
- this.setSpecifiedMapKeyClass_(this.getResourceMapKeyClass());
- this.setFullyQualifiedMapKeyClass(this.buildFullyQualifiedMapKeyClass());
- this.resolvedMapKeyType = this.resolveMapKeyType();//no need for change notification, use resolved target embeddable change notification instead?
- this.setResolvedMapKeyEmbeddable(this.resolveMapKeyEmbeddable());
- this.setResolvedMapKeyEntity(this.resolveMapKeyEntity());
- this.updateKeyType();
- this.updateMapKey();
- this.updateMapKeyColumn();
- this.mapKeyAttributeOverrideContainer.update(getResourcePersistentAttribute());
- }
-
- // ********** AbstractJavaAttributeMapping implementation **********
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.JOIN_TABLE);
- names.add(JPA.MAP_KEY);
- names.add(JPA.ORDER_BY);
- if (this.isJpa2_0Compatible()) {
- names.add(JPA.ATTRIBUTE_OVERRIDE);
- names.add(JPA.ATTRIBUTE_OVERRIDES);
- names.add(JPA2_0.MAP_KEY_CLASS);
- names.add(JPA2_0.MAP_KEY_COLUMN);
- names.add(JPA2_0.MAP_KEY_ENUMERATED);
- names.add(JPA2_0.MAP_KEY_JOIN_COLUMN);
- names.add(JPA2_0.MAP_KEY_JOIN_COLUMNS);
- names.add(JPA2_0.MAP_KEY_TEMPORAL);
- names.add(JPA2_0.ORDER_COLUMN);
- }
- }
-
- // ********** AbstractJavaRelationshipMapping implementation **********
-
- @Override
- protected String buildDefaultTargetEntity() {
- return this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- }
-
-
- // ********** ordering **********
-
- protected JavaOrderable buildOrderable() {
- return this.isJpa2_0Compatible() ?
- this.getJpaFactory().buildJavaOrderable(this, this.buildOrderableOwner()) :
- this.getJpaFactory().buildJavaOrderable(this, new Orderable.Owner() {/*nothing*/});
- }
-
- public JavaOrderable getOrderable() {
- return this.orderable;
- }
-
- protected Orderable2_0.Owner buildOrderableOwner() {
- return new Orderable2_0.Owner() {
- public String getTableName() {
- return getRelationshipReference().getPredominantJoiningStrategy().getTableName();
- }
- public Table getDbTable(String tableName) {
- return getRelationshipReference().getPredominantJoiningStrategy().getDbTable(tableName);
- }
- };
- }
-
- // ********** Fetchable implementation **********
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
-
- // ********** CollectionMapping implementation **********
-
- protected Embeddable resolveTargetEmbeddable() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- public Type getValueType() {
- return this.valueType;
- }
-
- protected void setValueType(Type newValueType) {
- Type old = this.valueType;
- this.valueType = newValueType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, old, newValueType);
- }
-
- protected void initializeValueType() {
- this.valueType = this.buildValueType();
- }
-
- protected void updateValueType() {
- this.setValueType(this.buildValueType());
- }
-
- protected Type buildValueType() {
- if (this.getResolvedTargetEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (this.resolvedTargetEmbeddable != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- else if (getTargetEntity() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- public Type getKeyType() {
- return this.keyType;
- }
-
- protected void setKeyType(Type newKeyType) {
- Type old = this.keyType;
- this.keyType = newKeyType;
- firePropertyChanged(KEY_TYPE_PROPERTY, old, newKeyType);
- }
-
- protected void initializeKeyType() {
- this.keyType = this.buildKeyType();
- }
-
- protected void updateKeyType() {
- this.setKeyType(this.buildKeyType());
- }
-
- protected Type buildKeyType() {
- if (getResolvedMapKeyEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- if (getResolvedMapKeyEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (getMapKeyClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- public Embeddable getResolvedMapKeyEmbeddable() {
- return this.resolvedMapKeyEmbeddable;
- }
-
- protected void setResolvedMapKeyEmbeddable(Embeddable embeddable) {
- Embeddable old = this.resolvedMapKeyEmbeddable;
- this.resolvedMapKeyEmbeddable = embeddable;
- this.firePropertyChanged(RESOLVED_MAP_KEY_EMBEDDABLE_PROPERTY, old, embeddable);
- }
-
- public Entity getResolvedMapKeyEntity() {
- return this.resolvedMapKeyEntity;
- }
-
- protected void setResolvedMapKeyEntity(Entity entity) {
- Entity old = this.resolvedMapKeyEntity;
- this.resolvedMapKeyEntity = entity;
- this.firePropertyChanged(RESOLVED_MAP_KEY_ENTITY_PROPERTY, old, entity);
- }
-
- public PersistentType getResolvedMapKeyType() {
- return getResolvedMapKeyEmbeddable() == null ? null : getResolvedMapKeyEmbeddable().getPersistentType();
- }
-
- protected PersistentType resolveMapKeyType() {
- return (this.fullyQualifiedMapKeyClass == null) ? null : this.getPersistenceUnit().getPersistentType(this.fullyQualifiedMapKeyClass);
- }
-
- protected Embeddable resolveMapKeyEmbeddable() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- protected Entity resolveMapKeyEntity() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- // ********** map key **********
-
- public String getMapKey() {
- if (this.noMapKey) {
- return null;
- }
- if (this.pkMapKey) {
- return this.getTargetEntityIdAttributeName();
- }
- if (this.customMapKey) {
- return this.specifiedMapKey;
- }
- throw new IllegalStateException("unknown map key"); //$NON-NLS-1$
- }
-
- public String getSpecifiedMapKey() {
- return this.specifiedMapKey;
- }
-
- public void setSpecifiedMapKey(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKey == null) {
- if (mapKeyAnnotation != null) {
- this.removeMapKeyAnnotation();
- }
- } else {
- if (mapKeyAnnotation == null) {
- mapKeyAnnotation = this.addMapKeyAnnotation();
- }
- mapKeyAnnotation.setName(mapKey);
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void setSpecifiedMapKey_(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void initializeMapKey() {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKeyAnnotation == null) {
- this.noMapKey = true;
- } else {
- this.specifiedMapKey = mapKeyAnnotation.getName();
- if (this.specifiedMapKey == null) {
- this.pkMapKey = true;
- } else {
- this.customMapKey = true;
- }
- }
- }
-
- protected void updateMapKey() {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKeyAnnotation == null) {
- this.setSpecifiedMapKey_(null);
- this.setNoMapKey_(true);
- this.setPkMapKey_(false);
- this.setCustomMapKey_(false);
- } else {
- String mk = mapKeyAnnotation.getName();
- this.setSpecifiedMapKey_(mk);
- this.setNoMapKey_(false);
- this.setPkMapKey_(mk == null);
- this.setCustomMapKey_(mk != null);
- }
- }
-
- protected MapKeyAnnotation getMapKeyAnnotation() {
- return (MapKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected MapKeyAnnotation addMapKeyAnnotation() {
- return (MapKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeMapKeyAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected boolean mapKeyNameTouches(int pos, CompilationUnit astRoot) {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- return (mapKeyAnnotation != null) && mapKeyAnnotation.nameTouches(pos, astRoot);
- }
-
-
- // ********** no map key **********
-
- public boolean isNoMapKey() {
- return this.noMapKey;
- }
-
- public void setNoMapKey(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- if (noMapKey) {
- if (this.getMapKeyAnnotation() != null) {
- this.removeMapKeyAnnotation();
- }
- } else {
- // the 'noMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setNoMapKey_(boolean)
- }
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
- protected void setNoMapKey_(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
-
- // ********** pk map key **********
-
- public boolean isPkMapKey() {
- return this.pkMapKey;
- }
-
- public void setPkMapKey(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (pkMapKey) {
- if (mapKeyAnnotation == null) {
- this.addMapKeyAnnotation();
- } else {
- mapKeyAnnotation.setName(null);
- }
- } else {
- // the 'pkMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setPkMapKey_(boolean)
- }
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
- protected void setPkMapKey_(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
-
- // ********** custom map key **********
-
- public boolean isCustomMapKey() {
- return this.customMapKey;
- }
-
- public void setCustomMapKey(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- if (customMapKey) {
- this.setSpecifiedMapKey(""); //$NON-NLS-1$
- } else {
- // the 'customMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setCustomMapKey_(boolean)
- }
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- protected void setCustomMapKey_(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
-
- // *************** map key class *************
-
- public String getMapKeyClass() {
- return (this.specifiedMapKeyClass != null) ? this.specifiedMapKeyClass : this.defaultMapKeyClass;
- }
-
- public String getSpecifiedMapKeyClass() {
- return this.specifiedMapKeyClass;
- }
-
- public void setSpecifiedMapKeyClass(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- MapKeyClass2_0Annotation mapKeyClassAnnotation = this.getMapKeyClassAnnotation();
- if (mapKeyClass == null) {
- if (mapKeyClassAnnotation != null) {
- this.removeMapKeyClassAnnotation();
- }
- } else {
- if (mapKeyClassAnnotation == null) {
- mapKeyClassAnnotation = this.addMapKeyClassAnnotation();
- }
- mapKeyClassAnnotation.setValue(mapKeyClass);
- }
-
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected void setSpecifiedMapKeyClass_(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String getResourceMapKeyClass() {
- MapKeyClass2_0Annotation annotation = getMapKeyClassAnnotation();
- return annotation == null ? null : annotation.getValue();
- }
-
- public String getDefaultMapKeyClass() {
- return this.defaultMapKeyClass;
- }
-
- protected void setDefaultMapKeyClass(String mapKeyClass) {
- String old = this.defaultMapKeyClass;
- this.defaultMapKeyClass = mapKeyClass;
- this.firePropertyChanged(DEFAULT_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String buildDefaultMapKeyClass() {
- return this.getPersistentAttribute().getMultiReferenceMapKeyTypeName();
- }
-
- public String getFullyQualifiedMapKeyClass() {
- return this.fullyQualifiedMapKeyClass;
- }
-
- protected void setFullyQualifiedMapKeyClass(String mapKeyClass) {
- String old = this.fullyQualifiedMapKeyClass;
- this.fullyQualifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(FULLY_QUALIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String buildFullyQualifiedMapKeyClass() {
- return (this.specifiedMapKeyClass == null) ?
- this.defaultMapKeyClass :
- this.getMapKeyClassAnnotation().getFullyQualifiedClassName();
- }
-
- public char getMapKeyClassEnclosingTypeSeparator() {
- return '.';
- }
-
- protected MapKeyClass2_0Annotation getMapKeyClassAnnotation() {
- return (MapKeyClass2_0Annotation) this.getResourcePersistentAttribute().getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- protected MapKeyClass2_0Annotation addMapKeyClassAnnotation() {
- return (MapKeyClass2_0Annotation) this.getResourcePersistentAttribute().addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- protected void removeMapKeyClassAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- // ********** map key column - JPA 2.0 **********
-
- protected JavaColumn buildMapKeyColumn() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaMapKeyColumn(this, this.buildMapKeyColumnOwner()) :
- new NullJavaMapKeyColumn2_0(this);
- }
-
- public JavaColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- protected void initializeMapKeyColumn() {
- this.mapKeyColumn.initialize(getMapKeyColumnAnnotation());
- }
-
- protected void updateMapKeyColumn() {
- getMapKeyColumn().update(getMapKeyColumnAnnotation());
- }
-
- public MapKeyColumn2_0Annotation getMapKeyColumnAnnotation() {
- if (!isJpa2_0Compatible()) {
- return null;
- }
- return (MapKeyColumn2_0Annotation) this.getResourcePersistentAttribute().getNonNullAnnotation(MapKeyColumn2_0Annotation.ANNOTATION_NAME);
- }
-
- protected JavaBaseColumn.Owner buildMapKeyColumnOwner() {
- return new MapKeyColumnOwner();
- }
-
- public JavaAttributeOverrideContainer getMapKeyAttributeOverrideContainer() {
- return this.mapKeyAttributeOverrideContainer;
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getOrderable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mapKeyNameTouches(pos, astRoot)) {
- return this.javaCandidateMapKeyNames(filter);
- }
- result = this.getMapKeyColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getMapKeyAttributeOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- protected Iterator<String> javaCandidateMapKeyNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateMapKeyNames(filter));
- }
-
- protected Iterator<String> candidateMapKeyNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateMapKeyNames(), filter);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-
- // ********** metamodel **********
-
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String keyTypeName = ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldMapKeyTypeName();
- if (keyTypeName != null) {
- typeArgumentNames.add(keyTypeName);
- }
- }
-
- public String getMetamodelFieldMapKeyTypeName() {
- return MappingTools.getMetamodelFieldMapKeyTypeName(this);
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.orderable.validate(messages, reporter, astRoot);
- this.validateMapKey(messages, reporter, astRoot);
- }
-
- protected void validateMapKey(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (getMapKeyAnnotation() != null) {//If MapKey annotation specified, no other MapKey* annotations can be specified, don't validate them
- //TODO validate that the map key refers to an existing attribute
- return;
- }
- if (getKeyType() == Type.BASIC_TYPE) {
- this.getMapKeyColumn().validate(messages, reporter, astRoot);
- //validate map key converter
- }
- else if (getKeyType() == Type.ENTITY_TYPE) {
- //validate map key join columns
- }
- else if (getKeyType() == Type.EMBEDDABLE_TYPE) {
- getMapKeyAttributeOverrideContainer().validate(messages, reporter, astRoot);
- //validate map key association overrides - for eclipselink
- }
- }
-
-
- protected class MapKeyColumnOwner implements JavaBaseColumn.Owner {
- public TypeMapping getTypeMapping() {
- return AbstractJavaMultiRelationshipMapping.this.getTypeMapping();
- }
-
- protected JoiningStrategy getPredominantJoiningStrategy() {
- return getRelationshipReference().getPredominantJoiningStrategy();
- }
-
- public String getDefaultTableName() {
- return getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return AbstractJavaMultiRelationshipMapping.this.getName() + "_KEY"; //$NON-NLS-1$
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getPredominantJoiningStrategy().tableNameIsInvalid(tableName);
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaMultiRelationshipMapping.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID,
- new String[] {column.getTable(), column.getName(), getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- }
-
- protected abstract class OverrideContainerOwner implements JavaOverrideContainer.Owner {
- public TypeMapping getTypeMapping() {
- return AbstractJavaMultiRelationshipMapping.this.getTypeMapping();
- }
-
- protected JoiningStrategy getPredominantJoiningStrategy() {
- return getRelationshipReference().getPredominantJoiningStrategy();
- }
-
- public String getDefaultTableName() {
- return getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaMultiRelationshipMapping.this.getValidationTextRange(astRoot);
- }
- }
-
- protected class MapKeyAttributeOverrideContainerOwner
- extends OverrideContainerOwner
- implements JavaAttributeOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaMultiRelationshipMapping.this.getResolvedMapKeyEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- public String getPossiblePrefix() {
- return "key."; //$NON-NLS-1$
- }
-
- public String getWritePrefix() {
- return this.getPossiblePrefix();
- }
-
- //since only the key can be an embeddable on a 1-m or m-m, all overrides are relevant
- public boolean isRelevant(String overrideName) {
- return true;
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {column.getTable(), column.getName(), getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {overrideName, column.getTable(), column.getName(), getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
deleted file mode 100644
index b3e9604d08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaNamedColumn.java
+++ /dev/null
@@ -1,223 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaNamedColumn<T extends NamedColumnAnnotation>
- extends AbstractJavaJpaContextNode
- implements JavaNamedColumn
-{
-
- protected Owner owner;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String columnDefinition;
-
- protected T resourceColumn;
-
- protected AbstractJavaNamedColumn(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- // ******************* initialization from java resource model ********************
-
- protected void initialize(T column) {
- this.resourceColumn = column;
- this.specifiedName = column.getName();
- this.defaultName = this.buildDefaultName();
- this.columnDefinition = column.getColumnDefinition();
- }
-
- protected void update(T column) {
- this.resourceColumn = column;
- this.setSpecifiedName_(column.getName());
- this.setDefaultName(this.buildDefaultName());
- this.setColumnDefinition_(column.getColumnDefinition());
- }
-
- protected T getResourceColumn() {
- return this.resourceColumn;
- }
-
-
- //************** NamedColumn implementation *****************
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- getResourceColumn().setName(newSpecifiedName);
- firePropertyChanged(NamedColumn.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(NamedColumn.SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(NamedColumn.DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- /**
- * Return the default column name.
- */
- protected String buildDefaultName() {
- return this.getOwner().getDefaultColumnName();
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- getResourceColumn().setColumnDefinition(newColumnDefinition);
- firePropertyChanged(NamedColumn.COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setColumnDefinition_(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- firePropertyChanged(NamedColumn.COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceColumn().getNameTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceColumn().nameTouches(pos, astRoot);
- }
-
- public Column getDbColumn() {
- Table table = this.getDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getName());
- }
-
- public Table getDbTable() {
- return getOwner().getDbTable(this.getTable());
- }
-
- /**
- * Return the name of the column's table. This is overridden
- * in AbstractJavaBaseColumn where a table can be defined.
- */
- public String getTable() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- public boolean isResolved() {
- return this.getDbColumn() != null;
- }
-
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.getJavaCandidateNames(filter).iterator();
- }
- return null;
- }
-
- private Iterable<String> getJavaCandidateNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateNames(filter));
- }
-
- private Iterable<String> getCandidateNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateNames(), filter);
- }
-
- private Iterable<String> getCandidateNames() {
- Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers() : EmptyIterable.<String> instance();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ****************** validation ****************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getResourceColumn().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getOwner().getValidationTextRange(astRoot);
- }
-
- @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) {
- Table dbTable = this.getDbTable();
- if (dbTable != null && !this.isResolved()) {
- messages.add(this.getOwner().buildUnresolvedNameMessage(this, this.getNameTextRange(astRoot)));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java
deleted file mode 100644
index 44b80160c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyMapping.java
+++ /dev/null
@@ -1,86 +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.core.internal.context.java;
-
-import java.util.Vector;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaOrphanRemoval2_0;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-
-
-public abstract class AbstractJavaOneToManyMapping<T extends OneToMany2_0Annotation>
- extends AbstractJavaMultiRelationshipMapping<T>
- implements JavaOneToManyMapping2_0, JavaOrphanRemovalHolder2_0
-{
- protected final JavaOrphanRemovable2_0 orphanRemoval;
-
- protected AbstractJavaOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
-
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- // ********** initialize/update **********
-
- @Override
- protected void initialize() {
- super.initialize();
- this.orphanRemoval.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.orphanRemoval.update(this.getResourcePersistentAttribute());
- }
-
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.JOIN_COLUMN);
- names.add(JPA.JOIN_COLUMNS);
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** JavaOneToManyMapping implementation **********
-
- @Override
- public JavaOneToManyRelationshipReference2_0 getRelationshipReference() {
- return (JavaOneToManyRelationshipReference2_0) super.getRelationshipReference();
- }
-
- // ********** JavaOrphanRemovalHolder2_0 implementation **********
-
- protected JavaOrphanRemovable2_0 buildOrphanRemoval() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaOrphanRemoval(this) :
- new NullJavaOrphanRemoval2_0(this);
- }
-
- public JavaOrphanRemovable2_0 getOrphanRemoval() {
- return this.orphanRemoval;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyRelationshipReference.java
deleted file mode 100644
index a0f4029318..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,219 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaOneToManyRelationshipReference
- extends AbstractJavaRelationshipReference
- implements JavaOneToManyRelationshipReference2_0
-{
- protected final JavaMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected final JavaJoinTableJoiningStrategy joinTableJoiningStrategy;
-
- protected final JavaJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
-
- protected AbstractJavaOneToManyRelationshipReference(JavaOneToManyMapping parent) {
- super(parent);
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- }
-
- protected JavaMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericJavaMappedByJoiningStrategy(this);
- }
-
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericJavaJoinTableJoiningStrategy(this);
- }
-
- protected abstract JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy();
-
- @Override
- public JavaOneToManyMapping getRelationshipMapping() {
- return (JavaOneToManyMapping) getParent();
- }
-
- public OneToManyAnnotation getMappingAnnotation() {
- return getRelationshipMapping().getMappingAnnotation();
- }
-
- public boolean isRelationshipOwner() {
- return this.getMappedByJoiningStrategy().getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- @Override
- public boolean isTargetForeignKeyRelationship() {
- return getJoinColumnJoiningStrategy().isTargetForeignKeyRelationship();
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.mappedByJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinTableJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinColumnJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** mapped by **********************************************
-
- public JavaMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public final void setMappedByJoiningStrategy() {
- setMappedByJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void setMappedByJoiningStrategy_() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public final void unsetMappedByJoiningStrategy() {
- unsetMappedByJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetMappedByJoiningStrategy_() {
- this.mappedByJoiningStrategy.removeStrategy();
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return this.getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join table *********************************************
-
- public JavaJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- setJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void setJoinTableJoiningStrategy_() {
- // join table is default, so no need to add annotation
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return this.mappedByJoiningStrategy.getMappedByAttribute() == null
- && ! this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns();
- }
-
-
- // **************** join columns *******************************************
-
- public JavaJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return false;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy.initialize();
- this.joinColumnJoiningStrategy.initialize();
- this.joinTableJoiningStrategy.initialize();
- }
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
- this.joinColumnJoiningStrategy.update();
- this.joinTableJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mappedByJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinTableJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinColumnJoiningStrategy.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java
deleted file mode 100644
index 71e4a42087..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneMapping.java
+++ /dev/null
@@ -1,95 +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.core.internal.context.java;
-
-import java.util.Vector;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaOrphanRemoval2_0;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-
-public abstract class AbstractJavaOneToOneMapping
- extends AbstractJavaSingleRelationshipMapping<OneToOne2_0Annotation>
- implements JavaOneToOneMapping2_0, JavaOrphanRemovalHolder2_0
-{
- protected final JavaOrphanRemovable2_0 orphanRemoval;
-
- // ********** constructor **********
- protected AbstractJavaOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- // ********** initialize/update **********
-
- @Override
- protected void initialize() {
- super.initialize();
- this.orphanRemoval.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.orphanRemoval.update(this.getResourcePersistentAttribute());
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.PRIMARY_KEY_JOIN_COLUMN);
- names.add(JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected Boolean getResourceOptional() {
- return this.mappingAnnotation.getOptional();
- }
-
- @Override
- protected void setResourceOptional(Boolean newOptional) {
- this.mappingAnnotation.setOptional(newOptional);
- }
-
- // ********** JavaOneToOneMapping implementation **********
-
- @Override
- public JavaOneToOneRelationshipReference2_0 getRelationshipReference() {
- return (JavaOneToOneRelationshipReference2_0) super.getRelationshipReference();
- }
-
- // ********** JavaOrphanRemovalHolder2_0 implementation **********
-
- protected JavaOrphanRemovable2_0 buildOrphanRemoval() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaOrphanRemoval(this) :
- new NullJavaOrphanRemoval2_0(this);
- }
-
- public JavaOrphanRemovable2_0 getOrphanRemoval() {
- return this.orphanRemoval;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneRelationshipReference.java
deleted file mode 100644
index 971f184022..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOneToOneRelationshipReference.java
+++ /dev/null
@@ -1,255 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaOneToOneRelationshipReference
- extends AbstractJavaRelationshipReference
- implements JavaOneToOneRelationshipReference2_0
-{
- protected final JavaMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected final JavaJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
- protected final JavaPrimaryKeyJoinColumnJoiningStrategy primaryKeyJoinColumnJoiningStrategy;
-
- protected final JavaJoinTableJoiningStrategy joinTableJoiningStrategy;
-
- protected AbstractJavaOneToOneRelationshipReference(JavaOneToOneMapping parent) {
- super(parent);
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- this.primaryKeyJoinColumnJoiningStrategy = buildPrimaryKeyJoinColumnJoiningStrategy();
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
-
- protected JavaMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericJavaMappedByJoiningStrategy(this);
- }
-
- protected JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericJavaJoinColumnJoiningStrategy(this);
- }
-
- protected JavaPrimaryKeyJoinColumnJoiningStrategy buildPrimaryKeyJoinColumnJoiningStrategy() {
- return new GenericJavaPrimaryKeyJoinColumnJoiningStrategy(this);
- }
-
- protected abstract JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy();
-
- @Override
- public JavaOneToOneMapping getRelationshipMapping() {
- return (JavaOneToOneMapping) getParent();
- }
-
- public OwnableRelationshipMappingAnnotation getMappingAnnotation() {
- return getRelationshipMapping().getMappingAnnotation();
- }
-
- public boolean isRelationshipOwner() {
- return this.mappedByJoiningStrategy.getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.mappedByJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinColumnJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.primaryKeyJoinColumnJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinTableJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** mapped by **********************************************
-
- public JavaMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public void setMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join columns *******************************************
-
- public JavaJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- // join columns are default, so no need to add annotations
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return this.getMappedByJoiningStrategy().getMappedByAttribute() == null
- && this.getPrimaryKeyJoinColumnJoiningStrategy().primaryKeyJoinColumnsSize() == 0
- && this.getJoinTableJoiningStrategy().getJoinTable() == null;
- }
-
-
- // **************** primary key join columns *******************************
-
- public JavaPrimaryKeyJoinColumnJoiningStrategy getPrimaryKeyJoinColumnJoiningStrategy() {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
-
- public boolean usesPrimaryKeyJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.primaryKeyJoinColumnJoiningStrategy;
- }
-
- public void setPrimaryKeyJoinColumnJoiningStrategy() {
- this.primaryKeyJoinColumnJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetPrimaryKeyJoinColumnJoiningStrategy() {
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultPrimaryKeyJoinColumn() {
- return false;
- }
-
-
- // **************** join table *********************************************
-
- public JavaJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return false;
- }
-
- // **************** resource => context ************************************
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy.initialize();
- this.primaryKeyJoinColumnJoiningStrategy.initialize();
- this.joinTableJoiningStrategy.initialize();
-
- // initialize join columns last, as the existence of a default join
- // column is dependent on the other mechanisms (mappedBy, join table)
- // not being specified
- this.joinColumnJoiningStrategy.initialize();
- }
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
- this.primaryKeyJoinColumnJoiningStrategy.update();
- this.joinTableJoiningStrategy.update();
-
- // update join columns last, as the existence of a default join
- // column is dependent on the other mechanisms (mappedBy, join table)
- // not being specified
- this.joinColumnJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mappedByJoiningStrategy.validate(messages, reporter, astRoot);
- this.primaryKeyJoinColumnJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinColumnJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinTableJoiningStrategy.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
deleted file mode 100644
index edc6319823..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
+++ /dev/null
@@ -1,153 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaOverride;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-
-public abstract class AbstractJavaOverride
- extends AbstractJavaJpaContextNode
- implements JavaOverride
-{
-
- protected String name;
-
- protected final Owner owner;
-
- protected OverrideAnnotation overrideAnnotation;
-
- public AbstractJavaOverride(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- protected void initialize(OverrideAnnotation overrideAnnotation) {
- this.overrideAnnotation = overrideAnnotation;
- this.initializeName();
- }
-
- protected void update(OverrideAnnotation overrideResource) {
- this.overrideAnnotation = overrideResource;
- this.updateName();
- }
-
- public OverrideAnnotation getOverrideAnnotation() {
- return this.overrideAnnotation;
- }
-
- // ********************* name ****************
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String prefix = getOwner().getPossiblePrefix();
- String unprefixedName = newName;
- if (newName != null && prefix != null && newName.startsWith(prefix)) {
- unprefixedName = newName.substring(newName.indexOf('.') + 1);
- }
- String oldName = this.name;
- this.name = unprefixedName; //set the name without the prefix in the context model
- this.overrideAnnotation.setName(newName); // set the name with the prefix in the resource model
- firePropertyChanged(NAME_PROPERTY, oldName, unprefixedName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void initializeName() {
- String name = this.getResourceName();
- String prefix = getOwner().getPossiblePrefix();
- if (name != null && prefix != null && name.startsWith(prefix)) {
- name = name.substring(name.indexOf('.') + 1);
- }
- this.name = name;
- }
-
- protected void updateName() {
- String name = this.getResourceName();
- String prefix = getOwner().getPossiblePrefix();
- if (name != null && prefix != null && name.startsWith(prefix)) {
- name = name.substring(name.indexOf('.') + 1);
- }
- this.setName_(name);
- }
-
- protected String getResourceName() {
- return this.overrideAnnotation.getName();
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- public BaseOverride setVirtual(boolean virtual) {
- return getOwner().setVirtual(virtual, this);
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
- protected abstract Iterator<String> candidateNames();
-
- private Iterator<String> candidateNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateNames(), filter);
- }
-
- private Iterator<String> javaCandidateNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateNames(filter));
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.javaCandidateNames(filter);
- }
- return null;
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.overrideAnnotation.nameTouches(pos, astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.overrideAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentAttribute.java
deleted file mode 100644
index a4dbea281d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentAttribute.java
+++ /dev/null
@@ -1,716 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Modifier;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * common state/behavior between Generic and EclipseLink persistent attributes
- */
-public abstract class AbstractJavaPersistentAttribute
- extends AbstractJavaJpaContextNode
- implements JavaPersistentAttribute2_0
-{
- protected String name;
-
- protected JavaAttributeMapping defaultMapping;
-
- protected JavaAttributeMapping specifiedMapping;
-
- protected AccessType defaultAccess;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- protected AbstractJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute resourcePersistentAttribute) {
- super(parent);
- this.resourcePersistentAttribute = resourcePersistentAttribute;
- this.name = buildName();
- this.defaultMapping = buildDefaultMapping();
- this.specifiedMapping = buildSpecifiedMapping();
- this.defaultAccess = buildDefaultAccess();
- }
-
- public void update() {
- this.setName(this.buildName());
- this.updateDefaultMapping();
- this.updateSpecifiedMapping();
- this.setDefaultAccess(this.buildDefaultAccess());
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- getMapping().postUpdate();
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public TextRange getSelectionTextRange() {
- return this.getSelectionTextRange(this.buildASTRoot());
- }
-
- protected TextRange getSelectionTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentAttribute.getNameTextRange(astRoot);
- }
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePersistentAttribute.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- public void dispose() {
- //nothing to dispose
- }
-
-
- // ********** AccessHolder implementation **********
-
- public AccessType getAccess() {
- AccessType access = this.getSpecifiedAccess();
- return (access != null) ? access : this.getDefaultAccess();
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType defaultAccess) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = defaultAccess;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, defaultAccess);
- }
-
- protected AccessType buildDefaultAccess() {
- return this.resourcePersistentAttribute.isField() ? AccessType.FIELD : AccessType.PROPERTY;
- }
-
-
- // ********** [Java]PersistentAttribute implementation **********
-
- public JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.resourcePersistentAttribute;
- }
-
- public PersistentType getOwningPersistentType() {
- return this.getParent();
- }
-
- public TypeMapping getOwningTypeMapping() {
- return this.getOwningPersistentType().getMapping();
- }
-
- public String getPrimaryKeyColumnName() {
- return this.getMapping().getPrimaryKeyColumnName();
- }
-
- public String getTypeName() {
- return this.resourcePersistentAttribute.getTypeName();
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- public boolean contains(int offset, CompilationUnit astRoot) {
- TextRange fullTextRange = this.getFullTextRange(astRoot);
- // 'fullTextRange' will be null if the attribute no longer exists in the java;
- // the context model can be out of synch with the resource model
- // when a selection event occurs before the context model has a
- // chance to synch with the resource model via the update thread
- return (fullTextRange == null) ? false : fullTextRange.includes(offset);
- }
-
- protected TextRange getFullTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentAttribute.getTextRange(astRoot);
- }
-
- public Embeddable getEmbeddable() {
- return (getTypeName() == null) ?
- null : this.getPersistenceUnit().getEmbeddable(getTypeName());
- }
-
- public boolean isField() {
- return this.resourcePersistentAttribute.isField();
- }
-
- public boolean isProperty() {
- return this.resourcePersistentAttribute.isProperty();
- }
-
- public boolean isPublic() {
- return Modifier.isPublic(this.resourcePersistentAttribute.getModifiers());
- }
-
- public boolean isFinal() {
- return Modifier.isFinal(this.resourcePersistentAttribute.getModifiers());
- }
-
- // ***** Basic defaults
- /**
- * From the JPA spec, when the basic mapping applies:
- * If the type of the attribute (field or property) is one of the following
- * it must be mapped as @Basic:
- * byte[]
- * java.lang.Byte[]
- * char[]
- * java.lang.Character[]
- * primitive types (except 'void')
- * primitive wrappers (except 'java.lang.Void')
- * java.lang.String
- * java.math.BigInteger
- * java.math.BigDecimal
- * java.util.Date
- * java.util.Calendar
- * java.sql.Date
- * java.sql.Time
- * java.sql.Timestamp
- * enums
- * any other type that implements java.io.Serializable
- */
- public boolean typeIsBasic() {
- // 'typeName' may include array brackets but not generic type arguments
- String typeName = getTypeName();
- if (typeName == null) {
- return false;
- }
-
- int arrayDepth = ReflectionTools.getArrayDepthForTypeDeclaration(typeName);
- if (arrayDepth > 1) {
- return false; // multi-dimensional arrays are not supported
- }
-
- if (arrayDepth == 1) {
- String elementTypeName = ReflectionTools.getElementTypeNameForTypeDeclaration(typeName, 1);
- return this.elementTypeIsValidForBasicArray(elementTypeName);
- }
-
- // arrayDepth == 0
- if (ClassName.isVariablePrimitive(typeName)) {
- return true; // any primitive but 'void'
- }
- if (ClassName.isVariablePrimitiveWrapper(typeName)) {
- return true; // any primitive wrapper but 'java.lang.Void'
- }
- if (this.typeIsOtherValidBasicType(typeName)) {
- return true;
- }
- if (this.resourcePersistentAttribute.typeIsEnum()) {
- return true;
- }
- if (this.resourcePersistentAttribute.typeIsSubTypeOf(SERIALIZABLE_TYPE_NAME)) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the specified type is a valid element type for
- * a one-dimensional array that can default to a Basic mapping:
- * byte
- * char
- * java.lang.Byte
- * java.lang.Character
- */
- protected boolean elementTypeIsValidForBasicArray(String elementTypeName) {
- return ArrayTools.contains(VALID_BASIC_ARRAY_ELEMENT_TYPE_NAMES, elementTypeName);
- }
-
- protected 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.
- */
- protected boolean typeIsOtherValidBasicType(String typeName) {
- return ArrayTools.contains(OTHER_VALID_BASIC_TYPE_NAMES, typeName);
- }
-
- protected 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(),
- };
-
- protected static final String SERIALIZABLE_TYPE_NAME = java.io.Serializable.class.getName();
-
- // ***** reference entities
- public String getSingleReferenceTargetTypeName() {
- // 'typeName' may include array brackets ("[]")
- // but not generic type arguments (e.g. "<java.lang.String>")
- String typeName = getTypeName();
- if (typeName == null) {
- return null;
- }
- if (ReflectionTools.getArrayDepthForTypeDeclaration(typeName) != 0) {
- return null; // arrays cannot be entities
- }
- if (this.typeIsContainer(typeName)) {
- return null; // "containers" cannot be entities
- }
- return typeName;
- }
-
- public String getMultiReferenceTargetTypeName() {
- return this.getJpaContainer().getMultiReferenceTargetTypeName(this.resourcePersistentAttribute);
- }
-
- public String getMultiReferenceMapKeyTypeName() {
- return this.getJpaContainer().getMultiReferenceMapKeyTypeName(this.resourcePersistentAttribute);
- }
-
- /**
- * return whether the specified type is one of the container
- * types allowed by the JPA spec
- */
- protected boolean typeIsContainer(String typeName) {
- return this.getJpaContainer(typeName).isContainer();
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- protected void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- protected String buildName() {
- return this.resourcePersistentAttribute.getName();
- }
-
- // ***** mapping
- public JavaAttributeMapping getMapping() {
- return (this.specifiedMapping != null) ? this.specifiedMapping : this.defaultMapping;
- }
-
- public String getMappingKey() {
- return this.getMapping().getKey();
- }
-
-
- // ***** default mapping
- public JavaAttributeMapping getDefaultMapping() {
- return this.defaultMapping;
- }
-
- /**
- * clients do not set the "default" mapping
- */
- protected void setDefaultMapping(JavaAttributeMapping defaultMapping) {
- JavaAttributeMapping old = this.defaultMapping;
- this.defaultMapping = defaultMapping;
- this.firePropertyChanged(DEFAULT_MAPPING_PROPERTY, old, defaultMapping);
- }
-
- protected JavaAttributeMapping buildDefaultMapping() {
- JavaAttributeMappingDefinition mappingDefinition =
- getJpaPlatform().getDefaultJavaAttributeMappingDefinition(this);
- return buildDefaultMapping(mappingDefinition);
- }
-
- protected JavaAttributeMapping buildDefaultMapping(JavaAttributeMappingDefinition mappingDefinition) {
- Annotation annotation = this.resourcePersistentAttribute.
- buildNullAnnotation(mappingDefinition.getAnnotationName());
- JavaAttributeMapping mapping = mappingDefinition.buildMapping(this, getJpaFactory());
- mapping.initialize(annotation);
- return mapping;
- }
-
- /**
- * return null if there is no "default" mapping for the attribute
- */
- public String getDefaultMappingKey() {
- return this.defaultMapping.getKey();
- }
-
- /**
- * the mapping might be "default", but it still might be a "null" mapping...
- */
- public boolean mappingIsDefault(JavaAttributeMapping mapping) {
- return this.defaultMapping == mapping;
- }
-
- protected void updateDefaultMapping() {
- // There will always be a mapping definition, even if it is a "null" mapping definition ...
- JavaAttributeMappingDefinition mappingDefinition =
- getJpaPlatform().getDefaultJavaAttributeMappingDefinition(this);
- String mappingKey = mappingDefinition.getKey();
- if (this.valuesAreEqual(this.defaultMapping.getKey(), mappingKey)) {
- this.defaultMapping.update(this.resourcePersistentAttribute.
- buildNullAnnotation(mappingDefinition.getAnnotationName()));
- }
- else {
- setDefaultMapping(buildDefaultMapping(mappingDefinition));
- }
- }
-
- // ***** specified mapping
- public JavaAttributeMapping getSpecifiedMapping() {
- return this.specifiedMapping;
- }
-
- /**
- * clients do not set the "specified" mapping;
- * @see #setSpecifiedMappingKey(String)
- */
- protected void setSpecifiedMapping(JavaAttributeMapping specifiedMapping) {
- JavaAttributeMapping old = this.specifiedMapping;
- this.specifiedMapping = specifiedMapping;
- this.firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, old, specifiedMapping);
- }
-
- protected JavaAttributeMapping buildSpecifiedMapping() {
- JavaAttributeMappingDefinition mappingDefinition =
- getJpaPlatform().getSpecifiedJavaAttributeMappingDefinition(this);
- return buildSpecifiedMapping(mappingDefinition);
- }
-
- protected JavaAttributeMapping buildSpecifiedMapping(JavaAttributeMappingDefinition mappingDefinition) {
- Annotation annotation = this.resourcePersistentAttribute.
- getAnnotation(mappingDefinition.getAnnotationName());
- JavaAttributeMapping mapping = mappingDefinition.buildMapping(this, getJpaFactory());
- // specified mappings may be null
- if (mapping != null) {
- mapping.initialize(annotation);
- }
- return mapping;
- }
-
- /**
- * return the key of the currently specified mapping or null
- * if there is no specified mapping for the attribute
- */
- protected String getSpecifiedMappingKey() {
- return (this.specifiedMapping == null) ? null : this.specifiedMapping.getKey();
- }
-
- // TODO support morphing mappings, i.e. copying common settings over
- // to the new mapping; this can't be done in the same was as XmlAttributeMapping
- // since we don't know all the possible mapping types
- public void setSpecifiedMappingKey(String key) {
- if (Tools.valuesAreEqual(key, this.getSpecifiedMappingKey())) {
- return;
- }
- JavaAttributeMapping old = this.specifiedMapping;
- JavaAttributeMapping newMapping = this.buildMappingFromMappingKey(key);
-
- this.specifiedMapping = newMapping;
-
- String newAnnotation = (newMapping == null) ? null : newMapping.getAnnotationName();
- JavaAttributeMapping mapping = (newMapping == null) ? this.defaultMapping : newMapping;
- this.resourcePersistentAttribute.setPrimaryAnnotation(newAnnotation, mapping.getSupportingAnnotationNames());
- this.firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, old, newMapping);
- }
- protected static final String[] EMPTY_STRING_ARRAY = new String[0];
-
- /**
- * return the annotation name of the currently specified mapping or null
- * if there is no specified mapping for the attribute
- */
- protected String getSpecifiedMappingAnnotationName() {
- return (this.specifiedMapping == null) ? null : this.specifiedMapping.getAnnotationName();
- }
-
- protected JavaAttributeMapping buildMappingFromMappingKey(String key) {
- JavaAttributeMappingDefinition mappingDefinition = getJpaPlatform().getSpecifiedJavaAttributeMappingDefinition(key);
- JavaAttributeMapping mapping = mappingDefinition.buildMapping(this, getJpaFactory());
- //no mapping.initialize(JavaResourcePersistentAttribute) call here
- //we do not yet have a mapping annotation so we can't call initialize
- return mapping;
- }
-
- protected Iterable<String> getSupportingAnnotationNames() {
- JavaAttributeMapping mapping = this.getMapping();
- return (mapping != null) ? mapping.getSupportingAnnotationNames() : EmptyIterable.<String>instance();
- }
-
- protected void updateSpecifiedMapping() {
- // There will always be a mapping definition, even if it is a "null" mapping provider ...
- JavaAttributeMappingDefinition mappingDefinition =
- getJpaPlatform().getSpecifiedJavaAttributeMappingDefinition(this);
- String mappingKey = mappingDefinition.getKey();
- if (this.specifiedMapping != null
- && this.specifiedMapping.getKey().equals(mappingKey)) {
- this.specifiedMapping.update(this.resourcePersistentAttribute.
- getAnnotation(mappingDefinition.getAnnotationName()));
- }
- else {
- setSpecifiedMapping(buildSpecifiedMapping(mappingDefinition));
- }
- }
-
-
- // ********** misc overrides **********
-
- @Override
- public PersistentType getParent() {
- return (PersistentType) super.getParent();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getSelectionTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- this.validateModifiers(messages, astRoot);
-
- if (this.specifiedMapping != null) {
- this.specifiedMapping.validate(messages, reporter, astRoot);
- }
- else if (this.defaultMapping != null) {
- this.defaultMapping.validate(messages, reporter, astRoot);
- }
- }
-
-
- protected void validateModifiers(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getMappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- return;
- }
-
- if (this.isField()) {
- if (this.isFinal()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD, astRoot));
- }
- if (this.isPublic()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD, astRoot));
- }
- }
- }
-
- protected IMessage buildAttributeMessage(String msgID, CompilationUnit astRoot) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {getName()},
- this,
- this.getValidationTextRange(astRoot)
- );
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return this.getMapping().javaCompletionProposals(pos, filter, astRoot);
- }
-
- // ********** metamodel **********
-
- public String getMetamodelContainerFieldTypeName() {
- return this.getJpaContainer().getMetamodelContainerFieldTypeName();
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName() {
- return this.getJpaContainer().getMetamodelContainerFieldMapKeyTypeName((CollectionMapping) this.getMapping());
- }
-
- public String getMetamodelTypeName() {
- String typeName = getTypeName();
- if (typeName == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- if (ClassName.isPrimitive(typeName)) {
- return ClassName.getWrapperClassName(typeName); // ???
- }
- return typeName;
- }
-
-
- // ********** JPA containers **********
-
- public JpaContainer getJpaContainer() {
- // 'typeName' may include array brackets ("[]")
- // but not generic type arguments (e.g. "<java.lang.String>")
- return getJpaContainer(this.resourcePersistentAttribute.getTypeName());
- }
- /**
- * Return the JPA container corresponding to the specified type;
- * return a "null" JPA container if the specified type is not one of the
- * container types allowed by the JPA spec.
- */
- protected JpaContainer getJpaContainer(String typeName) {
- for (JpaContainer jpaContainer : JPA_CONTAINERS) {
- if (jpaContainer.getTypeName().equals(typeName)) {
- return jpaContainer;
- }
- }
- return JpaContainer.Null.instance();
- }
-
- protected static final Iterable<JpaContainer> JPA_CONTAINERS =
- new ArrayIterable<JpaContainer>(new JpaContainer[] {
- new CollectionJpaContainer(java.util.Collection.class, JPA2_0.COLLECTION_ATTRIBUTE),
- new CollectionJpaContainer(java.util.Set.class, JPA2_0.SET_ATTRIBUTE),
- new CollectionJpaContainer(java.util.List.class, JPA2_0.LIST_ATTRIBUTE),
- new MapJpaContainer(java.util.Map.class, JPA2_0.MAP_ATTRIBUTE)
- });
-
-
- /**
- * Abstract JPA container
- */
- protected abstract static class AbstractJpaContainer implements JpaContainer {
- protected final String typeName;
- protected final String metamodelContainerFieldTypeName;
-
- protected AbstractJpaContainer(Class<?> containerClass, String metamodelContainerFieldTypeName) {
- this(containerClass.getName(), metamodelContainerFieldTypeName);
- }
-
- protected AbstractJpaContainer(String typeName, String metamodelContainerFieldTypeName) {
- super();
- if ((typeName == null) || (metamodelContainerFieldTypeName == null)) {
- throw new NullPointerException();
- }
- this.typeName = typeName;
- this.metamodelContainerFieldTypeName = metamodelContainerFieldTypeName;
- }
-
- public String getTypeName() {
- return this.typeName;
- }
-
- public boolean isContainer() {
- return true;
- }
-
- public String getMetamodelContainerFieldTypeName() {
- return this.metamodelContainerFieldTypeName;
- }
-
- }
-
- /**
- * Collection JPA container
- */
- protected static class CollectionJpaContainer extends AbstractJpaContainer {
- protected CollectionJpaContainer(Class<?> collectionClass, String staticMetamodelTypeDeclarationTypeName) {
- super(collectionClass, staticMetamodelTypeDeclarationTypeName);
- }
-
- public String getMultiReferenceTargetTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return (resourcePersistentAttribute.typeTypeArgumentNamesSize() == 1) ?
- resourcePersistentAttribute.getTypeTypeArgumentName(0) :
- null;
- }
-
- public String getMultiReferenceMapKeyTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return null;
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping) {
- return null;
- }
-
- public boolean isMap() {
- return false;
- }
- }
-
- /**
- * Map JPA container
- */
- protected static class MapJpaContainer extends AbstractJpaContainer {
- protected MapJpaContainer(Class<?> mapClass, String staticMetamodelTypeDeclarationTypeName) {
- super(mapClass, staticMetamodelTypeDeclarationTypeName);
- }
-
- public String getMultiReferenceTargetTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return (resourcePersistentAttribute.typeTypeArgumentNamesSize() == 2) ?
- resourcePersistentAttribute.getTypeTypeArgumentName(1) :
- null;
- }
-
- public String getMultiReferenceMapKeyTypeName(JavaResourcePersistentAttribute resourcePersistentAttribute) {
- return (resourcePersistentAttribute.typeTypeArgumentNamesSize() == 2) ?
- resourcePersistentAttribute.getTypeTypeArgumentName(0) :
- null;
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping) {
- return mapping.getMetamodelFieldMapKeyTypeName();
- }
-
- public boolean isMap() {
- return true;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentType.java
deleted file mode 100644
index c3be5d891e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaPersistentType.java
+++ /dev/null
@@ -1,661 +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.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaStructureNodes;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-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;
-
-/**
- * Java persistent type:<ul>
- * <li>name
- * <li>access
- * <li>mapping
- * <li>attributes
- * <li>super persistent type
- * </ul>
- */
-public abstract class AbstractJavaPersistentType
- extends AbstractJavaJpaContextNode
- implements JavaPersistentType
-{
- protected JavaResourcePersistentType resourcePersistentType;
-
- protected String name;
-
- protected AccessType defaultAccess;
-
- protected AccessType specifiedAccess;
-
- protected JavaTypeMapping mapping;
-
- protected final Vector<JavaPersistentAttribute> attributes = new Vector<JavaPersistentAttribute>();
-
- protected PersistentType superPersistentType;
-
-
- protected AbstractJavaPersistentType(PersistentType.Owner parent, JavaResourcePersistentType jrpt) {
- super(parent);
- this.initialize(jrpt);
- }
-
- protected void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.superPersistentType = this.buildSuperPersistentType();
- this.name = this.buildName();
- this.defaultAccess = buildDefaultAccess();
- this.specifiedAccess = buildSpecifiedAccess();
- this.mapping = buildMapping();
- this.initializeAttributes();
- }
-
-
- // ********** update **********
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.update();
- }
-
- public void update() {
- JpaFile jpaFile = this.getJpaFile();
- if (jpaFile != null) {
- // the JPA file can be null if the resource type is "external"
- jpaFile.addRootStructureNode(this.resourcePersistentType.getQualifiedName(), this);
- }
- this.setSuperPersistentType(this.buildSuperPersistentType());
- this.setName(this.buildName());
- this.updateAccess();
- this.updateMapping();
- this.updateAttributes();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- this.mapping.postUpdate();
- for (PersistentAttribute attribute : this.getAttributes()) {
- attribute.postUpdate();
- }
- }
-
-
- // ********** AbstractJpaNode overrides **********
-
- @Override
- public PersistentType.Owner getParent() {
- return (PersistentType.Owner) super.getParent();
- }
-
- @Override
- public IResource getResource() {
- return this.resourcePersistentType.getFile();
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return JavaStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- // it would be nice if the we passed in an astRoot here, but then we
- // would need to pass it to the XML structure nodes too...
- public JpaStructureNode getStructureNode(int offset) {
- CompilationUnit astRoot = this.buildASTRoot();
-
- if (this.contains(offset, astRoot)) {
- for (JavaPersistentAttribute persistentAttribute : this.getAttributes()) {
- if (persistentAttribute.contains(offset, astRoot)) {
- return persistentAttribute;
- }
- }
- return this;
- }
- return null;
- }
-
- protected boolean contains(int offset, CompilationUnit astRoot) {
- TextRange fullTextRange = this.getFullTextRange(astRoot);
- // 'fullTextRange' will be null if the type no longer exists in the java;
- // the context model can be out of synch with the resource model
- // when a selection event occurs before the context model has a
- // chance to synch with the resource model via the update thread
- return (fullTextRange == null) ? false : fullTextRange.includes(offset);
- }
-
- protected TextRange getFullTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.getTextRange(astRoot);
- }
-
- public TextRange getSelectionTextRange() {
- return this.getSelectionTextRange(this.buildASTRoot());
- }
-
- protected TextRange getSelectionTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.getNameTextRange(astRoot);
- }
-
- public void dispose() {
- JpaFile jpaFile = this.getJpaFile();
- if (jpaFile != null) {
- // the JPA file can be null if the .java file was deleted
- // or the resource type is "external"
- jpaFile.removeRootStructureNode(this.resourcePersistentType.getQualifiedName());
- }
- }
-
-
- // ********** PersistentType implementation **********
-
- public JavaResourcePersistentType getResourcePersistentType() {
- return this.resourcePersistentType;
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public String getShortName(){
- return this.name.substring(this.name.lastIndexOf('.') + 1);
- }
-
- protected void setName(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- protected String buildName() {
- return this.resourcePersistentType.getQualifiedName();
- }
-
-
- // ********** access **********
-
- public AccessType getAccess() {
- return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType defaultAccess) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = defaultAccess;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, defaultAccess);
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- /**
- * Check the access "specified" by the Java resource model:<ul>
- * <li>Check Java annotations first
- * <li>If <code>null</code>, check XML mapping specified access
- * <li>If still <code>null</code>, check {@link #superPersistentType} access
- * <li>If still <code>null</code>, check <code>entity-mappings</code>
- * specified access setting if the corresponding <code>persistent-type</code>
- * is listed in a mapping (<code>orm.xml</code>) file
- * <li>If still <code>null</code>, check the <code>persistence-unit</code>
- * default Access
- * <li>Default to <code>FIELD</code> if all else fails.
- * </ul>
- */
- protected AccessType buildDefaultAccess() {
- AccessType accessType = AccessType.fromJavaResourceModel(this.resourcePersistentType.getAccess());
- if (accessType != null) {
- return accessType;
- }
- accessType = this.getOwnerOverrideAccess();
- if (accessType != null) {
- return accessType;
- }
-
- if (this.superPersistentType != null) {
- accessType = this.superPersistentType.getAccess();
- if (accessType != null) {
- return accessType;
- }
- }
-
- accessType = this.getOwnerDefaultAccess();
- if (accessType != null) {
- return accessType;
- }
-
- // last ditch attempt to allow the user to annotate *something*
- return AccessType.FIELD;
- }
-
- protected void updateAccess() {
- this.setDefaultAccess(this.buildDefaultAccess());
- }
-
- /**
- * Build an access type based on annotations from the resource model.
- * (This is JPA platform-dependent.)
- */
- protected abstract AccessType buildSpecifiedAccess();
-
-
- // ********** mapping **********
-
- public JavaTypeMapping getMapping() {
- return this.mapping;
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- public void setMappingKey(String key) {
- if (this.valuesAreEqual(key, this.mapping.getKey())) {
- return;
- }
- JavaTypeMapping oldMapping = this.mapping;
- JavaTypeMapping newMapping = this.buildMappingFromMappingKey(key);
-
- this.mapping = newMapping;
- this.resourcePersistentType.setPrimaryAnnotation(newMapping.getAnnotationName(), newMapping.getSupportingAnnotationNames());
- this.firePropertyChanged(MAPPING_PROPERTY, oldMapping, newMapping);
- }
-
- protected void setMapping(JavaTypeMapping mapping) {
- JavaTypeMapping old = this.mapping;
- this.mapping = mapping;
- this.firePropertyChanged(MAPPING_PROPERTY, old, mapping);
- }
-
- protected JavaTypeMapping buildMapping() {
- JavaTypeMappingDefinition mappingDefinition = this.getJpaPlatform().getJavaTypeMappingDefinition(this);
- return this.buildMapping(mappingDefinition);
- }
-
- protected JavaTypeMapping buildMapping(JavaTypeMappingDefinition mappingDefinition) {
- JavaTypeMapping jtMapping = mappingDefinition.buildMapping(this, this.getJpaFactory());
- // mapping may be null
- if (jtMapping != null) {
- jtMapping.initialize(this.resourcePersistentType);
- }
- return jtMapping;
- }
-
- protected JavaTypeMapping buildMappingFromMappingKey(String key) {
- JavaTypeMappingDefinition mappingDefinition = this.getJpaPlatform().getJavaTypeMappingDefinition(key);
- JavaTypeMapping jtMapping = mappingDefinition.buildMapping(this, this.getJpaFactory());
- //no mapping.initialize(JavaResourcePersistentType) call here
- //we do not yet have a mapping annotation so we can't call initialize
- return jtMapping;
- }
-
- protected void updateMapping() {
- // There will always be a mapping definition, even if it is a "null" mapping definition ...
- JavaTypeMappingDefinition mappingDefinition = this.getJpaPlatform().getJavaTypeMappingDefinition(this);
- if ((this.mapping != null) && this.valuesAreEqual(this.mapping.getKey(), mappingDefinition.getKey())) {
- this.mapping.update(this.resourcePersistentType);
- } else {
- this.setMapping(this.buildMapping(mappingDefinition));
- }
- }
-
-
- // ********** attributes **********
-
- public ListIterator<JavaPersistentAttribute> attributes() {
- return new CloneListIterator<JavaPersistentAttribute>(this.attributes);
- }
-
- protected Iterable<JavaPersistentAttribute> getAttributes() {
- return new LiveCloneIterable<JavaPersistentAttribute>(this.attributes);
- }
-
- public int attributesSize() {
- return this.attributes.size();
- }
-
- private void addAttribute(int index, JavaPersistentAttribute attribute) {
- this.addItemToList(index, attribute, this.attributes, ATTRIBUTES_LIST);
- }
-
- private void removeAttribute(JavaPersistentAttribute attribute) {
- this.removeItemFromList(attribute, this.attributes, ATTRIBUTES_LIST);
- }
-
- private void moveAttribute(int index, JavaPersistentAttribute attribute) {
- this.moveItemInList(index, this.attributes.indexOf(attribute), this.attributes, ATTRIBUTES_LIST);
- }
-
- public Iterator<String> attributeNames() {
- return this.attributeNames(this.attributes());
- }
-
- protected Iterator<String> attributeNames(Iterator<? extends PersistentAttribute> attrs) {
- return new TransformationIterator<PersistentAttribute, String>(attrs) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- public JavaPersistentAttribute getAttributeNamed(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = this.attributesNamed(attributeName);
- return stream.hasNext() ? stream.next() : null;
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<JavaPersistentAttribute> stream = this.attributesNamed(attributeName);
- if (stream.hasNext()) {
- JavaPersistentAttribute attribute = stream.next();
- return stream.hasNext() ? null /*more than one*/: attribute;
- }
- return (this.superPersistentType == null) ? null : this.superPersistentType.resolveAttribute(attributeName);
- }
-
- protected Iterator<JavaPersistentAttribute> attributesNamed(final String attributeName) {
- return new FilteringIterator<JavaPersistentAttribute>(this.attributes()) {
- @Override
- protected boolean accept(JavaPersistentAttribute o) {
- return attributeName.equals(o.getName());
- }
- };
- }
-
- public Iterator<PersistentAttribute> allAttributes() {
- return new CompositeIterator<PersistentAttribute>(
- new TransformationIterator<PersistentType, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(PersistentType pt) {
- return pt.attributes();
- }
- }
- );
- }
-
- public Iterator<String> allAttributeNames() {
- return this.attributeNames(this.allAttributes());
- }
-
- protected void initializeAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.resourceAttributes(); stream.hasNext(); ) {
- this.attributes.add(this.createAttribute(stream.next()));
- }
- }
-
- protected Iterator<JavaResourcePersistentAttribute> resourceAttributes() {
- return (this.getAccess() == AccessType.PROPERTY) ?
- this.resourcePersistentType.persistableProperties() :
- this.resourcePersistentType.persistableFields();
- }
-
- protected void updateAttributes() {
- HashBag<JavaPersistentAttribute> contextAttributesToRemove = CollectionTools.bag(this.attributes(), this.attributesSize());
- ArrayList<JavaPersistentAttribute> contextAttributesToUpdate = new ArrayList<JavaPersistentAttribute>(this.attributesSize());
- int resourceIndex = 0;
-
- for (Iterator<JavaResourcePersistentAttribute> resourceAttributes = this.resourceAttributes(); resourceAttributes.hasNext(); ) {
- JavaResourcePersistentAttribute resourceAttribute = resourceAttributes.next();
- boolean match = false;
- for (Iterator<JavaPersistentAttribute> contextAttributes = contextAttributesToRemove.iterator(); contextAttributes.hasNext(); ) {
- JavaPersistentAttribute contextAttribute = contextAttributes.next();
- if (contextAttribute.getResourcePersistentAttribute() == resourceAttribute) {
- this.moveAttribute(resourceIndex, contextAttribute);
- contextAttributes.remove();
- contextAttributesToUpdate.add(contextAttribute);
- match = true;
- break;
- }
- }
- if ( ! match) {
- this.addAttribute(resourceIndex, this.createAttribute(resourceAttribute));
- }
- resourceIndex++;
- }
- for (JavaPersistentAttribute contextAttribute : contextAttributesToRemove) {
- this.removeAttribute(contextAttribute);
- }
- // handle adding and removing attributes first, update the
- // remaining attributes last; this reduces the churn during "update"
- for (JavaPersistentAttribute contextAttribute : contextAttributesToUpdate) {
- contextAttribute.update();
- }
- }
-
- protected JavaPersistentAttribute createAttribute(JavaResourcePersistentAttribute jrpa) {
- return this.getJpaFactory().buildJavaPersistentAttribute(this, jrpa);
- }
-
- public boolean hasAnyAnnotatedAttributes() {
- return this.resourcePersistentType.hasAnyAnnotatedAttributes();
- }
-
-
- // ********** super persistent type **********
-
- public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType superPersistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = superPersistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, superPersistentType);
- }
-
- protected PersistentType buildSuperPersistentType() {
- HashSet<JavaResourcePersistentType> visited = new HashSet<JavaResourcePersistentType>();
- visited.add(this.resourcePersistentType);
- PersistentType spt = this.getSuperPersistentType(this.resourcePersistentType.getSuperclassQualifiedName(), visited);
- if (spt == null) {
- return null;
- }
- if (CollectionTools.contains(spt.inheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spt.isMapped() ? spt : spt.getSuperPersistentType();
- }
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit. If it is not found we use
- * resource persistent type and look for *its* super type.
- *
- * The 'visited' collection is used to detect a cycle in the *resource* type
- * inheritance hierarchy and prevent the resulting stack overflow.
- * Any cycles in the *context* type inheritance hierarchy are handled in
- * #buildSuperPersistentType().
- */
- protected PersistentType getSuperPersistentType(String typeName, Collection<JavaResourcePersistentType> visited) {
- if (typeName == null) {
- return null;
- }
- JavaResourcePersistentType resourceType = this.getJpaProject().getJavaResourcePersistentType(typeName);
- if ((resourceType == null) || visited.contains(resourceType)) {
- return null;
- }
- visited.add(resourceType);
- PersistentType spt = this.getPersistentType(typeName);
- return (spt != null) ? spt : this.getSuperPersistentType(resourceType.getSuperclassQualifiedName(), visited); // recurse
- }
-
- protected PersistentType getPersistentType(String typeName) {
- return this.getPersistenceUnit().getPersistentType(typeName);
- }
-
-
- // ********** inheritance **********
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- return this.inheritanceHierarchyOf(this);
- }
-
- public Iterator<PersistentType> ancestors() {
- return this.inheritanceHierarchyOf(this.superPersistentType);
- }
-
- protected Iterator<PersistentType> inheritanceHierarchyOf(PersistentType start) {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(start) {
- @Override
- protected PersistentType nextLink(PersistentType persistentType) {
- return persistentType.getSuperPersistentType();
- }
- };
- }
-
-
- // ********** code completion **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- Iterator<String> values = this.mapping.javaCompletionProposals(pos, filter, astRoot);
- if (values != null) {
- return values;
- }
- for (JavaPersistentAttribute attribute : this.getAttributes()) {
- values = attribute.javaCompletionProposals(pos, filter, astRoot);
- if (values != null) {
- return values;
- }
- }
- return EmptyIterator.instance();
- }
-
-
- // ********** validation **********
-
- 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 (e.g. referenced by
- // persistence.xml)
- IFile file = this.resourcePersistentType.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(this.getJpaProject().getProject()) &&
- (this.resourcePersistentType 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.validateMapping(messages, reporter, astRoot);
- this.validateAttributes(messages, reporter, astRoot);
- }
-
- protected void validateMapping(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- try {
- this.mapping.validate(messages, reporter, astRoot);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- protected void validateAttributes(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- for (JavaPersistentAttribute attribute : this.getAttributes()) {
- this.validateAttribute(attribute, reporter, messages, astRoot);
- }
- }
-
- protected void validateAttribute(JavaPersistentAttribute attribute, IReporter reporter, List<IMessage> messages, CompilationUnit astRoot) {
- try {
- attribute.validate(messages, reporter, astRoot);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getSelectionTextRange(astRoot);
- }
-
-
- // ********** misc **********
-
- public boolean isMapped() {
- return this.mapping.isMapped();
- }
-
- public AccessType getOwnerOverrideAccess() {
- return this.getParent().getOverridePersistentTypeAccess();
- }
-
- public AccessType getOwnerDefaultAccess() {
- return this.getParent().getDefaultPersistentTypeAccess();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
- protected CompilationUnit buildASTRoot() {
- return this.resourcePersistentType.getJavaResourceCompilationUnit().buildASTRoot();
- }
-
- protected JpaFile getJpaFile() {
- return this.getJpaFile(this.resourcePersistentType.getFile());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.java
deleted file mode 100644
index 0f3c687b3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaQuery.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.core.internal.context.java;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.resource.java.BaseNamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-
-public abstract class AbstractJavaQuery extends AbstractJavaJpaContextNode
- implements JavaQuery
-{
- protected String name;
-
- protected String query;
-
- protected final Vector<JavaQueryHint> hints;
-
- protected BaseNamedQueryAnnotation queryAnnotation;
-
- protected AbstractJavaQuery(JavaJpaContextNode parent) {
- super(parent);
- this.hints = new Vector<JavaQueryHint>();
- }
-
- protected BaseNamedQueryAnnotation getResourceQuery() {
- return this.queryAnnotation;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.queryAnnotation.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- this.queryAnnotation.setQuery(newQuery);
- firePropertyChanged(QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- protected void setQuery_(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- firePropertyChanged(QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<JavaQueryHint> hints() {
- return new CloneListIterator<JavaQueryHint>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public JavaQueryHint addHint(int index) {
- JavaQueryHint hint = getJpaFactory().buildJavaQueryHint(this);
- this.hints.add(index, hint);
- this.getResourceQuery().addHint(index);
- this.fireItemAdded(HINTS_LIST, index, hint);
- return hint;
- }
-
- protected void addHint(int index, JavaQueryHint hint) {
- addItemToList(index, hint, this.hints, HINTS_LIST);
- }
-
- protected void addHint(JavaQueryHint hint) {
- addHint(this.hints.size(), hint);
- }
-
- public void removeHint(QueryHint queryHint) {
- removeHint(this.hints.indexOf(queryHint));
- }
-
- public void removeHint(int index) {
- JavaQueryHint removedHint = this.hints.remove(index);
- this.getResourceQuery().removeHint(index);
- fireItemRemoved(HINTS_LIST, index, removedHint);
- }
-
- protected void removeHint_(JavaQueryHint hint) {
- removeItemFromList(hint, this.hints, HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.hints, targetIndex, sourceIndex);
- this.getResourceQuery().moveHint(targetIndex, sourceIndex);
- fireItemMoved(HINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void initialize(BaseNamedQueryAnnotation annotation) {
- this.queryAnnotation = annotation;
- this.name = annotation.getName();
- this.query = annotation.getQuery();
- this.initializeQueryHints();
- }
-
- protected void update(BaseNamedQueryAnnotation annotation) {
- this.queryAnnotation = annotation;
- this.setName_(annotation.getName());
- this.setQuery_(annotation.getQuery());
- this.updateQueryHints();
- getPersistenceUnit().addQuery(this);
- }
-
- protected void initializeQueryHints() {
- for (ListIterator<QueryHintAnnotation> resourceHints = this.queryAnnotation.hints(); resourceHints.hasNext(); ) {
- this.hints.add(createQueryHint(resourceHints.next()));
- }
- }
-
- protected void updateQueryHints() {
- ListIterator<JavaQueryHint> contextHints = hints();
- ListIterator<QueryHintAnnotation> resourceHints = this.queryAnnotation.hints();
-
- while (contextHints.hasNext()) {
- JavaQueryHint hint = contextHints.next();
- if (resourceHints.hasNext()) {
- hint.update(resourceHints.next());
- }
- else {
- removeHint_(hint);
- }
- }
-
- while (resourceHints.hasNext()) {
- addHint(createQueryHint(resourceHints.next()));
- }
- }
-
- protected JavaQueryHint createQueryHint(QueryHintAnnotation resourceQueryHint) {
- JavaQueryHint queryHint = getJpaFactory().buildJavaQueryHint(this);
- queryHint.initialize(resourceQueryHint);
- return queryHint;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.queryAnnotation.getTextRange(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.queryAnnotation.getNameTextRange(astRoot);
- }
-
- public boolean overrides(Query other) {
- // java is at the base of the tree
- return false;
- }
-
- public boolean duplicates(Query other) {
- return (this != other)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(other.getName())
- && ! this.overrides(other)
- && ! other.overrides(this);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java
deleted file mode 100644
index d0819044df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipMapping.java
+++ /dev/null
@@ -1,348 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaCascade;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCascade2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java relationship mapping
- */
-public abstract class AbstractJavaRelationshipMapping<T extends RelationshipMapping2_0Annotation>
- extends AbstractJavaAttributeMapping<T>
- implements JavaRelationshipMapping2_0
-{
- protected String specifiedTargetEntity;
- protected String defaultTargetEntity;
- protected String fullyQualifiedTargetEntity;
- protected PersistentType resolvedTargetType;
- protected Entity resolvedTargetEntity;
-
- protected final JavaRelationshipReference relationshipReference;
-
- protected final JavaCascade2_0 cascade;
-
- protected FetchType specifiedFetch;
-
-
- protected AbstractJavaRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.relationshipReference = buildRelationshipReference();
- this.cascade = buildCascade();
- }
-
-
- @Override
- protected void initialize() {
- super.initialize();
- this.relationshipReference.initialize();
- this.specifiedFetch = this.getResourceFetch();
- this.cascade.initialize();
- this.defaultTargetEntity = this.buildDefaultTargetEntity();
- this.specifiedTargetEntity = this.getResourceTargetEntity();
- this.fullyQualifiedTargetEntity = this.buildFullyQualifiedTargetEntity();
- this.resolvedTargetType = this.resolveTargetType();
- this.resolvedTargetEntity = this.resolveTargetEntity();
- }
-
- @Override
- protected void update() {
- super.update();
- this.relationshipReference.update();
- this.setSpecifiedFetch_(this.getResourceFetch());
- this.cascade.update();
- this.setDefaultTargetEntity(this.buildDefaultTargetEntity());
- this.setSpecifiedTargetEntity_(this.getResourceTargetEntity());
- this.setFullyQualifiedTargetEntity(this.buildFullyQualifiedTargetEntity());
- this.resolvedTargetType = this.resolveTargetType();
- this.setResolvedTargetEntity(this.resolveTargetEntity());
- }
-
-
- // ********** target entity **********
-
- public String getTargetEntity() {
- return (this.specifiedTargetEntity != null) ? this.specifiedTargetEntity : this.defaultTargetEntity;
- }
-
- public String getSpecifiedTargetEntity() {
- return this.specifiedTargetEntity;
- }
-
- public void setSpecifiedTargetEntity(String targetEntity) {
- String old = this.specifiedTargetEntity;
- this.specifiedTargetEntity = targetEntity;
- this.mappingAnnotation.setTargetEntity(targetEntity);
- this.firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- protected void setSpecifiedTargetEntity_(String targetEntity) {
- String old = this.specifiedTargetEntity;
- this.specifiedTargetEntity = targetEntity;
- this.firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- protected String getResourceTargetEntity() {
- return this.mappingAnnotation.getTargetEntity();
- }
-
- public String getDefaultTargetEntity() {
- return this.defaultTargetEntity;
- }
-
- protected void setDefaultTargetEntity(String targetEntity) {
- String old = this.defaultTargetEntity;
- this.defaultTargetEntity = targetEntity;
- this.firePropertyChanged(DEFAULT_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- protected abstract String buildDefaultTargetEntity();
-
- public String getFullyQualifiedTargetEntity() {
- return this.fullyQualifiedTargetEntity;
- }
-
- protected void setFullyQualifiedTargetEntity(String targetEntity) {
- String old = this.fullyQualifiedTargetEntity;
- this.fullyQualifiedTargetEntity = targetEntity;
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- protected String buildFullyQualifiedTargetEntity() {
- return (this.specifiedTargetEntity == null) ?
- this.defaultTargetEntity :
- this.mappingAnnotation.getFullyQualifiedTargetEntityClassName();
- }
-
- public PersistentType getResolvedTargetType() {
- return this.resolvedTargetType;
- }
-
- protected PersistentType resolveTargetType() {
- return (this.fullyQualifiedTargetEntity == null) ? null : this.getPersistenceUnit().getPersistentType(this.fullyQualifiedTargetEntity);
- }
-
- public Entity getResolvedTargetEntity() {
- return this.resolvedTargetEntity;
- }
-
- protected void setResolvedTargetEntity(Entity entity) {
- Entity old = this.resolvedTargetEntity;
- this.resolvedTargetEntity = entity;
- this.firePropertyChanged(RESOLVED_TARGET_ENTITY_PROPERTY, old, entity);
- }
-
- protected Entity resolveTargetEntity() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public Iterator<String> allTargetEntityAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.allTargetEntityAttributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- });
- }
-
- protected Iterator<AttributeMapping> allTargetEntityAttributeMappings() {
- return (this.resolvedTargetEntity != null) ?
- this.resolvedTargetEntity.allAttributeMappings() :
- EmptyIterator.<AttributeMapping> instance();
- }
-
- protected String getTargetEntityIdAttributeName() {
- PersistentAttribute attribute = this.getTargetEntityIdAttribute();
- return (attribute == null) ? null : attribute.getName();
- }
-
- protected PersistentAttribute getTargetEntityIdAttribute() {
- return (this.resolvedTargetEntity == null) ? null : this.resolvedTargetEntity.getIdAttribute();
- }
-
- public char getTargetEntityEnclosingTypeSeparator() {
- return '.';
- }
-
-
- // ********** relationship reference **********
-
- public JavaRelationshipReference getRelationshipReference() {
- return this.relationshipReference;
- }
-
- protected abstract JavaRelationshipReference buildRelationshipReference();
-
- @Override
- public boolean isRelationshipOwner() {
- return this.relationshipReference.isRelationshipOwner();
- }
-
- public RelationshipMapping getRelationshipOwner() {
- Entity targetEntity = this.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- for (PersistentAttribute each :
- CollectionTools.iterable(
- targetEntity.getPersistentType().allAttributes())) {
- if (this.isOwnedBy(each.getMapping())) {
- return (RelationshipMapping) each.getMapping();
- }
- }
- return null;
- }
-
- @Override
- public boolean isOwnedBy(AttributeMapping mapping) {
- if (mapping.isRelationshipOwner()) {
- return this.relationshipReference.isOwnedBy((RelationshipMapping) mapping);
- }
- return false;
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return this.relationshipReference.isOverridableAssociation();
- }
-
-
- // ********** cascade **********
-
- protected JavaCascade2_0 buildCascade() {
- return new GenericJavaCascade(this);
- }
-
- public JavaCascade2_0 getCascade() {
- return this.cascade;
- }
-
-
- // ********** fetch **********
-
- public FetchType getFetch() {
- return (this.specifiedFetch != null) ? this.specifiedFetch : this.getDefaultFetch();
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType fetch) {
- FetchType old = this.specifiedFetch;
- this.specifiedFetch = fetch;
- this.mappingAnnotation.setFetch(FetchType.toJavaResourceModel(fetch));
- this.firePropertyChanged(SPECIFIED_FETCH_PROPERTY, old, fetch);
- }
-
- protected void setSpecifiedFetch_(FetchType fetch) {
- FetchType old = this.specifiedFetch;
- this.specifiedFetch = fetch;
- this.firePropertyChanged(SPECIFIED_FETCH_PROPERTY, old, fetch);
- }
-
- protected FetchType getResourceFetch() {
- return FetchType.fromJavaResourceModel(this.mappingAnnotation.getFetch());
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return this.relationshipReference.javaCompletionProposals(pos, filter, astRoot);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateTargetEntity(messages, astRoot);
- this.relationshipReference.validate(messages, reporter, astRoot);
- }
-
- protected void validateTargetEntity(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getTargetEntity() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_ENTITY_NOT_DEFINED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- else if (this.resolvedTargetEntity == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY,
- new String[] {this.getTargetEntity(), this.getName()},
- this,
- this.getTargetEntityTextRange(astRoot)
- )
- );
- }
- }
-
- protected TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.mappingAnnotation.getTargetEntityTextRange(astRoot), astRoot);
- }
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
-
- // ********** metamodel **********
-
- @Override
- public String getMetamodelTypeName() {
- return (this.fullyQualifiedTargetEntity != null) ? this.fullyQualifiedTargetEntity : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipReference.java
deleted file mode 100644
index 1b5ccb157d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaRelationshipReference.java
+++ /dev/null
@@ -1,100 +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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public abstract class AbstractJavaRelationshipReference
- extends AbstractJavaJpaContextNode
- implements JavaRelationshipReference
-{
- // cache the strategy for property change notification
- protected JoiningStrategy cachedPredominantJoiningStrategy;
-
-
- public AbstractJavaRelationshipReference(JavaRelationshipMapping parent) {
- super(parent);
- }
-
-
- public JavaRelationshipMapping getRelationshipMapping() {
- return (JavaRelationshipMapping) getParent();
- }
-
- public TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public Entity getEntity() {
- TypeMapping typeMapping = getTypeMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public boolean isOverridableAssociation() {
- return getPredominantJoiningStrategy().isOverridableAssociation();
- }
-
- public boolean isParentVirtual() {
- return getRelationshipMapping().getPersistentAttribute().isVirtual();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
- // **************** predominant joining strategy ***************************
-
- public JoiningStrategy getPredominantJoiningStrategy() {
- return this.cachedPredominantJoiningStrategy;
- }
-
- protected void setPredominantJoiningStrategy() {
- setPredominantJoiningStrategy(calculatePredominantJoiningStrategy());
- }
-
- protected void setPredominantJoiningStrategy(JoiningStrategy newJoiningStrategy) {
- JoiningStrategy oldJoiningStrategy = this.cachedPredominantJoiningStrategy;
- this.cachedPredominantJoiningStrategy = newJoiningStrategy;
- firePropertyChanged(PREDOMINANT_JOINING_STRATEGY_PROPERTY, oldJoiningStrategy, newJoiningStrategy);
- }
-
-
- // **************** resource -> context ************************************
-
- public void initialize() {
- initializeJoiningStrategies();
- this.cachedPredominantJoiningStrategy = calculatePredominantJoiningStrategy();
- }
-
- protected abstract void initializeJoiningStrategies();
-
- public void update() {
- updateJoiningStrategies();
- setPredominantJoiningStrategy();
- }
-
- protected abstract void updateJoiningStrategies();
-
- protected abstract JoiningStrategy calculatePredominantJoiningStrategy();
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getRelationshipMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSequenceGenerator.java
deleted file mode 100644
index 02d7926656..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSequenceGenerator.java
+++ /dev/null
@@ -1,127 +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.core.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-
-/**
- *
- */
-public abstract class AbstractJavaSequenceGenerator extends AbstractJavaGenerator
- implements JavaSequenceGenerator
-{
- protected String specifiedSequenceName;
-
-
- protected AbstractJavaSequenceGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
- // ********** sequence name **********
-
- public String getSequenceName() {
- return (this.specifiedSequenceName != null) ? this.specifiedSequenceName : this.getDefaultSequenceName();
- }
-
- public String getSpecifiedSequenceName() {
- return this.specifiedSequenceName;
- }
-
- public void setSpecifiedSequenceName(String specifiedSequenceName) {
- String old = this.specifiedSequenceName;
- this.specifiedSequenceName = specifiedSequenceName;
- this.getResourceGenerator().setSequenceName(specifiedSequenceName);
- this.firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, old, specifiedSequenceName);
- }
-
- protected void setSpecifiedSequenceName_(String specifiedSequenceName) {
- String old = this.specifiedSequenceName;
- this.specifiedSequenceName = specifiedSequenceName;
- this.firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, old, specifiedSequenceName);
- }
-
- public String getDefaultSequenceName() {
- return null;
- }
-
-
- // ********** resource => context **********
-
- public void initialize(SequenceGeneratorAnnotation resourceSequenceGenerator) {
- super.initialize(resourceSequenceGenerator);
- this.specifiedSequenceName = resourceSequenceGenerator.getSequenceName();
- }
-
- public void update(SequenceGeneratorAnnotation resourceSequenceGenerator) {
- super.update(resourceSequenceGenerator);
- this.setSpecifiedSequenceName_(resourceSequenceGenerator.getSequenceName());
- }
-
-
- // ********** Java completion proposals **********
-
- /**
- * called if the database is connected:
- * sequenceName
- */
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.sequenceNameTouches(pos, astRoot)) {
- return this.getJavaCandidateSequences(filter).iterator();
- }
- return null;
- }
-
- protected boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().sequenceNameTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateSequences(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateSequences(filter));
- }
-
- protected Iterable<String> getCandidateSequences(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateSequences(), filter);
- }
-
- protected Iterable<String> getCandidateSequences() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.getSortedSequenceIdentifiers() : EmptyIterable.<String> instance();
- }
-
-
- // ********** misc **********
-
- public int getDefaultInitialValue() {
- return SequenceGenerator.DEFAULT_INITIAL_VALUE;
- }
-
- @Override
- protected SequenceGeneratorAnnotation getResourceGenerator() {
- return (SequenceGeneratorAnnotation) super.getResourceGenerator();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java
deleted file mode 100644
index 375f50d6e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaSingleRelationshipMapping.java
+++ /dev/null
@@ -1,148 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java single relationship (1:1, m:1) mapping
- */
-public abstract class AbstractJavaSingleRelationshipMapping<T extends RelationshipMapping2_0Annotation>
- extends AbstractJavaRelationshipMapping<T>
- implements JavaSingleRelationshipMapping2_0
-{
- protected Boolean specifiedOptional;
-
- protected final JavaDerivedIdentity2_0 derivedIdentity;
-
-
- protected AbstractJavaSingleRelationshipMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.derivedIdentity = buildDerivedIdentity();
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.specifiedOptional = this.getResourceOptional();
- this.derivedIdentity.initialize();
- }
-
- @Override
- protected void update() {
- super.update();
- this.setSpecifiedOptional_(this.getResourceOptional());
- this.derivedIdentity.update();
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.JOIN_COLUMN);
- names.add(JPA.JOIN_COLUMNS);
- names.add(JPA.JOIN_TABLE);
- if (this.isJpa2_0Compatible()) {
- names.add(JPA.ID);
- names.add(JPA2_0.MAPS_ID);
- }
- }
-
-
- // ********** optional **********
-
- public boolean isOptional() {
- return (this.specifiedOptional != null) ? this.specifiedOptional.booleanValue() : this.isDefaultOptional();
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean optional) {
- Boolean old = this.specifiedOptional;
- this.specifiedOptional = optional;
- this.setResourceOptional(optional);
- this.firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, old, optional);
- }
-
- protected void setSpecifiedOptional_(Boolean optional) {
- Boolean old = this.specifiedOptional;
- this.specifiedOptional = optional;
- this.firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, old, optional);
- }
-
- public boolean isDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- protected abstract Boolean getResourceOptional();
-
- protected abstract void setResourceOptional(Boolean newOptional);
-
-
- // ********** 2.0 derived identity **********
-
- protected JavaDerivedIdentity2_0 buildDerivedIdentity() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaDerivedIdentity(this) :
- new NullJavaDerivedIdentity2_0(this);
- }
-
- public JavaDerivedIdentity2_0 getDerivedIdentity() {
- return this.derivedIdentity;
- }
-
-
- // ********** AbstractJavaRelationshipMapping implementation **********
-
- @Override
- protected String buildDefaultTargetEntity() {
- return this.getPersistentAttribute().getSingleReferenceTargetTypeName();
- }
-
-
- // ********** Fetchable implementation **********
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.derivedIdentity.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.derivedIdentity.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java
deleted file mode 100644
index db128ba727..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTable.java
+++ /dev/null
@@ -1,502 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * Java table
- */
-public abstract class AbstractJavaTable
- extends AbstractJavaJpaContextNode
- implements Table, UniqueConstraint.Owner
-{
- protected String specifiedName;
- protected String defaultName;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected final Vector<JavaUniqueConstraint> uniqueConstraints = new Vector<JavaUniqueConstraint>();
-
-
- // ********** constructor **********
-
- protected AbstractJavaTable(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return the Java table annotation. Do not return null if the Java
- * annotation does not exist; return a null table annotation instead.
- */
- protected abstract BaseTableAnnotation getAnnotation();
-
- /**
- * Return the name of the Java annotation.
- */
- protected abstract String getAnnotationName();
-
- protected abstract String buildDefaultName();
-
- protected abstract String buildDefaultSchema();
-
- protected abstract String buildDefaultCatalog();
-
-
- // ********** name **********
-
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- this.getAnnotation().setName(name);
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedName_(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String name) {
- String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
- }
-
-
- // ********** schema **********
-
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.getAnnotation().setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedSchema_(String newSpecifiedSchema) {
- String oldSpecifiedSchema = this.specifiedSchema;
- this.specifiedSchema = newSpecifiedSchema;
- firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, oldSpecifiedSchema, newSpecifiedSchema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
-
- // ********** catalog **********
-
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.getAnnotation().setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
-
- // ********** unique constraints **********
-
- public @SuppressWarnings("unchecked") ListIterator<JavaUniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<JavaUniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public JavaUniqueConstraint addUniqueConstraint(int index) {
- JavaUniqueConstraint uniqueConstraint = getJpaFactory().buildJavaUniqueConstraint(this, this);
- this.uniqueConstraints.add(index, uniqueConstraint);
- UniqueConstraintAnnotation uniqueConstraintAnnotation = this.getAnnotation().addUniqueConstraint(index);
- uniqueConstraint.initialize(uniqueConstraintAnnotation);
- fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public void removeUniqueConstraint(UniqueConstraint uniqueConstraint) {
- this.removeUniqueConstraint(this.uniqueConstraints.indexOf(uniqueConstraint));
- }
-
- public void removeUniqueConstraint(int index) {
- JavaUniqueConstraint removedUniqueConstraint = this.uniqueConstraints.remove(index);
- this.getAnnotation().removeUniqueConstraint(index);
- fireItemRemoved(UNIQUE_CONSTRAINTS_LIST, index, removedUniqueConstraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- this.getAnnotation().moveUniqueConstraint(targetIndex, sourceIndex);
- fireItemMoved(UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void addUniqueConstraint(int index, JavaUniqueConstraint uniqueConstraint) {
- addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- protected void addUniqueConstraint(JavaUniqueConstraint uniqueConstraint) {
- this.addUniqueConstraint(this.uniqueConstraints.size(), uniqueConstraint);
- }
-
- protected void removeUniqueConstraint_(JavaUniqueConstraint uniqueConstraint) {
- removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- protected void initializeUniqueConstraints(BaseTableAnnotation baseTableAnnotation) {
- for (Iterator<UniqueConstraintAnnotation> stream = baseTableAnnotation.uniqueConstraints(); stream.hasNext(); ) {
- this.uniqueConstraints.add(buildUniqueConstraint(stream.next()));
- }
- }
-
- protected void updateUniqueConstraints(BaseTableAnnotation baseTableAnnotation) {
- ListIterator<UniqueConstraintAnnotation> constraintAnnotations = baseTableAnnotation.uniqueConstraints();
- ListIterator<JavaUniqueConstraint> constraints = this.uniqueConstraints();
- while (constraints.hasNext()) {
- JavaUniqueConstraint uniqueConstraint = constraints.next();
- if (constraintAnnotations.hasNext()) {
- uniqueConstraint.update(constraintAnnotations.next());
- } else {
- this.removeUniqueConstraint_(uniqueConstraint);
- }
- }
-
- while (constraintAnnotations.hasNext()) {
- this.addUniqueConstraint(this.buildUniqueConstraint(constraintAnnotations.next()));
- }
- }
-
- protected JavaUniqueConstraint buildUniqueConstraint(UniqueConstraintAnnotation uniqueConstraintAnnotation) {
- JavaUniqueConstraint uniqueConstraint = this.getJpaFactory().buildJavaUniqueConstraint(this, this);
- uniqueConstraint.initialize(uniqueConstraintAnnotation);
- return uniqueConstraint;
- }
-
-
- // ********** convenience methods **********
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getAnnotation().getNameTextRange(astRoot), astRoot);
- }
-
- protected boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.getAnnotation().nameTouches(pos, astRoot);
- }
-
- protected TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getAnnotation().getSchemaTextRange(astRoot), astRoot);
- }
-
- protected boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.getAnnotation().schemaTouches(pos, astRoot);
- }
-
- protected TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getAnnotation().getCatalogTextRange(astRoot), astRoot);
- }
-
- protected boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.getAnnotation().catalogTouches(pos, astRoot);
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(BaseTableAnnotation baseTableAnnotation) {
- this.defaultName = this.buildDefaultName();
- this.specifiedName = baseTableAnnotation.getName();
-
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = baseTableAnnotation.getSchema();
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = baseTableAnnotation.getCatalog();
-
- this.initializeUniqueConstraints(baseTableAnnotation);
- }
-
- protected void update(BaseTableAnnotation baseTableAnnotation) {
- this.setDefaultName(this.buildDefaultName());
- this.setSpecifiedName_(baseTableAnnotation.getName());
-
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(baseTableAnnotation.getSchema());
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(baseTableAnnotation.getCatalog());
-
- this.updateUniqueConstraints(baseTableAnnotation);
- }
-
-
- // ********** database **********
-
- public org.eclipse.jpt.db.Table getDbTable() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema == null) ? null : dbSchema.getTableForIdentifier(this.getName());
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- public boolean isResolved() {
- return this.getDbTable() != null;
- }
-
- public boolean hasResolvedSchema() {
- return this.getDbSchema() != null;
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.getDbCatalog(catalog) != null);
- }
-
-
- // ********** UniqueConstraint.Owner implementation **********
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers().iterator() : EmptyIterator.<String>instance();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.getAnnotation().getTextRange(astRoot), astRoot);
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaUniqueConstraint constraint : CollectionTools.iterable(this.uniqueConstraints())) {
- result = constraint.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * called if the database is connected:
- * name, schema, catalog
- */
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.nameTouches(pos, astRoot)) {
- return this.getJavaCandidateNames(filter).iterator();
- }
- if (this.schemaTouches(pos, astRoot)) {
- return this.getJavaCandidateSchemata(filter).iterator();
- }
- if (this.catalogTouches(pos, astRoot)) {
- return this.getJavaCandidateCatalogs(filter).iterator();
- }
- return null;
- }
-
- protected Iterable<String> getJavaCandidateNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateNames(filter));
- }
-
- protected Iterable<String> getCandidateNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateNames(), filter);
- }
-
- protected Iterable<String> getCandidateNames() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.getSortedTableIdentifiers() : EmptyIterable.<String> instance();
- }
-
- protected Iterable<String> getJavaCandidateSchemata(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateSchemata(filter));
- }
-
- protected Iterable<String> getCandidateSchemata(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateSchemata(), filter);
- }
-
- protected Iterable<String> getCandidateSchemata() {
- return this.getDbSchemaContainer().getSortedSchemaIdentifiers();
- }
-
- protected Iterable<String> getJavaCandidateCatalogs(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateCatalogs(filter));
- }
-
- protected Iterable<String> getCandidateCatalogs(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateCatalogs(), filter);
- }
-
- protected Iterable<String> getCandidateCatalogs() {
- Database db = this.getDatabase();
- return (db != null) ? db.getSortedCatalogIdentifiers() : EmptyIterable.<String> instance();
- }
-
-
- // ********** misc **********
-
- /**
- * covariant override
- */
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.getQualifiedName());
- }
-
- protected String getQualifiedName() {
- return NameTools.buildQualifiedDatabaseObjectName(this.getCatalog(), this.getSchema(), this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java
deleted file mode 100644
index 1dfc6ac68d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMapping.java
+++ /dev/null
@@ -1,246 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-
-public abstract class AbstractJavaTypeMapping extends AbstractJavaJpaContextNode
- implements JavaTypeMapping
-{
- protected JavaResourcePersistentType javaResourcePersistentType;
-
-
- protected AbstractJavaTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- @Override
- public JavaPersistentType getParent() {
- return (JavaPersistentType) super.getParent();
- }
-
- protected JavaResourcePersistentType getResourcePersistentType() {
- return this.javaResourcePersistentType;
- }
-
- protected Annotation getResourceMappingAnnotation() {
- return this.javaResourcePersistentType.getAnnotation(getAnnotationName());
- }
-
- //***************** TypeMapping impl ***************************************
-
- public JavaPersistentType getPersistentType() {
- return getParent();
- }
-
- /* default implementation */
- public JavaPersistentType getIdClass() {
- return null;
- }
-
- public String getPrimaryTableName() {
- return null;
- }
-
- public org.eclipse.jpt.db.Table getPrimaryDbTable() {
- return null;
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return null;
- }
-
- public Schema getDbSchema() {
- return null;
- }
-
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return true;
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public TypeMapping getSuperTypeMapping() {
- return (getPersistentType().getSuperPersistentType() == null) ?
- null
- : getPersistentType().getSuperPersistentType().getMapping();
- }
-
- /**
- * Return an iterator of TypeMappings, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- public Iterator<TypeMapping> inheritanceHierarchy() {
- return this.getInheritanceHierarchy().iterator();
- }
-
- public Iterable<TypeMapping> getInheritanceHierarchy() {
- return new TransformationIterable<PersistentType, TypeMapping>(CollectionTools.iterable(getPersistentType().inheritanceHierarchy())) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- public Iterator<JavaAttributeMapping> attributeMappings() {
- return new TransformationIterator<JavaPersistentAttribute, JavaAttributeMapping>(getPersistentType().attributes()) {
- @Override
- protected JavaAttributeMapping transform(JavaPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
- public Iterable<JavaAttributeMapping> getAttributeMappings(final String mappingKey) {
- return new FilteringIterable<JavaAttributeMapping>(CollectionTools.collection(attributeMappings())) {
- @Override
- protected boolean accept(JavaAttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), mappingKey);
- }
- };
- }
-
- public Iterator<AttributeMapping> allAttributeMappings() {
- return new CompositeIterator<AttributeMapping>(
- new TransformationIterator<TypeMapping, Iterator<AttributeMapping>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<AttributeMapping> transform(TypeMapping typeMapping) {
- return typeMapping == null ? EmptyIterator.<AttributeMapping> instance() : typeMapping.attributeMappings();
- }
- });
- }
-
- public Iterable<AttributeMapping> getAllAttributeMappings(final String mappingKey) {
- return new FilteringIterable<AttributeMapping>(CollectionTools.collection(allAttributeMappings())) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), mappingKey);
- }
- };
- }
-
- public Iterator<String> overridableAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.attributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- });
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAttributeNames();
- }
- });
- }
-
- public Column resolveOverriddenColumn(String attributeName) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(attributeMappings())) {
- Column resolvedColumn = attributeMapping.resolveOverriddenColumn(attributeName);
- if (resolvedColumn != null) {
- return resolvedColumn;
- }
- }
- return null;
- }
-
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(attributeMappings())) {
- RelationshipReference resolvedRelationshipReference = attributeMapping.resolveRelationshipReference(attributeName);
- if (resolvedRelationshipReference != null) {
- return resolvedRelationshipReference;
- }
- }
- return null;
- }
-
- public Iterator<String> overridableAssociationNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.attributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- });
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAssociationNames();
- }
- });
- }
-
-
- //******************** updating *********************
- public void initialize(JavaResourcePersistentType jrpt) {
- this.javaResourcePersistentType = jrpt;
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.javaResourcePersistentType = jrpt;
- }
-
- //******************** validation *********************
-
- public boolean shouldValidateAgainstDatabase() {
- return getPersistenceUnit().shouldValidateAgainstDatabase();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceMappingAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getPersistentType().getValidationTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getPersistentType().getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMappingDefinition.java
deleted file mode 100644
index 65e6850206..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaTypeMappingDefinition.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public abstract class AbstractJavaTypeMappingDefinition
- implements JavaTypeMappingDefinition
-{
- protected AbstractJavaTypeMappingDefinition() {
- super();
- }
-
-
- /**
- * Default implementation. Override if the mapping definition needs to do more analysis.
- */
- public boolean test(JavaPersistentType persistentType) {
- return persistentType.getResourcePersistentType().getAnnotation(getAnnotationName())
- != null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getAnnotationName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaVersionMapping.java
deleted file mode 100644
index 7605471688..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaVersionMapping.java
+++ /dev/null
@@ -1,221 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaVersionMapping
- extends AbstractJavaAttributeMapping<VersionAnnotation>
- implements JavaVersionMapping
-{
- protected final JavaColumn column;
-
- protected JavaConverter converter;
-
- protected final JavaConverter nullConverter;
-
- protected AbstractJavaVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.column = getJpaFactory().buildJavaColumn(this, this);
- this.nullConverter = getJpaFactory().buildJavaNullConverter(this);
- this.converter = this.nullConverter;
- }
-
- @Override
- protected void initialize( ) {
- super.initialize();
- this.column.initialize(this.getResourceColumn());
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
- public ColumnAnnotation getResourceColumn() {
- return (ColumnAnnotation) getResourcePersistentAttribute().
- getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return VersionAnnotation.ANNOTATION_NAME;
- }
-
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.COLUMN);
- names.add(JPA.TEMPORAL);
- }
-
- //************** NamedColumn.Owner implementation ***************
-
- public String getDefaultColumnName() {
- return getName();
- }
-
- //************** BaseColumn.Owner implementation ***************
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- //************** VersionMapping implementation ***************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- public JavaConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- JavaConverter oldConverter = this.converter;
- JavaConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
-
- @Override
- protected void update() {
- super.update();
- this.column.update(this.getResourceColumn());
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update(this.getResourcePersistentAttribute());
- }
- else {
- JavaConverter javaConverter = buildConverter(getResourceConverterType());
- setConverter(javaConverter);
- }
- }
-
- protected JavaConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.getResourcePersistentAttribute());
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.getResourcePersistentAttribute().getAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = getConverter().javaCompletionProposals(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.getColumn().validate(messages, reporter, astRoot);
- this.getConverter().validate(messages, reporter, astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdClassReference.java
deleted file mode 100644
index 7d52f032ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaIdClassReference.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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaIdClassReference
- extends AbstractJavaJpaContextNode
- implements JavaIdClassReference
-{
- protected String idClassName;
-
- protected String fullyQualifiedIdClassName;
-
- protected JavaPersistentType idClass;
-
-
- public GenericJavaIdClassReference(JavaTypeMapping parent) {
- super(parent);
- }
-
-
- protected JavaTypeMapping getTypeMapping() {
- return (JavaTypeMapping) getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return getTypeMapping().getPersistentType();
- }
-
-
- // **************** PersistentType.Owner impl *****************************
-
- public AccessType getOverridePersistentTypeAccess() {
- return getPersistentType().getAccess();
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- // this shouldn't be needed, since we've specified an override access, but just to be safe ...
- return getPersistentType().getAccess();
- }
-
-
- // **************** IdClassReference impl *********************************
-
- public String getSpecifiedIdClassName() {
- return this.idClassName;
- }
-
- public void setSpecifiedIdClassName(String newClassName) {
- String oldClassName = this.idClassName;
- this.idClassName = newClassName;
- if (this.valuesAreDifferent(newClassName, oldClassName)) {
- if (newClassName != null) {
- if (getIdClassAnnotation() == null) {
- addIdClassAnnotation();
- }
- getIdClassAnnotation().setValue(newClassName);
- }
- else {
- removeIdClassAnnotation();
- }
- }
- firePropertyChanged(SPECIFIED_ID_CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected void setIdClassName_(String newClassName) {
- String oldClassName = this.idClassName;
- this.idClassName = newClassName;
- firePropertyChanged(SPECIFIED_ID_CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected String buildIdClassName() {
- IdClassAnnotation annotation = getIdClassAnnotation();
- if (annotation != null) {
- return annotation.getValue();
- }
- return null;
- }
-
- public String getDefaultIdClassName() {
- return null;
- }
-
- public String getIdClassName() {
- return getSpecifiedIdClassName();
- }
-
- public boolean isSpecified() {
- return getSpecifiedIdClassName() != null;
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClass;
- }
-
- protected void setIdClass_(JavaPersistentType newIdClass) {
- JavaPersistentType oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected JavaPersistentType buildIdClass() {
- JavaResourcePersistentType resourceIdClass = getResourceIdClass();
- return (resourceIdClass == null) ?
- null : this.buildIdClass(resourceIdClass);
- }
-
- protected JavaPersistentType buildIdClass(JavaResourcePersistentType resourceClass) {
- return getJpaFactory().buildJavaPersistentType(this, resourceClass);
- }
-
- protected JavaResourcePersistentType getResourcePersistentType() {
- return getPersistentType().getResourcePersistentType();
- }
-
- protected IdClassAnnotation getIdClassAnnotation() {
- return (IdClassAnnotation) getResourcePersistentType().
- getAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void addIdClassAnnotation() {
- getResourcePersistentType().addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeIdClassAnnotation() {
- getResourcePersistentType().removeAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- }
-
- protected JavaResourcePersistentType getResourceIdClass() {
- return (this.fullyQualifiedIdClassName == null) ?
- null : getJpaProject().getJavaResourcePersistentType(this.fullyQualifiedIdClassName);
- }
-
- public String getFullyQualifiedIdClassName() {
- return this.fullyQualifiedIdClassName;
- }
-
- protected void setFullyQualifiedIdClassName(String idClass) {
- String old = this.fullyQualifiedIdClassName;
- this.fullyQualifiedIdClassName = idClass;
- this.firePropertyChanged(FULLY_QUALIFIED_ID_CLASS_PROPERTY, old, idClass);
- }
-
- protected String buildFullyQualifiedIdClassName() {
- IdClassAnnotation annotation = getIdClassAnnotation();
- return (annotation == null) ?
- null : annotation.getFullyQualifiedClassName();
- }
-
- public char getIdClassEnclosingTypeSeparator() {
- return '.';
- }
-
- public void initialize() {
- this.idClassName = buildIdClassName();
- this.fullyQualifiedIdClassName = this.buildFullyQualifiedIdClassName();
- this.idClass = buildIdClass();
- }
-
- public void update() {
- setIdClassName_(buildIdClassName());
- this.setFullyQualifiedIdClassName(this.buildFullyQualifiedIdClassName());
- updateIdClass();
- }
-
- protected void updateIdClass() {
- JavaResourcePersistentType resourceIdClass = getResourceIdClass();
- if (resourceIdClass == null) {
- setIdClass_(null);
- }
- else {
- if (this.idClass == null || this.idClass.getResourcePersistentType() != resourceIdClass) {
- setIdClass_(buildIdClass(resourceIdClass));
- }
- this.idClass.update(resourceIdClass);
- }
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return (getIdClassAnnotation() == null) ?
- getTypeMapping().getValidationTextRange(astRoot)
- : getIdClassAnnotation().getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.java
deleted file mode 100644
index 9af9cdb1bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.java
+++ /dev/null
@@ -1,264 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnInAssociationOverrideJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn.Owner;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaJoinColumnInAssociationOverrideJoiningStrategy
- extends AbstractJavaJoinColumnJoiningStrategy
- implements JavaJoinColumnInAssociationOverrideJoiningStrategy
-{
- protected transient AssociationOverrideAnnotation associationOverrideAnnotation;
-
- public GenericJavaJoinColumnInAssociationOverrideJoiningStrategy(JavaAssociationOverrideRelationshipReference parent) {
- super(parent);
- }
-
- @Override
- protected Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- if (relationshipMapping != null) {
- return relationshipMapping.getRelationshipReference().isTargetForeignKeyRelationship();
- }
- return false;
- }
-
- public TypeMapping getRelationshipSource() {
- if (isTargetForeignKeyRelationship()) {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
- return getAssociationOverrideOwner().getTypeMapping();
- }
-
- public TypeMapping getRelationshipTarget() {
- if (isTargetForeignKeyRelationship()) {
- return getAssociationOverrideOwner().getTypeMapping();
- }
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- protected Entity getRelationshipTargetEntity() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return (relationshipTarget != null) && (relationshipTarget.getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) ? (Entity) relationshipTarget : null;
- }
-
- @Override
- public RelationshipMapping getRelationshipMapping() {
- return getAssociationOverrideOwner().getRelationshipMapping(getAttributeName());
- }
-
- protected String getAttributeName() {
- return this.getAssociationOverride().getName();
- }
-
- @Override
- public String getTableName() {
- if (isTargetForeignKeyRelationship()) {
- return super.getTableName();
- }
- return getAssociationOverrideOwner().getDefaultTableName();
- }
-
- @Override
- public boolean tableNameIsInvalid(String tableName) {
- if (isTargetForeignKeyRelationship()) {
- return super.tableNameIsInvalid(tableName);
- }
- return getAssociationOverrideOwner().tableNameIsInvalid(tableName);
- }
-
- @Override
- public Iterator<String> candidateTableNames() {
- if (isTargetForeignKeyRelationship()) {
- return super.candidateTableNames();
- }
- return getAssociationOverrideOwner().candidateTableNames();
- }
-
- @Override
- public Table getDbTable(String tableName) {
- if (isTargetForeignKeyRelationship()) {
- return super.getDbTable(tableName);
- }
- return getAssociationOverrideOwner().getDbTable(tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- return null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- protected JavaAssociationOverride getAssociationOverride() {
- return this.getRelationshipReference().getAssociationOverride();
- }
-
- protected JavaAssociationOverride.Owner getAssociationOverrideOwner() {
- return getAssociationOverride().getOwner();
- }
-
- @Override
- public JavaAssociationOverrideRelationshipReference getRelationshipReference() {
- return (JavaAssociationOverrideRelationshipReference) super.getRelationshipReference();
- }
-
- @Override
- protected ListIterator<JoinColumnAnnotation> joinColumnAnnotations() {
- return this.associationOverrideAnnotation.joinColumns();
- }
-
- @Override
- protected JoinColumnAnnotation buildNullJoinColumnAnnotation() {
- return new NullJoinColumnAnnotation(this.associationOverrideAnnotation);
- }
-
- @Override
- protected JoinColumnAnnotation addAnnotation(int index) {
- return this.associationOverrideAnnotation.addJoinColumn(index);
- }
-
- @Override
- protected void removeAnnotation(int index) {
- this.associationOverrideAnnotation.removeJoinColumn(index);
- }
-
- @Override
- protected void moveAnnotation(int targetIndex, int sourceIndex) {
- this.associationOverrideAnnotation.moveJoinColumn(targetIndex, sourceIndex);
- }
-
- public void initialize(AssociationOverrideAnnotation associationOverride) {
- this.associationOverrideAnnotation = associationOverride;
- super.initialize();
- }
-
- public void update(AssociationOverrideAnnotation associationOverride) {
- this.associationOverrideAnnotation = associationOverride;
- super.update();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getRelationshipReference().getValidationTextRange(astRoot);
- }
-
-// ********** join column owner adapter **********
-
- protected class JoinColumnOwner
- implements JavaJoinColumn.Owner
- {
-
- protected JoinColumnOwner() {
- super();
- }
-
- public String getDefaultTableName() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getTableName();
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public String getAttributeName() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getAttributeName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getPersistentAttribute();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getRelationshipSource();
- }
-
- public Entity getRelationshipTarget() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getRelationshipTargetEntity();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.candidateTableNames();
- }
-
- public Table getDbTable(String tableName) {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getReferencedColumnDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return false;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaJoinColumnInAssociationOverrideJoiningStrategy.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnUnresolvedNameMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnTableNotValidMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnUnresolvedReferencedColumnNameMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(getAssociationOverride(), column, textRange);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnJoiningStrategy.java
deleted file mode 100644
index 859d781ec6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinColumnJoiningStrategy.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnEnabledRelationshipReference;
-
-public class GenericJavaJoinColumnJoiningStrategy
- extends AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy
-{
-
- public GenericJavaJoinColumnJoiningStrategy(JavaJoinColumnEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public TypeMapping getRelationshipSource() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public TypeMapping getRelationshipTarget() {
- return getRelationshipTargetEntity();
- }
-
- @Override
- protected Entity getRelationshipTargetEntity() {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTableJoiningStrategy.java
deleted file mode 100644
index 1c458687c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,91 +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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaJoinTableJoiningStrategy
- extends AbstractJavaJoinTableJoiningStrategy
-{
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- public GenericJavaJoinTableJoiningStrategy(JavaJoinTableEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public boolean isOverridableAssociation() {
- return getJpaPlatformVariation().isJoinTableOverridable();
- }
-
- @Override
- public JavaJoinTableEnabledRelationshipReference getParent() {
- return (JavaJoinTableEnabledRelationshipReference) super.getParent();
- }
-
- @Override
- public JavaJoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return getRelationshipMapping().shouldValidateAgainstDatabase();
- }
-
-
- // **************** join table *********************************************
-
- @Override
- protected JoinTableAnnotation addAnnotation() {
- return (JoinTableAnnotation) this.resourcePersistentAttribute.
- addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
- @Override
- protected void removeAnnotation() {
- this.resourcePersistentAttribute.
- removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- public void initialize() {
- this.resourcePersistentAttribute =
- getRelationshipReference().getRelationshipMapping().
- getPersistentAttribute().getResourcePersistentAttribute();
- super.initialize();
- }
-
- @Override
- public void update() {
- this.resourcePersistentAttribute =
- getRelationshipReference().getRelationshipMapping().
- getPersistentAttribute().getResourcePersistentAttribute();
- super.update();
- }
-
- public JoinTableAnnotation getAnnotation() {
- return (JoinTableAnnotation) this.resourcePersistentAttribute.
- getNonNullAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getRelationshipReference().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyRelationshipReference.java
deleted file mode 100644
index 0844f8f36f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToManyRelationshipReference.java
+++ /dev/null
@@ -1,166 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaMappedByJoiningStrategy;
-import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaManyToManyRelationshipReference
- extends AbstractJavaRelationshipReference
- implements JavaManyToManyRelationshipReference
-{
- protected final JavaMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected final JavaJoinTableJoiningStrategy joinTableJoiningStrategy;
-
-
- public GenericJavaManyToManyRelationshipReference(JavaManyToManyMapping parent) {
- super(parent);
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
-
- protected JavaMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericJavaMappedByJoiningStrategy(this);
- }
-
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericJavaJoinTableJoiningStrategy(this);
- }
-
- @Override
- public JavaManyToManyMapping getRelationshipMapping() {
- return (JavaManyToManyMapping) getParent();
- }
-
- public OwnableRelationshipMappingAnnotation getMappingAnnotation() {
- return getRelationshipMapping().getMappingAnnotation();
- }
-
- public boolean isRelationshipOwner() {
- return this.getMappedByJoiningStrategy().getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.mappedByJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.joinTableJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** mapped by **********************************************
-
- public JavaMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public void setMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join table joining strategy ***************************
-
- public JavaJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public void setJoinTableJoiningStrategy() {
- // join table is default option, so no need to add to resource
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return getMappedByJoiningStrategy().getMappedByAttribute() == null;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy.initialize();
- this.joinTableJoiningStrategy.initialize();
- }
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
- this.joinTableJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mappedByJoiningStrategy.validate(messages, reporter, astRoot);
- this.joinTableJoiningStrategy.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneRelationshipReference.java
deleted file mode 100644
index 7373ddbba2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaManyToOneRelationshipReference.java
+++ /dev/null
@@ -1,37 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.NullJavaJoinTableJoiningStrategy;
-
-public class GenericJavaManyToOneRelationshipReference
- extends AbstractJavaManyToOneRelationshipReference
-{
-
- public GenericJavaManyToOneRelationshipReference(JavaManyToOneMapping parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new NullJavaJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- // the only joining strategy
- return this.joinColumnJoiningStrategy;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedByJoiningStrategy.java
deleted file mode 100644
index 6fe3a331a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaMappedByJoiningStrategy.java
+++ /dev/null
@@ -1,230 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-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 GenericJavaMappedByJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaMappedByJoiningStrategy
-{
- protected OwnableRelationshipMappingAnnotation mappingAnnotation;
-
- protected String mappedByAttribute;
-
-
- public GenericJavaMappedByJoiningStrategy(JavaOwnableRelationshipReference parent) {
- super(parent);
- }
-
-
- @Override
- public JavaOwnableRelationshipReference getParent() {
- return (JavaOwnableRelationshipReference) super.getParent();
- }
-
- public JavaOwnableRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public JavaRelationshipMapping getRelationshipMapping() {
- return getParent().getRelationshipMapping();
- }
-
- public String getTableName() {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? null : owner.getRelationshipReference().getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? null : owner.getRelationshipReference().getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? false : owner.getRelationshipReference().getPredominantJoiningStrategy().tableNameIsInvalid(tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- //this will not be called if getRelationshipOwner() is null
- return getRelationshipOwner().getRelationshipReference().getPredominantJoiningStrategy().getColumnTableNotValidDescription();
- }
-
- protected RelationshipMapping getRelationshipOwner() {
- return getRelationshipMapping().getRelationshipOwner();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean relationshipIsOwnedBy(RelationshipMapping otherMapping) {
- String thisEntity =
- (getRelationshipReference().getEntity()) == null ?
- null : getRelationshipReference().getEntity().getName();
- String otherTargetEntity =
- (otherMapping.getResolvedTargetEntity() == null) ?
- null : otherMapping.getResolvedTargetEntity().getName();
- return StringTools.stringsAreEqual(
- thisEntity,
- otherTargetEntity)
- && StringTools.stringsAreEqual(
- getMappedByAttribute(),
- otherMapping.getName());
- }
-
- public String getMappedByAttribute() {
- return this.mappedByAttribute;
- }
-
- public void setMappedByAttribute(String newMappedByAttribute) {
- String oldMappedByAttribute = this.mappedByAttribute;
- this.mappedByAttribute = newMappedByAttribute;
- this.mappingAnnotation.setMappedBy(newMappedByAttribute);
- firePropertyChanged(MAPPED_BY_ATTRIBUTE_PROPERTY, oldMappedByAttribute, newMappedByAttribute);
- }
-
- protected void setMappedByAttribute_(String newMappedByAttribute) {
- String oldMappedByAttribute = this.mappedByAttribute;
- this.mappedByAttribute = newMappedByAttribute;
- firePropertyChanged(MAPPED_BY_ATTRIBUTE_PROPERTY, oldMappedByAttribute, newMappedByAttribute);
- }
-
- public void addStrategy() {
- if (this.mappedByAttribute == null) {
- setMappedByAttribute(""); //$NON-NLS-1$
- }
- }
-
- public void removeStrategy() {
- if (this.mappedByAttribute != null) {
- setMappedByAttribute(null);
- }
- }
-
- public void initialize() {
- this.mappingAnnotation = this.getRelationshipReference().getMappingAnnotation();
- this.mappedByAttribute = this.mappingAnnotation.getMappedBy();
- }
-
- public void update() {
- this.mappingAnnotation = this.getRelationshipReference().getMappingAnnotation();
- setMappedByAttribute_(this.mappingAnnotation.getMappedBy());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mappingAnnotation.mappedByTouches(pos, astRoot)) {
- result = javaCandidateMappedByAttributeNames(filter);
- }
- return result;
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return getRelationshipMapping().allTargetEntityAttributeNames();
- }
-
- public Iterator<String> candidateMappedByAttributeNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateMappedByAttributeNames(), filter);
- }
-
- protected Iterator<String> javaCandidateMappedByAttributeNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateMappedByAttributeNames(filter));
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.mappingAnnotation.getMappedByTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- if (getMappedByAttribute() == null) {
- return;
- }
-
- Entity targetEntity = this.getRelationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return; // null target entity is validated elsewhere
- }
-
- AttributeMapping mappedByMapping = targetEntity.resolveAttributeMapping(this.mappedByAttribute);
-
- if (mappedByMapping == null) {
- messages.add(
- buildMessage(
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedByAttribute},
- astRoot));
- return;
- }
-
- if (! this.getRelationshipReference().mayBeMappedBy(mappedByMapping)) {
- messages.add(
- buildMessage(
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedByAttribute},
- astRoot));
- return;
- }
-
- // if mappedByMapping is not a relationship owner, then it should have
- // been flagged in above rule (mappedByIsValid)
- if (! ((RelationshipMapping) mappedByMapping).isRelationshipOwner()) {
- messages.add(buildMessage(
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- new String[] {this.mappedByAttribute},
- astRoot));
- }
- }
-
- protected IMessage buildMessage(String msgID, String[] params, CompilationUnit astRoot) {
- PersistentAttribute attribute = getRelationshipMapping().getPersistentAttribute();
- String attributeDesc = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
-
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- ArrayTools.add(params, 0, attributeDesc),
- this,
- this.getValidationTextRange(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneRelationshipReference.java
deleted file mode 100644
index a1cd310525..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaOneToOneRelationshipReference.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.java.NullJavaJoinTableJoiningStrategy;
-
-public class GenericJavaOneToOneRelationshipReference
- extends AbstractJavaOneToOneRelationshipReference
-{
-
- public GenericJavaOneToOneRelationshipReference(JavaOneToOneMapping parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new NullJavaJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.primaryKeyJoinColumnJoiningStrategy.primaryKeyJoinColumnsSize() > 0) {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index cf3cb4a94d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/GenericJavaPrimaryKeyJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,363 +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.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericJavaPrimaryKeyJoinColumnJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaPrimaryKeyJoinColumnJoiningStrategy
-{
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- protected final Vector<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = new Vector<JavaPrimaryKeyJoinColumn>();
- protected final JavaJoinColumn.Owner joinColumnOwner;
-
-
- public GenericJavaPrimaryKeyJoinColumnJoiningStrategy(
- JavaPrimaryKeyJoinColumnEnabledRelationshipReference parent) {
- super(parent);
- this.joinColumnOwner = this.buildJoinColumnOwner();
- }
-
- protected JavaJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- @Override
- public JavaPrimaryKeyJoinColumnEnabledRelationshipReference getParent() {
- return (JavaPrimaryKeyJoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public JavaPrimaryKeyJoinColumnEnabledRelationshipReference getRelationshipReference() {
- return getParent();
- }
-
- public JavaRelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public String getTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- protected TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY;
- }
-
- // **************** primary key join columns *******************************
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.primaryKeyJoinColumns);
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.primaryKeyJoinColumns.size();
- }
-
- public boolean hasPrimaryKeyJoinColumns() {
- return ! this.primaryKeyJoinColumns.isEmpty();
- }
-
- public JavaPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn pkJoinColumn =
- getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, this.joinColumnOwner);
- this.primaryKeyJoinColumns.add(index, pkJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAnnotation = addAnnotation(index);
- pkJoinColumn.initialize(pkJoinColumnAnnotation);
- fireItemAdded(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- return pkJoinColumn;
- }
-
- protected void addPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn joinColumn) {
- addItemToList(index, joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn joinColumn) {
- addPrimaryKeyJoinColumn(this.primaryKeyJoinColumns.size(), joinColumn);
- }
-
- public void removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn) {
- removePrimaryKeyJoinColumn(this.primaryKeyJoinColumns.indexOf(pkJoinColumn));
- }
-
- public void removePrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn pkJoinColumn = this.primaryKeyJoinColumns.remove(index);
- removeAnnotation(index);
- fireItemRemoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- protected void removePrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void movePrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.primaryKeyJoinColumns, targetIndex, sourceIndex);
- moveAnnotation(targetIndex, sourceIndex);
- fireItemMoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected PrimaryKeyJoinColumnAnnotation addAnnotation(int index) {
- return (PrimaryKeyJoinColumnAnnotation) this.resourcePersistentAttribute.
- addAnnotation(
- index,
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeAnnotation(int index) {
- this.resourcePersistentAttribute.
- removeAnnotation(
- index,
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- protected void moveAnnotation(int targetIndex, int sourceIndex) {
- this.resourcePersistentAttribute.
- moveAnnotation(
- targetIndex,
- sourceIndex,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
- }
-
- public void addStrategy() {
- if (primaryKeyJoinColumnsSize() == 0) {
- addPrimaryKeyJoinColumn(0);
- }
- }
-
- public void removeStrategy() {
- for (PrimaryKeyJoinColumn each : CollectionTools.iterable(primaryKeyJoinColumns())) {
- removePrimaryKeyJoinColumn(each);
- }
- }
-
-
- // **************** resource -> context ************************************
-
- public void initialize() {
- this.resourcePersistentAttribute =
- getRelationshipReference().getRelationshipMapping().
- getPersistentAttribute().getResourcePersistentAttribute();
- initializePrimaryKeyJoinColumns();
- }
-
- protected void initializePrimaryKeyJoinColumns() {
- Iterator<NestableAnnotation> annotations =
- this.resourcePersistentAttribute.annotations(
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- while (annotations.hasNext()) {
- this.primaryKeyJoinColumns.add(
- buildPrimaryKeyJoinColumn(
- (PrimaryKeyJoinColumnAnnotation) annotations.next()));
- }
- }
-
- public void update() {
- this.resourcePersistentAttribute =
- getRelationshipReference().getRelationshipMapping().
- getPersistentAttribute().getResourcePersistentAttribute();
- updatePrimaryKeyJoinColumns();
- }
-
- protected void updatePrimaryKeyJoinColumns() {
- ListIterator<JavaPrimaryKeyJoinColumn> joinColumns = primaryKeyJoinColumns();
- Iterator<NestableAnnotation> annotations =
- this.resourcePersistentAttribute.annotations(
- PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME,
- PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME);
-
- while (joinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn joinColumn = joinColumns.next();
- if (annotations.hasNext()) {
- joinColumn.update(
- (PrimaryKeyJoinColumnAnnotation) annotations.next());
- }
- else {
- removePrimaryKeyJoinColumn_(joinColumn);
- }
- }
-
- while (annotations.hasNext()) {
- addPrimaryKeyJoinColumn(
- buildPrimaryKeyJoinColumn(
- (PrimaryKeyJoinColumnAnnotation) annotations.next()));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(
- PrimaryKeyJoinColumnAnnotation annotation) {
- JavaPrimaryKeyJoinColumn joinColumn =
- getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, this.joinColumnOwner);
- joinColumn.initialize(annotation);
- return joinColumn;
- }
-
-
- // **************** Java completion proposals ******************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaPrimaryKeyJoinColumn column : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getRelationshipReference().getValidationTextRange(astRoot);
- }
-
-
- // ********** join column owner adapter **********
-
- protected class JoinColumnOwner
- implements JavaJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return GenericJavaPrimaryKeyJoinColumnJoiningStrategy.this.getTableName();
- }
-
- public Entity getRelationshipTarget() {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return getRelationshipMapping().getName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaPrimaryKeyJoinColumnJoiningStrategy.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity targetEntity = getRelationshipTarget();
- return (targetEntity == null) ? null : targetEntity.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return false;
- }
-
- public String getDefaultColumnName() {
- return null;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaPrimaryKeyJoinColumnJoiningStrategy.this.getValidationTextRange(astRoot);
- }
-
- public int joinColumnsSize() {
- return GenericJavaPrimaryKeyJoinColumnJoiningStrategy.this.primaryKeyJoinColumnsSize();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingDefinition.java
deleted file mode 100644
index 1f6ae3ca21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaBasicMappingDefinition.java
+++ /dev/null
@@ -1,59 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-
-public class JavaBasicMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaBasicMappingDefinition INSTANCE =
- new JavaBasicMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaBasicMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaBasicMapping(parent);
- }
-
- @Override
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.typeIsBasic();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableDefinition.java
deleted file mode 100644
index 2a94eab3b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddableDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-
-public class JavaEmbeddableDefinition
- extends AbstractJavaTypeMappingDefinition
-{
- // singleton
- private static final JavaEmbeddableDefinition INSTANCE =
- new JavaEmbeddableDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEmbeddableDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEmbeddable buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaEmbeddable(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingDefinition.java
deleted file mode 100644
index fe78cadb6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedIdMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-
-public class JavaEmbeddedIdMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEmbeddedIdMappingDefinition INSTANCE =
- new JavaEmbeddedIdMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singletong usage
- */
- private JavaEmbeddedIdMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedIdAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaEmbeddedIdMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingDefinition.java
deleted file mode 100644
index 5910a5327e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEmbeddedMappingDefinition.java
+++ /dev/null
@@ -1,59 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-
-public class JavaEmbeddedMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEmbeddedMappingDefinition INSTANCE =
- new JavaEmbeddedMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEmbeddedMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaEmbeddedMapping(parent);
- }
-
- @Override
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getEmbeddable() != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityDefinition.java
deleted file mode 100644
index 58df102ce8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-
-public class JavaEntityDefinition
- extends AbstractJavaTypeMappingDefinition
-{
- // singleton
- private static final JavaEntityDefinition INSTANCE =
- new JavaEntityDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEntityDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
- public JavaEntity buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaEntity(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityTextRangeResolver.java
deleted file mode 100644
index 29b3308447..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaEntityTextRangeResolver.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class JavaEntityTextRangeResolver
- implements PrimaryKeyTextRangeResolver
-{
- private JavaEntity entity;
-
- private CompilationUnit astRoot;
-
-
- public JavaEntityTextRangeResolver(JavaEntity entity, CompilationUnit astRoot) {
- this.entity = entity;
- this.astRoot = astRoot;
- }
-
-
- public TextRange getTypeMappingTextRange() {
- return this.entity.getValidationTextRange(this.astRoot);
- }
-
- public TextRange getIdClassTextRange() {
- return this.entity.getIdClassReference().getValidationTextRange(this.astRoot);
- }
-
- public TextRange getAttributeMappingTextRange(String attributeName) {
- return this.entity.getPersistentType().
- getAttributeNamed(attributeName).getMapping().getValidationTextRange(this.astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingDefinition.java
deleted file mode 100644
index 3e6e059340..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaIdMappingDefinition.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-
-public class JavaIdMappingDefinition
- extends AbstractJavaIdMappingDefinition
-{
- // singleton
- private static final JavaIdMappingDefinition INSTANCE =
- new JavaIdMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaIdMappingDefinition() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingDefinition.java
deleted file mode 100644
index e8e8382779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToManyMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-
-public class JavaManyToManyMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaManyToManyMappingDefinition INSTANCE =
- new JavaManyToManyMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaManyToManyMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ManyToManyAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaManyToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingDefinition.java
deleted file mode 100644
index 6eef2bbd55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaManyToOneMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-
-public class JavaManyToOneMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaManyToOneMappingDefinition INSTANCE =
- new JavaManyToOneMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaManyToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ManyToOneAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaManyToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassDefinition.java
deleted file mode 100644
index d14c61cb57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-
-public class JavaMappedSuperclassDefinition
- extends AbstractJavaTypeMappingDefinition
-{
- // singleton
- private static final JavaMappedSuperclassDefinition INSTANCE =
- new JavaMappedSuperclassDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaMappedSuperclassDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
- public JavaMappedSuperclass buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return factory.buildJavaMappedSuperclass(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassTextRangeResolver.java
deleted file mode 100644
index 35f5d8ae22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaMappedSuperclassTextRangeResolver.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class JavaMappedSuperclassTextRangeResolver
- implements PrimaryKeyTextRangeResolver
-{
- private JavaMappedSuperclass mappedSuperclass;
-
- private CompilationUnit astRoot;
-
-
- public JavaMappedSuperclassTextRangeResolver(
- JavaMappedSuperclass mappedSuperclass, CompilationUnit astRoot) {
-
- this.mappedSuperclass = mappedSuperclass;
- this.astRoot = astRoot;
- }
-
-
- public TextRange getTypeMappingTextRange() {
- return this.mappedSuperclass.getValidationTextRange(this.astRoot);
- }
-
- public TextRange getIdClassTextRange() {
- return this.mappedSuperclass.getIdClassReference().getValidationTextRange(this.astRoot);
- }
-
- public TextRange getAttributeMappingTextRange(String attributeName) {
- return this.mappedSuperclass.getPersistentType().
- getAttributeNamed(attributeName).getMapping().getValidationTextRange(this.astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java
deleted file mode 100644
index cbb5e22867..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaNullTypeMapping.java
+++ /dev/null
@@ -1,82 +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.core.internal.context.java;
-
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class JavaNullTypeMapping extends AbstractJavaTypeMapping
-{
- public JavaNullTypeMapping(JavaPersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- public String getKey() {
- return MappingKeys.NULL_TYPE_MAPPING_KEY;
- }
-
- public boolean isMapped() {
- return false;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-
- /**
- * We added this message here because the most likely solution is to add
- * an annotation to the .java file.
- * This message used to be found on the <class> tag in persistence.xml.
- * The other possible way to fix the error is to remove it from persistence.xml.
- * This can be accomplished with the Synchronize Classes action.
- * We could also add a quick fix for this error.
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_INVALID_CLASS,
- new String[] {this.getPersistentType().getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getPersistentType().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingDefinition.java
deleted file mode 100644
index 019d6f8c3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToManyMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-
-public class JavaOneToManyMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaOneToManyMappingDefinition INSTANCE =
- new JavaOneToManyMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaOneToManyMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaOneToManyMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingDefinition.java
deleted file mode 100644
index c785d6cf0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-public class JavaOneToOneMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaOneToOneMappingDefinition INSTANCE =
- new JavaOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaOneToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingDefinition.java
deleted file mode 100644
index 197f4e9512..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaTransientMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-
-public class JavaTransientMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaTransientMappingDefinition INSTANCE =
- new JavaTransientMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return TransientAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaTransientMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingDefinition.java
deleted file mode 100644
index dc674b492a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaVersionMappingDefinition.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-
-public class JavaVersionMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaVersionMappingDefinition INSTANCE =
- new JavaVersionMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaVersionMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return VersionAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return factory.buildJavaVersionMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideAnnotation.java
deleted file mode 100644
index debfe67de5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,95 +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.core.internal.context.java;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public abstract class VirtualAssociationOverrideAnnotation
- extends VirtualOverrideAnnotation
- implements AssociationOverrideAnnotation
-{
- protected JoiningStrategy joiningStrategy;
-
- private final Vector<JoinColumnAnnotation> joinColumns;
-
- protected VirtualAssociationOverrideAnnotation(JavaResourcePersistentMember parent, String name, JoiningStrategy joiningStrategy) {
- super(parent, name);
- this.joiningStrategy = joiningStrategy;
- this.joinColumns = this.buildJoinColumns();
- }
-
- protected Vector<JoinColumnAnnotation> buildJoinColumns() {
- if (this.joiningStrategy instanceof JoinColumnJoiningStrategy) {
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(((JoinColumnJoiningStrategy) this.joiningStrategy).joinColumnsSize());
- for (JoinColumn joinColumn : CollectionTools.iterable(((JoinColumnJoiningStrategy) this.joiningStrategy).joinColumns())) {
- result.add(new VirtualAssociationOverrideJoinColumnAnnotation(this, joinColumn));
- }
- return result;
- }
- return new Vector<JoinColumnAnnotation>();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected AssociationOverrideAnnotation addAnnotation() {
- return (AssociationOverrideAnnotation) super.addAnnotation();
- }
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return this.joinColumns.listIterator();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.elementAt(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- //Rebuilt every time so no need to implement update()
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideJoinColumnAnnotation.java
deleted file mode 100644
index b782216bfb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAssociationOverrideJoinColumnAnnotation.java
+++ /dev/null
@@ -1,127 +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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.internal.resource.java.NullBaseColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- */
-public final class VirtualAssociationOverrideJoinColumnAnnotation extends NullBaseColumnAnnotation
- implements JoinColumnAnnotation
-{
- private JoinColumn joinColumn;
-
- public VirtualAssociationOverrideJoinColumnAnnotation(Annotation parent, JoinColumn joinColumn) {
- super(parent);
- this.joinColumn = joinColumn;
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected JoinColumnAnnotation addAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getName() {
- return this.joinColumn.getSpecifiedName();
- }
-
- @Override
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- public String getReferencedColumnName() {
- return this.joinColumn.getSpecifiedReferencedColumnName();
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- @Override
- public String getColumnDefinition() {
- return this.joinColumn.getColumnDefinition();
- }
-
- @Override
- public void setColumnDefinition(String columnDefinition) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getTable() {
- return this.joinColumn.getSpecifiedTable();
- }
-
- @Override
- public void setTable(String table) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Boolean getInsertable() {
- return this.joinColumn.getSpecifiedInsertable();
- }
-
- @Override
- public void setInsertable(Boolean insertable) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Boolean getUpdatable() {
- return this.joinColumn.getSpecifiedUpdatable();
- }
-
- @Override
- public void setUpdatable(Boolean updatable) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Boolean getNullable() {
- return this.joinColumn.getSpecifiedNullable();
- }
-
- @Override
- public void setNullable(Boolean nullable) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Boolean getUnique() {
- return this.joinColumn.getSpecifiedUnique();
- }
-
- @Override
- public void setUnique(Boolean unique) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideAnnotation.java
deleted file mode 100644
index 25e71fa18e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public class VirtualAttributeOverrideAnnotation
- extends VirtualOverrideAnnotation
- implements AttributeOverrideAnnotation
-{
- private final VirtualAttributeOverrideColumnAnnotation column;
-
-
- public VirtualAttributeOverrideAnnotation(JavaResourcePersistentMember parent, String name, Column column) {
- super(parent, name);
- this.column = new VirtualAttributeOverrideColumnAnnotation(this, column);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected AttributeOverrideAnnotation addAnnotation() {
- return (AttributeOverrideAnnotation) super.addAnnotation();
- }
-
- // ****** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return this.getColumn();
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumnAnnotation.java
deleted file mode 100644
index 89ebcab07c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualAttributeOverrideColumnAnnotation.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.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverrideColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-
-/**
- * javax.persistence.Column
- */
-public class VirtualAttributeOverrideColumnAnnotation
- extends NullAttributeOverrideColumnAnnotation
-{
- private Column column;
-
- public VirtualAttributeOverrideColumnAnnotation(AttributeOverrideAnnotation parent, Column column) {
- super(parent);
- this.column = column;
- }
-
- @Override
- public String getName() {
- return this.column.getSpecifiedName();
- }
-
- @Override
- public String getColumnDefinition() {
- return this.column.getColumnDefinition();
- }
-
- @Override
- public String getTable() {
- return this.column.getSpecifiedTable();
- }
-
- @Override
- public Boolean getInsertable() {
- return this.column.getSpecifiedInsertable();
- }
-
- @Override
- public Boolean getUpdatable() {
- return this.column.getSpecifiedUpdatable();
- }
-
- @Override
- public Boolean getNullable() {
- return this.column.getSpecifiedNullable();
- }
-
- @Override
- public Boolean getUnique() {
- return this.column.getSpecifiedUnique();
- }
-
- @Override
- public Integer getLength() {
- return this.column.getSpecifiedLength();
- }
-
- @Override
- public Integer getScale() {
- return this.column.getSpecifiedScale();
- }
-
- @Override
- public Integer getPrecision() {
- return this.column.getSpecifiedPrecision();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualOverrideAnnotation.java
deleted file mode 100644
index 01f16152ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/VirtualOverrideAnnotation.java
+++ /dev/null
@@ -1,64 +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.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common behavior for virtual versions of
- * javax.persistence.AttributeOverride
- * and
- * javax.persistence.AssociationOverride
- */
-public abstract class VirtualOverrideAnnotation
- extends NullAnnotation
- implements OverrideAnnotation
-{
- private final String name;
-
- public VirtualOverrideAnnotation(JavaResourcePersistentMember parent, String name) {
- super(parent);
- this.name = name;
- }
-
- @Override
- protected OverrideAnnotation addAnnotation() {
- return (OverrideAnnotation) super.addAnnotation();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- 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;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractEntityMappings.java
deleted file mode 100644
index 8a17c88245..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractEntityMappings.java
+++ /dev/null
@@ -1,822 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmGenerator;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>orm.xml</code> file
- * <br>
- * <code>entity-mappings</code> element
- */
-public abstract class AbstractEntityMappings
- extends AbstractOrmXmlContextNode
- implements EntityMappings
-{
- protected final XmlEntityMappings xmlEntityMappings;
-
- protected String description;
-
- protected String package_;
-
- protected AccessType specifiedAccess;
- protected AccessType defaultAccess;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected final PersistenceUnitMetadata persistenceUnitMetadata;
-
- protected final List<OrmPersistentType> persistentTypes;
-
- protected final List<OrmSequenceGenerator> sequenceGenerators;
-
- protected final List<OrmTableGenerator> tableGenerators;
-
- protected final OrmQueryContainer queryContainer;
-
-
- protected AbstractEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- super(parent);
- this.xmlEntityMappings = xmlEntityMappings;
- this.persistentTypes = new ArrayList<OrmPersistentType>();
- this.sequenceGenerators = new ArrayList<OrmSequenceGenerator>();
- this.tableGenerators = new ArrayList<OrmTableGenerator>();
- this.queryContainer = this.getXmlContextNodeFactory().buildOrmQueryContainer(this, xmlEntityMappings);
-
- this.persistenceUnitMetadata = this.buildPersistenceUnitMetadata();
- this.description = this.xmlEntityMappings.getDescription();
- this.package_ = this.xmlEntityMappings.getPackage();
-
- this.defaultAccess = this.getPersistenceUnit().getDefaultAccess();
- this.specifiedAccess = this.getResourceAccess();
-
- this.defaultCatalog = this.getPersistenceUnit().getDefaultCatalog();
- this.specifiedCatalog = this.xmlEntityMappings.getCatalog();
-
- this.defaultSchema = this.getPersistenceUnit().getDefaultSchema();
- this.specifiedSchema = this.xmlEntityMappings.getSchema();
-
- this.initializePersistentTypes();
- this.initializeTableGenerators();
- this.initializeSequenceGenerators();
- }
-
- protected PersistenceUnitMetadata buildPersistenceUnitMetadata() {
- return this.getXmlContextNodeFactory().buildPersistenceUnitMetadata(this);
- }
-
- protected OrmPersistentType buildPersistentType(XmlTypeMapping resourceMapping) {
- return this.getXmlContextNodeFactory().buildOrmPersistentType(this, resourceMapping);
- }
-
- // **************** JpaNode impl *******************************************
-
- @Override
- public OrmXml getParent() {
- return (OrmXml) super.getParent();
- }
-
- protected OrmXml getOrmXml() {
- return this.getParent();
- }
-
-
- // **************** JpaContextNode impl ************************************
-
- @Override
- public MappingFileRoot getMappingFileRoot() {
- return this;
- }
-
-
- // **************** JpaStructureNode impl **********************************
-
- public String getId() {
- return OrmStructureNodes.ENTITY_MAPPINGS_ID;
- }
-
-
- // ********** PersistentType.Owner implementation **********
-
- public AccessType getOverridePersistentTypeAccess() {
- return this.isXmlMappingMetadataComplete() ? this.getSpecifiedAccess() : null;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- return getAccess();
- }
-
- public String getDefaultPersistentTypePackage() {
- return getPackage();
- }
-
- protected boolean isXmlMappingMetadataComplete() {
- return this.persistenceUnitMetadata.isXmlMappingMetadataComplete();
- }
-
- public boolean isDefaultPersistentTypeMetadataComplete() {
- return this.isXmlMappingMetadataComplete();
- }
-
-
- // **************** EntityMappings impl ************************************
-
- public XmlEntityMappings getXmlEntityMappings() {
- return this.xmlEntityMappings;
- }
-
- public void changeMapping(OrmPersistentType ormPersistentType, OrmTypeMapping oldMapping, OrmTypeMapping newMapping) {
- AccessType savedAccess = ormPersistentType.getSpecifiedAccess();
- ormPersistentType.dispose();
- int sourceIndex = this.persistentTypes.indexOf(ormPersistentType);
- this.persistentTypes.remove(sourceIndex);
- oldMapping.removeFromResourceModel(this.xmlEntityMappings);
- int targetIndex = insertionIndex(ormPersistentType);
- this.persistentTypes.add(targetIndex, ormPersistentType);
- newMapping.addToResourceModel(this.xmlEntityMappings);
-
- newMapping.initializeFrom(oldMapping);
- //not sure where else to put this, need to set the access on the resource model
- ormPersistentType.setSpecifiedAccess(savedAccess);
- fireItemMoved(PERSISTENT_TYPES_LIST, targetIndex, sourceIndex);
- }
-
- public OrmPersistentType getPersistentType(String fullyQualifiedTypeName) {
- for (OrmPersistentType ormPersistentType : this.getPersistentTypes()) {
- if (ormPersistentType.isFor(fullyQualifiedTypeName)) {
- return ormPersistentType;
- }
- }
- return null;
- }
-
- public boolean containsPersistentType(String fullyQualifiedTypeName) {
- return getPersistentType(fullyQualifiedTypeName) != null;
- }
-
- public PersistentType resolvePersistentType(String className) {
- if (className == null) {
- return null;
- }
-
- //static inner class listed in orm.xml will use '$', replace with '.'
- className = className.replace('$', '.');
-
- // first try to resolve using only the locally specified name...
- PersistentType mapKeyPersistentType = getPersistenceUnit().getPersistentType(className);
- if (mapKeyPersistentType != null) {
- return mapKeyPersistentType;
- }
-
- // ...then try to resolve by prepending the global package name
- if (getPackage() == null) {
- return null;
- }
- return getPersistenceUnit().getPersistentType(getPackage() + '.' + className);
- }
-
- public JavaResourcePersistentType resolveJavaResourcePersistentType(String className) {
- if (className == null) {
- return null;
- }
-
- //static inner class listed in orm.xml will use '$', replace with '.'
- className = className.replace('$', '.');
-
- // first try to resolve using only the locally specified name...
- JavaResourcePersistentType jrpt = getJpaProject().getJavaResourcePersistentType(className);
- if (jrpt != null) {
- return jrpt;
- }
-
- // ...then try to resolve by prepending the global package name
- if (getPackage() == null) {
- return null;
- }
- return getJpaProject().getJavaResourcePersistentType(getPackage() + '.' + className);
- }
-
- public PersistenceUnitMetadata getPersistenceUnitMetadata() {
- return this.persistenceUnitMetadata;
- }
-
- public String getPackage() {
- return this.package_;
- }
-
- public void setPackage(String newPackage) {
- String oldPackage = this.package_;
- this.package_ = newPackage;
- this.xmlEntityMappings.setPackage(newPackage);
- firePropertyChanged(PACKAGE_PROPERTY, oldPackage, newPackage);
- }
-
- public String getVersion() {
- return this.xmlEntityMappings.getVersion();
- }
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String newDescription) {
- String oldDescription = this.description;
- this.description = newDescription;
- this.xmlEntityMappings.setDescription(newDescription);
- firePropertyChanged(DESCRIPTION_PROPERTY, oldDescription, newDescription);
- }
-
-
- // ********** access **********
-
- public AccessType getAccess() {
- return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType access) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.xmlEntityMappings.setAccess(AccessType.toOrmResourceModel(access));
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType access) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = access;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, access);
- }
-
-
- // ********** schema **********
-
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.xmlEntityMappings.setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
-
- // ********** catalog **********
-
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.xmlEntityMappings.setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
-
- // ********** schema container **********
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
-
- // ********** ORM persistent types **********
-
- public ListIterator<OrmPersistentType> persistentTypes() {
- return new CloneListIterator<OrmPersistentType>(this.persistentTypes);
- }
-
- public ListIterable<OrmPersistentType> getPersistentTypes() {
- return new LiveCloneListIterable<OrmPersistentType>(this.persistentTypes);
- }
-
- public int getPersistentTypesSize() {
- return this.persistentTypes.size();
- }
-
- public OrmPersistentType addPersistentType(String mappingKey, String className) {
- OrmTypeMappingDefinition mappingDefinition =
- getMappingFileDefinition().getOrmTypeMappingDefinition(mappingKey);
- XmlTypeMapping typeMapping =
- mappingDefinition.buildResourceMapping(getResourceNodeFactory());
- OrmPersistentType persistentType = buildPersistentType(typeMapping);
- int index = insertionIndex(persistentType);
- this.persistentTypes.add(index, persistentType);
- if (className.startsWith(getPackage() + '.')) {
- // adds short name if package name is specified
- className = className.substring(getPackage().length() + 1);
- }
- persistentType.getMapping().addToResourceModel(this.xmlEntityMappings);
- typeMapping.setClassName(className);
- fireItemAdded(PERSISTENT_TYPES_LIST, index, persistentType);
- return persistentType;
- }
-
- protected int insertionIndex(OrmPersistentType ormPersistentType) {
- return CollectionTools.insertionIndexOf(this.persistentTypes, ormPersistentType, MAPPING_COMPARATOR);
- }
-
- protected static final Comparator<OrmPersistentType> MAPPING_COMPARATOR =
- new Comparator<OrmPersistentType>() {
- public int compare(OrmPersistentType o1, OrmPersistentType o2) {
- int o1Sequence = o1.getMapping().getXmlSequence();
- int o2Sequence = o2.getMapping().getXmlSequence();
- if (o1Sequence < o2Sequence) {
- return -1;
- }
- if (o1Sequence == o2Sequence) {
- return 0;
- }
- return 1;
- }
- };
-
- public void removePersistentType(int index) {
- OrmPersistentType persistentType = this.persistentTypes.get(index);
- persistentType.dispose();
- this.persistentTypes.remove(index);
- persistentType.getMapping().removeFromResourceModel(this.xmlEntityMappings);
- fireItemRemoved(PERSISTENT_TYPES_LIST, index, persistentType);
- }
-
- public void removePersistentType(OrmPersistentType persistentType) {
- removePersistentType(this.persistentTypes.indexOf(persistentType));
- }
-
- protected void removePersistentType_(OrmPersistentType persistentType) {
- persistentType.dispose();
- removeItemFromList(persistentType, this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
- protected void movePersistentType_(int index, OrmPersistentType persistentType) {
- moveItemInList(index, this.persistentTypes.indexOf(persistentType), this.persistentTypes, PERSISTENT_TYPES_LIST);
- }
-
-
- // ********** sequence generators **********
-
- public ListIterable<OrmSequenceGenerator> getSequenceGenerators() {
- return new LiveCloneListIterable<OrmSequenceGenerator>(this.sequenceGenerators);
- }
-
- public int getSequenceGeneratorsSize() {
- return this.sequenceGenerators.size();
- }
-
- public OrmSequenceGenerator addSequenceGenerator(int index) {
- XmlSequenceGenerator resourceSequenceGenerator = this.buildResourceSequenceGenerator();
- OrmSequenceGenerator contextSequenceGenerator = this.buildSequenceGenerator(resourceSequenceGenerator);
- this.sequenceGenerators.add(index, contextSequenceGenerator);
- this.xmlEntityMappings.getSequenceGenerators().add(index, resourceSequenceGenerator);
- fireItemAdded(SEQUENCE_GENERATORS_LIST, index, contextSequenceGenerator);
- return contextSequenceGenerator;
- }
-
- protected void addSequenceGenerator(int index, OrmSequenceGenerator sequenceGenerator) {
- addItemToList(index, sequenceGenerator, this.sequenceGenerators, EntityMappings.SEQUENCE_GENERATORS_LIST);
- }
-
- protected void addSequenceGenerator(OrmSequenceGenerator sequenceGenerator) {
- this.addSequenceGenerator(this.sequenceGenerators.size(), sequenceGenerator);
- }
-
- public void removeSequenceGenerator(OrmSequenceGenerator sequenceGenerator) {
- removeSequenceGenerator(this.sequenceGenerators.indexOf(sequenceGenerator));
- }
-
- public void removeSequenceGenerator(int index) {
- OrmSequenceGenerator removedSequenceGenerator = this.sequenceGenerators.remove(index);
- fireItemRemoved(SEQUENCE_GENERATORS_LIST, index, removedSequenceGenerator);
- this.xmlEntityMappings.getSequenceGenerators().remove(index);
- }
-
- protected void removeSequenceGenerator_(OrmSequenceGenerator sequenceGenerator) {
- removeItemFromList(sequenceGenerator, this.sequenceGenerators, EntityMappings.SEQUENCE_GENERATORS_LIST);
- }
-
- public void moveSequenceGenerator(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.sequenceGenerators, targetIndex, sourceIndex);
- this.xmlEntityMappings.getSequenceGenerators().move(targetIndex, sourceIndex);
- fireItemMoved(EntityMappings.SEQUENCE_GENERATORS_LIST, targetIndex, sourceIndex);
- }
-
- protected XmlSequenceGenerator buildResourceSequenceGenerator() {
- return OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- }
-
- // ********** table generators **********
-
- public ListIterable<OrmTableGenerator> getTableGenerators() {
- return new LiveCloneListIterable<OrmTableGenerator>(this.tableGenerators);
- }
-
- public int getTableGeneratorsSize() {
- return this.tableGenerators.size();
- }
-
- public OrmTableGenerator addTableGenerator(int index) {
- XmlTableGenerator resourceTableGenerator = buildResourceTableGenerator();
- OrmTableGenerator contextTableGenerator = buildTableGenerator(resourceTableGenerator);
- this.tableGenerators.add(index, contextTableGenerator);
- this.xmlEntityMappings.getTableGenerators().add(index, resourceTableGenerator);
- fireItemAdded(TABLE_GENERATORS_LIST, index, contextTableGenerator);
- return contextTableGenerator;
- }
-
- protected void addTableGenerator(int index, OrmTableGenerator tableGenerator) {
- addItemToList(index, tableGenerator, this.tableGenerators, EntityMappings.TABLE_GENERATORS_LIST);
- }
-
- protected void addTableGenerator(OrmTableGenerator tableGenerator) {
- this.addTableGenerator(this.tableGenerators.size(), tableGenerator);
- }
-
- public void removeTableGenerator(OrmTableGenerator tableGenerator) {
- removeTableGenerator(this.tableGenerators.indexOf(tableGenerator));
- }
-
- public void removeTableGenerator(int index) {
- OrmTableGenerator removedTableGenerator = this.tableGenerators.remove(index);
- this.xmlEntityMappings.getTableGenerators().remove(index);
- fireItemRemoved(TABLE_GENERATORS_LIST, index, removedTableGenerator);
- }
-
- protected void removeTableGenerator_(OrmTableGenerator tableGenerator) {
- removeItemFromList(tableGenerator, this.tableGenerators, EntityMappings.TABLE_GENERATORS_LIST);
- }
-
- public void moveTableGenerator(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.tableGenerators, targetIndex, sourceIndex);
- this.xmlEntityMappings.getTableGenerators().move(targetIndex, sourceIndex);
- fireItemMoved(EntityMappings.TABLE_GENERATORS_LIST, targetIndex, sourceIndex);
- }
-
- protected XmlTableGenerator buildResourceTableGenerator() {
- return OrmFactory.eINSTANCE.createXmlTableGenerator();
- }
-
-
- // ********** named queries **********
- public OrmQueryContainer getQueryContainer() {
- return this.queryContainer;
- }
-
-
- // ********** misc **********
-
- public OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return this.persistenceUnitMetadata.getPersistenceUnitDefaults();
- }
-
-
- // ********** initialization **********
-
- protected void initializePersistentTypes() {
- for (XmlTypeMapping typeMapping : this.xmlEntityMappings.getTypeMappings()) {
- addPersistentType(typeMapping);
- }
- }
-
- protected void initializeTableGenerators() {
- for (XmlTableGenerator tableGenerator : this.xmlEntityMappings.getTableGenerators()) {
- this.tableGenerators.add(buildTableGenerator(tableGenerator));
- }
- }
-
- protected void initializeSequenceGenerators() {
- for (XmlSequenceGenerator sequenceGenerator : this.xmlEntityMappings.getSequenceGenerators()) {
- this.sequenceGenerators.add(buildSequenceGenerator(sequenceGenerator));
- }
- }
-
-
- // ********** update **********
-
- public void update() {
- this.setDescription(this.xmlEntityMappings.getDescription());
- this.setPackage(this.xmlEntityMappings.getPackage());
-
- this.setDefaultAccess(this.getPersistenceUnit().getDefaultAccess());
- this.setSpecifiedAccess(this.getResourceAccess());
-
- this.setDefaultCatalog(this.getPersistenceUnit().getDefaultCatalog());
- this.setSpecifiedCatalog(this.xmlEntityMappings.getCatalog());
-
- this.setDefaultSchema(this.getPersistenceUnit().getDefaultSchema());
- this.setSpecifiedSchema(this.xmlEntityMappings.getSchema());
-
- this.persistenceUnitMetadata.update();
- this.updatePersistentTypes();
- this.updateTableGenerators();
- this.updateSequenceGenerators();
- getQueryContainer().update();
- }
-
- protected AccessType getResourceAccess() {
- return AccessType.fromOrmResourceModel(this.xmlEntityMappings.getAccess());
- }
-
- protected void updatePersistentTypes() {
- Collection<OrmPersistentType> contextTypesToRemove = CollectionTools.collection(persistentTypes());
- Collection<OrmPersistentType> contextTypesToUpdate = new ArrayList<OrmPersistentType>();
- int resourceIndex = 0;
-
- List<XmlTypeMapping> xmlTypeMappings = this.xmlEntityMappings.getTypeMappings();
- for (XmlTypeMapping xmlTypeMapping : xmlTypeMappings.toArray(new XmlTypeMapping[xmlTypeMappings.size()])) {
- boolean contextAttributeFound = false;
- for (OrmPersistentType contextType : contextTypesToRemove) {
- if (contextType.getMapping().getResourceTypeMapping() == xmlTypeMapping) {
- movePersistentType_(resourceIndex, contextType);
- contextTypesToRemove.remove(contextType);
- contextTypesToUpdate.add(contextType);
- contextAttributeFound = true;
- break;
- }
- }
- if (!contextAttributeFound) {
- OrmPersistentType ormPersistentType = addPersistentType(xmlTypeMapping);
- fireItemAdded(PERSISTENT_TYPES_LIST, getPersistentTypesSize(), ormPersistentType);
- }
- resourceIndex++;
- }
- for (OrmPersistentType contextType : contextTypesToRemove) {
- removePersistentType_(contextType);
- }
- //first handle adding/removing of the persistent types, then update the others last,
- //this causes less churn in the update process
- for (OrmPersistentType contextType : contextTypesToUpdate) {
- contextType.update();
- }
- }
-
- //not firing change notification so this can be reused in initialize and update
- protected OrmPersistentType addPersistentType(XmlTypeMapping resourceMapping) {
- OrmPersistentType ormPersistentType = buildPersistentType(resourceMapping);
- this.persistentTypes.add(ormPersistentType);
- return ormPersistentType;
- }
-
- protected void updateTableGenerators() {
- // make a copy of the XML generators (to prevent ConcurrentModificationException)
- Iterator<XmlTableGenerator> xmlGenerators = new CloneIterator<XmlTableGenerator>(this.xmlEntityMappings.getTableGenerators());
-
- for (OrmTableGenerator contextGenerator : this.getTableGenerators()) {
- if (xmlGenerators.hasNext()) {
- contextGenerator.update(xmlGenerators.next());
- } else {
- this.removeTableGenerator_(contextGenerator);
- }
- }
-
- while (xmlGenerators.hasNext()) {
- addTableGenerator(buildTableGenerator(xmlGenerators.next()));
- }
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator resourceTableGenerator) {
- return getXmlContextNodeFactory().buildOrmTableGenerator(this, resourceTableGenerator);
- }
-
- protected void updateSequenceGenerators() {
- // make a copy of the XML sequence generators (to prevent ConcurrentModificationException)
- Iterator<XmlSequenceGenerator> xmlSequenceGenerators = new CloneIterator<XmlSequenceGenerator>(this.xmlEntityMappings.getSequenceGenerators());//prevent ConcurrentModificiationException
-
- for (OrmSequenceGenerator contextSequenceGenerator : this.getSequenceGenerators()) {
- if (xmlSequenceGenerators.hasNext()) {
- contextSequenceGenerator.update(xmlSequenceGenerators.next());
- }
- else {
- removeSequenceGenerator_(contextSequenceGenerator);
- }
- }
-
- while (xmlSequenceGenerators.hasNext()) {
- addSequenceGenerator(buildSequenceGenerator(xmlSequenceGenerators.next()));
- }
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator resourceSequenceGenerator) {
- return getXmlContextNodeFactory().buildOrmSequenceGenerator(this, resourceSequenceGenerator);
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- for (PersistentType persistentType : this.getPersistentTypes()) {
- persistentType.postUpdate();
- }
- }
-
- // ********** text **********
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (OrmPersistentType persistentType: this.getPersistentTypes()) {
- if (persistentType.contains(textOffset)) {
- return persistentType.getStructureNode(textOffset);
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.xmlEntityMappings != null) && this.xmlEntityMappings.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return this.xmlEntityMappings.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateVersion(messages);
- this.validateGenerators(messages);
- this.queryContainer.validate(messages, reporter);
- for (OrmPersistentType ormPersistentType : this.getPersistentTypes()) {
- this.validatePersistentType(ormPersistentType, messages, reporter);
- }
- }
-
- protected void validateVersion(List<IMessage> messages) {
- if (! latestDocumentVersion().equals(this.xmlEntityMappings.getVersion())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- JpaValidationMessages.XML_VERSION_NOT_LATEST,
- this,
- this.xmlEntityMappings.getVersionTextRange()));
- }
- }
-
- /**
- * Return the latest version of the document supported by the platform
- */
- protected abstract String latestDocumentVersion();
-
- protected void validateGenerators(List<IMessage> messages) {
- for (OrmGenerator localGenerator : this.getGenerators()) {
- for (Iterator<Generator> globalGenerators = this.getPersistenceUnit().generators(); globalGenerators.hasNext(); ) {
- if (localGenerator.duplicates(globalGenerators.next())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.GENERATOR_DUPLICATE_NAME,
- new String[] {localGenerator.getName()},
- localGenerator,
- localGenerator.getNameTextRange()
- )
- );
- }
- }
- }
- }
-
- /**
- * Return all the generators, table and sequence.
- */
- @SuppressWarnings("unchecked")
- protected Iterable<OrmGenerator> getGenerators() {
- return new CompositeIterable<OrmGenerator>(
- this.getTableGenerators(),
- this.getSequenceGenerators()
- );
- }
-
-
- protected void validatePersistentType(OrmPersistentType persistentType, List<IMessage> messages, IReporter reporter) {
- try {
- persistentType.validate(messages, reporter);
- } catch (Throwable exception) {
- JptCorePlugin.log(exception);
- }
- }
-
-
- // ********** dispose **********
-
- public void dispose() {
- for (OrmPersistentType ormPersistentType : this.getPersistentTypes()) {
- ormPersistentType.dispose();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAssociationOverrideRelationshipReference.java
deleted file mode 100644
index de18403841..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAssociationOverrideRelationshipReference.java
+++ /dev/null
@@ -1,160 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnInAssociationOverrideJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmAssociationOverrideRelationshipReference extends AbstractOrmXmlContextNode
- implements OrmAssociationOverrideRelationshipReference
-{
-
- // cache the strategy for property change notification
- protected JoiningStrategy cachedPredominantJoiningStrategy;
-
- protected OrmJoinColumnInAssociationOverrideJoiningStrategy joinColumnJoiningStrategy;
-
- protected AbstractOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, XmlAssociationOverride xao) {
- super(parent);
- this.initializeJoiningStrategies(xao);
- }
-
- protected OrmJoinColumnInAssociationOverrideJoiningStrategy buildJoinColumnJoiningStrategy(XmlAssociationOverride xao) {
- return new GenericOrmJoinColumnInAssociationOverrideJoiningStrategy(this, xao);
- }
-
- public void initializeFrom(AssociationOverrideRelationshipReference oldAssociationOverride) {
- if (oldAssociationOverride.getJoinColumnJoiningStrategy().hasSpecifiedJoinColumns()) {
- getJoinColumnJoiningStrategy().initializeFrom(oldAssociationOverride.getJoinColumnJoiningStrategy());
- }
- }
-
- @Override
- public OrmAssociationOverride getParent() {
- return (OrmAssociationOverride) super.getParent();
- }
-
- public OrmAssociationOverride getAssociationOverride() {
- return getParent();
- }
-
- public TypeMapping getTypeMapping() {
- return getAssociationOverride().getOwner().getTypeMapping();
- }
-
- public Entity getEntity() {
- TypeMapping typeMapping = getTypeMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean isParentVirtual() {
- return getAssociationOverride().isVirtual();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
- // **************** predominant joining strategy ***************************
-
- public JoiningStrategy getPredominantJoiningStrategy() {
- return this.cachedPredominantJoiningStrategy;
- }
-
- protected void setPredominantJoiningStrategy(JoiningStrategy newJoiningStrategy) {
- JoiningStrategy oldJoiningStrategy = this.cachedPredominantJoiningStrategy;
- this.cachedPredominantJoiningStrategy = newJoiningStrategy;
- firePropertyChanged(PREDOMINANT_JOINING_STRATEGY_PROPERTY, oldJoiningStrategy, newJoiningStrategy);
- }
-
- protected void initialize(XmlAssociationOverride associationOverride) {
- initializeJoiningStrategies(associationOverride);
- this.cachedPredominantJoiningStrategy = calculatePredominantJoiningStrategy();
- }
-
- protected void initializeJoiningStrategies(XmlAssociationOverride xao) {
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy(xao);
- }
-
- public void update(XmlAssociationOverride associationOverride) {
- updateJoiningStrategies(associationOverride);
- setPredominantJoiningStrategy(calculatePredominantJoiningStrategy());
- }
-
- protected void updateJoiningStrategies(XmlAssociationOverride associationOverride) {
- this.joinColumnJoiningStrategy.update(associationOverride);
- }
-
- protected abstract JoiningStrategy calculatePredominantJoiningStrategy();
-
- // **************** join columns *******************************************
-
-
- public OrmJoinColumnInAssociationOverrideJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.addStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return false;
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return getAssociationOverride().getOwner().getRelationshipMapping(getAssociationOverride().getName());
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return getRelationshipMapping().isOwnedBy(mapping);
- }
-
- public boolean isRelationshipOwner() {
- return getRelationshipMapping().isRelationshipOwner();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.joinColumnJoiningStrategy.validate(messages, reporter);
- }
-
- public TextRange getValidationTextRange() {
- return getAssociationOverride().getValidationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java
deleted file mode 100644
index ed650203bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmAttributeMapping.java
+++ /dev/null
@@ -1,386 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.ColumnMapping;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmBaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.SimpleMetamodelField;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.AttributeMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmAttributeMapping<T extends XmlAttributeMapping>
- extends AbstractOrmXmlContextNode
- implements OrmAttributeMapping, AttributeMapping2_0
-{
- protected String name;
-
- protected final T resourceAttributeMapping;
-
- protected AbstractOrmAttributeMapping(OrmPersistentAttribute parent, T resourceAttributeMapping) {
- super(parent);
- this.resourceAttributeMapping = resourceAttributeMapping;
- this.name = this.getResourceMappingName();
- }
-
- protected JavaPersistentAttribute getJavaPersistentAttribute() {
- return this.getPersistentAttribute().getJavaPersistentAttribute();
- }
-
- protected JavaResourcePersistentAttribute getJavaResourcePersistentAttribute() {
- return this.getJavaPersistentAttribute().getResourcePersistentAttribute();
- }
-
- public boolean isVirtual() {
- return getPersistentAttribute().isVirtual();
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.resourceAttributeMapping.setName(name);
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- this.getPersistentAttribute().nameChanged(old, name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- this.getPersistentAttribute().nameChanged(old, name);
- }
-
- public OrmPersistentAttribute getPersistentAttribute() {
- return (OrmPersistentAttribute) getParent();
- }
-
- protected EntityMappings getEntityMappings() {
- return this.getPersistentAttribute().getOwningPersistentType().getParent();
- }
-
- protected PersistentType resolvePersistentType(String className) {
- return this.getEntityMappings().resolvePersistentType(className);
- }
-
- public boolean isDefault() {
- return false;
- }
-
- public void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping) {
- setName(oldMapping.getName());
- }
-
- public void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- initializeFromOrmAttributeMapping((OrmAttributeMapping) oldMapping);
- }
-
- public void initializeFromOrmBasicMapping(OrmBasicMapping oldMapping) {
- initializeFromOrmColumnMapping(oldMapping);
- }
-
- public void initializeFromOrmIdMapping(OrmIdMapping oldMapping) {
- initializeFromOrmColumnMapping(oldMapping);
- }
-
- public void initializeFromOrmTransientMapping(OrmTransientMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmBaseEmbeddedMapping(OrmBaseEmbeddedMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmEmbeddedMapping(OrmEmbeddedMapping oldMapping) {
- initializeFromOrmBaseEmbeddedMapping(oldMapping);
- }
-
- public void initializeFromOrmEmbeddedIdMapping(OrmEmbeddedIdMapping oldMapping) {
- initializeFromOrmBaseEmbeddedMapping(oldMapping);
- }
-
- public void initializeFromOrmVersionMapping(OrmVersionMapping oldMapping) {
- initializeFromOrmColumnMapping(oldMapping);
- }
-
- public void initializeFromOrmRelationshipMapping(OrmRelationshipMapping oldMapping) {
- initializeFromOrmAttributeMapping(oldMapping);
- }
-
- public void initializeFromOrmMultiRelationshipMapping(OrmMultiRelationshipMapping oldMapping) {
- initializeFromOrmRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- initializeFromOrmRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToManyMapping(OrmOneToManyMapping oldMapping) {
- initializeFromOrmMultiRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToOneMapping(OrmManyToOneMapping oldMapping) {
- initializeFromOrmSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmOneToOneMapping(OrmOneToOneMapping oldMapping) {
- initializeFromOrmSingleRelationshipMapping(oldMapping);
- }
-
- public void initializeFromOrmManyToManyMapping(OrmManyToManyMapping oldMapping) {
- initializeFromOrmMultiRelationshipMapping(oldMapping);
- }
-
- public String getPrimaryKeyColumnName() {
- return null;
- }
-
- public OrmTypeMapping getTypeMapping() {
- return this.getPersistentAttribute().getOwningTypeMapping();
- }
-
-
- public boolean isOverridableAttributeMapping() {
- return false;
- }
-
- public boolean isOverridableAssociationMapping() {
- return false;
- }
-
- public boolean isRelationshipOwner() {
- return false;
- }
-
- public boolean isOwnedBy(AttributeMapping mapping) {
- // Default implementation - override where needed
- return false;
- }
-
- public Iterator<String> allMappingNames() {
- return getName() == null ? EmptyIterator.<String> instance() : new SingleElementIterator<String>(getName());
- }
-
- public AttributeMapping resolveAttributeMapping(String attributeName) {
- if (getName() != null && getName().equals(attributeName)) {
- return this;
- }
- return null;
- }
-
- public Iterator<String> allOverrideableAttributeMappingNames() {
- if (isOverridableAttributeMapping() && getName() != null) {
- return new SingleElementIterator<String>(getName());
- }
- return EmptyIterator.<String> instance();
- }
-
- public Iterator<String> allOverrideableAssociationMappingNames() {
- if (isOverridableAssociationMapping() && getName() != null) {
- return new SingleElementIterator<String>(getName());
- }
- return EmptyIterator.<String> instance();
- }
-
- public Column resolveOverriddenColumn(String attributeName) {
- ColumnMapping columnMapping = this.resolveColumnMapping(attributeName);
- return columnMapping == null ? null : columnMapping.getColumn();
- }
-
- protected ColumnMapping resolveColumnMapping(String attributeName) {
- AttributeMapping attributeMapping = resolveAttributeMapping(attributeName);
- if (attributeMapping != null && attributeMapping.isOverridableAttributeMapping()) {
- return (ColumnMapping) attributeMapping;
- }
- return null;
- }
-
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- RelationshipMapping relationshipMapping = this.resolveRelationshipMapping(attributeName);
- return relationshipMapping == null ? null : relationshipMapping.getRelationshipReference();
- }
-
- protected RelationshipMapping resolveRelationshipMapping(String attributeName) {
- AttributeMapping attributeMapping = resolveAttributeMapping(attributeName);
- if (attributeMapping != null && attributeMapping.isOverridableAssociationMapping()) {
- return (RelationshipMapping) attributeMapping;
- }
- return null;
- }
-
- public T getResourceAttributeMapping() {
- return this.resourceAttributeMapping;
- }
-
- public void update() {
- this.setName_(this.getResourceMappingName());
- }
-
- protected String getResourceMappingName() {
- return this.resourceAttributeMapping.getName();
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return this.getTypeMapping().shouldValidateAgainstDatabase();
- }
-
- public boolean contains(int textOffset) {
- return this.resourceAttributeMapping.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return this.resourceAttributeMapping.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- return (this.getPersistentAttribute().isVirtual()) ? this.getTypeMapping().getAttributesTextRange() : this.resourceAttributeMapping.getValidationTextRange();
- }
-
- public TextRange getNameTextRange() {
- return this.resourceAttributeMapping.getNameTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** metamodel **********
-
- public MetamodelField getMetamodelField() {
- // if we don't have a name we can't build a metamodel field...
- String metamodelFieldName = this.getMetamodelFieldName();
- return (metamodelFieldName == null) ? null :
- new SimpleMetamodelField(
- this.getMetamodelFieldModifiers(),
- this.getMetamodelFieldTypeName(),
- this.getMetamodelFieldTypeArgumentNames(),
- metamodelFieldName
- );
- }
-
- protected Iterable<String> getMetamodelFieldModifiers() {
- return STANDARD_METAMODEL_FIELD_MODIFIERS;
- }
-
- /**
- * most mappings are "singular"
- */
- protected String getMetamodelFieldTypeName() {
- return JPA2_0.SINGULAR_ATTRIBUTE;
- }
-
- protected final Iterable<String> getMetamodelFieldTypeArgumentNames() {
- ArrayList<String> typeArgumentNames = new ArrayList<String>(3);
- typeArgumentNames.add(this.getTypeMapping().getPersistentType().getName());
- this.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- return typeArgumentNames;
- }
-
- /**
- * by default, we add only the mapping's attribute type name;
- * but collection relationship mappings will also need to add the key type
- * name if the "collection" is of type java.util.Map
- */
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- typeArgumentNames.add(this.getMetamodelTypeName());
- }
-
- public String getMetamodelTypeName() {
- return ((OrmPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelTypeName();
- }
-
- protected String getMetamodelFieldName() {
- return this.getName();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateAttribute(messages);
- this.validateMapping(messages);
- }
-
- protected void validateAttribute(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.name)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- }
-
- //TODO validation message - i think more info is needed in this message. include type mapping type?
- protected void validateMapping(List<IMessage> messages) {
- if ( ! this.getTypeMapping().attributeMappingKeyAllowed(this.getKey())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING,
- new String[] {this.name},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
deleted file mode 100644
index fe0fc25c4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseColumn.java
+++ /dev/null
@@ -1,329 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmBaseColumn;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmBaseColumn<T extends AbstractXmlColumn> extends AbstractOrmNamedColumn<T>
- implements OrmBaseColumn
-{
- protected String specifiedTable;
-
- protected String defaultTable;
-
- protected Boolean specifiedUnique;
-
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
- protected AbstractOrmBaseColumn(XmlContextNode parent, OrmBaseColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initializeFrom(BaseColumn oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedTable(oldColumn.getSpecifiedTable());
- setSpecifiedUnique(oldColumn.getSpecifiedUnique());
- setSpecifiedNullable(oldColumn.getSpecifiedNullable());
- setSpecifiedInsertable(oldColumn.getSpecifiedInsertable());
- setSpecifiedUpdatable(oldColumn.getSpecifiedUpdatable());
- }
-
- @Override
- public OrmBaseColumn.Owner getOwner() {
- return (OrmBaseColumn.Owner) super.getOwner();
- }
-
-// @Override
-// protected void addInsignificantXmlFeatureIdsTo(Set<Integer> insignificantXmlFeatureIds) {
-// super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__DEFAULT_TABLE);
-// insignificantXmlFeatureIds.add(JpaCoreMappingsPackage.IABSTRACT_COLUMN__TABLE);
-// }
-
- @Override
- public String getTable() {
- return (this.getSpecifiedTable() == null) ? getDefaultTable() : this.getSpecifiedTable();
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- if (this.valuesAreDifferent(oldSpecifiedTable, newSpecifiedTable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setTable(newSpecifiedTable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedTable != null) {
- addResourceColumn();
- getResourceColumn().setTable(newSpecifiedTable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- protected void setSpecifiedTable_(String newSpecifiedTable) {
- String oldSpecifiedTable = this.specifiedTable;
- this.specifiedTable = newSpecifiedTable;
- firePropertyChanged(BaseColumn.SPECIFIED_TABLE_PROPERTY, oldSpecifiedTable, newSpecifiedTable);
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String newDefaultTable) {
- String oldDefaultTable = this.defaultTable;
- this.defaultTable = newDefaultTable;
- firePropertyChanged(BaseColumn.DEFAULT_TABLE_PROPERTY, oldDefaultTable, newDefaultTable);
- }
-
- public boolean tableNameIsInvalid() {
- return getOwner().tableNameIsInvalid(getTable());
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public boolean isUnique() {
- return (this.getSpecifiedUnique() == null) ? this.isDefaultUnique() : this.getSpecifiedUnique().booleanValue();
- }
-
- public boolean isDefaultUnique() {
- return BaseColumn.DEFAULT_UNIQUE;
- }
-
- public Boolean getSpecifiedUnique() {
- return this.specifiedUnique;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- if (this.valuesAreDifferent(oldSpecifiedUnique, newSpecifiedUnique)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setUnique(newSpecifiedUnique);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
- }
- else if (newSpecifiedUnique != null) {
- addResourceColumn();
- getResourceColumn().setUnique(newSpecifiedUnique);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- protected void setSpecifiedUnique_(Boolean newSpecifiedUnique) {
- Boolean oldSpecifiedUnique = this.specifiedUnique;
- this.specifiedUnique = newSpecifiedUnique;
- firePropertyChanged(BaseColumn.SPECIFIED_UNIQUE_PROPERTY, oldSpecifiedUnique, newSpecifiedUnique);
- }
-
- public boolean isNullable() {
- return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
- }
-
- public boolean isDefaultNullable() {
- return BaseColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- if (this.valuesAreDifferent(oldSpecifiedNullable, newSpecifiedNullable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setNullable(newSpecifiedNullable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedNullable != null) {
- addResourceColumn();
- getResourceColumn().setNullable(newSpecifiedNullable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- public boolean isInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
- }
-
- public boolean isDefaultInsertable() {
- return BaseColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- if (this.valuesAreDifferent(oldSpecifiedInsertable, newSpecifiedInsertable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedInsertable != null) {
- addResourceColumn();
- getResourceColumn().setInsertable(newSpecifiedInsertable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- public boolean isUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
- }
-
- public boolean isDefaultUpdatable() {
- return BaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- if (this.valuesAreDifferent(oldSpecifiedUpdatable, newSpecifiedUpdatable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
- }
- else if (newSpecifiedUpdatable != null) {
- addResourceColumn();
- getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- public TextRange getTableTextRange() {
- if (getResourceColumn() != null) {
- TextRange textRange = getResourceColumn().getTableTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return this.getParent().getValidationTextRange();
- }
-
- @Override
- protected void initialize(T column) {
- super.initialize(column);
- this.specifiedTable = this.getResourceTable(column);
- this.defaultTable = this.buildDefaultTableName();
- //TODO default from java for all of these settings
- this.specifiedNullable = this.getResourceNullable(column);
- this.specifiedUpdatable = this.getResourceUpdatable(column);
- this.specifiedUnique = this.getResourceUnique(column);
- this.specifiedInsertable = this.getResourceInsertable(column);
- }
-
- @Override
- protected void update(T column) {
- super.update(column);
- setSpecifiedTable_(this.getResourceTable(column));
- setDefaultTable(this.buildDefaultTableName());
- setSpecifiedNullable_(this.getResourceNullable(column));
- setSpecifiedUpdatable_(this.getResourceUpdatable(column));
- setSpecifiedUnique_(this.getResourceUnique(column));
- setSpecifiedInsertable_(this.getResourceInsertable(column));
- }
-
- protected String getResourceTable(T column) {
- return column == null ? null : column.getTable();
- }
-
- protected Boolean getResourceNullable(T column) {
- return column == null ? null : column.getNullable();
- }
-
- protected Boolean getResourceUpdatable(T column) {
- return column == null ? null : column.getUpdatable();
- }
-
- protected Boolean getResourceUnique(T column) {
- return column == null ? null : column.getUnique();
- }
-
- protected Boolean getResourceInsertable(T column) {
- return column == null ? null : column.getInsertable();
- }
-
- protected String buildDefaultTableName() {
- return getOwner().getDefaultTableName();
- }
-
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (this.validateTable(messages)) {
- super.validate(messages, reporter);
- }
- }
-
- /**
- * Return true if the table is valid and no messages are logged
- */
- protected boolean validateTable(List<IMessage> messages) {
- if (this.tableNameIsInvalid()) {
- messages.add(this.getOwner().buildTableNotValidMessage(this, this.getTableTextRange()));
- return false;
- }
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
deleted file mode 100644
index eb17fbafee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
+++ /dev/null
@@ -1,384 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaBaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmBaseEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmBaseEmbeddedMapping<T extends AbstractXmlEmbedded>
- extends AbstractOrmAttributeMapping<T>
- implements OrmBaseEmbeddedMapping
-{
- protected OrmAttributeOverrideContainer attributeOverrideContainer;
-
- protected Embeddable targetEmbeddable;
-
-
- protected AbstractOrmBaseEmbeddedMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.targetEmbeddable = embeddableFor(this.getJavaPersistentAttribute());
- this.attributeOverrideContainer
- = getXmlContextNodeFactory().buildOrmAttributeOverrideContainer(
- this,
- buildAttributeOverrideContainerOwner());
- }
-
-
- protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() {
- return new AttributeOverrideContainerOwner();
- }
-
- @Override
- public void initializeFromOrmBaseEmbeddedMapping(OrmBaseEmbeddedMapping oldMapping) {
- super.initializeFromOrmBaseEmbeddedMapping(oldMapping);
- this.attributeOverrideContainer.initializeFromAttributeOverrideContainer(oldMapping.getAttributeOverrideContainer());
- }
-
- public OrmAttributeOverrideContainer getAttributeOverrideContainer() {
- return this.attributeOverrideContainer;
- }
-
- protected JavaAttributeOverride getJavaAttributeOverrideNamed(String attributeName) {
- if (getJavaEmbeddedMapping() != null) {
- return getJavaEmbeddedMapping().getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- }
- return null;
- }
-
- public Embeddable getTargetEmbeddable() {
- return this.targetEmbeddable;
- }
-
- protected void setTargetEmbeddable_(Embeddable newTargetEmbeddable) {
- Embeddable oldTargetEmbeddable = this.targetEmbeddable;
- this.targetEmbeddable = newTargetEmbeddable;
- firePropertyChanged(TARGET_EMBEDDABLE_PROPERTY, oldTargetEmbeddable, newTargetEmbeddable);
- }
-
- protected Iterator<AttributeMapping> embeddableAttributeMappings() {
- Embeddable targetEmbeddable = getTargetEmbeddable();
- if (targetEmbeddable != null && targetEmbeddable != getPersistentAttribute().getOwningTypeMapping()) {
- return targetEmbeddable.attributeMappings();
- }
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> allOverrideableAttributeMappingNames() {
- return this.isJpa2_0Compatible() ?
- this.embeddableOverrideableAttributeMappingNames() :
- super.allOverrideableAttributeMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- }
- );
- }
-
- @Override
- public Iterator<String> allOverrideableAssociationMappingNames() {
- return this.isJpa2_0Compatible() ?
- this.embeddableOverrideableAssociationMappingNames() :
- super.allOverrideableAssociationMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- }
- );
- }
-
- protected Iterator<String> embeddableOverrideableMappingNames(Transformer<AttributeMapping, Iterator<String>> transformer) {
- return new TransformationIterator<String, String>(
- new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.embeddableAttributeMappings(), transformer)))
- {
- @Override
- protected String transform(String next) {
- return getName() + '.' + next;
- }
- };
- }
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- if (getName() == null) {
- return null;
- }
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AttributeOverride override = getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- if (this.getTargetEmbeddable() == null) {
- return null;
- }
- return this.getTargetEmbeddable().resolveOverriddenColumn(attributeName);
- }
- }
- }
- return null;
- }
-
- public JavaBaseEmbeddedMapping getJavaEmbeddedMapping() {
- JavaPersistentAttribute jpa = this.getJavaPersistentAttribute();
- if ((jpa != null) && this.valuesAreEqual(jpa.getMappingKey(), this.getKey())) {
- return (JavaBaseEmbeddedMapping) jpa.getMapping();
- }
- return null;
- }
-
-
- @Override
- public void update() {
- super.update();
- setTargetEmbeddable_(embeddableFor(this.getJavaPersistentAttribute()));
- getAttributeOverrideContainer().update();
- }
-
-
- //******** Validation ******************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (validateTargetEmbeddable(messages, reporter)) {
- validateOverrides(messages, reporter);
- }
- }
-
- protected boolean validateTargetEmbeddable(List<IMessage> messages, IReporter reporter) {
- if (getTargetEmbeddable() == null) {
- String targetEmbeddableTypeName = getPersistentAttribute().getTypeName();
- // if the type isn't resolveable, there'll already be a java error
- if (targetEmbeddableTypeName != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE,
- new String[] {targetEmbeddableTypeName},
- this,
- this.getValidationTextRange()));
- }
- return false;
- }
- return true;
- }
-
- protected void validateOverrides(List<IMessage> messages, IReporter reporter) {
- getAttributeOverrideContainer().validate(messages, reporter);
- }
-
- //************ static methods ************
-
- public static Embeddable embeddableFor(JavaPersistentAttribute javaPersistentAttribute) {
- return (javaPersistentAttribute == null) ? null : javaPersistentAttribute.getEmbeddable();
- }
-
-
- //********** AttributeOverrideContainer.Owner implementation *********
-
- protected class AttributeOverrideContainerOwner
- implements OrmAttributeOverrideContainer.Owner
- {
- public OrmTypeMapping getTypeMapping() {
- return AbstractOrmBaseEmbeddedMapping.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmBaseEmbeddedMapping.this.getTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : allOverridableAttributeNames_(typeMapping);
- }
-
- /* assumes the type mapping is not null */
- protected Iterator<String> allOverridableAttributeNames_(TypeMapping typeMapping) {
- return typeMapping.allOverridableAttributeNames();
- }
-
- public EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return AbstractOrmBaseEmbeddedMapping.this.resourceAttributeMapping.getAttributeOverrides();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAttributeOverride javaAttributeOverride = getJavaAttributeOverrideNamed(attributeOverrideName);
- if (javaAttributeOverride != null && !javaAttributeOverride.isVirtual()) {
- return javaAttributeOverride.getColumn();
- }
- }
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
- return new VirtualXmlAttributeOverrideColumn(overridableColumn);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeUnresolvedColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideUnresolvedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeUnresolvedColumnTableNotValidMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmBaseEmbeddedMapping.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideUnresolvedColumnNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- AbstractOrmBaseEmbeddedMapping.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmBaseEmbeddedMapping.this.getValidationTextRange();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBasicMapping.java
deleted file mode 100644
index abe63ea8df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBasicMapping.java
+++ /dev/null
@@ -1,329 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmBasicMapping<T extends XmlBasic>
- extends AbstractOrmAttributeMapping<T>
- implements OrmBasicMapping
-{
- protected final OrmColumn column;
-
- protected FetchType specifiedFetch;
-
- protected Boolean specifiedOptional;
-
- protected OrmConverter converter;
-
- protected final OrmConverter nullConverter;
-
- protected AbstractOrmBasicMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.column = getXmlContextNodeFactory().buildOrmColumn(this, this);
- this.column.initialize(this.getResourceColumn());//TODO pass in to factory
- this.specifiedFetch = this.getResourceFetch();
- this.specifiedOptional = this.getResourceOptional();
- this.nullConverter = this.getXmlContextNodeFactory().buildOrmNullConverter(this);
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return BasicMapping.DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.resourceAttributeMapping.setFetch(FetchType.toOrmResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- public boolean isOptional() {
- return (this.getSpecifiedOptional() == null) ? this.isDefaultOptional() : this.getSpecifiedOptional().booleanValue();
- }
-
- public boolean isDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- this.resourceAttributeMapping.setOptional(newSpecifiedOptional);
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- protected void setSpecifiedOptional_(Boolean newSpecifiedOptional) {
- Boolean oldOptional = this.specifiedOptional;
- this.specifiedOptional = newSpecifiedOptional;
- firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, oldOptional, newSpecifiedOptional);
- }
-
- public OrmConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- OrmConverter oldConverter = this.converter;
- OrmConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmBasicMapping(this);
- }
-
-
- @Override
- public void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromOrmColumnMapping(oldMapping);
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
- public int getXmlSequence() {
- return 20;
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public String getDefaultColumnName() {
- return getName();
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedFetch_(this.getResourceFetch());
- this.setSpecifiedOptional_(this.getResourceOptional());
- this.column.update(this.getResourceColumn());
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update();
- }
- else {
- setConverter(buildConverter(getResourceConverterType()));
- }
- }
-
- protected Boolean getResourceOptional() {
- return this.resourceAttributeMapping.getOptional();
- }
-
- protected FetchType getResourceFetch() {
- return FetchType.fromOrmResourceModel(this.resourceAttributeMapping.getFetch());
- }
-
- protected OrmConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.ENUMERATED_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmEnumeratedConverter(this, this.resourceAttributeMapping);
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- if (this.valuesAreEqual(converterType, Converter.LOB_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmLobConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.resourceAttributeMapping.getEnumerated() != null) {
- return Converter.ENUMERATED_CONVERTER;
- }
- else if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- else if (this.resourceAttributeMapping.isLob()) {
- return Converter.LOB_CONVERTER;
- }
-
- return Converter.NO_CONVERTER;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getBasics().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getBasics().remove(this.resourceAttributeMapping);
- }
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- getColumn().validate(messages, reporter);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {getName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- getName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEmbeddable.java
deleted file mode 100644
index 67f61d556c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEmbeddable.java
+++ /dev/null
@@ -1,86 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public abstract class AbstractOrmEmbeddable
- extends AbstractOrmTypeMapping<XmlEmbeddable>
- implements OrmEmbeddable
-{
- protected AbstractOrmEmbeddable(OrmPersistentType parent, XmlEmbeddable resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 2;
- }
-
- public JavaEmbeddable getJavaEmbeddable() {
- JavaPersistentType javaPersistentType = this.getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.getMappingKey() == MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY) {
- return (JavaEmbeddable) javaPersistentType.getMapping();
- }
- return null;
- }
-
- /**
- * This checks metaDataComplete before returning the JavaEmbeddable.
- * As far as defaults are concerned, if metadataComplete is true, the JavaEmbeddable is ignored.
- */
- protected JavaEmbeddable getJavaEmbeddableForDefaults() {
- if (isMetadataComplete()) {
- return null;
- }
- return getJavaEmbeddable();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public void addToResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEmbeddables().add(this.resourceTypeMapping);
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEmbeddables().remove(this.resourceTypeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java
deleted file mode 100644
index e25a980363..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java
+++ /dev/null
@@ -1,2134 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.JpaPlatformVariation.Supported;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmBaseJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmGeneratorContainer;
-import org.eclipse.jpt.core.context.orm.OrmIdClassReference;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericEntityPrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.Inheritance;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmEntity
- extends AbstractOrmTypeMapping<XmlEntity>
- implements OrmEntity, OrmCacheableHolder2_0
-{
- protected String specifiedName;
-
- protected String defaultName;
-
- protected final OrmIdClassReference idClassReference;
-
- protected final OrmTable table;
-
- protected boolean specifiedTableIsAllowed;
-
- protected boolean tableIsUndefined;
-
- protected final List<OrmSecondaryTable> specifiedSecondaryTables;
-
- protected final List<OrmSecondaryTable> virtualSecondaryTables;
-
- protected final List<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
-
- protected final List<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns;
-
- protected InheritanceType specifiedInheritanceStrategy;
-
- protected InheritanceType defaultInheritanceStrategy;
-
- protected String defaultDiscriminatorValue;
-
- protected String specifiedDiscriminatorValue;
-
- protected boolean specifiedDiscriminatorValueIsAllowed;
-
- protected boolean discriminatorValueIsUndefined;
-
- protected final OrmDiscriminatorColumn discriminatorColumn;
-
- protected boolean specifiedDiscriminatorColumnIsAllowed;
-
- protected boolean discriminatorColumnIsUndefined;
-
- protected final OrmGeneratorContainer generatorContainer;
-
- protected final OrmAttributeOverrideContainer attributeOverrideContainer;
-
- protected final OrmAssociationOverrideContainer associationOverrideContainer;
-
- protected final OrmQueryContainer queryContainer;
-
- protected Entity rootEntity;
-
- protected AbstractOrmEntity(OrmPersistentType parent, XmlEntity resourceMapping) {
- super(parent, resourceMapping);
- this.idClassReference = buildIdClassReference();
- this.table = getXmlContextNodeFactory().buildOrmTable(this);
- this.specifiedSecondaryTables = new ArrayList<OrmSecondaryTable>();
- this.virtualSecondaryTables = new ArrayList<OrmSecondaryTable>();
- this.discriminatorColumn = buildDiscriminatorColumn();
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- this.defaultPrimaryKeyJoinColumns = new ArrayList<OrmPrimaryKeyJoinColumn>();
- this.associationOverrideContainer = buildAssociationOverrideContainer();
- this.attributeOverrideContainer = buildAttributeOverrideContainer();
- this.queryContainer = this.buildQueryContainer();
- this.generatorContainer = this.buildGeneratorContainer();
- this.specifiedName = this.resourceTypeMapping.getName();
- this.defaultName = this.buildDefaultName();
- this.rootEntity = this.calculateRootEntity();
- this.initializeInheritance(this.getResourceInheritance());
- this.specifiedDiscriminatorColumnIsAllowed = this.buildSpecifiedDiscriminatorColumnIsAllowed();
- this.discriminatorColumnIsUndefined = this.buildDiscriminatorColumnIsUndefined();
- this.discriminatorColumn.initialize(this.resourceTypeMapping); //TODO pass in to constructor
- this.specifiedDiscriminatorValueIsAllowed = this.buildSpecifiedDiscriminatorValueIsAllowed();
- this.discriminatorValueIsUndefined = this.buildDiscriminatorValueIsUndefined();
- this.specifiedDiscriminatorValue = this.resourceTypeMapping.getDiscriminatorValue();
- this.defaultDiscriminatorValue = this.buildDefaultDiscriminatorValue();
- this.specifiedTableIsAllowed = this.buildSpecifiedTableIsAllowed();
- this.tableIsUndefined = this.buildTableIsUndefined();
- this.table.initialize(this.resourceTypeMapping);//TODO pass in to constructor
- this.initializeSpecifiedSecondaryTables();
- this.initializeVirtualSecondaryTables();
- this.initializeSpecifiedPrimaryKeyJoinColumns();
- this.initializeDefaultPrimaryKeyJoinColumns();
- }
-
- protected OrmIdClassReference buildIdClassReference() {
- return new GenericOrmIdClassReference(this, getJavaIdClassReferenceForDefaults());
- }
-
- protected OrmDiscriminatorColumn buildDiscriminatorColumn() {
- return getXmlContextNodeFactory().buildOrmDiscriminatorColumn(this, buildDiscriminatorColumnOwner());
- }
-
- protected OrmDiscriminatorColumn.Owner buildDiscriminatorColumnOwner() {
- return new OrmDiscriminatorColumn.Owner(){
- public String getDefaultTableName() {
- return AbstractOrmEntity.this.getPrimaryTableName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractOrmEntity.this.getDbTable(tableName);
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractOrmEntity.this;
- }
-
- public String getDefaultColumnName() {
- if (getResourceTypeMapping().getDiscriminatorColumn() == null) {
- if (!isMetadataComplete()) {
- if (getJavaEntity() != null && getJavaEntity().getDiscriminatorColumn().getSpecifiedName() != null) {
- return getJavaEntity().getDiscriminatorColumn().getSpecifiedName();
- }
- }
- }
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getName()
- :
- isTablePerClass() ?
- null
- :
- DiscriminatorColumn.DEFAULT_NAME;
- }
-
- public int getDefaultLength() {
- if (getResourceTypeMapping().getDiscriminatorColumn() == null) {
- if (!isMetadataComplete()) {
- if (getJavaEntity() != null && getJavaEntity().getDiscriminatorColumn().getSpecifiedLength() != null) {
- return getJavaEntity().getDiscriminatorColumn().getSpecifiedLength().intValue();
- }
- }
- }
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getLength()
- :
- isTablePerClass() ?
- 0//TODO think i want to return null here
- :
- DiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- if (getResourceTypeMapping().getDiscriminatorColumn() == null) {
- if (!isMetadataComplete()) {
- if (getJavaEntity() != null && getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType() != null) {
- return getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType();
- }
- }
- }
- return isDescendant() ?
- getRootEntity().getDiscriminatorColumn().getDiscriminatorType()
- :
- isTablePerClass() ?
- null
- :
- DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.DISCRIMINATOR_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmEntity.this.getValidationTextRange();
- }
- };
- }
-
- protected OrmAssociationOverrideContainer buildAssociationOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAssociationOverrideContainer(
- this,
- new AssociationOverrideContainerOwner());
- }
-
- protected OrmAttributeOverrideContainer buildAttributeOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAttributeOverrideContainer(
- this,
- new AttributeOverrideContainerOwner());
- }
-
- protected OrmGeneratorContainer buildGeneratorContainer() {
- return getXmlContextNodeFactory().buildOrmGeneratorContainer(this, this.resourceTypeMapping);
- }
-
- protected OrmQueryContainer buildQueryContainer() {
- return getXmlContextNodeFactory().buildOrmQueryContainer(this, this.resourceTypeMapping);
- }
-
-
- // ******************* TypeMapping implementation ********************
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- @Override
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
- @Override
- public String getPrimaryTableName() {
- return this.table.getName();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getPrimaryDbTable() {
- return this.table.getDbTable();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- // matching database objects and identifiers is database platform-specific
- return this.getDataSource().selectDatabaseObjectForIdentifier(this.getAssociatedDbTablesIncludingInherited(), tableName);
- }
-
- private Iterable<org.eclipse.jpt.db.Table> getAssociatedDbTablesIncludingInherited() {
- return new FilteringIterable<org.eclipse.jpt.db.Table>(this.getAssociatedDbTablesIncludingInherited_()) {
- @Override
- protected boolean accept(org.eclipse.jpt.db.Table t) {
- return t != null;
- }
- };
- }
-
- private Iterable<org.eclipse.jpt.db.Table> getAssociatedDbTablesIncludingInherited_() {
- return new TransformationIterable<Table, org.eclipse.jpt.db.Table>(this.getAssociatedTablesIncludingInherited()) {
- @Override
- protected org.eclipse.jpt.db.Table transform(Table t) {
- return t.getDbTable();
- }
- };
- }
-
- @Override
- public Schema getDbSchema() {
- return this.table.getDbSchema();
- }
-
- public JavaEntity getJavaEntity() {
- JavaPersistentType javaPersistentType = this.getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.getMappingKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) {
- return (JavaEntity) javaPersistentType.getMapping();
- }
- return null;
- }
-
- /**
- * This checks metaDataComplete before returning the JavaEntity.
- * As far as defaults are concerned, if metadataComplete is true, the JavaEntity is ignored.
- */
- protected JavaEntity getJavaEntityForDefaults() {
- if (isMetadataComplete()) {
- return null;
- }
- return getJavaEntity();
- }
-
- protected JavaIdClassReference getJavaIdClassReferenceForDefaults() {
- JavaEntity entity = getJavaEntityForDefaults();
- return (entity == null) ? null : entity.getIdClassReference();
- }
-
-
- //****************** OrmAttributeOverrideContainer.Owner implementation *******************
-
- public TypeMapping getOverridableTypeMapping() {
- PersistentType superPersistentType = getPersistentType().getSuperPersistentType();
- return superPersistentType == null ? null : superPersistentType.getMapping();
- }
-
- public OrmTypeMapping getTypeMapping() {
- return this;
- }
-
- protected JavaAttributeOverride getJavaAttributeOverrideNamed(String attributeName) {
- if (getJavaEntity() != null) {
- return getJavaEntity().getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- }
- return null;
- }
-
- @Override
- public RelationshipReference resolveRelationshipReference(String name) {
- if (this.isJpa2_0Compatible()) {
- int dotIndex = name.indexOf('.');
- if (dotIndex != -1) {
- AssociationOverride override = getAssociationOverrideContainer().getAssociationOverrideNamed(name.substring(dotIndex + 1));
- if (override != null && !override.isVirtual()) {
- return override.getRelationshipReference();
- }
- }
- }
- return super.resolveRelationshipReference(name);
- }
-
- protected JavaAssociationOverride getJavaAssociationOverrideNamed(String attributeName) {
- if (getJavaEntity() != null) {
- return getJavaEntity().getAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- }
- return null;
- }
-
- // **************** name **************************************************
-
- public String getName() {
- return (this.getSpecifiedName() == null) ? getDefaultName() : this.getSpecifiedName();
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- this.resourceTypeMapping.setName(newSpecifiedName);
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
-
- // **************** id class **********************************************
-
- public OrmIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
-
- // **************** table *************************************************
-
- public OrmTable getTable() {
- return this.table;
- }
-
- public ListIterator<OrmSecondaryTable> secondaryTables() {
- if (specifiedSecondaryTablesSize() > 0) {
- return specifiedSecondaryTables();
- }
- return virtualSecondaryTables();
- }
-
- public int secondaryTablesSize() {
- if (specifiedSecondaryTablesSize() > 0) {
- return specifiedSecondaryTablesSize();
- }
- return virtualSecondaryTablesSize();
- }
-
- public ListIterator<OrmSecondaryTable> virtualSecondaryTables() {
- return new CloneListIterator<OrmSecondaryTable>(this.virtualSecondaryTables);
- }
-
- public int virtualSecondaryTablesSize() {
- return this.virtualSecondaryTables.size();
- }
-
- protected void addVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- addItemToList(secondaryTable, this.virtualSecondaryTables, OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST);
- }
-
- protected void removeVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.virtualSecondaryTables, OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST);
- }
-
- public ListIterator<OrmSecondaryTable> specifiedSecondaryTables() {
- return new CloneListIterator<OrmSecondaryTable>(this.specifiedSecondaryTables);
- }
-
- public int specifiedSecondaryTablesSize() {
- return this.specifiedSecondaryTables.size();
- }
-
- public OrmSecondaryTable addSpecifiedSecondaryTable(int index) {
- if (!secondaryTablesDefinedInXml()) {
- throw new IllegalStateException("Virtual secondary tables exist, must first call setSecondaryTablesDefinedInXml(true)"); //$NON-NLS-1$
- }
- XmlSecondaryTable secondaryTableResource = OrmFactory.eINSTANCE.createXmlSecondaryTable();
- OrmSecondaryTable secondaryTable = buildSecondaryTable(secondaryTableResource);
- this.specifiedSecondaryTables.add(index, secondaryTable);
- this.resourceTypeMapping.getSecondaryTables().add(index, secondaryTableResource);
- fireItemAdded(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, secondaryTable);
- return secondaryTable;
- }
-
- public OrmSecondaryTable addSpecifiedSecondaryTable() {
- return this.addSpecifiedSecondaryTable(this.specifiedSecondaryTables.size());
- }
-
- protected void addSpecifiedSecondaryTable(int index, OrmSecondaryTable secondaryTable) {
- addItemToList(index, secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- protected void addSpecifiedSecondaryTable(OrmSecondaryTable secondaryTable) {
- this.addSpecifiedSecondaryTable(this.specifiedSecondaryTables.size(), secondaryTable);
- }
-
- public void removeSpecifiedSecondaryTable(SecondaryTable secondaryTable) {
- this.removeSpecifiedSecondaryTable(this.specifiedSecondaryTables.indexOf(secondaryTable));
- }
-
- public void removeSpecifiedSecondaryTable(int index) {
- OrmSecondaryTable removedSecondaryTable = this.specifiedSecondaryTables.remove(index);
- this.resourceTypeMapping.getSecondaryTables().remove(index);
- fireItemRemoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, index, removedSecondaryTable);
- }
-
- protected void removeSpecifiedSecondaryTable_(OrmSecondaryTable secondaryTable) {
- removeItemFromList(secondaryTable, this.specifiedSecondaryTables, Entity.SPECIFIED_SECONDARY_TABLES_LIST);
- }
-
- public void moveSpecifiedSecondaryTable(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedSecondaryTables, targetIndex, sourceIndex);
- this.resourceTypeMapping.getSecondaryTables().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, targetIndex, sourceIndex);
- }
-
- public boolean containsSecondaryTable(String name) {
- return containsSecondaryTable(name, secondaryTables());
- }
-
- public boolean containsSpecifiedSecondaryTable(String name) {
- return containsSecondaryTable(name, specifiedSecondaryTables());
- }
-
- public boolean containsVirtualSecondaryTable(String name) {
- return containsSecondaryTable(name, virtualSecondaryTables());
- }
-
- public boolean containsVirtualSecondaryTable(OrmSecondaryTable secondaryTable) {
- return this.virtualSecondaryTables.contains(secondaryTable);
- }
-
- protected boolean containsSecondaryTable(String name, ListIterator<OrmSecondaryTable> secondaryTables) {
- for (OrmSecondaryTable secondaryTable : CollectionTools.iterable(secondaryTables)) {
- String secondaryTableName = secondaryTable.getName();
- if (secondaryTableName != null && secondaryTableName.equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean secondaryTablesDefinedInXml() {
- return virtualSecondaryTablesSize() == 0;
- }
-
- public void setSecondaryTablesDefinedInXml(boolean defineInXml) {
- if (defineInXml == secondaryTablesDefinedInXml()) {
- return;
- }
- if (defineInXml) {
- specifySecondaryTablesInXml();
- }
- else {
- removeSecondaryTablesFromXml();
- }
- }
-
- /**
- * This is used to take all the java secondary tables and specify them in the xml. You must
- * use setSecondaryTablesDefinedInXml(boolean) before calling addSpecifiedSecondaryTable().
- *
- * Yes this code looks odd, but be careful making changes to it
- */
- protected void specifySecondaryTablesInXml() {
- if (virtualSecondaryTablesSize() != 0) {
- List<OrmSecondaryTable> virtualSecondaryTables1 = CollectionTools.list(this.virtualSecondaryTables());
- List<OrmSecondaryTable> virtualSecondaryTables2 = CollectionTools.list(this.virtualSecondaryTables());
- //remove all the virtual secondary tables without firing change notification.
- for (OrmSecondaryTable virtualSecondaryTable : CollectionTools.iterable(virtualSecondaryTables())) {
- this.virtualSecondaryTables.remove(virtualSecondaryTable);
- }
- //add specified secondary tables for each virtual secondary table. If the virtual secondary tables
- //are not removed first, they will be removed as a side effect of adding the first specified secondary table.
- //This screws up the change notification to the UI, since that change notification is in a different thread
- for (OrmSecondaryTable virtualSecondaryTable : virtualSecondaryTables2) {
- XmlSecondaryTable secondaryTableResource = OrmFactory.eINSTANCE.createXmlSecondaryTable();
- OrmSecondaryTable specifiedSecondaryTable = buildSecondaryTable(secondaryTableResource);
- this.specifiedSecondaryTables.add(specifiedSecondaryTable);
- this.resourceTypeMapping.getSecondaryTables().add(secondaryTableResource);
- specifiedSecondaryTable.initializeFrom(virtualSecondaryTable);
- }
- //fire change notification at the end
- fireItemsRemoved(OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST, 0, virtualSecondaryTables1);
- fireItemsAdded(Entity.SPECIFIED_SECONDARY_TABLES_LIST, 0, this.specifiedSecondaryTables);
- }
- }
-
- protected void removeSecondaryTablesFromXml() {
- if (specifiedSecondaryTablesSize() != 0) {
- List<OrmSecondaryTable> specifiedSecondaryTablesCopy = CollectionTools.list(this.specifiedSecondaryTables());
- for (OrmSecondaryTable specifiedSecondaryTable : CollectionTools.iterable(specifiedSecondaryTables())) {
- int index = this.specifiedSecondaryTables.indexOf(specifiedSecondaryTable);
- this.specifiedSecondaryTables.remove(specifiedSecondaryTable);
- if (this.specifiedSecondaryTables.size() == 0) {
- initializeVirtualSecondaryTables();
- }
- this.resourceTypeMapping.getSecondaryTables().remove(index);
- }
- fireItemsRemoved(Entity.SPECIFIED_SECONDARY_TABLES_LIST, 0, specifiedSecondaryTablesCopy);
- if (this.virtualSecondaryTables.size() != 0) {
- fireItemsAdded(OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST, 0, this.virtualSecondaryTables);
- }
- }
- }
-
- protected Iterator<String> tableNames(Iterator<Table> tables) {
- return new TransformationIterator<Table, String>(tables) {
- @Override
- protected String transform(Table t) {
- return t.getName();
- }
- };
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return this.nonNullTableNames(this.associatedTablesIncludingInherited());
- }
-
- protected Iterator<String> nonNullTableNames(Iterator<Table> tables) {
- return new FilteringIterator<String>(this.tableNames(tables)) {
- @Override
- protected boolean accept(String o) {
- return o != null;
- }
- };
- }
-
- public Iterator<Table> associatedTables() {
- return new CompositeIterator<Table>(this.table, this.secondaryTables());
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return this.getAssociatedTablesIncludingInherited().iterator();
- }
-
- public Iterable<Table> getAssociatedTablesIncludingInherited() {
- return new CompositeIterable<Table>(new TransformationIterable<TypeMapping, Iterable<Table>>(CollectionTools.iterable(this.inheritanceHierarchy())) {
- @Override
- protected Iterable<Table> transform(TypeMapping mapping) {
- return new FilteringIterable<Table>(CollectionTools.iterable(mapping.associatedTables())) {
- @Override
- protected boolean accept(Table o) {
- return true;
- //TODO
- //filtering these out so as to avoid the duplicate table, root and children share the same table
- //return !(o instanceof SingleTableInheritanceChildTableImpl);
- }
- };
- }
- });
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- if (tableIsUndefined()) {
- return false;
- }
- return ! CollectionTools.contains(this.associatedTableNamesIncludingInherited(), tableName);
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return super.shouldValidateAgainstDatabase() && ! isAbstractTablePerClass();
- }
-
- public InheritanceType getInheritanceStrategy() {
- return (this.getSpecifiedInheritanceStrategy() == null) ? this.getDefaultInheritanceStrategy() : this.getSpecifiedInheritanceStrategy();
- }
-
- public InheritanceType getDefaultInheritanceStrategy() {
- return this.defaultInheritanceStrategy;
- }
-
- protected void setDefaultInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.defaultInheritanceStrategy;
- this.defaultInheritanceStrategy = newInheritanceType;
- firePropertyChanged(DEFAULT_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- public InheritanceType getSpecifiedInheritanceStrategy() {
- return this.specifiedInheritanceStrategy;
- }
-
- public void setSpecifiedInheritanceStrategy(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- if (oldInheritanceType != newInheritanceType) {
- if (this.getResourceInheritance() != null) {
- this.getResourceInheritance().setStrategy(InheritanceType.toOrmResourceModel(newInheritanceType));
- if (this.getResourceInheritance().isUnset()) {
- removeResourceInheritance();
- }
- }
- else if (newInheritanceType != null) {
- addResourceInheritance();
- getResourceInheritance().setStrategy(InheritanceType.toOrmResourceModel(newInheritanceType));
- }
- }
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- protected void setSpecifiedInheritanceStrategy_(InheritanceType newInheritanceType) {
- InheritanceType oldInheritanceType = this.specifiedInheritanceStrategy;
- this.specifiedInheritanceStrategy = newInheritanceType;
- firePropertyChanged(SPECIFIED_INHERITANCE_STRATEGY_PROPERTY, oldInheritanceType, newInheritanceType);
- }
-
- protected Inheritance getResourceInheritance() {
- return this.resourceTypeMapping.getInheritance();
- }
-
- protected void addResourceInheritance() {
- this.resourceTypeMapping.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- }
-
- protected void removeResourceInheritance() {
- this.resourceTypeMapping.setInheritance(null);
- }
-
- public OrmDiscriminatorColumn getDiscriminatorColumn() {
- return this.discriminatorColumn;
- }
-
- public OrmGeneratorContainer getGeneratorContainer() {
- return this.generatorContainer;
- }
-
- public String getDefaultDiscriminatorValue() {
- return this.defaultDiscriminatorValue;
- }
-
- protected void setDefaultDiscriminatorValue(String newDefaultDiscriminatorValue) {
- String oldDefaultDiscriminatorValue = this.defaultDiscriminatorValue;
- this.defaultDiscriminatorValue = newDefaultDiscriminatorValue;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, oldDefaultDiscriminatorValue, newDefaultDiscriminatorValue);
- }
-
- public String getSpecifiedDiscriminatorValue() {
- return this.specifiedDiscriminatorValue;
- }
-
- public void setSpecifiedDiscriminatorValue(String newSpecifiedDiscriminatorValue) {
- String oldSpecifiedDiscriminatorValue = this.specifiedDiscriminatorValue;
- this.specifiedDiscriminatorValue = newSpecifiedDiscriminatorValue;
- this.resourceTypeMapping.setDiscriminatorValue(newSpecifiedDiscriminatorValue);
- firePropertyChanged(SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY, oldSpecifiedDiscriminatorValue, newSpecifiedDiscriminatorValue);
- }
-
- public String getDiscriminatorValue() {
- return (this.getSpecifiedDiscriminatorValue() == null) ? getDefaultDiscriminatorValue() : this.getSpecifiedDiscriminatorValue();
- }
-
- public boolean specifiedDiscriminatorValueIsAllowed() {
- return this.specifiedDiscriminatorValueIsAllowed;
- }
-
- protected void setSpecifiedDiscriminatorValueIsAllowed(boolean specifiedDiscriminatorValueIsAllowed) {
- boolean old = this.specifiedDiscriminatorValueIsAllowed;
- this.specifiedDiscriminatorValueIsAllowed = specifiedDiscriminatorValueIsAllowed;
- firePropertyChanged(Entity.SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY, old, specifiedDiscriminatorValueIsAllowed);
- }
-
- public boolean discriminatorValueIsUndefined() {
- return this.discriminatorValueIsUndefined;
- }
-
- protected void setDiscriminatorValueIsUndefined(boolean discriminatorValueIsUndefined) {
- boolean old = this.discriminatorValueIsUndefined;
- this.discriminatorValueIsUndefined = discriminatorValueIsUndefined;
- firePropertyChanged(Entity.DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY, old, discriminatorValueIsUndefined);
- }
-
- public boolean specifiedDiscriminatorColumnIsAllowed() {
- return this.specifiedDiscriminatorColumnIsAllowed;
- }
-
- protected void setSpecifiedDiscriminatorColumnIsAllowed(boolean specifiedDiscriminatorColumnIsAllowed) {
- boolean old = this.specifiedDiscriminatorColumnIsAllowed;
- this.specifiedDiscriminatorColumnIsAllowed = specifiedDiscriminatorColumnIsAllowed;
- firePropertyChanged(Entity.SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY, old, specifiedDiscriminatorColumnIsAllowed);
- }
-
- public boolean discriminatorColumnIsUndefined() {
- return this.discriminatorColumnIsUndefined;
- }
-
- protected void setDiscriminatorColumnIsUndefined(boolean discriminatorColumnIsUndefined) {
- boolean old = this.discriminatorColumnIsUndefined;
- this.discriminatorColumnIsUndefined = discriminatorColumnIsUndefined;
- firePropertyChanged(Entity.DISCRIMINATOR_COLUMN_IS_UNDEFINED_PROPERTY, old, discriminatorColumnIsUndefined);
- }
-
-
- public boolean specifiedTableIsAllowed() {
- return this.specifiedTableIsAllowed;
- }
-
- protected void setSpecifiedTableIsAllowed(boolean specifiedTableIsAllowed) {
- boolean old = this.specifiedTableIsAllowed;
- this.specifiedTableIsAllowed = specifiedTableIsAllowed;
- firePropertyChanged(Entity.SPECIFIED_TABLE_IS_ALLOWED_PROPERTY, old, specifiedTableIsAllowed);
- }
-
- public boolean tableIsUndefined() {
- return this.tableIsUndefined;
- }
-
- protected void setTableIsUndefined(boolean tableIsUndefined) {
- boolean old = this.tableIsUndefined;
- this.tableIsUndefined = tableIsUndefined;
- firePropertyChanged(Entity.TABLE_IS_UNDEFINED_PROPERTY, old, tableIsUndefined);
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumns);
- }
-
- public int defaultPrimaryKeyJoinColumnsSize() {
- return this.defaultPrimaryKeyJoinColumns.size();
- }
-
- public OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- throw new UnsupportedOperationException("use defaultPrimaryKeyJoinColumns() instead"); //$NON-NLS-1$
- }
-
- protected void addDefaultPrimaryKeyJoinColumn(OrmPrimaryKeyJoinColumn defaultPkJoinColumn) {
- addItemToList(defaultPkJoinColumn, this.defaultPrimaryKeyJoinColumns, OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void removeDefaultPrimaryKeyJoinColumn(PrimaryKeyJoinColumn defaultPkJoinColumn) {
- removeItemFromList(defaultPkJoinColumn, this.defaultPrimaryKeyJoinColumns, OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.specifiedPrimaryKeyJoinColumns.isEmpty() ? this.defaultPrimaryKeyJoinColumns() : this.specifiedPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.isEmpty() ? this.defaultPrimaryKeyJoinColumnsSize() : this.specifiedPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- if (!this.defaultPrimaryKeyJoinColumns.isEmpty()) {
- this.defaultPrimaryKeyJoinColumns.clear();
- }
- XmlPrimaryKeyJoinColumn resourcePkJoinColumn = OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn();
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = buildPrimaryKeyJoinColumn(resourcePkJoinColumn);
- this.specifiedPrimaryKeyJoinColumns.add(index, contextPkJoinColumn);
- this.resourceTypeMapping.getPrimaryKeyJoinColumns().add(index, resourcePkJoinColumn);
-
- this.fireItemAdded(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, contextPkJoinColumn);
- this.fireListCleared(OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- return contextPkJoinColumn;
- }
-
- protected OrmBaseJoinColumn.Owner createPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.addSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.size(), primaryKeyJoinColumn);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(primaryKeyJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- initializeDefaultPrimaryKeyJoinColumns();
- }
- this.resourceTypeMapping.getPrimaryKeyJoinColumns().remove(index);
- fireItemRemoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (!this.defaultPrimaryKeyJoinColumns.isEmpty()) {
- fireListChanged(OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST, this.defaultPrimaryKeyJoinColumns);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.resourceTypeMapping.getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public OrmAttributeOverrideContainer getAttributeOverrideContainer() {
- return this.attributeOverrideContainer;
- }
-
- public OrmAssociationOverrideContainer getAssociationOverrideContainer() {
- return this.associationOverrideContainer;
- }
-
- public OrmQueryContainer getQueryContainer() {
- return this.queryContainer;
- }
-
- public String getDefaultTableName() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- JavaTable javaTable = javaEntity.getTable();
- if ( ! this.isMetadataComplete()
- && ! this.table.isResourceSpecified()
- && javaTable.getSpecifiedName() != null) {
- return javaTable.getSpecifiedName();
- }
- }
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getName()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getName();
- }
-
- public String getDefaultSchema() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- JavaTable javaTable = javaEntity.getTable();
- if ( ! this.isMetadataComplete()
- && ! this.table.isResourceSpecified()
- && javaTable.getSpecifiedSchema() != null) {
- return javaTable.getSpecifiedSchema();
- }
- }
-
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getSchema()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getContextDefaultSchema();
- }
-
- public String getDefaultCatalog() {
- JavaEntity javaEntity = this.getJavaEntity();
- if (javaEntity != null) {
- JavaTable javaTable = javaEntity.getTable();
- if ( ! this.isMetadataComplete()
- && ! this.table.isResourceSpecified()
- && javaTable.getSpecifiedCatalog() != null) {
- return javaTable.getSpecifiedCatalog();
- }
- }
-
- return this.isSingleTableDescendant() ?
- this.getRootEntity().getTable().getCatalog()
- :
- this.isAbstractTablePerClass() ?
- null
- :
- this.getContextDefaultCatalog();
- }
-
- /**
- * Return whether the entity is a descendant of the root entity
- * of a "single table" inheritance hierarchy.
- */
- protected boolean isSingleTableDescendant() {
- return this.isDescendant() && (this.getInheritanceStrategy() == InheritanceType.SINGLE_TABLE);
- }
-
- public Entity getParentEntity() {
- for (Iterator<PersistentType> stream = getPersistentType().ancestors(); stream.hasNext();) {
- TypeMapping tm = stream.next().getMapping();
- if (tm instanceof Entity) {
- return (Entity) tm;
- }
- }
- return null;
- }
-
- public Entity getRootEntity() {
- return this.rootEntity;
- }
-
- public boolean isRoot() {
- return this == this.getRootEntity();
- }
-
- /**
- * Return whether the entity is a descendant in (as opposed to the root of)
- * an inheritance hierarchy.
- */
- protected boolean isDescendant() {
- return ! this.isRoot();
- }
-
- /**
- * Return whether the entity is the top of an inheritance hierarchy
- * and has no descendants and no specified inheritance strategy has been defined.
- */
- protected boolean isRootNoDescendantsNoStrategyDefined() {
- return isRoot() && !getPersistenceUnit().entityIsRootWithSubEntities(this.getName()) && getSpecifiedInheritanceStrategy() == null;
- }
-
- /**
- * Return whether the entity is abstract and is a part of a
- * "table per class" inheritance hierarchy.
- */
- protected boolean isAbstractTablePerClass() {
- return isAbstract() && isTablePerClass();
- }
-
- /**
- * Return whether the entity is a part of a "table per class"
- * inheritance hierarchy.
- */
- protected boolean isTablePerClass() {
- return (this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS);
- }
-
- /**
- * Return whether the type is abstract, false if no java type exists.
- */
- protected boolean isAbstract() {
- JavaResourcePersistentType javaResourcePersistentType = getJavaResourcePersistentType();
- return javaResourcePersistentType == null ? false : javaResourcePersistentType.isAbstract();
- }
-
-// public String primaryKeyColumnName() {
-// String pkColumnName = null;
-// for (Iterator<IPersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
-// IPersistentAttribute attribute = stream.next();
-// String name = attribute.primaryKeyColumnName();
-// if (pkColumnName == null) {
-// pkColumnName = name;
-// }
-// else if (name != null) {
-// // if we encounter a composite primary key, return null
-// return null;
-// }
-// }
-// // if we encounter only a single primary key column name, return it
-// return pkColumnName;
-// }
-//
-// public String primaryKeyAttributeName() {
-// String pkColumnName = null;
-// String pkAttributeName = null;
-// for (Iterator<IPersistentAttribute> stream = getPersistentType().allAttributes(); stream.hasNext();) {
-// IPersistentAttribute attribute = stream.next();
-// String name = attribute.primaryKeyColumnName();
-// if (pkColumnName == null) {
-// pkColumnName = name;
-// pkAttributeName = attribute.getName();
-// }
-// else if (name != null) {
-// // if we encounter a composite primary key, return null
-// return null;
-// }
-// }
-// // if we encounter only a single primary key column name, return it
-// return pkAttributeName;
-// }
-//
-
-
- public int getXmlSequence() {
- return 1;
- }
-
- /**
- * Return an iterator of Entities, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- protected Iterator<TypeMapping> ancestors() {
- return new TransformationIterator<PersistentType, TypeMapping>(getPersistentType().ancestors()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- @Override
- public Iterator<String> overridableAttributeNames() {
- if (!isTablePerClass()) {
- return EmptyIterator.instance();
- }
- return super.overridableAttributeNames();
- }
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- AttributeOverride override = getAttributeOverrideContainer().getAttributeOverrideNamed(attributeName.substring(dotIndex + 1));
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- }
- }
- return super.resolveOverriddenColumn(attributeName);
- }
-
- @Override
- public Iterator<String> overridableAssociationNames() {
- if (!isTablePerClass()) {
- return EmptyIterator.instance();
- }
- return super.overridableAssociationNames();
- }
-
- public AttributeMapping resolveAttributeMapping(String name) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(this.allAttributeMappings())) {
- AttributeMapping resolvedMapping = attributeMapping.resolveAttributeMapping(name);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- return null;
- }
-
-//
-// public IAttributeOverride createAttributeOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAttributeOverride(new IEntity.AttributeOverrideOwner(this));
-// }
-//
-// public IAssociationOverride createAssociationOverride(int index) {
-// return OrmFactory.eINSTANCE.createXmlAssociationOverride(new IEntity.AssociationOverrideOwner(this));
-// }
-//
-// public IAttributeOverride attributeOverrideNamed(String name) {
-// return (IAttributeOverride) overrideNamed(name, getAttributeOverrides());
-// }
-//
-// public boolean containsAttributeOverride(String name) {
-// return containsOverride(name, getAttributeOverrides());
-// }
-//
-// public boolean containsSpecifiedAttributeOverride(String name) {
-// return containsOverride(name, getSpecifiedAttributeOverrides());
-// }
-//
-// public boolean containsAssociationOverride(String name) {
-// return containsOverride(name, getAssociationOverrides());
-// }
-//
-// public boolean containsSpecifiedAssociationOverride(String name) {
-// return containsOverride(name, getSpecifiedAssociationOverrides());
-// }
-//
-// private IOverride overrideNamed(String name, List<? extends IOverride> overrides) {
-// for (IOverride override : overrides) {
-// String overrideName = override.getName();
-// if (overrideName == null && name == null) {
-// return override;
-// }
-// if (overrideName != null && overrideName.equals(name)) {
-// return override;
-// }
-// }
-// return null;
-// }
-//
-// private boolean containsOverride(String name, List<? extends IOverride> overrides) {
-// return overrideNamed(name, overrides) != null;
-// }
-//
-// public boolean containsSpecifiedPrimaryKeyJoinColumns() {
-// return !this.getSpecifiedPrimaryKeyJoinColumns().isEmpty();
-// }
-
- protected void initializeInheritance(Inheritance inheritanceResource) {
- this.specifiedInheritanceStrategy = this.getResourceInheritanceStrategy(inheritanceResource);
- //no need to initialize defaultInheritanceStrategy, need to get all the persistentTypes in the model first
- }
-
- protected void initializeSpecifiedSecondaryTables() {
- for (XmlSecondaryTable secondaryTable : this.resourceTypeMapping.getSecondaryTables()) {
- this.specifiedSecondaryTables.add(buildSecondaryTable(secondaryTable));
- }
- }
-
- protected void initializeVirtualSecondaryTables() {
- if (isMetadataComplete()) {
- return;
- }
- if (getJavaEntity() == null) {
- return;
- }
- if (specifiedSecondaryTablesSize() > 0) {
- return;
- }
- ListIterator<JavaSecondaryTable> javaSecondaryTables = getJavaEntity().secondaryTables();
- while(javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- if (javaSecondaryTable.getName() != null) {
- this.virtualSecondaryTables.add(buildVirtualSecondaryTable(javaSecondaryTable));
- }
- }
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumns() {
- if (isMetadataComplete()) {
- return;
- }
- if (getJavaEntity() == null) {
- this.defaultPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(null));
- return;
- }
- if (specifiedPrimaryKeyJoinColumnsSize() > 0) {
- return;
- }
- ListIterator<JavaPrimaryKeyJoinColumn> javaPkJoinColumns = getJavaEntity().primaryKeyJoinColumns();
- while(javaPkJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn javaPkJoinColumn = javaPkJoinColumns.next();
- if (javaPkJoinColumn.getName() != null) {
- this.defaultPrimaryKeyJoinColumns.add(buildVirtualPrimaryKeyJoinColumn(javaPkJoinColumn));
- }
- }
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns() {
- for (XmlPrimaryKeyJoinColumn resourcePkJoinColumn : this.resourceTypeMapping.getPrimaryKeyJoinColumns()) {
- this.specifiedPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(resourcePkJoinColumn));
- }
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedName(this.resourceTypeMapping.getName());
- this.setDefaultName(this.buildDefaultName());
- this.idClassReference.update(getJavaIdClassReferenceForDefaults());
- this.updateInheritance(this.getResourceInheritance());
- this.updateRootEntity();
- this.updateDiscriminatorColumn();
- this.updateDiscriminatorValue();
- this.setSpecifiedTableIsAllowed(this.buildSpecifiedTableIsAllowed());
- this.setTableIsUndefined(this.buildTableIsUndefined());
- this.table.update(this.resourceTypeMapping);
- this.updateSpecifiedSecondaryTables();
- this.updateVirtualSecondaryTables();
- this.generatorContainer.update();
- this.updateSpecifiedPrimaryKeyJoinColumns();
- this.updateDefaultPrimaryKeyJoinColumns();
- getAttributeOverrideContainer().update();
- getAssociationOverrideContainer().update();
- getQueryContainer().update();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- this.postUpdateDiscriminatorColumn();
- this.postUpdateDiscriminatorValue();
- }
-
- protected String buildDefaultName() {
- if (!isMetadataComplete()) {
- JavaEntity javaEntity = getJavaEntity();
- if (javaEntity != null) {
- return javaEntity.getName();
- }
- }
- String className = getClass_();
- return StringTools.stringIsEmpty(className) ? null : ClassName.getSimpleName(className);
- }
-
- protected void updateDiscriminatorColumn() {
- this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
- getDiscriminatorColumn().update(this.resourceTypeMapping);
- }
-
- protected void postUpdateDiscriminatorColumn() {
- this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
- this.getDiscriminatorColumn().postUpdate();
- }
-
- protected void updateDiscriminatorValue() {
- this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
- this.setSpecifiedDiscriminatorValue(this.resourceTypeMapping.getDiscriminatorValue());
- }
-
- protected void postUpdateDiscriminatorValue() {
- this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
- this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
- }
-
- /**
- * From the Spec:
- * If the DiscriminatorValue annotation is not specified, a
- * provider-specific function to generate a value representing
- * the entity type is used for the value of the discriminator
- * column. If the DiscriminatorType is STRING, the discriminator
- * value default is the entity name.
- *
- * TODO extension point for provider-specific function?
- */
- protected String buildDefaultDiscriminatorValue() {
- if (!isMetadataComplete() && getJavaEntity() != null) {
- return getJavaEntity().getDiscriminatorValue();
- }
- if (discriminatorValueIsUndefined()) {
- return null;
- }
- if (this.getDiscriminatorType() != DiscriminatorType.STRING) {
- return null;
- }
- return this.getName();
- }
-
- protected DiscriminatorType getDiscriminatorType() {
- return this.getDiscriminatorColumn().getDiscriminatorType();
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType() {
- if (getPersistentType().getJavaPersistentType() != null) {
- return getPersistentType().getJavaPersistentType().getResourcePersistentType();
- }
- return null;
- }
-
- protected boolean buildSpecifiedDiscriminatorValueIsAllowed() {
- return !isTablePerClass() && !isAbstract();
- }
-
- protected boolean buildDiscriminatorValueIsUndefined() {
- return isTablePerClass() || isAbstract() || isRootNoDescendantsNoStrategyDefined();
- }
-
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return !isTablePerClass() && isRoot();
- }
-
- protected boolean buildDiscriminatorColumnIsUndefined() {
- return isTablePerClass() || isRootNoDescendantsNoStrategyDefined();
- }
-
- protected boolean buildSpecifiedTableIsAllowed() {
- return !isAbstractTablePerClass() && !isSingleTableDescendant();
- }
-
- protected boolean buildTableIsUndefined() {
- return isAbstractTablePerClass();
- }
-
-
- protected void updateInheritance(Inheritance inheritanceResource) {
- this.setSpecifiedInheritanceStrategy_(this.getResourceInheritanceStrategy(inheritanceResource));
- this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
- }
-
- protected void updateRootEntity() {
- //I am making an assumption here that we don't need property change notification for rootEntity, this might be wrong
- this.rootEntity = calculateRootEntity();
- if (this.rootEntity != this) {
- this.rootEntity.addSubEntity(this);
- }
- }
-
- protected Entity calculateRootEntity() {
- Entity root = this;
- for (Iterator<TypeMapping> stream = inheritanceHierarchy(); stream.hasNext();) {
- TypeMapping typeMapping = stream.next();
- if (typeMapping instanceof Entity) {
- root = (Entity) typeMapping;
- }
- }
- return root;
- }
-
- public void addSubEntity(Entity subEntity) {
- getPersistenceUnit().addRootEntityWithSubEntities(getName());
- }
-
- protected void updateSpecifiedSecondaryTables() {
- // make a copy of the XML tables (to prevent ConcurrentModificationException)
- Iterator<XmlSecondaryTable> xmlTables = new CloneIterator<XmlSecondaryTable>(this.resourceTypeMapping.getSecondaryTables());
-
- for (Iterator<OrmSecondaryTable> contextTables = this.specifiedSecondaryTables(); contextTables.hasNext(); ) {
- OrmSecondaryTable contextTable = contextTables.next();
- if (xmlTables.hasNext()) {
- contextTable.update(xmlTables.next());
- }
- else {
- removeSpecifiedSecondaryTable_(contextTable);
- }
- }
-
- while (xmlTables.hasNext()) {
- addSpecifiedSecondaryTable(buildSecondaryTable(xmlTables.next()));
- }
- }
-
- //if any secondary-tables are specified in the xml file, then all of the java secondaryTables are overriden
- protected void updateVirtualSecondaryTables() {
- ListIterator<OrmSecondaryTable> secondaryTables = virtualSecondaryTables();
- ListIterator<JavaSecondaryTable> javaSecondaryTables = EmptyListIterator.instance();
-
- if (getJavaEntity() != null && !isMetadataComplete() && specifiedSecondaryTablesSize() == 0) {
- javaSecondaryTables = getJavaEntity().secondaryTables();
- }
- while (secondaryTables.hasNext()) {
- OrmSecondaryTable virtualSecondaryTable = secondaryTables.next();
- if (javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- virtualSecondaryTable.update(new VirtualXmlSecondaryTable(javaSecondaryTable));
- }
- else {
- removeVirtualSecondaryTable(virtualSecondaryTable);
- }
- }
-
- while (javaSecondaryTables.hasNext()) {
- JavaSecondaryTable javaSecondaryTable = javaSecondaryTables.next();
- addVirtualSecondaryTable(buildVirtualSecondaryTable(javaSecondaryTable));
- }
- }
-
- protected OrmSecondaryTable buildSecondaryTable(XmlSecondaryTable xmlSecondaryTable) {
- return getXmlContextNodeFactory().buildOrmSecondaryTable(this, xmlSecondaryTable);
- }
-
- protected OrmSecondaryTable buildVirtualSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- return buildSecondaryTable(new VirtualXmlSecondaryTable(javaSecondaryTable));
- }
-
- protected InheritanceType getResourceInheritanceStrategy(Inheritance inheritanceResource) {
- if (inheritanceResource == null) {
- return null;
- }
- return InheritanceType.fromOrmResourceModel(inheritanceResource.getStrategy());
- }
-
- protected InheritanceType buildDefaultInheritanceStrategy() {
- if ((this.getResourceInheritance() == null)
- && ! this.isMetadataComplete()
- && (this.getJavaEntity() != null)) {
- return this.getJavaEntity().getInheritanceStrategy();
- }
- return this.isRoot() ? InheritanceType.SINGLE_TABLE : this.getRootEntity().getInheritanceStrategy();
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns() {
- // make a copy of the XML join columns (to prevent ConcurrentModificationException)
- Iterator<XmlPrimaryKeyJoinColumn> xmlPkJoinColumns = new CloneIterator<XmlPrimaryKeyJoinColumn>(this.resourceTypeMapping.getPrimaryKeyJoinColumns());
-
- for (Iterator<OrmPrimaryKeyJoinColumn> contextPkJoinColumns = this.specifiedPrimaryKeyJoinColumns(); contextPkJoinColumns.hasNext(); ) {
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = contextPkJoinColumns.next();
- if (xmlPkJoinColumns.hasNext()) {
- contextPkJoinColumn.update(xmlPkJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(contextPkJoinColumn);
- }
- }
-
- while (xmlPkJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(xmlPkJoinColumns.next()));
- }
- }
-
- //if there are any specified pkJoinColumns, then no default pkJoinColumns
- //if the java has specified pkJoinColumns, then those are the default pkJoinColumns
- //otherwise, just 1 pkJoinColumn, defaults being null if multiple primaryKey columns
- protected void updateDefaultPrimaryKeyJoinColumns() {
- ListIterator<OrmPrimaryKeyJoinColumn> defaultPkJoinColumns = defaultPrimaryKeyJoinColumns();
- ListIterator<JavaPrimaryKeyJoinColumn> javaPkJoinColumns = EmptyListIterator.instance();
-
- if (getJavaEntity() != null && !isMetadataComplete() && specifiedPrimaryKeyJoinColumnsSize() == 0) {
- javaPkJoinColumns = getJavaEntity().primaryKeyJoinColumns();
- }
- while (defaultPkJoinColumns.hasNext()) {
- OrmPrimaryKeyJoinColumn defaultPkJoinColumn = defaultPkJoinColumns.next();
- if (javaPkJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn javaPkJoinColumn = javaPkJoinColumns.next();
- defaultPkJoinColumn.update(new VirtualXmlPrimaryKeyJoinColumn(javaPkJoinColumn));
- }
- else {
- if (defaultPrimaryKeyJoinColumnsSize() == 1) {
- defaultPkJoinColumn.update(null);
- }
- else {
- removeDefaultPrimaryKeyJoinColumn(defaultPkJoinColumn);
- }
- }
- }
-
- while (javaPkJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn javaPkJoinColumn = javaPkJoinColumns.next();
- addDefaultPrimaryKeyJoinColumn(buildVirtualPrimaryKeyJoinColumn(javaPkJoinColumn));
- }
-
- if (defaultPrimaryKeyJoinColumnsSize() == 0 && specifiedPrimaryKeyJoinColumnsSize() == 0) {
- addDefaultPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(null));
- }
- }
-
- protected OrmPrimaryKeyJoinColumn buildVirtualPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn javaSecondaryTable) {
- return buildPrimaryKeyJoinColumn(new VirtualXmlPrimaryKeyJoinColumn(javaSecondaryTable));
- }
-
- protected OrmPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- return getXmlContextNodeFactory().buildOrmPrimaryKeyJoinColumn(this, createPrimaryKeyJoinColumnOwner(), resourcePkJoinColumn);
- }
-
-
- // *************************************************************************
-
- public String getPrimaryKeyColumnName() {
- return AbstractJavaEntity.getPrimaryKeyColumnName(this);
- }
-
- public PersistentAttribute getIdAttribute() {
- Iterable<AttributeMapping> idAttributeMappings = getAllAttributeMappings(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- if (CollectionTools.size(idAttributeMappings) != 1) {
- return null;
- }
- return idAttributeMappings.iterator().next().getPersistentAttribute();
- }
-
- public void addToResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEntities().add(this.resourceTypeMapping);
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getEntities().remove(this.resourceTypeMapping);
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- validatePrimaryKey(messages, reporter);
- validateTable(messages, reporter);
- for (Iterator<OrmSecondaryTable> stream = this.secondaryTables(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- validateInheritance(messages, reporter);
- this.generatorContainer.validate(messages, reporter);
- this.queryContainer.validate(messages, reporter);
- this.attributeOverrideContainer.validate(messages, reporter);
- this.associationOverrideContainer.validate(messages, reporter);
- }
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
- protected PrimaryKeyValidator buildPrimaryKeyValidator() {
- return new GenericEntityPrimaryKeyValidator(this, buildTextRangeResolver());
- // TODO - JPA 2.0 validation
- }
-
- protected PrimaryKeyTextRangeResolver buildTextRangeResolver() {
- return new OrmEntityTextRangeResolver(this);
- }
-
- protected void validateTable(List<IMessage> messages, IReporter reporter) {
- if (isAbstractTablePerClass()) {
- if (this.table.isResourceSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE,
- new String[] {this.getName()},
- this,
- this.getTable().getValidationTextRange()
- )
- );
- }
- return;
- }
- if (isSingleTableDescendant()) {
- if (this.table.isResourceSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE,
- new String[] {this.getName()},
- this,
- this.getTable().getValidationTextRange()
- )
- );
- }
- return;
- }
- this.table.validate(messages, reporter);
- }
-
- protected void validateInheritance(List<IMessage> messages, IReporter reporter) {
- validateInheritanceStrategy(messages);
- validateDiscriminatorColumn(messages, reporter);
- validateDiscriminatorValue(messages);
- }
-
- protected void validateDiscriminatorColumn(List<IMessage> messages, IReporter reporter) {
- if (specifiedDiscriminatorColumnIsAllowed() && !discriminatorColumnIsUndefined()) {
- getDiscriminatorColumn().validate(messages, reporter);
- }
- else if (getDiscriminatorColumn().isResourceSpecified()) {
- if (!isRoot()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorColumnTextRange()
- )
- );
- }
- else if (isTablePerClass()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorColumnTextRange()
- )
- );
-
- }
- }
- }
-
- protected void validateDiscriminatorValue(List<IMessage> messages) {
- if (discriminatorValueIsUndefined() && getSpecifiedDiscriminatorValue() != null) {
- if (isAbstract()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorValueTextRange()
- )
- );
- }
- else if (isTablePerClass()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED,
- new String[] {this.getName()},
- this,
- this.getDiscriminatorValueTextRange()
- )
- );
- }
- }
- }
-
- protected void validateInheritanceStrategy(List<IMessage> messages) {
- Supported tablePerConcreteClassInheritanceIsSupported = getJpaPlatformVariation().getTablePerConcreteClassInheritanceIsSupported();
- if (tablePerConcreteClassInheritanceIsSupported == Supported.YES) {
- return;
- }
- if ((getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS) && isRoot()) {
- if (tablePerConcreteClassInheritanceIsSupported == Supported.NO) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM,
- new String[] {this.getName()},
- this,
- this.getInheritanceStrategyTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM,
- new String[] {this.getName()},
- this,
- this.getInheritanceStrategyTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getDiscriminatorValueTextRange() {
- return this.resourceTypeMapping.getDiscriminatorValueTextRange();
- }
-
- protected TextRange getDiscriminatorColumnTextRange() {
- return this.resourceTypeMapping.getDiscriminatorColumn().getValidationTextRange();
- }
-
- protected TextRange getInheritanceStrategyTextRange() {
- return this.resourceTypeMapping.getInheritanceStrategyTextRange();
- }
-
- protected class AssociationOverrideContainerOwner
- implements OrmAssociationOverrideContainer.Owner
- {
- public OrmTypeMapping getTypeMapping() {
- return AbstractOrmEntity.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmEntity.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public EList<XmlAssociationOverride> getResourceAssociationOverrides() {
- return AbstractOrmEntity.this.resourceTypeMapping.getAssociationOverrides();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- if (!isMetadataComplete()) {
- JavaPersistentType javaPersistentType = getPersistentType().getJavaPersistentType();
- if (javaPersistentType != null) {
- RelationshipReference relationshipReference = javaPersistentType.getMapping().resolveRelationshipReference(associationOverrideName);
- if (relationshipReference != null) {
- return relationshipReference;
- }
- }
- }
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractOrmEntity.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return AbstractOrmEntity.this.associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractOrmEntity.this.getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return AbstractOrmEntity.this.getPrimaryTableName();
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {overrideName, column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmEntity.this.getValidationTextRange();
- }
- }
-
-
- //********** OrmAttributeOverrideContainer.Owner implementation *********
-
- protected class AttributeOverrideContainerOwner
- implements OrmAttributeOverrideContainer.Owner
- {
- public OrmTypeMapping getTypeMapping() {
- return AbstractOrmEntity.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmEntity.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : allOverridableAttributeNames_(typeMapping);
- }
-
- /* assumes the type mapping is not null */
- protected Iterator allOverridableAttributeNames_(TypeMapping typeMapping) {
- final Collection mappedByRelationshipAttributes = CollectionTools.collection(
- new TransformationIterator<SingleRelationshipMapping2_0, String>(getMapsIdRelationships()) {
- @Override
- protected String transform(SingleRelationshipMapping2_0 next) {
- return next.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue();
- }
- });
- return new FilteringIterator<String>(typeMapping.allOverridableAttributeNames()) {
- @Override
- protected boolean accept(String o) {
- if (mappedByRelationshipAttributes.isEmpty()) {
- return true;
- }
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (o.indexOf('.') > 0) ?
- o.substring(0, o.indexOf('.'))
- : o;
- return ! mappedByRelationshipAttributes.contains(qualifier);
- }
- };
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
- public EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return AbstractOrmEntity.this.resourceTypeMapping.getAttributeOverrides();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- if (!isMetadataComplete()) {
- JavaPersistentType javaPersistentType = getPersistentType().getJavaPersistentType();
- if (javaPersistentType != null) {
- Column column = javaPersistentType.getMapping().resolveOverriddenColumn(attributeOverrideName);
- if (column != null) {
- return column;
- }
- }
- }
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
- JavaAttributeOverride javaAttributeOverride = null;
- if (!isMetadataComplete) {
- javaAttributeOverride = getJavaAttributeOverrideNamed(attributeName);
- }
- if (javaAttributeOverride == null) {
- //TODO not the greatest solution here, but things seems to work, so I'm stepping away slowly
- if (overridableColumn instanceof JavaColumn) {
- return new VirtualXmlColumn(AbstractOrmEntity.this, overridableColumn);
- }
- return new VirtualXmlAttributeOverrideColumn(overridableColumn);
- }
- return new VirtualXmlColumn(AbstractOrmEntity.this, javaAttributeOverride.getColumn());
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractOrmEntity.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return AbstractOrmEntity.this.associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractOrmEntity.this.getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return AbstractOrmEntity.this.getPrimaryTableName();
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmEntity.this.getValidationTextRange();
- }
- }
-
-
- protected class PrimaryKeyJoinColumnOwner implements OrmBaseJoinColumn.Owner
- {
- public TypeMapping getTypeMapping() {
- return AbstractOrmEntity.this;
- }
-
- public String getDefaultTableName() {
- return AbstractOrmEntity.this.getPrimaryTableName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractOrmEntity.this.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity parentEntity = AbstractOrmEntity.this.getParentEntity();
- return (parentEntity == null) ? null : parentEntity.getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return AbstractOrmEntity.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractOrmEntity.this.defaultPrimaryKeyJoinColumns.contains(joinColumn);
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- Entity parentEntity = AbstractOrmEntity.this.getParentEntity();
- return (parentEntity == null) ? getPrimaryKeyColumnName() : parentEntity.getPrimaryKeyColumnName();
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet: bug 148262"); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
deleted file mode 100644
index 696357b668..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmGenerator.java
+++ /dev/null
@@ -1,236 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaGenerator;
-import org.eclipse.jpt.core.context.orm.OrmGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- *
- */
-public abstract class AbstractOrmGenerator<T extends XmlGenerator>
- extends AbstractOrmXmlContextNode
- implements OrmGenerator
-{
-
- protected String name;
-
- protected Integer specifiedInitialValue;
- protected int defaultInitialValue;
-
- protected Integer specifiedAllocationSize;
- protected int defaultAllocationSize;
-
- protected T resourceGenerator;
-
-
- protected AbstractOrmGenerator(XmlContextNode parent) {
- super(parent);
- }
-
- protected T getResourceGenerator() {
- return this.resourceGenerator;
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.getResourceGenerator().setName(name);
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** initial value **********
-
- public int getInitialValue() {
- return (this.specifiedInitialValue != null) ? this.specifiedInitialValue.intValue() : this.defaultInitialValue;
- }
-
- public Integer getSpecifiedInitialValue() {
- return this.specifiedInitialValue;
- }
-
- public void setSpecifiedInitialValue(Integer specifiedInitialValue) {
- Integer old = this.specifiedInitialValue;
- this.specifiedInitialValue = specifiedInitialValue;
- this.getResourceGenerator().setInitialValue(specifiedInitialValue);
- this.firePropertyChanged(SPECIFIED_INITIAL_VALUE_PROPERTY, old, specifiedInitialValue);
- }
-
- protected void setSpecifiedInitialValue_(Integer specifiedInitialValue) {
- Integer old = this.specifiedInitialValue;
- this.specifiedInitialValue = specifiedInitialValue;
- this.firePropertyChanged(SPECIFIED_INITIAL_VALUE_PROPERTY, old, specifiedInitialValue);
- }
-
- public int getDefaultInitialValue() {
- return this.defaultInitialValue;
- }
-
- protected void setDefaultInitialValue(int defaultInitialValue) {
- int old = this.defaultInitialValue;
- this.defaultInitialValue = defaultInitialValue;
- this.firePropertyChanged(DEFAULT_INITIAL_VALUE_PROPERTY, old, defaultInitialValue);
- }
-
-
- // ********** allocation size **********
-
- public int getAllocationSize() {
- return (this.specifiedAllocationSize != null) ? this.specifiedAllocationSize.intValue() : this.defaultAllocationSize;
- }
-
- public Integer getSpecifiedAllocationSize() {
- return this.specifiedAllocationSize;
- }
-
- public void setSpecifiedAllocationSize(Integer specifiedAllocationSize) {
- Integer old = this.specifiedAllocationSize;
- this.specifiedAllocationSize = specifiedAllocationSize;
- this.getResourceGenerator().setAllocationSize(specifiedAllocationSize);
- this.firePropertyChanged(SPECIFIED_ALLOCATION_SIZE_PROPERTY, old, specifiedAllocationSize);
- }
-
- protected void setSpecifiedAllocationSize_(Integer specifiedAllocationSize) {
- Integer old = this.specifiedAllocationSize;
- this.specifiedAllocationSize = specifiedAllocationSize;
- this.firePropertyChanged(SPECIFIED_ALLOCATION_SIZE_PROPERTY, old, specifiedAllocationSize);
- }
-
- public int getDefaultAllocationSize() {
- return Generator.DEFAULT_ALLOCATION_SIZE;
- }
-
- protected void setDefaultAllocationSize(int defaultAllocationSize) {
- int old = this.defaultAllocationSize;
- this.defaultAllocationSize = defaultAllocationSize;
- this.firePropertyChanged(DEFAULT_ALLOCATION_SIZE_PROPERTY, old, defaultAllocationSize);
- }
-
-
- // ********** text ranges **********
-
- public TextRange getValidationTextRange() {
- TextRange validationTextRange = this.getResourceGenerator().getValidationTextRange();
- return validationTextRange != null ? validationTextRange : getParent().getValidationTextRange();
- }
-
- public TextRange getNameTextRange() {
- TextRange nameTextRange = this.getResourceGenerator().getNameTextRange();
- return nameTextRange != null ? nameTextRange : getValidationTextRange();
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(T xmlResourceGenerator) {
- this.resourceGenerator = xmlResourceGenerator;
- this.name = xmlResourceGenerator.getName();
- this.specifiedInitialValue = xmlResourceGenerator.getInitialValue();
- this.specifiedAllocationSize = xmlResourceGenerator.getAllocationSize();
- //TODO defaults
- }
-
- protected void update(T xmlResourceGenerator) {
- this.resourceGenerator = xmlResourceGenerator;
- this.setName_(xmlResourceGenerator.getName());
- this.setSpecifiedInitialValue_(xmlResourceGenerator.getInitialValue());
- this.setSpecifiedAllocationSize_(xmlResourceGenerator.getAllocationSize());
- getPersistenceUnit().addGenerator(this);
- //TODO defaults
- }
-
-
- // ********** database stuff **********
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- protected abstract String getSchema();
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- protected abstract String getCatalog();
-
-
- // ********** misc **********
-
- public boolean isVirtual() {
- return getResourceGenerator().isVirtual();
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public boolean overrides(Generator other) {
- // this isn't ideal, but it will have to do until we have further adopter input
- return (this.name != null)
- && this.name.equals(other.getName())
- && (other instanceof JavaGenerator);
- }
-
- public boolean duplicates(Generator other) {
- return (this != other)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(other.getName())
- && ! this.isVirtual()
- && ! this.overrides(other)
- && ! other.overrides(this);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmIdMapping.java
deleted file mode 100644
index 6dc07edd24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmIdMapping.java
+++ /dev/null
@@ -1,431 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmGeneratorContainer;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.IdMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-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 abstract class AbstractOrmIdMapping<T extends XmlId>
- extends AbstractOrmAttributeMapping<T>
- implements OrmIdMapping, IdMapping2_0
-{
- protected final OrmColumn column;
-
- /* 2.0 feature - a relationship may map this id */
- protected boolean mappedByRelationship;
-
- protected OrmGeneratedValue generatedValue;
-
- protected OrmConverter converter;
-
- protected final OrmConverter nullConverter;
-
- protected final OrmGeneratorContainer generatorContainer;
-
-
- protected AbstractOrmIdMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.column = getXmlContextNodeFactory().buildOrmColumn(this, this);
- this.column.initialize(this.resourceAttributeMapping.getColumn());//TODO pass in to constructor
- this.mappedByRelationship = calculateMappedByRelationship();
- this.generatorContainer = buildGeneratorContainer();
- this.initializeGeneratedValue();
- this.nullConverter = this.getXmlContextNodeFactory().buildOrmNullConverter(this);
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
-
- protected OrmGeneratorContainer buildGeneratorContainer() {
- return getXmlContextNodeFactory().buildOrmGeneratorContainer(this, this.resourceAttributeMapping);
- }
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 0;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmIdMapping(this);
- }
-
- @Override
- public void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromOrmColumnMapping(oldMapping);
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public OrmConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- OrmConverter oldConverter = this.converter;
- OrmConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public OrmGeneratedValue addGeneratedValue() {
- if (getGeneratedValue() != null) {
- throw new IllegalStateException("gemeratedValue already exists"); //$NON-NLS-1$
- }
- XmlGeneratedValue resourceGeneratedValue = OrmFactory.eINSTANCE.createXmlGeneratedValue();
- this.generatedValue = buildGeneratedValue(resourceGeneratedValue);
- this.resourceAttributeMapping.setGeneratedValue(resourceGeneratedValue);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, null, this.generatedValue);
- return this.generatedValue;
- }
-
- public void removeGeneratedValue() {
- if (getGeneratedValue() == null) {
- throw new IllegalStateException("gemeratedValue does not exist, cannot be removed"); //$NON-NLS-1$
- }
- OrmGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = null;
- this.resourceAttributeMapping.setGeneratedValue(null);
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, null);
- }
-
- public OrmGeneratedValue getGeneratedValue() {
- return this.generatedValue;
- }
-
- protected void setGeneratedValue(OrmGeneratedValue newGeneratedValue) {
- OrmGeneratedValue oldGeneratedValue = this.generatedValue;
- this.generatedValue = newGeneratedValue;
- firePropertyChanged(GENERATED_VALUE_PROPERTY, oldGeneratedValue, newGeneratedValue);
- }
-
- public OrmGeneratorContainer getGeneratorContainer() {
- return this.generatorContainer;
- }
-
- @Override
- public String getPrimaryKeyColumnName() {
- return this.getColumn().getName();
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getIds().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getIds().remove(this.resourceAttributeMapping);
- }
-
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- protected boolean isColumnSpecified() {
- if (! isVirtual()) {
- return getResourceColumn() != null;
- }
- else {
- return getJavaResourcePersistentAttribute().getAnnotation(JPA.COLUMN) != null;
- }
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
-
- //************** NamedColumn.Owner implementation ***************
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return (isMappedByRelationship() && ! isColumnSpecified()) ? null : getName();
- }
-
-
- //************** BaseColumn.Owner implementation ***************
-
- public String getDefaultTableName() {
- return (isMappedByRelationship() && ! isColumnSpecified()) ? null : getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
-
- // **************** IdColumn2_0 impl **************************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getResolvedAttributeMappingValue() == this) {
- return true;
- }
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- protected void initializeGeneratedValue() {
- if (this.resourceAttributeMapping.getGeneratedValue() != null) {
- this.generatedValue = buildGeneratedValue(this.resourceAttributeMapping.getGeneratedValue());
- }
- }
-
- protected OrmGeneratedValue buildGeneratedValue(XmlGeneratedValue resourceGeneratedValue) {
- return getXmlContextNodeFactory().buildOrmGeneratedValue(this, resourceGeneratedValue);
- }
-
- @Override
- public void update() {
- super.update();
- this.column.update(getResourceColumn());
- setMappedByRelationship(calculateMappedByRelationship());
- this.generatorContainer.update();
- this.updateGeneratedValue();
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update();
- }
- else {
- setConverter(buildConverter(getResourceConverterType()));
- }
- }
-
- protected void updateGeneratedValue() {
- if (this.resourceAttributeMapping.getGeneratedValue() == null) {
- if (getGeneratedValue() != null) {
- setGeneratedValue(null);
- }
- }
- else {
- if (getGeneratedValue() == null) {
- setGeneratedValue(buildGeneratedValue(this.resourceAttributeMapping.getGeneratedValue()));
- }
- else {
- getGeneratedValue().update(this.resourceAttributeMapping.getGeneratedValue());
- }
- }
- }
-
- protected OrmConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- // [JPA 2.0] if the column is specified, or if the id is not mapped by a relationship,
- // then the column is validated.
- // (In JPA 1.0, the column will always be validated, since the id is never mapped by a
- // relationship)
- if (isColumnSpecified() || ! isMappedByRelationship()) {
- getColumn().validate(messages, reporter);
- }
-
- // [JPA 2.0] if the column is specified and the id is mapped by a relationship,
- // then that is an error
- // (In JPA 1.0, this will never be the case, since the id is never mapped by a relationship)
- if (isColumnSpecified() && isMappedByRelationship()) {
- messages.add(
- buildMessage(
- JpaValidationMessages.ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED,
- new String[] {},
- getColumn().getValidationTextRange()));
- }
-
- if (this.generatedValue != null) {
- this.generatedValue.validate(messages, reporter);
- }
- this.generatorContainer.validate(messages, reporter);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {getName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- getName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- /* TODO - move to AbstractOrmAttributeMapping? */
- protected IMessage buildMessage(String msgID, String[] params, TextRange textRange) {
- String attributeDescString;
- PersistentAttribute attribute = getPersistentAttribute();
- if (attribute.isVirtual()) {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.VIRTUAL_ATTRIBUTE_DESC, attribute.getName());
- }
- else {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY, msgID, ArrayTools.add(params, 0, attributeDescString), this, textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.java
deleted file mode 100644
index 670a504acd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.java
+++ /dev/null
@@ -1,255 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn.Owner;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy
- extends AbstractOrmJoinColumnJoiningStrategy
-{
-
- protected AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy(
- OrmJoinColumnEnabledRelationshipReference parent,
- XmlJoinColumnsMapping resource) {
- super(parent, resource);
- }
-
- @Override
- protected Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- @Override
- public OrmJoinColumnEnabledRelationshipReference getRelationshipReference() {
- return (OrmJoinColumnEnabledRelationshipReference) super.getRelationshipReference();
- }
-
- protected abstract Entity getRelationshipTargetEntity();
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY;
- }
-
- public boolean isOverridableAssociation() {
- return true;
- }
-
- public TextRange getValidationTextRange() {
- return this.getRelationshipReference().getValidationTextRange();
- }
-
- // ********** join column owner adapter **********
-
- protected class JoinColumnOwner
- implements OrmJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getTableName();
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public String getAttributeName() {
- return getRelationshipMapping().getName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getRelationshipSource();
- }
-
- public Entity getRelationshipTarget() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getRelationshipTargetEntity();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.candidateTableNames();
- }
-
- public Table getDbTable(String tableName) {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getReferencedColumnDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.defaultJoinColumn == joinColumn;
- }
-
- public int joinColumnsSize() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy.this.getValidationTextRange();
- }
-
- protected boolean isPersistentAttributeVirtual() {
- return getPersistentAttribute().isVirtual();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- this.getAttributeName(),
- column.getTable(), column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getAttributeName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedReferencedColumnNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {this.getAttributeName(), column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getAttributeName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getAttributeName()},
- column,
- textRange
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnJoiningStrategy.java
deleted file mode 100644
index 7c1f778da8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,300 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmJoinColumnJoiningStrategy
- extends AbstractOrmXmlContextNode
- implements OrmJoinColumnJoiningStrategy
-{
- protected OrmJoinColumn defaultJoinColumn;
-
- protected final Vector<OrmJoinColumn> specifiedJoinColumns = new Vector<OrmJoinColumn>();
-
- protected final OrmJoinColumn.Owner joinColumnOwner;
-
- protected XmlJoinColumnsMapping resource;
-
-
- protected AbstractOrmJoinColumnJoiningStrategy(
- JoinColumnEnabledRelationshipReference parent,
- XmlJoinColumnsMapping resource) {
- super(parent);
- this.resource = resource;
- this.joinColumnOwner = this.buildJoinColumnOwner();
- this.initializeSpecifiedJoinColumns();
- this.initializeDefaultJoinColumn();
- }
-
- public void initializeFrom(JoinColumnJoiningStrategy oldStrategy) {
- for (JoinColumn joinColumn : CollectionTools.iterable(oldStrategy.joinColumns())) {
- JoinColumn newJoinColumn = this.addSpecifiedJoinColumn(this.specifiedJoinColumnsSize());
- newJoinColumn.setSpecifiedName(joinColumn.getName());
- newJoinColumn.setSpecifiedReferencedColumnName(joinColumn.getReferencedColumnName());
- }
- }
-
- protected abstract OrmJoinColumn.Owner buildJoinColumnOwner();
-
- protected void initializeSpecifiedJoinColumns() {
- for (XmlJoinColumn resourceJoinColumn : this.resource.getJoinColumns()) {
- this.specifiedJoinColumns.add(buildJoinColumn(resourceJoinColumn));
- }
- }
-
- protected void initializeDefaultJoinColumn() {
- if (mayHaveDefaultJoinColumn()) {
- this.defaultJoinColumn = this.buildJoinColumn(null);
- }
- }
-
- @Override
- public JoinColumnEnabledRelationshipReference getParent() {
- return (JoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public JoinColumnEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public String getTableName() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : getRelationshipSource().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? false : typeMapping.tableNameIsInvalid(tableName);
- }
-
- protected Iterator<String> candidateTableNames() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? EmptyIterator.<String> instance() : typeMapping.associatedTableNamesIncludingInherited();
- }
-
- public void addStrategy() {
- if (specifiedJoinColumnsSize() == 0) {
- addSpecifiedJoinColumn(0);
- }
- }
-
- public void removeStrategy() {
- for (JoinColumn each : CollectionTools.iterable(specifiedJoinColumns())) {
- removeSpecifiedJoinColumn(each);
- }
- }
-
- public Table getReferencedColumnDbTable() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getPrimaryDbTable();
- }
-
-
- // **************** join columns *******************************************
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.hasSpecifiedJoinColumns() ?
- this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.hasSpecifiedJoinColumns() ?
- this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
-
- // **************** default join column ************************************
-
- public OrmJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(OrmJoinColumn joinColumn) {
- OrmJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = joinColumn;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, old, joinColumn);
- }
-
- protected ListIterator<OrmJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<OrmJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
-
- // **************** specified join columns *********************************
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return ! this.specifiedJoinColumns.isEmpty();
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- OrmJoinColumn oldDefaultJoinColumn = this.defaultJoinColumn;
- if (oldDefaultJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultJoinColumn = null;
- }
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumn();
- OrmJoinColumn contextJoinColumn = this.buildJoinColumn(resourceJoinColumn);
- this.specifiedJoinColumns.add(index, contextJoinColumn);
- this.resource.getJoinColumns().add(index, resourceJoinColumn);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, contextJoinColumn);
- if (oldDefaultJoinColumn != null) {
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, oldDefaultJoinColumn, null);
- }
- return contextJoinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if (this.specifiedJoinColumns.isEmpty()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = this.buildJoinColumn(null);
- }
- this.resource.getJoinColumns().remove(index);
- this.fireItemRemoved(SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN_PROPERTY, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(OrmJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.resource.getJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return this.getXmlContextNodeFactory().buildOrmJoinColumn(this, this.joinColumnOwner, resourceJoinColumn);
- }
-
- // **************** resource => context ************************************
-
- public void update() {
- updateSpecifiedJoinColumns();
- updateDefaultJoinColumn();
- }
-
- protected void updateSpecifiedJoinColumns() {
- // make a copy of the XML join columns (to prevent ConcurrentModificationException)
- Iterator<XmlJoinColumn> xmlJoinColumns =
- new CloneIterator<XmlJoinColumn>(this.resource.getJoinColumns());
-
- for (Iterator<OrmJoinColumn> contextJoinColumns = this.specifiedJoinColumns();
- contextJoinColumns.hasNext(); ) {
- OrmJoinColumn contextJoinColumn = contextJoinColumns.next();
- if (xmlJoinColumns.hasNext()) {
- contextJoinColumn.update(xmlJoinColumns.next());
- }
- else {
- removeSpecifiedJoinColumn_(contextJoinColumn);
- }
- }
-
- while (xmlJoinColumns.hasNext()) {
- addSpecifiedJoinColumn(buildJoinColumn(xmlJoinColumns.next()));
- }
- }
-
- protected void updateDefaultJoinColumn() {
- if (mayHaveDefaultJoinColumn()) {
- if (this.defaultJoinColumn == null) {
- this.setDefaultJoinColumn(this.buildJoinColumn(null));
- } else {
- this.defaultJoinColumn.update(null);
- }
- } else {
- this.setDefaultJoinColumn(null);
- }
- }
-
- protected boolean mayHaveDefaultJoinColumn() {
- return getRelationshipReference().mayHaveDefaultJoinColumn()
- && ! hasSpecifiedJoinColumns();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- for (Iterator<OrmJoinColumn> stream = this.joinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinTableJoiningStrategy.java
deleted file mode 100644
index 7cc5d7a7a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,167 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmJoinTableJoiningStrategy
- extends AbstractOrmXmlContextNode
- implements OrmJoinTableJoiningStrategy
-{
- protected OrmJoinTable joinTable;
-
-
- protected AbstractOrmJoinTableJoiningStrategy(
- JoinTableEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public void initializeFrom(JoinTableJoiningStrategy oldStrategy) {
- JoinTable oldJoinTable = (oldStrategy.getJoinTable());
- if (oldJoinTable != null) {
- this.addStrategy();
- this.getJoinTable().setSpecifiedCatalog(oldJoinTable.getSpecifiedCatalog());
- this.getJoinTable().setSpecifiedSchema(oldJoinTable.getSpecifiedSchema());
- this.getJoinTable().setSpecifiedName(oldJoinTable.getSpecifiedName());
- }
- }
-
- @Override
- public JoinTableEnabledRelationshipReference getParent() {
- return (JoinTableEnabledRelationshipReference) super.getParent();
- }
-
- public JoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public String getTableName() {
- return getJoinTable().getName();
- }
-
- public Table getDbTable(String tableName) {
- return getJoinTable().getDbTable();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getTableName(), tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.DOES_NOT_MATCH_JOIN_TABLE;
- }
-
- public String getJoinTableDefaultName() {
- return MappingTools.buildJoinTableDefaultName(this.getRelationshipReference());
- }
-
- public void addStrategy() {
- if (this.joinTable == null) {
- XmlJoinTable resourceJoinTable = OrmFactory.eINSTANCE.createXmlJoinTable();
- this.joinTable = getXmlContextNodeFactory().buildOrmJoinTable(this, resourceJoinTable);
- setResourceJoinTable(resourceJoinTable);
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, null, this.joinTable);
- }
- }
-
- public void removeStrategy() {
- if (this.joinTable != null) {
- OrmJoinTable oldJoinTable = this.joinTable;
- this.joinTable = null;
- removeResourceJoinTable();
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, oldJoinTable, null);
- }
- }
-
- protected abstract void setResourceJoinTable(XmlJoinTable resourceJoinTable);
-
-
- // **************** join table *********************************************
-
- public OrmJoinTable getJoinTable() {
- return this.joinTable;
- }
-
- public OrmJoinTable addJoinTable() {
- addStrategy();
- return this.joinTable;
- }
-
- protected void setJoinTable_(OrmJoinTable newJoinTable) {
- OrmJoinTable oldJoinTable = this.joinTable;
- this.joinTable = newJoinTable;
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, oldJoinTable, newJoinTable);
- }
-
- public XmlJoinTable addResourceJoinTable() {
- XmlJoinTable resourceJoinTable = OrmFactory.eINSTANCE.createXmlJoinTable();
- setResourceJoinTable(resourceJoinTable);
- return resourceJoinTable;
- }
-
- protected boolean mayHaveJoinTable() {
- return getResourceJoinTable() != null
- || getRelationshipReference().mayHaveDefaultJoinTable();
- }
-
-
- // **************** resource -> context ************************************
-
- protected void initialize() {
- if (mayHaveJoinTable()) {
- this.joinTable = getXmlContextNodeFactory().buildOrmJoinTable(this, getResourceJoinTable());
- }
- }
-
- public void update() {
- if (mayHaveJoinTable()) {
- if (this.joinTable == null) {
- setJoinTable_(getXmlContextNodeFactory().buildOrmJoinTable(this, getResourceJoinTable()));
- }
- this.joinTable.update();
- }
- else {
- if (this.joinTable != null) {
- // no resource, so no clean up
- setJoinTable_(null);
- }
- }
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (this.joinTable != null) {
- this.joinTable.validate(messages, reporter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToManyMapping.java
deleted file mode 100644
index 51be06cd62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToManyMapping.java
+++ /dev/null
@@ -1,59 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-public abstract class AbstractOrmManyToManyMapping<T extends XmlManyToMany>
- extends AbstractOrmMultiRelationshipMapping<T>
- implements OrmManyToManyMapping2_0
-{
- protected AbstractOrmManyToManyMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- }
-
-
- @Override
- protected OrmRelationshipReference buildRelationshipReference() {
- return new GenericOrmManyToManyRelationshipReference(this, this.resourceAttributeMapping);
- }
-
- public int getXmlSequence() {
- return 70;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToManyMapping(this);
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getManyToManys().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getManyToManys().remove(this.resourceAttributeMapping);
- }
-
- @Override
- public OrmManyToManyRelationshipReference getRelationshipReference() {
- return (OrmManyToManyRelationshipReference) super.getRelationshipReference();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneMapping.java
deleted file mode 100644
index 086df36c77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneMapping.java
+++ /dev/null
@@ -1,54 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-
-public abstract class AbstractOrmManyToOneMapping<T extends XmlManyToOne>
- extends AbstractOrmSingleRelationshipMapping<T>
- implements OrmManyToOneMapping2_0
-{
- protected AbstractOrmManyToOneMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- }
-
-
- public int getXmlSequence() {
- return 40;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmManyToOneMapping(this);
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getManyToOnes().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getManyToOnes().remove(this.resourceAttributeMapping);
- }
-
- @Override
- public OrmManyToOneRelationshipReference2_0 getRelationshipReference() {
- return (OrmManyToOneRelationshipReference2_0) super.getRelationshipReference();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneRelationshipReference.java
deleted file mode 100644
index b4cd104670..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmManyToOneRelationshipReference.java
+++ /dev/null
@@ -1,160 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmManyToOneRelationshipReference
- extends AbstractOrmRelationshipReference
- implements OrmManyToOneRelationshipReference2_0
-{
- protected OrmJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
- protected OrmJoinTableJoiningStrategy joinTableJoiningStrategy;
-
- protected AbstractOrmManyToOneRelationshipReference(
- OrmManyToOneMapping parent, XmlManyToOne resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected void initializeJoiningStrategies() {
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- }
-
- protected OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericOrmJoinColumnJoiningStrategy(this, getResourceMapping());
- }
-
- protected abstract OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy();
-
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- newRelationshipReference.initializeFromJoinColumnEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference) {
- int index = 0;
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- oldRelationshipReference.getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- @Override
- public OrmManyToOneMapping getRelationshipMapping() {
- return (OrmManyToOneMapping) getParent();
- }
-
- public XmlManyToOne getResourceMapping() {
- return getRelationshipMapping().getResourceAttributeMapping();
- }
-
- public boolean isRelationshipOwner() {
- return true;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return false;
- }
-
-
- // **************** join columns *******************************************
-
- public OrmJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.joinTableJoiningStrategy.removeStrategy();
- // join columns are default (only strategy in fact) so no need to add to resource
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return this.getJoinTableJoiningStrategy().getJoinTable() == null;
- }
-
- // **************** join table *********************************************
-
- public OrmJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return false;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void updateJoiningStrategies() {
- this.joinTableJoiningStrategy.update();
- this.joinColumnJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.joinColumnJoiningStrategy.validate(messages, reporter);
- this.joinTableJoiningStrategy.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMappedSuperclass.java
deleted file mode 100644
index bd30ea7c6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMappedSuperclass.java
+++ /dev/null
@@ -1,148 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmIdClassReference;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmMappedSuperclass extends AbstractOrmTypeMapping<XmlMappedSuperclass>
- implements OrmMappedSuperclass
-{
- protected final OrmIdClassReference idClassReference;
-
-
- protected AbstractOrmMappedSuperclass(OrmPersistentType parent, XmlMappedSuperclass resourceMapping) {
- super(parent, resourceMapping);
- this.idClassReference = buildIdClassReference();
- }
-
-
- protected OrmIdClassReference buildIdClassReference() {
- return new GenericOrmIdClassReference(this, getJavaIdClassReferenceForDefaults());
- }
-
- public int getXmlSequence() {
- return 0;
- }
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- @Override
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
-
- // **************** id class **********************************************
-
- public OrmIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
-
- // ************************************************************************
-
- public JavaMappedSuperclass getJavaMappedSuperclass() {
- JavaPersistentType javaPersistentType = this.getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.getMappingKey() == MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) {
- return (JavaMappedSuperclass) javaPersistentType.getMapping();
- }
- return null;
- }
-
- /**
- * This checks metaDataComplete before returning the JavaMappedSuperclass.
- * As far as defaults are concerned, if metadataComplete is true, the JavaMappedSuperclass is ignored.
- */
- protected JavaMappedSuperclass getJavaMappedSuperclassForDefaults() {
- if (isMetadataComplete()) {
- return null;
- }
- return getJavaMappedSuperclass();
- }
-
- protected JavaIdClassReference getJavaIdClassReferenceForDefaults() {
- JavaMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getIdClassReference();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- @Override
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-
- public Iterator<String> associatedTableNamesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTables() {
- return EmptyIterator.instance();
- }
-
- public Iterator<Table> associatedTablesIncludingInherited() {
- return EmptyIterator.instance();
- }
-
- public void addToResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getMappedSuperclasses().add(this.resourceTypeMapping);
- }
-
- public void removeFromResourceModel(XmlEntityMappings entityMappings) {
- entityMappings.getMappedSuperclasses().remove(this.resourceTypeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.idClassReference.update(getJavaIdClassReferenceForDefaults());
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validatePrimaryKey(messages, reporter);
- }
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
- protected PrimaryKeyValidator buildPrimaryKeyValidator() {
- return new GenericMappedSuperclassPrimaryKeyValidator(this, buildTextRangeResolver());
- // TODO - JPA 2.0 validation
- }
-
- protected PrimaryKeyTextRangeResolver buildTextRangeResolver() {
- return new OrmMappedSuperclassTextRangeResolver(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
deleted file mode 100644
index e460f4a76a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ /dev/null
@@ -1,869 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmMultiRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmOrderable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmPersistentAttribute2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * ORM multi-relationship (m:m, 1:m) mapping
- */
-public abstract class AbstractOrmMultiRelationshipMapping<T extends AbstractXmlMultiRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T>
- implements OrmMultiRelationshipMapping, OrmCollectionMapping2_0
-{
- protected final OrmOrderable orderable;
-
- protected String specifiedMapKey;
- protected boolean noMapKey = false;
- protected boolean pkMapKey = false;
- protected boolean customMapKey = false;
-
- protected String specifiedMapKeyClass;
- protected String defaultMapKeyClass;
- protected PersistentType resolvedMapKeyType;
- protected Embeddable resolvedMapKeyEmbeddable;
- protected Entity resolvedMapKeyEntity;
-
- protected Embeddable resolvedTargetEmbeddable;
-
- protected Type valueType;
- protected Type keyType;
-
- protected final OrmColumn mapKeyColumn;
-
- protected final OrmAttributeOverrideContainer mapKeyAttributeOverrideContainer;
-
- protected AbstractOrmMultiRelationshipMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.orderable = this.buildOrderable();
- this.resolvedTargetEmbeddable = this.resolveTargetEmbeddable();
- this.valueType = this.buildValueType();
- this.resolvedMapKeyType = this.resolveMapKeyType();
- this.resolvedMapKeyEmbeddable = this.resolveMapKeyEmbeddable();
- this.resolvedMapKeyEntity = this.resolveMapKeyEntity();
- this.initializeMapKey();
- this.defaultMapKeyClass = this.buildDefaultMapKeyClass();
- this.specifiedMapKeyClass = this.getResourceMapKeyClass();
- this.mapKeyColumn = getXmlContextNodeFactory().buildOrmColumn(this, this.buildMapKeyColumnOwner());
- this.mapKeyAttributeOverrideContainer = buildMapKeyAttributeOverrideContainer();
- }
-
- @Override
- public void update() {
- super.update();
- this.orderable.update();
- this.resolvedTargetEmbeddable = this.resolveTargetEmbeddable();
- this.updateValueType();
- this.setSpecifiedMapKeyClass_(this.getResourceMapKeyClass());
- this.setDefaultMapKeyClass(this.buildDefaultMapKeyClass());
- this.resolvedMapKeyType = this.resolveMapKeyType();//no need for change notification, use resolved target embeddable change notification instead?
- this.setResolvedMapKeyEmbeddable(this.resolveMapKeyEmbeddable());
- this.setResolvedMapKeyEntity(this.resolveMapKeyEntity());
- this.updateKeyType();
- this.updateMapKey();
- this.setDefaultMapKeyClass(this.buildDefaultMapKeyClass());
- this.setSpecifiedMapKeyClass_(this.getResourceMapKeyClass());
- this.mapKeyColumn.update(getResourceMapKeyColumn());
- this.mapKeyColumn.update(getResourceMapKeyColumn());
- this.mapKeyAttributeOverrideContainer.update();
-}
-
- @Override
- protected String getResourceDefaultTargetEntity() {
- return this.getJavaPersistentAttribute().getMultiReferenceTargetTypeName();
- }
-
- public FetchType getDefaultFetch() {
- return CollectionMapping.DEFAULT_FETCH_TYPE;
- }
-
- // **************** order by ***********************************************
-
- protected OrmOrderable buildOrderable() {
- return this.isJpa2_0Compatible() ?
- this.getXmlContextNodeFactory().buildOrmOrderable(this, this.buildOrderableOwner()) :
- this.getXmlContextNodeFactory().buildOrmOrderable(this, new Orderable.Owner() {/*nothing*/});
- }
-
- public OrmOrderable getOrderable() {
- return this.orderable;
- }
-
- protected Orderable2_0.Owner buildOrderableOwner() {
- return new Orderable2_0.Owner() {
- public String getTableName() {
- return getRelationshipReference().getPredominantJoiningStrategy().getTableName();
- }
- public Table getDbTable(String tableName) {
- return getRelationshipReference().getPredominantJoiningStrategy().getDbTable(tableName);
- }
- };
- }
-
- // ********** CollectionMapping implementation **********
-
- protected Embeddable resolveTargetEmbeddable() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- public Embeddable getResolvedMapKeyEmbeddable() {
- return this.resolvedMapKeyEmbeddable;
- }
-
- protected void setResolvedMapKeyEmbeddable(Embeddable embeddable) {
- Embeddable old = this.resolvedMapKeyEmbeddable;
- this.resolvedMapKeyEmbeddable = embeddable;
- this.firePropertyChanged(RESOLVED_MAP_KEY_EMBEDDABLE_PROPERTY, old, embeddable);
- }
-
- public Entity getResolvedMapKeyEntity() {
- return this.resolvedMapKeyEntity;
- }
-
- protected void setResolvedMapKeyEntity(Entity entity) {
- Entity old = this.resolvedMapKeyEntity;
- this.resolvedMapKeyEntity = entity;
- this.firePropertyChanged(RESOLVED_MAP_KEY_ENTITY_PROPERTY, old, entity);
- }
-
- public PersistentType getResolvedMapKeyType() {
- return getResolvedMapKeyEmbeddable() == null ? null : getResolvedMapKeyEmbeddable().getPersistentType();
- }
-
- protected PersistentType resolveMapKeyType() {
- return this.resolvePersistentType(this.getMapKeyClass());
- }
-
- protected Embeddable resolveMapKeyEmbeddable() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- protected Entity resolveMapKeyEntity() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- // **************** value type ************************************************
-
- public Type getValueType() {
- return this.valueType;
- }
-
- protected void setValueType(Type newValueType) {
- Type old = this.valueType;
- this.valueType = newValueType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, old, newValueType);
- }
-
- protected Type buildValueType() {
- if (this.getResolvedTargetEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (this.resolvedTargetEmbeddable != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- else if (getTargetEntity() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- protected void initializeValueType() {
- this.valueType = this.buildValueType();
- }
-
- protected void updateValueType() {
- this.setValueType(this.buildValueType());
- }
-
- // **************** key type ************************************************
-
- public Type getKeyType() {
- return this.keyType;
- }
-
- protected void setKeyType(Type newKeyType) {
- Type old = this.keyType;
- this.keyType = newKeyType;
- firePropertyChanged(KEY_TYPE_PROPERTY, old, newKeyType);
- }
-
- protected Type buildKeyType() {
- if (getResolvedMapKeyEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- if (getResolvedMapKeyEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (getMapKeyClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- protected void initializeKeyType() {
- this.keyType = this.buildKeyType();
- }
-
- protected void updateKeyType() {
- this.setKeyType(this.buildKeyType());
- }
-
- // **************** map key ************************************************
-
- public String getMapKey() {
- if (this.noMapKey) {
- return null;
- }
- if (this.pkMapKey) {
- return this.getTargetEntityIdAttributeName();
- }
- if (this.customMapKey) {
- return this.specifiedMapKey;
- }
- throw new IllegalStateException("unknown map key"); //$NON-NLS-1$
- }
-
- public String getSpecifiedMapKey() {
- return this.specifiedMapKey;
- }
-
- public void setSpecifiedMapKey(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- if (this.attributeValueHasChanged(old, mapKey)) {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (mapKey == null) {
- if (xmlMapKey != null) {
- this.removeXmlMapKey();
- }
- } else {
- if (xmlMapKey == null) {
- xmlMapKey = this.addXmlMapKey();
- }
- xmlMapKey.setName(mapKey);
- }
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void setSpecifiedMapKey_(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void initializeMapKey() {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (xmlMapKey == null) {
- this.noMapKey = true;
- } else {
- this.specifiedMapKey = xmlMapKey.getName();
- if (this.specifiedMapKey == null) {
- this.pkMapKey = true;
- } else {
- this.customMapKey = true;
- }
- }
- }
-
- protected void updateMapKey() {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (xmlMapKey == null) {
- this.setSpecifiedMapKey_(null);
- this.setNoMapKey_(true);
- this.setPkMapKey_(false);
- this.setCustomMapKey_(false);
- } else {
- String mk = xmlMapKey.getName();
- this.setSpecifiedMapKey_(mk);
- this.setNoMapKey_(false);
- this.setPkMapKey_(mk == null);
- this.setCustomMapKey_(mk != null);
- }
- }
-
- protected MapKey getXmlMapKey() {
- return this.resourceAttributeMapping.getMapKey();
- }
-
- protected MapKey addXmlMapKey() {
- MapKey mapKey = OrmFactory.eINSTANCE.createMapKey();
- this.resourceAttributeMapping.setMapKey(mapKey);
- return mapKey;
- }
-
- protected void removeXmlMapKey() {
- this.resourceAttributeMapping.setMapKey(null);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEntityAttributeNames();
- }
-
-
- // **************** no map key ***********************************************
-
- public boolean isNoMapKey() {
- return this.noMapKey;
- }
-
- public void setNoMapKey(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- if (noMapKey) {
- if (this.getXmlMapKey() != null) {
- this.removeXmlMapKey();
- }
- }
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
- protected void setNoMapKey_(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
-
- // **************** pk map key ***********************************************
-
- public boolean isPkMapKey() {
- return this.pkMapKey;
- }
-
- public void setPkMapKey(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- MapKey xmlMapKey = this.getXmlMapKey();
- if (pkMapKey) {
- if (xmlMapKey == null) {
- this.addXmlMapKey();
- } else {
- xmlMapKey.setName(null);
- }
- }
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
- protected void setPkMapKey_(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
-
- // **************** custom map key ***********************************************
-
- public boolean isCustomMapKey() {
- return this.customMapKey;
- }
-
- public void setCustomMapKey(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- if (customMapKey) {
- this.setSpecifiedMapKey(""); //$NON-NLS-1$
- }
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- protected void setCustomMapKey_(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
-
- // **************** map key class ******************************************
-
- public char getMapKeyClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getMapKeyClass() {
- return (this.specifiedMapKeyClass != null) ? this.specifiedMapKeyClass : this.defaultMapKeyClass;
- }
-
- public String getSpecifiedMapKeyClass() {
- return this.specifiedMapKeyClass;
- }
-
- public void setSpecifiedMapKeyClass(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- if (this.attributeValueHasChanged(old, mapKeyClass)) {
- XmlClassReference xmlMapKeyClass = this.getXmlMapKeyClass();
- if (mapKeyClass == null) {
- if (xmlMapKeyClass != null) {
- this.removeXmlMapKeyClass();
- }
- } else {
- if (xmlMapKeyClass == null) {
- xmlMapKeyClass = this.addXmlMapKeyClass();
- }
- xmlMapKeyClass.setClassName(mapKeyClass);
- }
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected void setSpecifiedMapKeyClass_(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected XmlClassReference getXmlMapKeyClass() {
- return this.resourceAttributeMapping.getMapKeyClass();
- }
-
- protected XmlClassReference addXmlMapKeyClass() {
- XmlClassReference mapKeyClass = OrmFactory.eINSTANCE.createXmlClassReference();
- this.resourceAttributeMapping.setMapKeyClass(mapKeyClass);
- return mapKeyClass;
- }
-
- protected void removeXmlMapKeyClass() {
- this.resourceAttributeMapping.setMapKeyClass(null);
- }
-
- public String getDefaultMapKeyClass() {
- return this.defaultMapKeyClass;
- }
-
- protected void setDefaultMapKeyClass(String mapKeyClass) {
- String old = this.defaultMapKeyClass;
- this.defaultMapKeyClass = mapKeyClass;
- this.firePropertyChanged(DEFAULT_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String getResourceMapKeyClass() {
- XmlClassReference mapKeyClass = this.resourceAttributeMapping.getMapKeyClass();
- return mapKeyClass == null ? null : mapKeyClass.getClassName();
- }
-
- protected String buildDefaultMapKeyClass() {
- if (this.getJavaPersistentAttribute() != null) {
- return this.getJavaPersistentAttribute().getMultiReferenceMapKeyTypeName();
- }
- return null;
- }
-
- // ************** value column ********************************************
-
- public OrmColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- protected XmlColumn getResourceMapKeyColumn() {
- return this.resourceAttributeMapping.getMapKeyColumn();
- }
-
- protected OrmColumn.Owner buildMapKeyColumnOwner() {
- return new MapKeyColumnOwner();
- }
-
- public OrmAttributeOverrideContainer getMapKeyAttributeOverrideContainer() {
- return this.mapKeyAttributeOverrideContainer;
- }
-
- protected OrmAttributeOverrideContainer buildMapKeyAttributeOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAttributeOverrideContainer(this, new MapKeyAttributeOverrideContainerOwner());
- }
-
- protected JavaAttributeOverride getJavaMapKeyAttributeOverrideNamed(String attributeName) {
- if (getJavaMultiRelationshipMapping() != null) {
- return getJavaMultiRelationshipMapping().getMapKeyAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- }
- return null;
- }
-
- protected JavaCollectionMapping2_0 getJavaMultiRelationshipMapping() {
- if (this.getJavaPersistentAttribute() == null) {
- return null;
- }
- AttributeMapping javaAttributeMapping = this.getJavaPersistentAttribute().getMapping();
- if (javaAttributeMapping.getKey() == this.getKey()) {
- return ((JavaCollectionMapping2_0) javaAttributeMapping);
- }
- return null;
- }
-
- // ********** metamodel **********
-
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((OrmPersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String keyTypeName = ((OrmPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldMapKeyTypeName();
- if (keyTypeName != null) {
- typeArgumentNames.add(keyTypeName);
- }
- }
-
- public String getMetamodelFieldMapKeyTypeName() {
- return MappingTools.getMetamodelFieldMapKeyTypeName(this);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.orderable.validate(messages, reporter);
- this.validateMapKey(messages, reporter);
- }
-
- public void validateMapKey(List<IMessage> messages, IReporter reporter) {
- if (getMapKey() != null || getMapKeyAnnotation() != null) {
- //TODO validate that the map key refers to an existing attribute
- return;
- }
- if (getKeyType() == Type.BASIC_TYPE) {
- this.getMapKeyColumn().validate(messages, reporter);
- //validate map key converter
- }
- else if (getKeyType() == Type.ENTITY_TYPE) {
- //validate map key join columns
- }
- else if (getKeyType() == Type.EMBEDDABLE_TYPE) {
- getMapKeyAttributeOverrideContainer().validate(messages, reporter);
- //validate map key association overrides
- }
- }
- protected MapKeyAnnotation getMapKeyAnnotation() {
- if (!isVirtual()) {
- return null;
- }
- JavaResourcePersistentAttribute jrpa = getJavaResourcePersistentAttribute();
- return jrpa == null ? null : (MapKeyAnnotation) jrpa.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
-
- protected class MapKeyColumnOwner implements OrmColumn.Owner {
- public TypeMapping getTypeMapping() {
- return AbstractOrmMultiRelationshipMapping.this.getTypeMapping();
- }
-
- protected OrmJoiningStrategy getPredominantJoiningStrategy() {
- return getRelationshipReference().getPredominantJoiningStrategy();
- }
-
- public String getDefaultTableName() {
- return getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return AbstractOrmMultiRelationshipMapping.this.getName() + "_KEY"; //$NON-NLS-1$
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getRelationshipReference().getPredominantJoiningStrategy().tableNameIsInvalid(tableName);
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public XmlColumn getResourceColumn() {
- return AbstractOrmMultiRelationshipMapping.this.resourceAttributeMapping.getMapKeyColumn();
- }
-
- public void addResourceColumn() {
- AbstractOrmMultiRelationshipMapping.this.resourceAttributeMapping.setMapKeyColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- AbstractOrmMultiRelationshipMapping.this.resourceAttributeMapping.setMapKeyColumn(null);
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmMultiRelationshipMapping.this.getValidationTextRange();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID,
- new String[] {column.getTable(), column.getName(), getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID,
- new String[] {getName(), column.getTable(), column.getName(), getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME,
- new String[] {getName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- }
-
- protected class MapKeyAttributeOverrideContainerOwner
- implements OrmAttributeOverrideContainer.Owner
- {
- public OrmTypeMapping getTypeMapping() {
- return AbstractOrmMultiRelationshipMapping.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmMultiRelationshipMapping.this.getResolvedMapKeyEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- protected JavaAttributeOverride getJavaAttributeOverrideNamed(String attributeName) {
- return AbstractOrmMultiRelationshipMapping.this.getJavaMapKeyAttributeOverrideNamed(attributeName);
- }
-
- public EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return AbstractOrmMultiRelationshipMapping.this.resourceAttributeMapping.getMapKeyAttributeOverrides();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAttributeOverride javaAttributeOverride = getJavaAttributeOverrideNamed(attributeOverrideName);
- if (javaAttributeOverride != null && !javaAttributeOverride.isVirtual()) {
- return javaAttributeOverride.getColumn();
- }
- }
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
-
- public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
- return new VirtualXmlAttributeOverrideColumn(overridableColumn);
- }
-
- protected OrmJoiningStrategy getPredominantJoiningStrategy() {
- return getRelationshipReference().getPredominantJoiningStrategy();
- }
-
- public String getDefaultTableName() {
- return getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmMultiRelationshipMapping.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- AbstractOrmMultiRelationshipMapping.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- getPredominantJoiningStrategy().getColumnTableNotValidDescription()},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmMultiRelationshipMapping.this.getValidationTextRange();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
deleted file mode 100644
index cca8d0cb49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmNamedColumn.java
+++ /dev/null
@@ -1,219 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmNamedColumn<T extends AbstractXmlNamedColumn> extends AbstractOrmXmlContextNode
- implements OrmNamedColumn
-{
- protected Owner owner;
-
- protected String specifiedName;
-
- protected String defaultName;
-
- protected String columnDefinition;
-
- protected AbstractOrmNamedColumn(XmlContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public void initializeFrom(NamedColumn oldColumn) {
- setSpecifiedName(oldColumn.getSpecifiedName());
- setColumnDefinition(oldColumn.getColumnDefinition());
- }
-
- protected abstract T getResourceColumn();
-
- protected abstract void removeResourceColumn();
-
- protected abstract void addResourceColumn();
-
- protected void removeResourceColumnIfFeaturesUnset() {
- if (this.getResourceColumn().isUnset()) {
- removeResourceColumn();
- }
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- if (this.attributeValueHasChanged(oldSpecifiedName, newSpecifiedName)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setName(newSpecifiedName);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedName != null) {
- addResourceColumn();
- getResourceColumn().setName(newSpecifiedName);
- }
- }
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- protected void setSpecifiedName_(String newSpecifiedName) {
- String oldSpecifiedName = this.specifiedName;
- this.specifiedName = newSpecifiedName;
- firePropertyChanged(SPECIFIED_NAME_PROPERTY, oldSpecifiedName, newSpecifiedName);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String newDefaultName) {
- String oldDefaultName = this.defaultName;
- this.defaultName = newDefaultName;
- firePropertyChanged(DEFAULT_NAME_PROPERTY, oldDefaultName, newDefaultName);
- }
-
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- if (this.attributeValueHasChanged(oldColumnDefinition, newColumnDefinition)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setColumnDefinition(newColumnDefinition);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newColumnDefinition != null) {
- addResourceColumn();
- getResourceColumn().setColumnDefinition(newColumnDefinition);
- }
- }
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- protected void setColumnDefinition_(String newColumnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = newColumnDefinition;
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, newColumnDefinition);
- }
-
- public Column getDbColumn() {
- Table table = this.getDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(getName());
- }
-
- public Table getDbTable() {
- return getOwner().getDbTable(this.getTable());
- }
-
- /**
- * Return the name of the column's table. This is overridden
- * in AbstractOrmBaseColumn where a table can be defined.
- */
- public String getTable() {
- return this.getOwner().getTypeMapping().getPrimaryTableName();
- }
-
- public boolean isResolved() {
- return getDbColumn() != null;
- }
-
- public TextRange getNameTextRange() {
- if (getResourceColumn() != null) {
- TextRange textRange = getResourceColumn().getNameTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return getOwner().getValidationTextRange();
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = getResourceColumn().getValidationTextRange();
- if (textRange != null) {
- return textRange;
- }
- return getOwner().getValidationTextRange();
- }
-
-
- // ******************* initialization from orm xml resource model ********************
-
- protected void initialize(T column) {
- this.specifiedName = this.getResourceColumnName(column);
- this.defaultName = this.buildDefaultName();
- this.columnDefinition = this.getResourceColumnDefinition(column);
- }
-
- protected void update(T column) {
- setSpecifiedName_(this.getResourceColumnName(column));
- setDefaultName(this.buildDefaultName());
- setColumnDefinition_(this.getResourceColumnDefinition(column));
- }
-
- protected String getResourceColumnName(T column) {
- return column == null ? null : column.getName();
- }
-
- protected String getResourceColumnDefinition(T column) {
- return column == null ? null : column.getColumnDefinition();
- }
-
- /**
- * Return the default column name.
- */
- protected String buildDefaultName() {
- return this.getOwner().getDefaultColumnName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateName(messages);
- }
-
- protected void validateName(List<IMessage> messages) {
- Table dbTable = this.getDbTable();
- if (dbTable != null && ! this.isResolved()) {
- messages.add(this.getOwner().buildUnresolvedNameMessage(this, this.getNameTextRange()));
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyMapping.java
deleted file mode 100644
index e10221dabb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyMapping.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-
-public abstract class AbstractOrmOneToManyMapping<T extends XmlOneToMany>
- extends AbstractOrmMultiRelationshipMapping<T>
- implements OrmOneToManyMapping2_0, OrmOrphanRemovalHolder2_0
-{
- protected final OrmOrphanRemovable2_0 orphanRemoval;
-
- // ********** constructor **********
- protected AbstractOrmOneToManyMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.orphanRemoval = ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).buildOrmOrphanRemoval(this, resourceMapping);
- }
-
- // ********** update **********
-
- @Override
- public void update() {
- super.update();
- this.getOrphanRemoval().update();
- }
-
- public int getXmlSequence() {
- return 50;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToManyMapping(this);
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getOneToManys().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getOneToManys().remove(this.resourceAttributeMapping);
- }
-
- @Override
- public OrmOneToManyRelationshipReference2_0 getRelationshipReference() {
- return (OrmOneToManyRelationshipReference2_0) super.getRelationshipReference();
- }
-
- // ********** OrmOrphanRemovalHolder2_0 implementation **********
-
- public OrmOrphanRemovable2_0 getOrphanRemoval() {
- return this.orphanRemoval;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyRelationshipReference.java
deleted file mode 100644
index 9037e773e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,235 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmOneToManyRelationshipReference
- extends AbstractOrmRelationshipReference
- implements OrmOneToManyRelationshipReference2_0
-{
- protected OrmMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected OrmJoinTableJoiningStrategy joinTableJoiningStrategy;
-
- protected OrmJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
- protected AbstractOrmOneToManyRelationshipReference(
- OrmOneToManyMapping parent, XmlOneToMany resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
-
- // initialize join table last, as the existence of a default join
- // table is dependent on the other mechanisms (mappedBy)
- // not being specified
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
- protected OrmMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericOrmMappedByJoiningStrategy(this, getResourceMapping());
- }
-
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericOrmJoinTableJoiningStrategy(this, getResourceMapping());
- }
-
- protected abstract OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy();
-
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- newRelationshipReference.initializeFromOwnableRelationshipReference(this);
- newRelationshipReference.initializeFromJoinTableEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromOwnableRelationshipReference(
- OrmOwnableRelationshipReference oldRelationshipReference) {
- super.initializeFromOwnableRelationshipReference(oldRelationshipReference);
- this.mappedByJoiningStrategy.setMappedByAttribute(
- oldRelationshipReference.getMappedByJoiningStrategy().getMappedByAttribute());
- }
-
- @Override
- public void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinTableEnabledRelationshipReference(oldRelationshipReference);
- OrmJoinTable oldTable =
- oldRelationshipReference.getJoinTableJoiningStrategy().getJoinTable();
- if (oldTable != null) {
- this.joinTableJoiningStrategy.addJoinTable().initializeFrom(oldTable);
- }
- }
-
- @Override
- public OrmOneToManyMapping getRelationshipMapping() {
- return (OrmOneToManyMapping) getParent();
- }
-
- public XmlOneToMany getResourceMapping() {
- return getRelationshipMapping().getResourceAttributeMapping();
- }
-
- public boolean isRelationshipOwner() {
- return this.getMappedByJoiningStrategy().getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- @Override
- public boolean isTargetForeignKeyRelationship() {
- return getJoinColumnJoiningStrategy().isTargetForeignKeyRelationship();
- }
-
-
- // **************** mapped by **********************************************
-
- public OrmMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public final void setMappedByJoiningStrategy() {
- setMappedByJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void setMappedByJoiningStrategy_() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public final void unsetMappedByJoiningStrategy() {
- unsetMappedByJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetMappedByJoiningStrategy_() {
- this.mappedByJoiningStrategy.removeStrategy();
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return this.getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join table *********************************************
-
- public OrmJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- setJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void setJoinTableJoiningStrategy_() {
- // join table is default, so no need to add to resource
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return this.mappedByJoiningStrategy.getMappedByAttribute() == null
- && ! this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns();
- }
-
-
- // **************** join columns *******************************************
-
- public OrmJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return false;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
- this.joinColumnJoiningStrategy.update();
-
- // update join table last, as the existence of a default join
- // table is dependent on the other mechanisms (mappedBy)
- // not being specified
- this.joinTableJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.mappedByJoiningStrategy.validate(messages, reporter);
- this.joinTableJoiningStrategy.validate(messages, reporter);
- this.joinColumnJoiningStrategy.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneMapping.java
deleted file mode 100644
index 277405cd38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneMapping.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-
-public abstract class AbstractOrmOneToOneMapping<T extends XmlOneToOne>
- extends AbstractOrmSingleRelationshipMapping<T>
- implements OrmOneToOneMapping2_0, OrmOrphanRemovalHolder2_0
-{
- protected final OrmOrphanRemovable2_0 orphanRemoval;
-
- // ********** constructor **********
- protected AbstractOrmOneToOneMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.orphanRemoval = ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).buildOrmOrphanRemoval(this, resourceMapping);
- }
-
- // ********** update **********
-
- @Override
- public void update() {
- super.update();
- this.getOrphanRemoval().update();
- }
-
- public int getXmlSequence() {
- return 60;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmOneToOneMapping(this);
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getOneToOnes().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getOneToOnes().remove(this.resourceAttributeMapping);
- }
-
- @Override
- public OrmOneToOneRelationshipReference2_0 getRelationshipReference() {
- return (OrmOneToOneRelationshipReference2_0) super.getRelationshipReference();
- }
-
- // ********** OrmOrphanRemovalHolder2_0 implementation **********
-
- public OrmOrphanRemovable2_0 getOrphanRemoval() {
- return this.orphanRemoval;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneRelationshipReference.java
deleted file mode 100644
index 136371467a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmOneToOneRelationshipReference.java
+++ /dev/null
@@ -1,263 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmOneToOneRelationshipReference
- extends AbstractOrmRelationshipReference
- implements OrmOneToOneRelationshipReference2_0
-{
- protected OrmMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected OrmJoinColumnJoiningStrategy joinColumnJoiningStrategy;
-
- protected OrmPrimaryKeyJoinColumnJoiningStrategy primaryKeyJoinColumnJoiningStrategy;
-
- protected OrmJoinTableJoiningStrategy joinTableJoiningStrategy;
-
-
- protected AbstractOrmOneToOneRelationshipReference(
- OrmOneToOneMapping parent, XmlOneToOne resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
- this.primaryKeyJoinColumnJoiningStrategy = buildPrimaryKeyJoinColumnJoiningStrategy();
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
-
- // initialize join columns last, as the existence of a default join
- // column is dependent on the other mechanisms (mappedBy, join table)
- // not being specified
- this.joinColumnJoiningStrategy = buildJoinColumnJoiningStrategy();
- }
-
- protected OrmMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericOrmMappedByJoiningStrategy(this, getResourceMapping());
- }
-
- protected OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericOrmJoinColumnJoiningStrategy(this, getResourceMapping());
- }
-
- protected OrmPrimaryKeyJoinColumnJoiningStrategy buildPrimaryKeyJoinColumnJoiningStrategy() {
- return new GenericOrmPrimaryKeyJoinColumnJoiningStrategy(this, getResourceMapping());
- }
-
- protected abstract OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy();
-
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- newRelationshipReference.initializeFromOwnableRelationshipReference(this);
- newRelationshipReference.initializeFromJoinColumnEnabledRelationshipReference(this);
- // no other primary key reference as of yet, so no initialization based on pk join columns
- }
-
- @Override
- public void initializeFromOwnableRelationshipReference(
- OrmOwnableRelationshipReference oldRelationshipReference) {
- this.mappedByJoiningStrategy.setMappedByAttribute(
- oldRelationshipReference.getMappedByJoiningStrategy().getMappedByAttribute());
- }
-
- @Override
- public void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference) {
- int index = 0;
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- oldRelationshipReference.getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- @Override
- public OrmOneToOneMapping getRelationshipMapping() {
- return (OrmOneToOneMapping) getParent();
- }
-
- public XmlOneToOne getResourceMapping() {
- return getRelationshipMapping().getResourceAttributeMapping();
- }
-
- public boolean isRelationshipOwner() {
- return this.mappedByJoiningStrategy.getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- // **************** mapped by **********************************************
-
- public OrmMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public void setMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join columns *******************************************
-
- public OrmJoinColumnJoiningStrategy getJoinColumnJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
- public boolean usesJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinColumnJoiningStrategy;
- }
-
- public void setJoinColumnJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- // join columns are default, so no need to add annotations
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinColumnJoiningStrategy() {
- this.joinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinColumn() {
- return this.getMappedByJoiningStrategy().getMappedByAttribute() == null
- && this.getPrimaryKeyJoinColumnJoiningStrategy().primaryKeyJoinColumnsSize() == 0
- && this.getJoinTableJoiningStrategy().getJoinTable() == null;
- }
-
-
- // **************** primary key join columns *******************************
-
- public OrmPrimaryKeyJoinColumnJoiningStrategy getPrimaryKeyJoinColumnJoiningStrategy() {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
-
- public boolean usesPrimaryKeyJoinColumnJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.primaryKeyJoinColumnJoiningStrategy;
- }
-
- public void setPrimaryKeyJoinColumnJoiningStrategy() {
- this.primaryKeyJoinColumnJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetPrimaryKeyJoinColumnJoiningStrategy() {
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultPrimaryKeyJoinColumn() {
- return false;
- }
-
-
- // **************** join table *********************************************
-
- public OrmJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public final void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.mappedByJoiningStrategy.removeStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- this.primaryKeyJoinColumnJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public final void unsetJoinTableJoiningStrategy() {
- unsetJoinTableJoiningStrategy_();
- setPredominantJoiningStrategy();
- }
-
- protected void unsetJoinTableJoiningStrategy_() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return false;
- }
-
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
- this.primaryKeyJoinColumnJoiningStrategy.update();
- this.joinTableJoiningStrategy.update();
- // update join columns last, as the existence of a default join
- // column is dependent on the other mechanisms (mappedBy, join table)
- // not being specified
- this.joinColumnJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.mappedByJoiningStrategy.validate(messages, reporter);
- this.primaryKeyJoinColumnJoiningStrategy.validate(messages, reporter);
- this.joinColumnJoiningStrategy.validate(messages, reporter);
- this.joinTableJoiningStrategy.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmPersistentAttribute.java
deleted file mode 100644
index fb0eab8ee7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmPersistentAttribute.java
+++ /dev/null
@@ -1,316 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmPersistentAttribute2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * ORM persistent attribute
- */
-public abstract class AbstractOrmPersistentAttribute
- extends AbstractOrmXmlContextNode
- implements OrmPersistentAttribute2_0
-{
- protected final Owner owner;
-
- protected OrmAttributeMapping attributeMapping;
-
- protected JavaPersistentAttribute javaPersistentAttribute;
-
- protected AccessType defaultAccess;
-
- protected AbstractOrmPersistentAttribute(OrmPersistentType parent, Owner owner, XmlAttributeMapping resourceMapping) {
- super(parent);
- this.owner = owner;
- this.attributeMapping = buildAttributeMapping(resourceMapping);
- this.javaPersistentAttribute = findJavaPersistentAttribute();
- this.defaultAccess = buildDefaultAccess();
- }
-
- public XmlAttributeMapping getResourceAttributeMapping() {
- return this.attributeMapping.getResourceAttributeMapping();
- }
-
- public JavaPersistentAttribute getJavaPersistentAttribute() {
- return this.javaPersistentAttribute;
- }
-
- protected void setJavaPersistentAttribute(JavaPersistentAttribute javaPersistentAttribute) {
- JavaPersistentAttribute old = this.javaPersistentAttribute;
- this.javaPersistentAttribute = javaPersistentAttribute;
- this.firePropertyChanged(JAVA_PERSISTENT_ATTRIBUTE_PROPERTY, old, javaPersistentAttribute);
- }
-
- protected OrmAttributeMapping buildAttributeMapping(XmlAttributeMapping resourceMapping) {
- OrmAttributeMappingDefinition mappingDefinition =
- getMappingFileDefinition().getOrmAttributeMappingDefinition(resourceMapping.getMappingKey());
- return mappingDefinition.buildContextMapping(this, resourceMapping, getXmlContextNodeFactory());
- }
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- public AccessType getAccess() {
- return getSpecifiedAccess() != null ? getSpecifiedAccess() : getDefaultAccess();
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType newAccess) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = newAccess;
- firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, this.defaultAccess);
- }
-
- public String getName() {
- return this.attributeMapping.getName();
- }
-
- public void nameChanged(String oldName, String newName) {
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public OrmAttributeMapping getSpecifiedMapping() {
- return this.attributeMapping;
- }
-
- public OrmAttributeMapping getMapping() {
- return this.attributeMapping;
- }
-
- public String getMappingKey() {
- return this.attributeMapping.getKey();
- }
-
- public String getDefaultMappingKey() {
- return null;
- }
-
- public void setSpecifiedMappingKey(String newMappingKey) {
- if (this.valuesAreEqual(this.getMappingKey(), newMappingKey)) {
- return;
- }
- OrmAttributeMapping oldMapping = this.attributeMapping;
- OrmAttributeMappingDefinition mappingDefinition =
- getMappingFileDefinition().getOrmAttributeMappingDefinition(newMappingKey);
- XmlAttributeMapping resourceAttributeMapping =
- mappingDefinition.buildResourceMapping(getResourceNodeFactory());
- this.attributeMapping = buildAttributeMapping(resourceAttributeMapping);
-
- getOwningPersistentType().changeMapping(this, oldMapping, this.attributeMapping);
- firePropertyChanged(SPECIFIED_MAPPING_PROPERTY, oldMapping, this.attributeMapping);
- }
-
- public OrmPersistentType getOwningPersistentType() {
- return (OrmPersistentType) getParent();
- }
-
- public OrmTypeMapping getOwningTypeMapping() {
- return getOwningPersistentType().getMapping();
- }
-
- public boolean isVirtual() {
- return getOwningPersistentType().containsVirtualAttribute(this);
- }
-
- public void makeVirtual() {
- if (isVirtual()) {
- throw new IllegalStateException("Attribute is already virtual"); //$NON-NLS-1$
- }
- getOwningPersistentType().makeAttributeVirtual(this);
- }
-
- public void makeSpecified() {
- if (!isVirtual()) {
- throw new IllegalStateException("Attribute is already specified"); //$NON-NLS-1$
- }
- if (getMappingKey() == MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY) {
- throw new IllegalStateException("Use makeSpecified(String) instead and specify a mapping type"); //$NON-NLS-1$
- }
- getOwningPersistentType().makeAttributeSpecified(this);
- }
-
- public void makeSpecified(String mappingKey) {
- if (!isVirtual()) {
- throw new IllegalStateException("Attribute is already specified"); //$NON-NLS-1$
- }
- getOwningPersistentType().makeAttributeSpecified(this, mappingKey);
- }
-
- public String getPrimaryKeyColumnName() {
- return this.attributeMapping.getPrimaryKeyColumnName();
- }
-
- public String getTypeName() {
- JavaPersistentAttribute javaAttribute = getJavaPersistentAttribute();
- return (javaAttribute == null) ? null : javaAttribute.getTypeName();
- }
-
- public void update() {
- this.attributeMapping.update();
- this.setJavaPersistentAttribute(findJavaPersistentAttribute());
- this.owner.updateJavaPersistentAttribute();
- this.setDefaultAccess(buildDefaultAccess());
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- getMapping().postUpdate();
- }
-
- protected JavaPersistentAttribute findJavaPersistentAttribute() {
- return this.owner.findJavaPersistentAttribute(this);
- }
-
- protected AccessType buildDefaultAccess() {
- return getOwningPersistentType().getAccess();
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public JpaStructureNode getStructureNode(int offset) {
- return this;
- }
-
- public boolean contains(int textOffset) {
- if (isVirtual()) {
- return false;
- }
- return this.attributeMapping.contains(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- if (isVirtual()) {
- return null;
- }
- return this.attributeMapping.getSelectionTextRange();
- }
-
- public void dispose() {
- //nothing to dispose
- }
-
-
- // ********** misc overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateAttribute(messages);
- this.validateModifiers(messages);
- this.attributeMapping.validate(messages, reporter);
- }
-
- protected void validateAttribute(List<IMessage> messages) {
- if (this.javaPersistentAttribute == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME,
- new String[] {this.getName(), this.getOwningPersistentType().getMapping().getClass_()},
- this.attributeMapping,
- this.attributeMapping.getNameTextRange()
- )
- );
- }
- }
-
- protected void validateModifiers(List<IMessage> messages) {
- if (this.getMappingKey() == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY) {
- return;
- }
- if (this.javaPersistentAttribute == null) {
- return;
- }
-
- if (this.javaPersistentAttribute.isField()) {
- if (this.javaPersistentAttribute.isFinal()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD));
- }
- if (this.javaPersistentAttribute.isPublic()) {
- messages.add(this.buildAttributeMessage(JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD));
- }
- } else {
- //TODO validation : need to have a validation message for final methods as well.
- //From the JPA spec : No methods or persistent instance variables of the entity class may be final.
- }
- }
-
- protected IMessage buildAttributeMessage(String msgID) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {this.getName()},
- this,
- getValidationTextRange()
- );
- }
-
- public TextRange getValidationTextRange() {
- if (isVirtual()) {
- return getOwningPersistentType().getMapping().getAttributesTextRange();
- }
- return this.attributeMapping.getValidationTextRange();
- }
-
-
- // ********** metamodel **********
-
- public String getMetamodelContainerFieldTypeName() {
- return this.getJpaContainer().getMetamodelContainerFieldTypeName();
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName() {
- return this.getJpaContainer().getMetamodelContainerFieldMapKeyTypeName((CollectionMapping) this.getMapping());
- }
-
- public String getMetamodelTypeName() {
- JavaPersistentAttribute2_0 javaAttribute = (JavaPersistentAttribute2_0) this.getJavaPersistentAttribute();
- return (javaAttribute == null) ? MetamodelField.DEFAULT_TYPE_NAME : javaAttribute.getMetamodelTypeName();
- }
-
- protected JavaPersistentAttribute.JpaContainer getJpaContainer() {
- JavaPersistentAttribute2_0 javaAttribute = (JavaPersistentAttribute2_0) getJavaPersistentAttribute();
- return javaAttribute == null ? JavaPersistentAttribute.JpaContainer.Null.instance() : javaAttribute.getJpaContainer();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
deleted file mode 100644
index fe9aedf3e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmQuery.java
+++ /dev/null
@@ -1,193 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlQuery;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-
-public abstract class AbstractOrmQuery<E extends XmlQuery> extends AbstractOrmXmlContextNode
- implements OrmQuery
-{
-
- protected String name;
-
- protected String query;
-
- protected final List<OrmQueryHint> hints;
-
- protected E resourceQuery;
-
- protected AbstractOrmQuery(XmlContextNode parent, E resourceQuery) {
- super(parent);
- this.hints = new ArrayList<OrmQueryHint>();
- this.initialize(resourceQuery);
- }
-
- protected E getResourceQuery() {
- return this.resourceQuery;
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.getResourceQuery().setName(newName);
- firePropertyChanged(Query.NAME_PROPERTY, oldName, newName);
- }
-
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String newQuery) {
- String oldQuery = this.query;
- this.query = newQuery;
- this.getResourceQuery().setQuery(newQuery);
- firePropertyChanged(Query.QUERY_PROPERTY, oldQuery, newQuery);
- }
-
- public ListIterator<OrmQueryHint> hints() {
- return new CloneListIterator<OrmQueryHint>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public OrmQueryHint addHint(int index) {
- XmlQueryHint resourceQueryHint = OrmFactory.eINSTANCE.createXmlQueryHint();
- OrmQueryHint contextQueryHint = buildQueryHint(resourceQueryHint);
- this.hints.add(index, contextQueryHint);
- this.getResourceQuery().getHints().add(index, resourceQueryHint);
- this.fireItemAdded(Query.HINTS_LIST, index, contextQueryHint);
- return contextQueryHint;
- }
-
- protected void addHint(int index, OrmQueryHint queryHint) {
- addItemToList(index, queryHint, this.hints, Query.HINTS_LIST);
- }
-
- protected void addHint(OrmQueryHint queryHint) {
- this.addHint(this.hints.size(), queryHint);
- }
-
- public void removeHint(QueryHint queryHint) {
- removeHint(this.hints.indexOf(queryHint));
- }
-
- public void removeHint(int index) {
- OrmQueryHint queryHint = this.hints.remove(index);
- this.getResourceQuery().getHints().remove(index);
- fireItemRemoved(Query.HINTS_LIST, index, queryHint);
- }
-
- protected void removeHint_(OrmQueryHint queryHint) {
- removeItemFromList(queryHint, this.hints, Query.HINTS_LIST);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- this.getResourceQuery().getHints().move(targetIndex, sourceIndex);
- moveItemInList(targetIndex, sourceIndex, this.hints, Query.HINTS_LIST);
- }
-
-
- protected void initialize(E xmlQuery) {
- this.resourceQuery = xmlQuery;
- this.name = xmlQuery.getName();
- this.query = xmlQuery.getQuery();
- this.initializeHints();
- }
-
- protected void initializeHints() {
- for (XmlQueryHint resourceQueryHint : this.resourceQuery.getHints()) {
- this.hints.add(buildQueryHint(resourceQueryHint));
- }
- }
-
- protected OrmQueryHint buildQueryHint(XmlQueryHint resourceQueryHint) {
- return getXmlContextNodeFactory().buildOrmQueryHint(this, resourceQueryHint);
- }
-
- public void update(E xmlQuery) {
- this.resourceQuery = xmlQuery;
- this.setName(xmlQuery.getName());
- this.setQuery(xmlQuery.getQuery());
- this.updateHints();
- getPersistenceUnit().addQuery(this);
- }
-
- protected void updateHints() {
- // make a copy of the XML hints (to prevent ConcurrentModificationException)
- Iterator<XmlQueryHint> xmlHints = new CloneIterator<XmlQueryHint>(this.resourceQuery.getHints());
-
- for (Iterator<OrmQueryHint> contextHints = this.hints(); contextHints.hasNext(); ) {
- OrmQueryHint contextHint = contextHints.next();
- if (xmlHints.hasNext()) {
- contextHint.update(xmlHints.next());
- }
- else {
- removeHint_(contextHint);
- }
- }
-
- while (xmlHints.hasNext()) {
- addHint(buildQueryHint(xmlHints.next()));
- }
- }
-
- public boolean overrides(Query other) {
- // this isn't ideal, but it will have to do until we have further adopter input
- return (this.name != null)
- && this.name.equals(other.getName())
- && (other instanceof JavaQuery);
- }
-
- public boolean duplicates(Query other) {
- return (this != other)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(other.getName())
- && ! this.overrides(other)
- && ! other.overrides(this);
- }
-
- public TextRange getValidationTextRange() {
- return this.getResourceQuery().getValidationTextRange();
- }
-
- public TextRange getNameTextRange() {
- return this.getResourceQuery().getNameTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java
deleted file mode 100644
index 975ffef534..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipMapping.java
+++ /dev/null
@@ -1,356 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmCascade;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCascade2_0;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmRelationshipMapping<T extends AbstractXmlRelationshipMapping>
- extends AbstractOrmAttributeMapping<T>
- implements OrmRelationshipMapping
-{
- protected String specifiedTargetEntity;
- protected String defaultTargetEntity;
- protected PersistentType resolvedTargetType;
- protected Entity resolvedTargetEntity;
-
- protected final OrmRelationshipReference relationshipReference;
-
- protected final OrmCascade2_0 cascade;
-
- protected FetchType specifiedFetch;
-
-
- protected AbstractOrmRelationshipMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.relationshipReference = buildRelationshipReference();
- this.cascade = buildCascade();
- this.specifiedTargetEntity = getResourceTargetEntity();
- this.defaultTargetEntity = buildDefaultTargetEntity();
- this.resolvedTargetType = this.resolveTargetType();
- this.resolvedTargetEntity = this.resolveTargetEntity();
- this.specifiedFetch = getResourceFetch();
- }
-
- @Override
- public void update() {
- super.update();
- this.relationshipReference.update();
- this.cascade.update();
- this.setSpecifiedTargetEntity_(this.getResourceTargetEntity());
- this.setDefaultTargetEntity(this.buildDefaultTargetEntity());
- this.resolvedTargetType = this.resolveTargetType();
- this.setResolvedTargetEntity(this.resolveTargetEntity());
- this.setSpecifiedFetch_(this.getResourceFetch());
- }
-
- protected abstract OrmRelationshipReference buildRelationshipReference();
-
- @Override
- public OrmPersistentAttribute getParent() {
- return (OrmPersistentAttribute) super.getParent();
- }
-
- @Override
- public boolean isRelationshipOwner() {
- return this.relationshipReference.isRelationshipOwner();
- }
-
- @Override
- public boolean isOwnedBy(AttributeMapping mapping) {
- if (mapping.isRelationshipOwner()) {
- return this.relationshipReference.isOwnedBy((RelationshipMapping) mapping);
- }
- return false;
- }
-
- public RelationshipMapping getRelationshipOwner() {
- Entity targetEntity = this.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- for (PersistentAttribute each :
- CollectionTools.iterable(
- targetEntity.getPersistentType().allAttributes())) {
- if (this.isOwnedBy(each.getMapping())) {
- return (RelationshipMapping) each.getMapping();
- }
- }
- return null;
- }
-
- @Override
- public boolean isOverridableAssociationMapping() {
- return this.relationshipReference.isOverridableAssociation();
- }
-
-
- // **************** target entity ******************************************
-
- public char getTargetEntityEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getTargetEntity() {
- return (this.specifiedTargetEntity != null) ? this.specifiedTargetEntity : this.defaultTargetEntity;
- }
-
- public String getSpecifiedTargetEntity() {
- return this.specifiedTargetEntity;
- }
-
- public void setSpecifiedTargetEntity(String targetEntity) {
- String old = this.specifiedTargetEntity;
- this.specifiedTargetEntity = targetEntity;
- this.resourceAttributeMapping.setTargetEntity(targetEntity);
- this.firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- protected void setSpecifiedTargetEntity_(String targetEntity) {
- String old = this.specifiedTargetEntity;
- this.specifiedTargetEntity = targetEntity;
- this.firePropertyChanged(SPECIFIED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- public String getDefaultTargetEntity() {
- return this.defaultTargetEntity;
- }
-
- protected void setDefaultTargetEntity(String targetEntity) {
- String old = this.defaultTargetEntity;
- this.defaultTargetEntity = targetEntity;
- this.firePropertyChanged(DEFAULT_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- public Entity getResolvedTargetEntity() {
- return this.resolvedTargetEntity;
- }
-
- protected void setResolvedTargetEntity(Entity targetEntity) {
- Entity old = this.resolvedTargetEntity;
- this.resolvedTargetEntity = targetEntity;
- this.firePropertyChanged(RESOLVED_TARGET_ENTITY_PROPERTY, old, targetEntity);
- }
-
- public PersistentType getResolvedTargetType() {
- return this.resolvedTargetType;
- }
-
- protected PersistentType resolveTargetType() {
- return this.resolvePersistentType(this.getTargetEntity());
- }
-
- protected String getResourceTargetEntity() {
- return this.resourceAttributeMapping.getTargetEntity();
- }
-
- protected String buildDefaultTargetEntity() {
- if (this.getJavaPersistentAttribute() != null) {
- return getResourceDefaultTargetEntity();
- }
- return null;
- }
-
- protected abstract String getResourceDefaultTargetEntity();
-
- protected Entity resolveTargetEntity() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
-
- // **************** reference **********************************************
-
- public OrmRelationshipReference getRelationshipReference() {
- return this.relationshipReference;
- }
-
-
- // **************** cascade ************************************************
-
- protected OrmCascade2_0 buildCascade() {
- return new GenericOrmCascade(this, this.resourceAttributeMapping);
- }
-
- public OrmCascade2_0 getCascade() {
- return this.cascade;
- }
-
-
- // **************** fetch **************************************************
-
- public FetchType getFetch() {
- return (this.specifiedFetch != null) ? this.specifiedFetch : this.getDefaultFetch();
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType fetch) {
- FetchType old = this.specifiedFetch;
- this.specifiedFetch = fetch;
- this.resourceAttributeMapping.setFetch(FetchType.toOrmResourceModel(fetch));
- this.firePropertyChanged(SPECIFIED_FETCH_PROPERTY, old, fetch);
- }
-
- protected void setSpecifiedFetch_(FetchType fetch) {
- FetchType old = this.specifiedFetch;
- this.specifiedFetch = fetch;
- this.firePropertyChanged(SPECIFIED_FETCH_PROPERTY, old, fetch);
- }
- protected FetchType getResourceFetch() {
- return FetchType.fromOrmResourceModel(this.resourceAttributeMapping.getFetch());
- }
-
-
- // ********** RelationshipMapping implementation **********
-
- @Override
- public void initializeFromOrmRelationshipMapping(OrmRelationshipMapping oldMapping) {
- super.initializeFromOrmRelationshipMapping(oldMapping);
- setSpecifiedTargetEntity(oldMapping.getSpecifiedTargetEntity());
- setSpecifiedFetch(oldMapping.getSpecifiedFetch());
- oldMapping.getRelationshipReference().initializeOn(this.relationshipReference);
- this.cascade.initializeFrom(oldMapping.getCascade());
- //TODO should we set the fetch type from a BasicMapping??
- }
-
- public Iterator<String> allTargetEntityAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.allTargetEntityAttributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- });
- }
-
- public Iterator<AttributeMapping> allTargetEntityAttributeMappings() {
- return (this.resolvedTargetEntity != null) ?
- this.resolvedTargetEntity.allAttributeMappings() :
- EmptyIterator.<AttributeMapping> instance();
- }
-
- protected String getTargetEntityIdAttributeName() {
- PersistentAttribute attribute = this.getTargetEntityIdAttribute();
- return (attribute == null) ? null : attribute.getName();
- }
-
- protected PersistentAttribute getTargetEntityIdAttribute() {
- return (this.resolvedTargetEntity == null) ? null : this.resolvedTargetEntity.getIdAttribute();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateTargetEntity(messages);
- this.relationshipReference.validate(messages, reporter);
- }
-
- protected void validateTargetEntity(List<IMessage> messages) {
- if (getTargetEntity() == null) {
- if (getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_ENTITY_NOT_DEFINED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- else if (getResolvedTargetEntity() == null) {
- if (getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY,
- new String[] {this.getName(), getTargetEntity()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY,
- new String[] {getTargetEntity(), this.getName()},
- this,
- this.getTargetEntityTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getTextRange(TextRange textRange) {
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
- protected TextRange getTargetEntityTextRange() {
- return this.getTextRange(this.getResourceAttributeMapping().getTargetEntityTextRange());
- }
-
-
- // ********** metamodel **********
-
- @Override
- public String getMetamodelTypeName() {
- if (this.resolvedTargetType == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- String targetTypeName = this.resolvedTargetType.getName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipReference.java
deleted file mode 100644
index 5f522255ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmRelationshipReference.java
+++ /dev/null
@@ -1,126 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public abstract class AbstractOrmRelationshipReference
- extends AbstractOrmXmlContextNode
- implements OrmRelationshipReference
-{
- protected AbstractXmlRelationshipMapping resourceMapping;
-
- // cache the strategy for property change notification
- protected OrmJoiningStrategy cachedPredominantJoiningStrategy;
-
-
- protected AbstractOrmRelationshipReference(
- OrmRelationshipMapping parent, AbstractXmlRelationshipMapping resourceMapping) {
-
- super(parent);
- this.resourceMapping = resourceMapping;
- this.initialize();
- }
-
- public void initializeFromOwnableRelationshipReference(
- OrmOwnableRelationshipReference oldRelationshipReference) {
- // no op
- }
-
- public void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference) {
- // no op
- }
-
- public void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference) {
- // no op
- }
-
- public OrmRelationshipMapping getRelationshipMapping() {
- return (OrmRelationshipMapping) getParent();
- }
-
- public TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public Entity getEntity() {
- TypeMapping typeMapping = getTypeMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public boolean isOverridableAssociation() {
- return getPredominantJoiningStrategy().isOverridableAssociation();
- }
-
- public boolean isParentVirtual() {
- return getRelationshipMapping().getPersistentAttribute().isVirtual();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
-
- // **************** predominant joining strategy ***************************
-
- public OrmJoiningStrategy getPredominantJoiningStrategy() {
- return this.cachedPredominantJoiningStrategy;
- }
-
- protected void setPredominantJoiningStrategy() {
- setPredominantJoiningStrategy(calculatePredominantJoiningStrategy());
- }
-
- protected void setPredominantJoiningStrategy(OrmJoiningStrategy newJoiningStrategy) {
- JoiningStrategy oldJoiningStrategy = this.cachedPredominantJoiningStrategy;
- this.cachedPredominantJoiningStrategy = newJoiningStrategy;
- firePropertyChanged(PREDOMINANT_JOINING_STRATEGY_PROPERTY, oldJoiningStrategy, newJoiningStrategy);
- }
-
-
- // **************** resource -> context ************************************
-
- protected void initialize() {
- initializeJoiningStrategies();
- this.cachedPredominantJoiningStrategy = calculatePredominantJoiningStrategy();
- }
-
- protected abstract void initializeJoiningStrategies();
-
-
- public void update() {
- updateJoiningStrategies();
- setPredominantJoiningStrategy();
- }
-
- protected abstract void updateJoiningStrategies();
-
- protected abstract OrmJoiningStrategy calculatePredominantJoiningStrategy();
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange() {
- return getRelationshipMapping().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSequenceGenerator.java
deleted file mode 100644
index 4f3f6df0be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSequenceGenerator.java
+++ /dev/null
@@ -1,90 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- *
- */
-public abstract class AbstractOrmSequenceGenerator
- extends AbstractOrmGenerator<XmlSequenceGenerator>
- implements OrmSequenceGenerator
-{
-
- protected String specifiedSequenceName;
- protected String defaultSequenceName;
-
-
- protected AbstractOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- super(parent);
- this.initialize(resourceSequenceGenerator);
- }
-
-
- @Override
- public int getDefaultInitialValue() {
- return SequenceGenerator.DEFAULT_INITIAL_VALUE;
- }
-
- // ********** sequence name **********
-
- public String getSequenceName() {
- return (this.specifiedSequenceName != null) ? this.specifiedSequenceName : this.defaultSequenceName;
- }
-
- public String getSpecifiedSequenceName() {
- return this.specifiedSequenceName;
- }
-
- public void setSpecifiedSequenceName(String specifiedSequenceName) {
- String old = this.specifiedSequenceName;
- this.specifiedSequenceName = specifiedSequenceName;
- this.getResourceGenerator().setSequenceName(specifiedSequenceName);
- this.firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, old, specifiedSequenceName);
- }
-
- protected void setSpecifiedSequenceName_(String specifiedSequenceName) {
- String old = this.specifiedSequenceName;
- this.specifiedSequenceName = specifiedSequenceName;
- this.firePropertyChanged(SPECIFIED_SEQUENCE_NAME_PROPERTY, old, specifiedSequenceName);
- }
-
- public String getDefaultSequenceName() {
- return this.defaultSequenceName;
- }
-
- protected void setDefaultSequenceName(String defaultSequenceName) {
- String old = this.defaultSequenceName;
- this.defaultSequenceName = defaultSequenceName;
- this.firePropertyChanged(DEFAULT_SEQUENCE_NAME_PROPERTY, old, defaultSequenceName);
- }
-
-
- // ********** resource => context **********
-
- @Override
- protected void initialize(XmlSequenceGenerator sequenceGenerator) {
- super.initialize(sequenceGenerator);
- this.specifiedSequenceName = sequenceGenerator.getSequenceName();
- //TODO default sequence name
- }
-
- @Override
- public void update(XmlSequenceGenerator sequenceGenerator) {
- super.update(sequenceGenerator);
- this.setSpecifiedSequenceName_(sequenceGenerator.getSequenceName());
- //TODO default sequence name
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
deleted file mode 100644
index a4244858e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmSingleRelationshipMapping.java
+++ /dev/null
@@ -1,120 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Nullable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmSingleRelationshipMapping<T extends AbstractXmlSingleRelationshipMapping>
- extends AbstractOrmRelationshipMapping<T>
- implements OrmSingleRelationshipMapping2_0
-{
- protected Boolean specifiedOptional;
-
- protected final OrmDerivedIdentity2_0 derivedIdentity;
-
-
- protected AbstractOrmSingleRelationshipMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.specifiedOptional = this.getResourceOptional();
- //TODO defaultOptional
- this.derivedIdentity = buildDerivedIdentity();
- }
-
-
- @Override
- public void initializeFromOrmSingleRelationshipMapping(OrmSingleRelationshipMapping oldMapping) {
- super.initializeFromOrmSingleRelationshipMapping(oldMapping);
- getDerivedIdentity().initializeFrom(((OrmSingleRelationshipMapping2_0) oldMapping).getDerivedIdentity());
- }
-
- @Override
- protected String getResourceDefaultTargetEntity() {
- return this.getJavaPersistentAttribute().getSingleReferenceTargetTypeName();
- }
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
-
- // **************** optional ***********************************************
-
- public boolean isOptional() {
- return (this.specifiedOptional != null) ? this.specifiedOptional.booleanValue() : this.isDefaultOptional();
- }
-
- public Boolean getSpecifiedOptional() {
- return this.specifiedOptional;
- }
-
- public void setSpecifiedOptional(Boolean optional) {
- Boolean old = this.specifiedOptional;
- this.specifiedOptional = optional;
- this.resourceAttributeMapping.setOptional(optional);
- this.firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, old, optional);
- }
-
- protected void setSpecifiedOptional_(Boolean optional) {
- Boolean old = this.specifiedOptional;
- this.specifiedOptional = optional;
- this.firePropertyChanged(Nullable.SPECIFIED_OPTIONAL_PROPERTY, old, optional);
- }
-
- public boolean isDefaultOptional() {
- return Nullable.DEFAULT_OPTIONAL;
- }
-
-
- // ********** 2.0 derived identity **********
-
- protected OrmDerivedIdentity2_0 buildDerivedIdentity() {
- return ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).
- buildOrmDerivedIdentity(this, (XmlSingleRelationshipMapping_2_0) this.resourceAttributeMapping);
- }
-
- public OrmDerivedIdentity2_0 getDerivedIdentity() {
- return this.derivedIdentity;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedOptional_(this.getResourceOptional());
- this.derivedIdentity.update();
- }
-
- protected Boolean getResourceOptional() {
- return this.resourceAttributeMapping.getOptional();
- }
-
-
- // **************** validation ************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.derivedIdentity.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java
deleted file mode 100644
index 41d1ff0535..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTable.java
+++ /dev/null
@@ -1,475 +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.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.Table;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- *
- */
-public abstract class AbstractOrmTable
- extends AbstractOrmXmlContextNode
- implements Table, UniqueConstraint.Owner
-{
- protected String specifiedName;
- protected String defaultName;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected final List<OrmUniqueConstraint> uniqueConstraints;
-
-
- // ********** constructor **********
-
- protected AbstractOrmTable(XmlContextNode parent) {
- super(parent);
- this.uniqueConstraints = new ArrayList<OrmUniqueConstraint>();
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return null if no resource table exists.
- */
- protected abstract AbstractXmlTable getResourceTable();
-
- /**
- * Return the added resource table.
- */
- protected abstract AbstractXmlTable addResourceTable();
-
- protected abstract void removeResourceTable();
-
- protected abstract String buildDefaultName();
-
- protected abstract String buildDefaultSchema();
-
- protected abstract String buildDefaultCatalog();
-
-
- public boolean isResourceSpecified() {
- return this.getResourceTable() != null;
- }
-
- // ********** name **********
-
- public String getName() {
- return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
- }
-
- public String getSpecifiedName() {
- return this.specifiedName;
- }
-
- public void setSpecifiedName(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- if (this.attributeValueHasChanged(old, name)) {
- AbstractXmlTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setName(name);
- if (resourceTable.isUnset()) {
- this.removeResourceTable();
- }
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
- }
-
- protected void setSpecifiedName_(String name) {
- String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultName() {
- return this.defaultName;
- }
-
- protected void setDefaultName(String name) {
- String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
- }
-
-
- // ********** schema **********
-
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- if (this.attributeValueHasChanged(old, schema)) {
- AbstractXmlTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setSchema(schema);
- if (resourceTable.isUnset()) {
- this.removeResourceTable();
- }
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
-
- // ********** catalog **********
-
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- if (this.attributeValueHasChanged(old, catalog)) {
- AbstractXmlTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.setCatalog(catalog);
- if (resourceTable.isUnset()) {
- this.removeResourceTable();
- }
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
- }
-
- protected void setSpecifiedCatalog_(String newSpecifiedCatalog) {
- String oldSpecifiedCatalog = this.specifiedCatalog;
- this.specifiedCatalog = newSpecifiedCatalog;
- firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, oldSpecifiedCatalog, newSpecifiedCatalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String newDefaultCatalog) {
- String oldDefaultCatalog = this.defaultCatalog;
- this.defaultCatalog = newDefaultCatalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, oldDefaultCatalog, newDefaultCatalog);
- }
-
-
- // ********** unique constraints **********
-
- public @SuppressWarnings("unchecked") ListIterator<OrmUniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<OrmUniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public OrmUniqueConstraint addUniqueConstraint(int index) {
- XmlUniqueConstraint resourceConstraint = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- OrmUniqueConstraint contextConstraint = this.buildUniqueConstraint(resourceConstraint);
- this.uniqueConstraints.add(index, contextConstraint);
-
- AbstractXmlTable resourceTable = this.getResourceTable();
- if (resourceTable == null) {
- resourceTable = this.addResourceTable();
- }
- resourceTable.getUniqueConstraints().add(index, resourceConstraint);
-
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, contextConstraint);
- return contextConstraint;
- }
-
- protected void addUniqueConstraint(int index, OrmUniqueConstraint uniqueConstraint) {
- this.addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- protected void addUniqueConstraint(OrmUniqueConstraint uniqueConstraint) {
- this.addUniqueConstraint(this.uniqueConstraints.size(), uniqueConstraint);
- }
-
- public void removeUniqueConstraint(UniqueConstraint uniqueConstraint) {
- this.removeUniqueConstraint(this.uniqueConstraints.indexOf(uniqueConstraint));
- }
-
- public void removeUniqueConstraint(int index) {
- OrmUniqueConstraint removedUniqueConstraint = this.uniqueConstraints.remove(index);
- this.getResourceTable().getUniqueConstraints().remove(index);
- this.fireItemRemoved(UNIQUE_CONSTRAINTS_LIST, index, removedUniqueConstraint);
- }
-
- protected void removeUniqueConstraint_(OrmUniqueConstraint uniqueConstraint) {
- this.removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- this.getResourceTable().getUniqueConstraints().move(targetIndex, sourceIndex);
- this.fireItemMoved(UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
-
- // ********** convenience methods **********
-
- protected TextRange getTextRange(TextRange textRange) {
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
- protected TextRange getNameTextRange() {
- return this.getTextRange(this.getResourceTableNameTextRange());
- }
-
- protected TextRange getResourceTableNameTextRange() {
- AbstractXmlTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getNameTextRange();
- }
-
- protected TextRange getSchemaTextRange() {
- return this.getTextRange(this.getResourceTableSchemaTextRange());
- }
-
- protected TextRange getResourceTableSchemaTextRange() {
- AbstractXmlTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getSchemaTextRange();
- }
-
- protected TextRange getCatalogTextRange() {
- return this.getTextRange(this.getResourceTableCatalogTextRange());
- }
-
- protected TextRange getResourceTableCatalogTextRange() {
- AbstractXmlTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getCatalogTextRange();
- }
-
- protected OrmUniqueConstraint buildUniqueConstraint(XmlUniqueConstraint resourceUniqueConstraint) {
- return this.getXmlContextNodeFactory().buildOrmUniqueConstraint(this, this, resourceUniqueConstraint);
- }
-
-
- // ********** resource => context **********
-
- protected void initialize(AbstractXmlTable xmlTable) {
- this.defaultName = this.buildDefaultName();
- this.specifiedName = this.getResourceTableName(xmlTable);
-
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = this.getResourceTableSchema(xmlTable);
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = this.getResourceTableCatalog(xmlTable);
-
- this.initializeUniqueContraints(xmlTable);
- }
-
- protected void initializeUniqueContraints(AbstractXmlTable xmlTable) {
- if (xmlTable == null) {
- return;
- }
- for (XmlUniqueConstraint uniqueConstraint : xmlTable.getUniqueConstraints()) {
- this.uniqueConstraints.add(this.buildUniqueConstraint(uniqueConstraint));
- }
- }
-
- protected void update(AbstractXmlTable xmlTable) {
- this.setDefaultName(this.buildDefaultName());
- this.setSpecifiedName_(this.getResourceTableName(xmlTable));
-
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(this.getResourceTableSchema(xmlTable));
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(this.getResourceTableCatalog(xmlTable));
-
- this.updateUniqueConstraints(xmlTable);
- }
-
- protected String getResourceTableName(AbstractXmlTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getName();
- }
-
- protected String getResourceTableSchema(AbstractXmlTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getSchema();
- }
-
- protected String getResourceTableCatalog(AbstractXmlTable xmlTable) {
- return (xmlTable == null) ? null : xmlTable.getCatalog();
- }
-
- protected void updateUniqueConstraints(AbstractXmlTable xmlTable) {
- Iterator<XmlUniqueConstraint> xmlConstraints = this.xmlUniqueConstraints(xmlTable);
-
- for (Iterator<OrmUniqueConstraint> contextConstraints = this.uniqueConstraints(); contextConstraints.hasNext(); ) {
- OrmUniqueConstraint contextConstraint = contextConstraints.next();
- if (xmlConstraints.hasNext()) {
- contextConstraint.update(xmlConstraints.next());
- } else {
- this.removeUniqueConstraint_(contextConstraint);
- }
- }
-
- while (xmlConstraints.hasNext()) {
- this.addUniqueConstraint(this.buildUniqueConstraint(xmlConstraints.next()));
- }
- }
-
- protected Iterator<XmlUniqueConstraint> xmlUniqueConstraints(AbstractXmlTable xmlTable) {
- // make a copy of the XML constraints (to prevent ConcurrentModificationException)
- return (xmlTable == null) ? EmptyIterator.<XmlUniqueConstraint>instance()
- : new CloneIterator<XmlUniqueConstraint>(xmlTable.getUniqueConstraints());
- }
-
- public void initializeFrom(Table oldTable) {
- this.setSpecifiedName(oldTable.getSpecifiedName());
- this.setSpecifiedCatalog(oldTable.getSpecifiedCatalog());
- this.setSpecifiedSchema(oldTable.getSpecifiedSchema());
- }
-
-
- // ********** database stuff **********
-
- public org.eclipse.jpt.db.Table getDbTable() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema == null) ? null : dbSchema.getTableForIdentifier(this.getName());
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
- public boolean isResolved() {
- return this.getDbTable() != null;
- }
-
- public boolean hasResolvedSchema() {
- return this.getDbSchema() != null;
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.getDbCatalog(catalog) != null);
- }
-
-
- // ********** UniqueConstraint.Owner implementation **********
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers().iterator() : EmptyIterator.<String>instance();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- return this.getTextRange(this.getResourceTableValidationTextRange());
- }
-
- protected TextRange getResourceTableValidationTextRange() {
- AbstractXmlTable resourceTable = this.getResourceTable();
- return (resourceTable == null) ? null : resourceTable.getValidationTextRange();
- }
-
-
- // ********** misc **********
-
- /**
- * covariant override
- */
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.getQualifiedName());
- }
-
- protected String getQualifiedName() {
- return NameTools.buildQualifiedDatabaseObjectName(this.getCatalog(), this.getSchema(), this.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java
deleted file mode 100644
index 9b3eed9c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmTypeMapping.java
+++ /dev/null
@@ -1,363 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmTypeMapping<T extends XmlTypeMapping>
- extends AbstractOrmXmlContextNode
- implements OrmTypeMapping
-{
- protected String class_;
-
- public boolean defaultMetadataComplete;
-
- protected Boolean specifiedMetadataComplete;
-
- protected final T resourceTypeMapping;
-
-
- protected AbstractOrmTypeMapping(OrmPersistentType parent, T resourceMapping) {
- super(parent);
- this.resourceTypeMapping = resourceMapping;
- this.class_ = this.getResourceClassName();
- this.specifiedMetadataComplete = this.getResourceMetadataComplete();
- this.defaultMetadataComplete = this.getPersistentType().isDefaultMetadataComplete();
- }
-
- // **************** Type Mapping implementation *****************************
-
- @Override
- public OrmPersistentType getParent() {
- return (OrmPersistentType) super.getParent();
- }
-
- public OrmPersistentType getPersistentType() {
- return this.getParent();
- }
-
- protected JavaPersistentType getJavaPersistentType() {
- return this.getPersistentType().getJavaPersistentType();
- }
-
- public boolean isMapped() {
- return true;
- }
-
- /* default implementation */
- public JavaPersistentType getIdClass() {
- return null;
- }
-
- public String getPrimaryTableName() {
- return null;
- }
-
- public String getClass_() {
- return this.class_;
- }
-
- public void setClass(String newClass) {
- String oldClass = this.class_;
- this.class_ = newClass;
- this.resourceTypeMapping.setClassName(newClass);
- firePropertyChanged(CLASS_PROPERTY, oldClass, newClass);
- getPersistentType().classChanged(oldClass, newClass);
- }
-
-
- public boolean isMetadataComplete() {
- if (isDefaultMetadataComplete()) {
- //entity-mappings/persistence-unit-metadata/xml-mapping-metadata-complete is specified, then it overrides
- //anything set here
- return true;
- }
- return (this.getSpecifiedMetadataComplete() == null) ? this.isDefaultMetadataComplete() : this.getSpecifiedMetadataComplete().booleanValue();
- }
-
- public boolean isDefaultMetadataComplete() {
- return this.defaultMetadataComplete;
- }
-
- protected void setDefaultMetadataComplete(boolean newDefaultMetadataComplete) {
- boolean oldMetadataComplete = this.defaultMetadataComplete;
- this.defaultMetadataComplete = newDefaultMetadataComplete;
- firePropertyChanged(DEFAULT_METADATA_COMPLETE_PROPERTY, oldMetadataComplete, newDefaultMetadataComplete);
- }
-
- public Boolean getSpecifiedMetadataComplete() {
- return this.specifiedMetadataComplete;
- }
-
- public void setSpecifiedMetadataComplete(Boolean newSpecifiedMetadataComplete) {
- Boolean oldMetadataComplete = this.specifiedMetadataComplete;
- this.specifiedMetadataComplete = newSpecifiedMetadataComplete;
- this.resourceTypeMapping.setMetadataComplete(newSpecifiedMetadataComplete);
- firePropertyChanged(SPECIFIED_METADATA_COMPLETE_PROPERTY, oldMetadataComplete, newSpecifiedMetadataComplete);
- }
-
- /**
- * ITypeMapping is changed and various ITypeMappings may have
- * common settings. In this method initialize the new ITypeMapping (this)
- * fromthe old ITypeMapping (oldMapping)
- */
- public void initializeFrom(OrmTypeMapping oldMapping) {
- this.setClass(oldMapping.getClass_());
- this.setSpecifiedMetadataComplete(oldMapping.getSpecifiedMetadataComplete());
- this.setDefaultMetadataComplete(oldMapping.isDefaultMetadataComplete());
- }
-
- public Table getPrimaryDbTable() {
- return null;
- }
-
- public Table getDbTable(String tableName) {
- return null;
- }
-
- public Schema getDbSchema() {
- return null;
- }
-
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return true;
- }
-
- public Iterator<OrmAttributeMapping> attributeMappings() {
- return new TransformationIterator<OrmPersistentAttribute, OrmAttributeMapping>(getPersistentType().attributes()) {
- @Override
- protected OrmAttributeMapping transform(OrmPersistentAttribute attribute) {
- return attribute.getMapping();
- }
- };
- }
-
- public Iterable<OrmAttributeMapping> getAttributeMappings(final String mappingKey) {
- return new FilteringIterable<OrmAttributeMapping>(CollectionTools.collection(attributeMappings())) {
- @Override
- protected boolean accept(OrmAttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), mappingKey);
- }
- };
- }
-
- public Iterator<AttributeMapping> allAttributeMappings() {
- return new CompositeIterator<AttributeMapping>(
- new TransformationIterator<TypeMapping, Iterator<AttributeMapping>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<AttributeMapping> transform(TypeMapping typeMapping) {
- return typeMapping.attributeMappings();
- }
- });
- }
-
- public Iterable<AttributeMapping> getAllAttributeMappings(final String mappingKey) {
- return new FilteringIterable<AttributeMapping>(CollectionTools.collection(allAttributeMappings())) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), mappingKey);
- }
- };
- }
-
- public TypeMapping getSuperTypeMapping() {
- return (getPersistentType().getSuperPersistentType() == null) ?
- null
- : getPersistentType().getSuperPersistentType().getMapping();
- }
-
- /**
- * Return an iterator of TypeMappings, each which inherits from the one before,
- * and terminates at the root entity (or at the point of cyclicity).
- */
- public Iterator<TypeMapping> inheritanceHierarchy() {
- return new TransformationIterator<PersistentType, TypeMapping>(getPersistentType().inheritanceHierarchy()) {
- @Override
- protected TypeMapping transform(PersistentType type) {
- return type.getMapping();
- }
- };
- }
-
- public Iterator<String> overridableAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.attributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- });
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAttributeNames();
- }
- });
- }
-
- public Column resolveOverriddenColumn(String attributeName) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(attributeMappings())) {
- Column resolvedColumn = attributeMapping.resolveOverriddenColumn(attributeName);
- if (resolvedColumn != null) {
- return resolvedColumn;
- }
- }
- if (!isMetadataComplete()) {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- if (javaPersistentType != null) {
- return javaPersistentType.getMapping().resolveOverriddenColumn(attributeName);
- }
- }
- return null;
- }
-
- public Iterator<String> overridableAssociationNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.attributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- });
- }
-
- public Iterator<String> allOverridableAssociationNames() {
- return new CompositeIterator<String>(new TransformationIterator<TypeMapping, Iterator<String>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<String> transform(TypeMapping mapping) {
- return mapping.overridableAssociationNames();
- }
- });
- }
-
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(attributeMappings())) {
- RelationshipReference resolvedRelationshipReference = attributeMapping.resolveRelationshipReference(attributeName);
- if (resolvedRelationshipReference != null) {
- return resolvedRelationshipReference;
- }
- }
- if (!isMetadataComplete()) {
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- if (javaPersistentType != null) {
- return javaPersistentType.getMapping().resolveRelationshipReference(attributeName);
- }
- }
- return null;
- }
-
- public T getResourceTypeMapping() {
- return this.resourceTypeMapping;
- }
-
- public void update() {
- this.setClass(this.getResourceClassName());
- this.setSpecifiedMetadataComplete(this.getResourceMetadataComplete());
- this.setDefaultMetadataComplete(this.getPersistentType().isDefaultMetadataComplete());
- }
-
- protected String getResourceClassName() {
- return this.resourceTypeMapping.getClassName();
- }
-
- protected Boolean getResourceMetadataComplete() {
- return this.resourceTypeMapping.getMetadataComplete();
- }
-
-
- // *************************************************************************
-
- public JpaStructureNode getStructureNode(int offset) {
- if (this.resourceTypeMapping.containsOffset(offset)) {
- return getPersistentType();
- }
- return null;
- }
-
- public TextRange getSelectionTextRange() {
- return this.resourceTypeMapping.getSelectionTextRange();
- }
-
- public TextRange getClassTextRange() {
- return this.resourceTypeMapping.getClassTextRange();
- }
-
- public TextRange getAttributesTextRange() {
- return this.resourceTypeMapping.getAttributesTextRange();
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.resourceTypeMapping != null)
- && this.resourceTypeMapping.containsOffset(textOffset);
- }
-
- //************************* validation ************************
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateClass(messages);
- }
-
- protected void validateClass(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.class_)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS,
- this,
- this.getClassTextRange()
- )
- );
- return;
- }
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return getPersistenceUnit().shouldValidateAgainstDatabase();
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceTypeMapping.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getPersistentType().getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmVersionMapping.java
deleted file mode 100644
index 609fb02d07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmVersionMapping.java
+++ /dev/null
@@ -1,245 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmVersionMapping<T extends XmlVersion>
- extends AbstractOrmAttributeMapping<T>
- implements OrmVersionMapping
-{
- protected final OrmColumn column;
-
- protected OrmConverter converter;
-
- protected final OrmConverter nullConverter;
-
- protected AbstractOrmVersionMapping(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.column = getXmlContextNodeFactory().buildOrmColumn(this, this);
- this.column.initialize(this.getResourceColumn());//TODO pass in to constructor
- this.nullConverter = this.getXmlContextNodeFactory().buildOrmNullConverter(this);
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
- public int getXmlSequence() {
- return 30;
- }
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmVersionMapping(this);
- }
-
- @Override
- public void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromOrmColumnMapping(oldMapping);
- getColumn().initializeFrom(oldMapping.getColumn());
- }
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- public OrmConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- OrmConverter oldConverter = this.converter;
- OrmConverter newConverter = buildConverter(converterType);
- this.converter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.converter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getVersions().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getVersions().remove(this.resourceAttributeMapping);
- }
-
- //************** NamedColumn.Owner implementation ***************
-
- public String getDefaultColumnName() {
- return getName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- //************** BaseColumn.Owner implementation ***************
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- @Override
- public void update() {
- super.update();
- this.column.update(this.getResourceColumn());
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update();
- }
- else {
- setConverter(buildConverter(getResourceConverterType()));
- }
- }
-
- protected OrmConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
- //***************** XmlColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- this.resourceAttributeMapping.setColumn(null);
- }
-
- // ****************** validation ****************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- this.getColumn().validate(messages, reporter);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME,
- new String[] {getName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- getName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNode.java
deleted file mode 100644
index a6441f79c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNode.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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-
-/**
- * Use this abstract class for context nodes that are part of an
- * <code>orm.xml</code> file.
- * This will not work for a pure {@link org.eclipse.jpt.core.context.MappingFile}
- * implementation.
- */
-public abstract class AbstractOrmXmlContextNode
- extends AbstractXmlContextNode
-{
- // ********** constructor **********
-
- protected AbstractOrmXmlContextNode(JpaContextNode parent) {
- super(parent);
- }
-
-
- // ********** convenience methods **********
-
- protected OrmXmlDefinition getMappingFileDefinition() {
- return (OrmXmlDefinition) this.getJpaPlatform().getResourceDefinition(this.getResourceType());
- }
-
- protected EFactory getResourceNodeFactory() {
- return this.getMappingFileDefinition().getResourceNodeFactory();
- }
-
- protected OrmXml2_0ContextNodeFactory getXmlContextNodeFactory() {
- return (OrmXml2_0ContextNodeFactory) this.getMappingFileDefinition().getContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
deleted file mode 100644
index 5fdcfc1c11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,449 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmBaseJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.context.orm.OrmGeneratorContainer;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericEntityMappings;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAssociationOverride;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAttributeOverride;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmBasicMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmEmbeddable;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmEmbeddedMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmEntity;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmEnumeratedConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmGeneratedValue;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmGeneratorContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmJoinColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmJoinTable;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmLobConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmManyToManyMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmManyToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmMappedSuperclass;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNamedNativeQuery;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNamedQuery;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOneToManyMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmOrderable;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPersistentType;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmQueryContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmQueryHint;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmSecondaryTable;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmSequenceGenerator;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmTable;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmTableGenerator;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmTemporalConverter;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmTransientMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmUniqueConstraint;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmVersionMapping;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericPersistenceUnitDefaults;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericPersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.UnsupportedOrmAttributeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmOrderColumn2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmCacheable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.NullOrmOrphanRemoval2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-
-public abstract class AbstractOrmXmlContextNodeFactory
- implements OrmXml2_0ContextNodeFactory
-{
- public EntityMappings buildEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
- return new GenericEntityMappings(parent, xmlEntityMappings);
- }
-
- public PersistenceUnitMetadata buildPersistenceUnitMetadata(EntityMappings parent) {
- return new GenericPersistenceUnitMetadata(parent);
- }
-
- public OrmPersistenceUnitDefaults buildPersistenceUnitDefaults(PersistenceUnitMetadata parent) {
- return new GenericPersistenceUnitDefaults(parent);
- }
-
- public OrmPersistentType buildOrmPersistentType(EntityMappings parent, XmlTypeMapping resourceMapping) {
- return new GenericOrmPersistentType(parent, resourceMapping);
- }
-
- public OrmEntity buildOrmEntity(OrmPersistentType parent, XmlEntity resourceMapping) {
- return new GenericOrmEntity(parent, resourceMapping);
- }
-
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType parent, XmlMappedSuperclass resourceMapping) {
- return new GenericOrmMappedSuperclass(parent, resourceMapping);
- }
-
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent, XmlEmbeddable resourceMapping) {
- return new GenericOrmEmbeddable(parent, resourceMapping);
- }
-
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, XmlAttributeMapping resourceMapping) {
- return new GenericOrmPersistentAttribute(parent, owner, resourceMapping);
- }
-
- public OrmTable buildOrmTable(OrmEntity parent) {
- return new GenericOrmTable(parent);
- }
-
- public OrmSecondaryTable buildOrmSecondaryTable(OrmEntity parent, XmlSecondaryTable xmlSecondaryTable) {
- return new GenericOrmSecondaryTable(parent, xmlSecondaryTable);
- }
-
- public OrmPrimaryKeyJoinColumn buildOrmPrimaryKeyJoinColumn(XmlContextNode parent, OrmBaseJoinColumn.Owner owner, XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- return new GenericOrmPrimaryKeyJoinColumn(parent, owner, resourcePkJoinColumn);
- }
-
- public OrmJoinTable buildOrmJoinTable(OrmJoinTableJoiningStrategy parent, XmlJoinTable resourceJoinTable) {
- return new GenericOrmJoinTable(parent, resourceJoinTable);
- }
-
- public OrmJoinColumn buildOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn resourceJoinColumn) {
- return new GenericOrmJoinColumn(parent, owner, resourceJoinColumn);
- }
-
- public OrmAttributeOverrideContainer buildOrmAttributeOverrideContainer(XmlContextNode parent, OrmAttributeOverrideContainer.Owner owner) {
- return new GenericOrmAttributeOverrideContainer(parent, owner);
- }
-
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(XmlContextNode parent, OrmAssociationOverrideContainer.Owner owner) {
- return new GenericOrmAssociationOverrideContainer(parent, owner);
- }
-
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(OrmEmbeddedMapping2_0 parent, OrmAssociationOverrideContainer.Owner owner) {
- return new NullOrmAssociationOverrideContainer(parent, owner);
- }
-
- public OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
- return new GenericOrmAttributeOverride(parent, owner, xmlAttributeOverride);
- }
-
- public OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
- return new GenericOrmAssociationOverride(parent, owner, xmlAssociationOverride);
- }
-
- public OrmAssociationOverrideRelationshipReference buildOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, XmlAssociationOverride associationOverride) {
- return new GenericOrmAssociationOverrideRelationshipReference(parent, associationOverride);
- }
-
- public OrmDiscriminatorColumn buildOrmDiscriminatorColumn(OrmEntity parent, OrmDiscriminatorColumn.Owner owner) {
- return new GenericOrmDiscriminatorColumn(parent, owner);
- }
-
- public OrmColumn buildOrmColumn(XmlContextNode parent, OrmColumn.Owner owner) {
- return new GenericOrmColumn(parent, owner);
- }
-
- public OrmGeneratedValue buildOrmGeneratedValue(XmlContextNode parent, XmlGeneratedValue resourceGeneratedValue) {
- return new GenericOrmGeneratedValue(parent, resourceGeneratedValue);
- }
-
- public OrmGeneratorContainer buildOrmGeneratorContainer(XmlContextNode parent, XmlGeneratorContainer resourceGeneratorContainer) {
- return new GenericOrmGeneratorContainer(parent, resourceGeneratorContainer);
- }
-
- public OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator(parent, resourceSequenceGenerator);
- }
-
- public OrmTableGenerator buildOrmTableGenerator(XmlContextNode parent, XmlTableGenerator resourceTableGenerator) {
- return new GenericOrmTableGenerator(parent, resourceTableGenerator);
- }
-
- public OrmQueryContainer buildOrmQueryContainer(XmlContextNode parent, XmlQueryContainer resourceQueryContainer) {
- return new GenericOrmQueryContainer(parent, resourceQueryContainer);
- }
-
- public OrmNamedNativeQuery buildOrmNamedNativeQuery(XmlContextNode parent, XmlNamedNativeQuery resourceNamedNativeQuery) {
- return new GenericOrmNamedNativeQuery(parent, resourceNamedNativeQuery);
- }
-
- public OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- return new GenericOrmNamedQuery(parent, resourceNamedQuery);
- }
-
- public OrmQueryHint buildOrmQueryHint(OrmQuery parent, XmlQueryHint resourceQueryHint) {
- return new GenericOrmQueryHint(parent, resourceQueryHint);
- }
-
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent, XmlBasic resourceMapping) {
- return new GenericOrmBasicMapping(parent, resourceMapping);
- }
-
- public OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded resourceMapping) {
- return new GenericOrmEmbeddedMapping(parent, resourceMapping);
- }
-
- public OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId resourceMapping) {
- return new GenericOrmEmbeddedIdMapping(parent, resourceMapping);
- }
-
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, XmlId resourceMapping) {
- return new GenericOrmIdMapping(parent, resourceMapping);
- }
-
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany resourceMapping) {
- return new GenericOrmManyToManyMapping(parent, resourceMapping);
- }
-
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- return new GenericOrmManyToOneMapping(parent, resourceMapping);
- }
-
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany resourceMapping) {
- return new GenericOrmOneToManyMapping(parent, resourceMapping);
- }
-
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- return new GenericOrmOneToOneMapping(parent, resourceMapping);
- }
-
- public OrmTransientMapping buildOrmTransientMapping(OrmPersistentAttribute parent, XmlTransient resourceMapping) {
- return new GenericOrmTransientMapping(parent, resourceMapping);
- }
-
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent, XmlVersion resourceMapping) {
- return new GenericOrmVersionMapping(parent, resourceMapping);
- }
-
- public OrmAttributeMapping buildOrmNullAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping) {
- return new GenericOrmNullAttributeMapping(parent, resourceMapping);
- }
-
- public OrmAttributeMapping buildUnsupportedOrmAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping) {
- return new UnsupportedOrmAttributeMapping(parent, resourceMapping);
- }
-
- public OrmUniqueConstraint buildOrmUniqueConstraint(XmlContextNode parent, UniqueConstraint.Owner owner, XmlUniqueConstraint resourceUniqueConstraint) {
- return new GenericOrmUniqueConstraint(parent, owner, resourceUniqueConstraint);
- }
-
- public OrmConverter buildOrmEnumeratedConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- return new GenericOrmEnumeratedConverter(parent, resourceMapping);
- }
-
- public OrmConverter buildOrmLobConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- return new GenericOrmLobConverter(parent, resourceMapping);
- }
-
- public OrmConverter buildOrmTemporalConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- return new GenericOrmTemporalConverter(parent, resourceMapping);
- }
-
- public OrmConverter buildOrmNullConverter(OrmAttributeMapping parent) {
- return new GenericOrmNullConverter(parent);
- }
-
- public OrmOrderable2_0 buildOrmOrderable(OrmAttributeMapping parent, Orderable.Owner owner) {
- return new GenericOrmOrderable(parent, owner);
- }
-
- public OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner) {
- return new GenericOrmOrderColumn2_0(parent, owner);
- }
-
- public OrmDerivedIdentity2_0 buildOrmDerivedIdentity(
- OrmSingleRelationshipMapping2_0 parent, XmlSingleRelationshipMapping_2_0 resource) {
- return new NullOrmDerivedIdentity2_0(parent);
- }
-
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(
- OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
-
- throw new UnsupportedOperationException();
- }
-
- public OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource) {
- return new NullOrmCacheable2_0(parent);
- }
-
- public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource) {
- return new NullOrmOrphanRemoval2_0(parent);
- }
-
- public OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, XmlCollectionTable resource) {
- throw new UnsupportedOperationException();
- }
-
- // ********** ORM Virtual Resource Model **********
-
- public XmlAssociationOverride buildVirtualXmlAssociationOverride(String name, OrmTypeMapping parent, JoiningStrategy joiningStrategy) {
- return new VirtualXmlAssociationOverride(name, parent, joiningStrategy);
- }
-
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- return new VirtualXmlBasic(ormTypeMapping, javaBasicMapping);
- }
-
- public XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- return new VirtualXmlEmbeddedId(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- public XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- return new VirtualXmlEmbedded(ormTypeMapping, javaEmbeddedMapping);
- }
-
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- return new VirtualXmlId(ormTypeMapping, javaIdMapping);
- }
-
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- return new VirtualXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
-
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- return new VirtualXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
-
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
-
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
-
- public XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- return new VirtualXmlTransient(ormTypeMapping, javaTransientMapping);
- }
-
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- return new VirtualXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
- public XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- public XmlElementCollection buildVirtualXmlElementCollection2_0(OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlDefinition.java
deleted file mode 100644
index 367f38c895..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlDefinition.java
+++ /dev/null
@@ -1,107 +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.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.core.context.orm.UnsupportedOrmAttributeMappingDefinition;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-/**
- * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractOrmXmlDefinition
- implements OrmXmlDefinition
-{
- private OrmTypeMappingDefinition[] ormTypeMappingDefinitions;
-
- private OrmAttributeMappingDefinition[] ormAttributeMappingDefinitions;
-
- private final OrmXmlContextNodeFactory factory;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractOrmXmlDefinition() {
- super();
- this.factory = buildContextNodeFactory();
- }
-
-
- protected abstract OrmXmlContextNodeFactory buildContextNodeFactory();
-
- public OrmXmlContextNodeFactory getContextNodeFactory() {
- return this.factory;
- }
-
-
- // ********** ORM type mappings **********
-
- public OrmTypeMappingDefinition getOrmTypeMappingDefinition(String mappingKey) {
- for (OrmTypeMappingDefinition definition : CollectionTools.iterable(ormTypeMappingDefinitions())) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public ListIterator<OrmTypeMappingDefinition> ormTypeMappingDefinitions() {
- return new ArrayListIterator<OrmTypeMappingDefinition>(getOrmTypeMappingDefinitions());
- }
-
- protected synchronized OrmTypeMappingDefinition[] getOrmTypeMappingDefinitions() {
- if (this.ormTypeMappingDefinitions == null) {
- this.ormTypeMappingDefinitions = this.buildOrmTypeMappingDefinitions();
- }
- return this.ormTypeMappingDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for types in mapping files of this type.
- * The order is unimportant.
- */
- protected abstract OrmTypeMappingDefinition[] buildOrmTypeMappingDefinitions();
-
-
- // ********** ORM attribute mappings **********
-
- public OrmAttributeMappingDefinition getOrmAttributeMappingDefinition(String mappingKey) {
- for (OrmAttributeMappingDefinition definition : CollectionTools.iterable(ormAttributeMappingDefinitions())) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- return UnsupportedOrmAttributeMappingDefinition.instance();
- }
-
- public ListIterator<OrmAttributeMappingDefinition> ormAttributeMappingDefinitions() {
- return new ArrayListIterator<OrmAttributeMappingDefinition>(getOrmAttributeMappingDefinitions());
- }
-
- protected synchronized OrmAttributeMappingDefinition[] getOrmAttributeMappingDefinitions() {
- if (this.ormAttributeMappingDefinitions == null) {
- this.ormAttributeMappingDefinitions = this.buildOrmAttributeMappingDefinitions();
- }
- return this.ormAttributeMappingDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for attributes in mapping files of this type.
- * The order is unimportant.
- */
- protected abstract OrmAttributeMappingDefinition[] buildOrmAttributeMappingDefinitions();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdClassReference.java
deleted file mode 100644
index 5b9a999399..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmIdClassReference.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaIdClassReference;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmIdClassReference;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlIdClassContainer;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmIdClassReference
- extends AbstractXmlContextNode
- implements OrmIdClassReference
-{
- protected String specifiedIdClassName;
-
- protected String defaultIdClassName;
-
- protected JavaPersistentType idClass;
-
-
- public GenericOrmIdClassReference(OrmTypeMapping parent, JavaIdClassReference javaIdClassReference) {
- super(parent);
- this.specifiedIdClassName = buildSpecifiedIdClassName();
- this.defaultIdClassName = buildDefaultIdClassName(javaIdClassReference);
- this.idClass = buildIdClass();
- }
-
-
- protected OrmTypeMapping getTypeMapping() {
- return (OrmTypeMapping) getParent();
- }
-
- protected OrmPersistentType getPersistentType() {
- return getTypeMapping().getPersistentType();
- }
-
-
- // **************** PersistentType.Owner impl *****************************
-
- public AccessType getOverridePersistentTypeAccess() {
- return getPersistentType().getAccess();
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- // this shouldn't be needed, since we've specified an override access, but just to be safe ...
- return getPersistentType().getAccess();
- }
-
-
- // **************** IdClassReference impl *********************************
-
- public String getSpecifiedIdClassName() {
- return this.specifiedIdClassName;
- }
-
- public void setSpecifiedIdClassName(String newClassName) {
- String oldClassName = this.specifiedIdClassName;
- this.specifiedIdClassName = newClassName;
- if (valuesAreDifferent(oldClassName, newClassName)) {
- if (getIdXmlClassRef() != null) {
- getIdXmlClassRef().setClassName(newClassName);
- if (getIdXmlClassRef().isUnset()) {
- removeIdClassElement();
- }
- }
- else if (newClassName != null) {
- addIdClassElement();
- getIdXmlClassRef().setClassName(newClassName);
- }
- }
- firePropertyChanged(SPECIFIED_ID_CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected void setSpecifiedIdClassName_(String newClassName) {
- String oldClassName = this.specifiedIdClassName;
- this.specifiedIdClassName = newClassName;
- firePropertyChanged(SPECIFIED_ID_CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected String buildSpecifiedIdClassName() {
- XmlClassReference idXmlClassRef = this.getIdXmlClassRef();
- return (idXmlClassRef == null) ? null : idXmlClassRef.getClassName();
- }
-
- public String getDefaultIdClassName() {
- return this.defaultIdClassName;
- }
-
- protected void setDefaultIdClassName_(String newClassName) {
- String oldClassName = this.defaultIdClassName;
- this.defaultIdClassName = newClassName;
- firePropertyChanged(DEFAULT_ID_CLASS_NAME_PROPERTY, oldClassName, newClassName);
- }
-
- protected String buildDefaultIdClassName(JavaIdClassReference javaIdClassReference) {
- return (javaIdClassReference == null) ? null : javaIdClassReference.getFullyQualifiedIdClassName();
- }
-
- public String getIdClassName() {
- return (this.specifiedIdClassName == null) ? this.defaultIdClassName : this.specifiedIdClassName;
- }
-
- public boolean isSpecified() {
- return getIdClassName() != null;
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClass;
- }
-
- protected void setIdClass_(JavaPersistentType newIdClass) {
- JavaPersistentType oldIdClass = this.idClass;
- this.idClass = newIdClass;
- firePropertyChanged(ID_CLASS_PROPERTY, oldIdClass, newIdClass);
- }
-
- protected JavaPersistentType buildIdClass() {
- JavaResourcePersistentType resourceIdClass = getResourceIdClass();
- return (resourceIdClass == null) ?
- null : this.buildIdClass(resourceIdClass);
- }
-
- protected JavaPersistentType buildIdClass(JavaResourcePersistentType resourceClass) {
- return getJpaFactory().buildJavaPersistentType(this, resourceClass);
- }
-
- protected XmlTypeMapping getResourceTypeMapping() {
- return getTypeMapping().getResourceTypeMapping();
- }
-
- protected XmlIdClassContainer getResourceIdClassContainer() {
- return (XmlIdClassContainer) getResourceTypeMapping();
- }
-
- protected XmlClassReference getIdXmlClassRef() {
- return this.getResourceIdClassContainer().getIdClass();
- }
-
- protected void addIdClassElement() {
- getResourceIdClassContainer().setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- }
-
- protected void removeIdClassElement() {
- getResourceIdClassContainer().setIdClass(null);
- }
-
- protected JavaResourcePersistentType getResourceIdClass() {
- XmlClassReference idXmlClassRef = this.getIdXmlClassRef();
- if (idXmlClassRef == null) {
- return null;
- }
-
- String className = idXmlClassRef.getClassName();
- if (className == null) {
- return null;
- }
-
- return this.getEntityMappings().resolveJavaResourcePersistentType(className);
- }
-
- protected EntityMappings getEntityMappings() {
- return (EntityMappings) getMappingFileRoot();
- }
-
- public char getIdClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public void update(JavaIdClassReference javaIdClassReference) {
- setDefaultIdClassName_(buildDefaultIdClassName(javaIdClassReference));
- setSpecifiedIdClassName_(buildSpecifiedIdClassName());
- updateIdClass();
- }
-
- protected void updateIdClass() {
- JavaResourcePersistentType resourceIdClass = getResourceIdClass();
- if (resourceIdClass == null) {
- setIdClass_(null);
- }
- else {
- if (this.idClass == null || this.idClass.getResourcePersistentType() != resourceIdClass) {
- setIdClass_(buildIdClass(resourceIdClass));
- }
- else {
- this.idClass.update(resourceIdClass);
- }
- }
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getValidationTextRange() {
- XmlClassReference idXmlClassRef = getIdXmlClassRef();
- return (idXmlClassRef == null) ?
- this.getTypeMapping().getValidationTextRange() :
- idXmlClassRef.getClassNameTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // most validation is done "holistically" from the type mapping level
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.java
deleted file mode 100644
index d82061ceca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.java
+++ /dev/null
@@ -1,231 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnInAssociationOverrideJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn.Owner;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmJoinColumnInAssociationOverrideJoiningStrategy
- extends AbstractOrmJoinColumnJoiningStrategy
- implements OrmJoinColumnInAssociationOverrideJoiningStrategy
-{
-
- public GenericOrmJoinColumnInAssociationOverrideJoiningStrategy(OrmAssociationOverrideRelationshipReference parent, XmlAssociationOverride xao) {
- super(parent, xao);
- }
-
- @Override
- protected Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- if (relationshipMapping != null) {
- return relationshipMapping.getRelationshipReference().isTargetForeignKeyRelationship();
- }
- return false;
- }
-
- public TypeMapping getRelationshipSource() {
- if (isTargetForeignKeyRelationship()) {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
- return getAssociationOverrideOwner().getTypeMapping();
- }
-
- public TypeMapping getRelationshipTarget() {
- if (isTargetForeignKeyRelationship()) {
- return getAssociationOverrideOwner().getTypeMapping();
- }
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- protected Entity getRelationshipTargetEntity() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return (relationshipTarget != null) && (relationshipTarget.getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY) ? (Entity) relationshipTarget : null;
- }
-
- @Override
- public RelationshipMapping getRelationshipMapping() {
- return getAssociationOverrideOwner().getRelationshipMapping(getAttributeName());
- }
-
- protected String getAttributeName() {
- return this.getAssociationOverride().getName();
- }
-
- @Override
- public String getTableName() {
- if (isTargetForeignKeyRelationship()) {
- return super.getTableName();
- }
- return getAssociationOverrideOwner().getDefaultTableName();
- }
-
- @Override
- public Table getDbTable(String tableName) {
- if (isTargetForeignKeyRelationship()) {
- return super.getDbTable(tableName);
- }
- return getAssociationOverrideOwner().getDbTable(tableName);
- }
-
- @Override
- public boolean tableNameIsInvalid(String tableName) {
- if (isTargetForeignKeyRelationship()) {
- return super.tableNameIsInvalid(tableName);
- }
- return getAssociationOverrideOwner().tableNameIsInvalid(tableName);
- }
-
- @Override
- public Iterator<String> candidateTableNames() {
- if (isTargetForeignKeyRelationship()) {
- return super.candidateTableNames();
- }
- return getAssociationOverrideOwner().candidateTableNames();
- }
-
- public String getColumnTableNotValidDescription() {
- return null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- protected OrmAssociationOverride getAssociationOverride() {
- return this.getRelationshipReference().getAssociationOverride();
- }
-
- protected OrmAssociationOverride.Owner getAssociationOverrideOwner() {
- return getAssociationOverride().getOwner();
- }
-
- @Override
- public OrmAssociationOverrideRelationshipReference getRelationshipReference() {
- return (OrmAssociationOverrideRelationshipReference) super.getRelationshipReference();
- }
-
- public TextRange getValidationTextRange() {
- return getRelationshipReference().getValidationTextRange();
- }
-
- public void update(XmlAssociationOverride xao) {
- //TODO can we make resource final and then just have an update() method?
- //would need to update the association overrides with the same resource association override
- this.resource = xao;
- super.update();
- }
-
-
-
- // ********** join column owner adapter **********
-
- protected class JoinColumnOwner
- implements OrmJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- public String getDefaultTableName() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getTableName();
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public String getAttributeName() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getAttributeName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getPersistentAttribute();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getRelationshipSource();
- }
-
- public Entity getRelationshipTarget() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getRelationshipTargetEntity();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.candidateTableNames();
- }
-
- public Table getDbTable(String tableName) {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getReferencedColumnDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return false;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.joinColumnsSize();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmJoinColumnInAssociationOverrideJoiningStrategy.this.getValidationTextRange();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnTableNotValidMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnUnresolvedNameMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildColumnUnresolvedReferencedColumnNameMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(getAssociationOverride(), column, textRange);
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return getAssociationOverrideOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(getAssociationOverride(), column, textRange);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnJoiningStrategy.java
deleted file mode 100644
index 3f5775129d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,43 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping;
-
-public class GenericOrmJoinColumnJoiningStrategy
- extends AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy
-{
-
- public GenericOrmJoinColumnJoiningStrategy(
- OrmJoinColumnEnabledRelationshipReference parent,
- XmlJoinColumnsMapping resource) {
- super(parent, resource);
- }
-
- public TypeMapping getRelationshipSource() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public TypeMapping getRelationshipTarget() {
- return getRelationshipTargetEntity();
- }
-
- @Override
- protected Entity getRelationshipTargetEntity() {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTableJoiningStrategy.java
deleted file mode 100644
index bb0882b662..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,72 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmJoinTableJoiningStrategy
- extends AbstractOrmJoinTableJoiningStrategy
-{
- protected XmlJoinTableMapping resource;
-
-
- public GenericOrmJoinTableJoiningStrategy(
- OrmJoinTableEnabledRelationshipReference parent,
- XmlJoinTableMapping resource) {
- super(parent);
- this.resource = resource;
- this.initialize();
- }
-
-
- @Override
- public OrmJoinTableEnabledRelationshipReference getParent() {
- return (OrmJoinTableEnabledRelationshipReference) super.getParent();
- }
-
- @Override
- public OrmJoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- @Override
- protected void setResourceJoinTable(XmlJoinTable resourceJoinTable) {
- this.resource.setJoinTable(resourceJoinTable);
- }
-
- public boolean isOverridableAssociation() {
- return getJpaPlatformVariation().isJoinTableOverridable();
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return getRelationshipMapping().shouldValidateAgainstDatabase();
- }
-
- // **************** join table *********************************************
-
- public void removeResourceJoinTable() {
- this.resource.setJoinTable(null);
- }
-
- public XmlJoinTable getResourceJoinTable() {
- return this.resource.getJoinTable();
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange() {
- return getRelationshipReference().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyRelationshipReference.java
deleted file mode 100644
index 177b534ba7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToManyRelationshipReference.java
+++ /dev/null
@@ -1,187 +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.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmManyToManyRelationshipReference
- extends AbstractOrmRelationshipReference
- implements OrmManyToManyRelationshipReference
-{
- protected OrmMappedByJoiningStrategy mappedByJoiningStrategy;
-
- protected OrmJoinTableJoiningStrategy joinTableJoiningStrategy;
-
-
- public GenericOrmManyToManyRelationshipReference(
- OrmManyToManyMapping parent, XmlManyToMany resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected void initializeJoiningStrategies() {
- this.mappedByJoiningStrategy = buildMappedByJoiningStrategy();
-
- // initialize join table last, as the existence of a default join
- // table is dependent on the other mechanisms (mappedBy)
- // not being specified
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
- protected OrmMappedByJoiningStrategy buildMappedByJoiningStrategy() {
- return new GenericOrmMappedByJoiningStrategy(this, getResourceMapping());
- }
-
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericOrmJoinTableJoiningStrategy(this, getResourceMapping());
- }
-
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- newRelationshipReference.initializeFromOwnableRelationshipReference(this);
- newRelationshipReference.initializeFromJoinTableEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromOwnableRelationshipReference(
- OrmOwnableRelationshipReference oldRelationshipReference) {
- super.initializeFromOwnableRelationshipReference(oldRelationshipReference);
- this.mappedByJoiningStrategy.setMappedByAttribute(
- oldRelationshipReference.getMappedByJoiningStrategy().getMappedByAttribute());
- }
-
- @Override
- public void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinTableEnabledRelationshipReference(oldRelationshipReference);
- OrmJoinTable oldTable =
- oldRelationshipReference.getJoinTableJoiningStrategy().getJoinTable();
- if (oldTable != null) {
- this.joinTableJoiningStrategy.addJoinTable().initializeFrom(oldTable);
- }
- }
-
-
- @Override
- public OrmManyToManyMapping getRelationshipMapping() {
- return (OrmManyToManyMapping) super.getRelationshipMapping();
- }
-
- public XmlManyToMany getResourceMapping() {
- return getRelationshipMapping().getResourceAttributeMapping();
- }
-
- public boolean isRelationshipOwner() {
- return this.mappedByJoiningStrategy.getMappedByAttribute() == null;
- }
-
- public boolean isOwnedBy(RelationshipMapping mapping) {
- return this.mappedByJoiningStrategy.relationshipIsOwnedBy(mapping);
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-
-
- // **************** mapped by **********************************************
-
- public OrmMappedByJoiningStrategy getMappedByJoiningStrategy() {
- return this.mappedByJoiningStrategy;
- }
-
- public boolean usesMappedByJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.mappedByJoiningStrategy;
- }
-
- public void setMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.addStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMappedByJoiningStrategy() {
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return mappedByMapping.getKey() == MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** join table joining strategy ***************************
-
- public OrmJoinTableJoiningStrategy getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public void setJoinTableJoiningStrategy() {
- // join table is the default strategy, so no need to add to resource
- this.mappedByJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return getMappedByJoiningStrategy().getMappedByAttribute() == null;
- }
-
-
- // **************** resource => context ************************************
-
- @Override
- protected void updateJoiningStrategies() {
- this.mappedByJoiningStrategy.update();
-
- // update join table last, as the existence of a default join
- // table is dependent on the other mechanisms (mappedBy)
- // not being specified
- this.joinTableJoiningStrategy.update();
- }
-
-
- // **************** Validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.mappedByJoiningStrategy.validate(messages, reporter);
- this.joinTableJoiningStrategy.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneRelationshipReference.java
deleted file mode 100644
index 26b5d5f573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmManyToOneRelationshipReference.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-public class GenericOrmManyToOneRelationshipReference
- extends AbstractOrmManyToOneRelationshipReference
-{
-
- public GenericOrmManyToOneRelationshipReference(
- OrmManyToOneMapping parent, XmlManyToOne resource) {
- super(parent, resource);
- }
-
- @Override
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new NullOrmJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- // the only joining strategy
- return this.joinColumnJoiningStrategy;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedByJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedByJoiningStrategy.java
deleted file mode 100644
index a637ac4280..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmMappedByJoiningStrategy.java
+++ /dev/null
@@ -1,205 +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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedByJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOwnableRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.XmlMappedByMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-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 GenericOrmMappedByJoiningStrategy
- extends AbstractOrmXmlContextNode
- implements OrmMappedByJoiningStrategy
-{
- protected XmlMappedByMapping resource;
-
- protected String mappedByAttribute;
-
-
- public GenericOrmMappedByJoiningStrategy(
- OrmOwnableRelationshipReference parent,
- XmlMappedByMapping resource) {
- super(parent);
- this.resource = resource;
- this.mappedByAttribute = this.resource.getMappedBy();
- }
-
-
- @Override
- public OrmOwnableRelationshipReference getParent() {
- return (OrmOwnableRelationshipReference) super.getParent();
- }
-
- public OrmOwnableRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public String getTableName() {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? null : owner.getRelationshipReference().getPredominantJoiningStrategy().getTableName();
- }
-
- public Table getDbTable(String tableName) {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? null : owner.getRelationshipReference().getPredominantJoiningStrategy().getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- RelationshipMapping owner = getRelationshipOwner();
- return owner == null ? false : owner.getRelationshipReference().getPredominantJoiningStrategy().tableNameIsInvalid(tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- //this will not be called if getRelationshipOwner() is null
- return getRelationshipOwner().getRelationshipReference().getPredominantJoiningStrategy().getColumnTableNotValidDescription();
- }
-
- protected RelationshipMapping getRelationshipOwner() {
- return getRelationshipMapping().getRelationshipOwner();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public OrmRelationshipMapping getRelationshipMapping() {
- return getParent().getRelationshipMapping();
- }
-
- public boolean relationshipIsOwnedBy(RelationshipMapping otherMapping) {
- String thisEntity =
- (getRelationshipReference().getEntity()) == null ?
- null : getRelationshipReference().getEntity().getName();
- String targetEntity =
- (otherMapping.getResolvedTargetEntity() == null) ?
- null : otherMapping.getResolvedTargetEntity().getName();
- return StringTools.stringsAreEqual(
- thisEntity,
- targetEntity)
- && StringTools.stringsAreEqual(
- getMappedByAttribute(),
- otherMapping.getName());
- }
-
- public String getMappedByAttribute() {
- return this.mappedByAttribute;
- }
-
- public void setMappedByAttribute(String newMappedByAttribute) {
- String oldMappedByAttribute = this.mappedByAttribute;
- this.mappedByAttribute = newMappedByAttribute;
- this.resource.setMappedBy(newMappedByAttribute);
- firePropertyChanged(MAPPED_BY_ATTRIBUTE_PROPERTY, oldMappedByAttribute, newMappedByAttribute);
- }
-
- protected void setMappedByAttribute_(String newMappedByAttribute) {
- String oldMappedByAttribute = this.mappedByAttribute;
- this.mappedByAttribute = newMappedByAttribute;
- firePropertyChanged(MAPPED_BY_ATTRIBUTE_PROPERTY, oldMappedByAttribute, newMappedByAttribute);
- }
-
- public void addStrategy() {
- if (this.mappedByAttribute == null) {
- setMappedByAttribute(""); //$NON-NLS-1$
- }
- }
-
- public void removeStrategy() {
- if (this.mappedByAttribute != null) {
- setMappedByAttribute(null);
- }
- }
-
- public void update() {
- setMappedByAttribute_(this.resource.getMappedBy());
- }
-
- public Iterator<String> candidateMappedByAttributeNames() {
- return getRelationshipMapping().allTargetEntityAttributeNames();
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange() {
- TextRange mappedByTextRange = this.resource.getMappedByTextRange();
- return mappedByTextRange != null ? mappedByTextRange : getRelationshipReference().getValidationTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- if (getMappedByAttribute() == null) {
- return;
- }
-
- Entity targetEntity = this.getRelationshipMapping().getResolvedTargetEntity();
- if (targetEntity == null) {
- return; // null target entity is validated elsewhere
- }
-
- AttributeMapping mappedByMapping = targetEntity.resolveAttributeMapping(this.mappedByAttribute);
-
- if (mappedByMapping == null) {
- messages.add(
- buildMessage(
- JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY,
- new String[] {this.mappedByAttribute}));
- return;
- }
-
- if (! this.getRelationshipReference().mayBeMappedBy(mappedByMapping)) {
- messages.add(
- buildMessage(
- JpaValidationMessages.MAPPING_INVALID_MAPPED_BY,
- new String[] {this.mappedByAttribute}));
- return;
- }
-
- // if mappedByMapping is not a relationship owner, then it should have
- // been flagged in above rule (mappedByIsValid)
- if (! ((RelationshipMapping) mappedByMapping).isRelationshipOwner()) {
- messages.add(buildMessage(
- JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES,
- new String[] {this.mappedByAttribute}));
- }
- }
-
- protected IMessage buildMessage(String msgID, String[] params) {
- String attributeDescString;
- PersistentAttribute attribute = getRelationshipMapping().getPersistentAttribute();
- if (attribute.isVirtual()) {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.VIRTUAL_ATTRIBUTE_DESC, attribute.getName());
- }
- else {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY, msgID, ArrayTools.add(params, 0, attributeDescString), this, getValidationTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneRelationshipReference.java
deleted file mode 100644
index 86673561c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmOneToOneRelationshipReference.java
+++ /dev/null
@@ -1,44 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-public class GenericOrmOneToOneRelationshipReference
- extends AbstractOrmOneToOneRelationshipReference
-{
-
-
- public GenericOrmOneToOneRelationshipReference(
- OrmOneToOneMapping parent, XmlOneToOne resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new NullOrmJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.primaryKeyJoinColumnJoiningStrategy.primaryKeyJoinColumnsSize() > 0) {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index f1a1758182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmPrimaryKeyJoinColumnJoiningStrategy.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.core.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmPrimaryKeyJoinColumnJoiningStrategy
- extends AbstractOrmXmlContextNode
- implements OrmPrimaryKeyJoinColumnJoiningStrategy
-{
- protected XmlOneToOne resource;
-
- protected final Vector<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = new Vector<OrmPrimaryKeyJoinColumn>();
-
- protected final OrmJoinColumn.Owner joinColumnOwner;
-
-
- public GenericOrmPrimaryKeyJoinColumnJoiningStrategy(
- OrmPrimaryKeyJoinColumnEnabledRelationshipReference parent,
- XmlOneToOne resource) {
- super(parent);
- this.resource = resource;
- this.joinColumnOwner = this.buildJoinColumnOwner();
- this.initializePrimaryKeyJoinColumns();
- }
-
- protected OrmJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected void initializePrimaryKeyJoinColumns() {
- if (this.resource != null) {
- for (XmlPrimaryKeyJoinColumn resourceJoinColumn : this.resource.getPrimaryKeyJoinColumns()) {
- this.primaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(resourceJoinColumn));
- }
- }
- }
-
- protected OrmPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(
- XmlPrimaryKeyJoinColumn resourceJoinColumn) {
- return this.getXmlContextNodeFactory().buildOrmPrimaryKeyJoinColumn(this, this.joinColumnOwner, resourceJoinColumn);
- }
-
- @Override
- public OrmJoinColumnEnabledRelationshipReference getParent() {
- return (OrmJoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public OrmJoinColumnEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public OrmRelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public String getTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public String getColumnTableNotValidDescription() {
- return JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY;
- }
-
- protected TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public void addStrategy() {
- if (primaryKeyJoinColumnsSize() == 0) {
- addPrimaryKeyJoinColumn(0);
- }
- }
-
- public void removeStrategy() {
- for (PrimaryKeyJoinColumn each : CollectionTools.iterable(primaryKeyJoinColumns())) {
- removePrimaryKeyJoinColumn(each);
- }
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
-
- // **************** primary key join columns *******************************
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.primaryKeyJoinColumns);
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.primaryKeyJoinColumns.size();
- }
-
- public boolean hasPrimaryKeyJoinColumns() {
- return ! this.primaryKeyJoinColumns.isEmpty();
- }
-
- public OrmPrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index) {
- XmlPrimaryKeyJoinColumn resourcePkJoinColumn =
- OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn();
- OrmPrimaryKeyJoinColumn contextPkJoinColumn =
- this.buildPrimaryKeyJoinColumn(resourcePkJoinColumn);
- this.primaryKeyJoinColumns.add(index, contextPkJoinColumn);
- this.resource.getPrimaryKeyJoinColumns().add(index, resourcePkJoinColumn);
- this.fireItemAdded(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, contextPkJoinColumn);
- return contextPkJoinColumn;
- }
-
- protected void addPrimaryKeyJoinColumn(int index, OrmPrimaryKeyJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addPrimaryKeyJoinColumn(OrmPrimaryKeyJoinColumn joinColumn) {
- this.addPrimaryKeyJoinColumn(this.primaryKeyJoinColumns.size(), joinColumn);
- }
-
- public void removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn) {
- this.removePrimaryKeyJoinColumn(this.primaryKeyJoinColumns.indexOf(pkJoinColumn));
- }
-
- public void removePrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn removedPkJoinColumn = this.primaryKeyJoinColumns.remove(index);
- this.resource.getPrimaryKeyJoinColumns().remove(index);
- this.fireItemRemoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPkJoinColumn);
- }
-
- protected void removePrimaryKeyJoinColumn_(OrmPrimaryKeyJoinColumn joinColumn) {
- removeItemFromList(joinColumn, this.primaryKeyJoinColumns, PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void movePrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.primaryKeyJoinColumns, targetIndex, sourceIndex);
- this.resource.getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- // **************** resource -> context ************************************
-
- public void update() {
- updatePrimaryKeyJoinColumns();
- }
-
- protected void updatePrimaryKeyJoinColumns() {
- // make a copy of the XML PK join columns (to prevent ConcurrentModificationException)
- Iterator<XmlPrimaryKeyJoinColumn> xmlPkJoinColumns =
- new CloneIterator<XmlPrimaryKeyJoinColumn>(this.resource.getPrimaryKeyJoinColumns());
-
- for (Iterator<OrmPrimaryKeyJoinColumn> contextPkJoinColumns = primaryKeyJoinColumns();
- contextPkJoinColumns.hasNext(); ) {
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = contextPkJoinColumns.next();
- if (xmlPkJoinColumns.hasNext()) {
- contextPkJoinColumn.update(xmlPkJoinColumns.next());
- }
- else {
- removePrimaryKeyJoinColumn_(contextPkJoinColumn);
- }
- }
-
- while (xmlPkJoinColumns.hasNext()) {
- addPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(xmlPkJoinColumns.next()));
- }
- }
-
- public TextRange getValidationTextRange() {
- return this.getRelationshipReference().getValidationTextRange();
- }
-
-
- // ********** join column owner adapter **********
-
- protected class JoinColumnOwner
- implements OrmJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- /**
- * by default, the join column is in the type mapping's primary table
- */
- public String getDefaultTableName() {
- return GenericOrmPrimaryKeyJoinColumnJoiningStrategy.this.getTableName();
- }
-
- public Entity getRelationshipTarget() {
- return getRelationshipMapping().getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- return getRelationshipMapping().getName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- /**
- * the join column can be on a secondary table
- */
- public boolean tableIsAllowed() {
- return true;
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmPrimaryKeyJoinColumnJoiningStrategy.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public Table getReferencedColumnDbTable() {
- Entity relationshipTarget = getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return false;
- }
-
- public String getDefaultColumnName() {
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmPrimaryKeyJoinColumnJoiningStrategy.this.primaryKeyJoinColumnsSize();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmPrimaryKeyJoinColumnJoiningStrategy.this.getValidationTextRange();
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- throw new UnsupportedOperationException("validation not supported yet"); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmXmlContextNodeFactory.java
deleted file mode 100644
index 26b83ea43d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/GenericOrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,16 +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.core.internal.context.orm;
-
-
-public class GenericOrmXmlContextNodeFactory extends AbstractOrmXmlContextNodeFactory
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmAssociationOverrideContainer.java
deleted file mode 100644
index 10dd335a0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmAssociationOverrideContainer.java
+++ /dev/null
@@ -1,75 +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.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public class NullOrmAssociationOverrideContainer extends AbstractOrmXmlContextNode
- implements OrmAssociationOverrideContainer
-{
-
- protected final OrmAssociationOverrideContainer.Owner owner;
-
- public NullOrmAssociationOverrideContainer(XmlContextNode parent, OrmAssociationOverrideContainer.Owner owner) {
- super(parent);
- this.owner = owner;
- }
-
- protected Owner getOwner() {
- return this.owner;
- }
-
- public ListIterator<OrmAssociationOverride> associationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int associationOverridesSize() {
- return 0;
- }
-
- public ListIterator<OrmAssociationOverride> virtualAssociationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int virtualAssociationOverridesSize() {
- return 0;
- }
-
- public ListIterator<OrmAssociationOverride> specifiedAssociationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int specifiedAssociationOverridesSize() {
- return 0;
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public OrmAssociationOverride getAssociationOverrideNamed(String name) {
- return null;
- }
-
- public void update() {
- //no-op
- }
-
-
- public TextRange getValidationTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmJoinTableJoiningStrategy.java
deleted file mode 100644
index 1c65fa9dd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/NullOrmJoinTableJoiningStrategy.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class NullOrmJoinTableJoiningStrategy
- extends AbstractOrmJoinTableJoiningStrategy
-{
-
-
- public NullOrmJoinTableJoiningStrategy(OrmJoinTableEnabledRelationshipReference parent) {
- super(parent);
- this.initialize();
- }
-
-
- @Override
- public OrmJoinTableEnabledRelationshipReference getParent() {
- return (OrmJoinTableEnabledRelationshipReference) super.getParent();
- }
-
- @Override
- public OrmJoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- @Override
- public OrmRelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- @Override
- protected void setResourceJoinTable(XmlJoinTable resourceJoinTable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-
- // **************** join table *********************************************
-
-
- public void removeResourceJoinTable() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected boolean mayHaveJoinTable() {
- return false;
- }
-
- public XmlJoinTable getResourceJoinTable() {
- return null;
- }
-
-
- // **************** validation *********************************************
-
- public TextRange getValidationTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingDefinition.java
deleted file mode 100644
index 210c6e2f79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmBasicMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmBasicMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmBasicMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmBasicMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlBasic(),
- XmlBasic.class);
- }
-
- public OrmBasicMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmBasicMapping(parent, (XmlBasic) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlBasic(ormTypeMapping, (JavaBasicMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableDefinition.java
deleted file mode 100644
index d908024b78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddableDefinition.java
+++ /dev/null
@@ -1,67 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-/**
- * default ORM Embeddable provider
- */
-public class OrmEmbeddableDefinition
- implements OrmTypeMappingDefinition
-{
- // singleton
- private static final OrmEmbeddableDefinition INSTANCE =
- new OrmEmbeddableDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEmbeddableDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public XmlTypeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlEmbeddable(),
- XmlEmbeddable.class);
- }
-
- public OrmEmbeddable buildContextMapping(
- OrmPersistentType parent,
- XmlTypeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmEmbeddable(parent, (XmlEmbeddable) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingDefinition.java
deleted file mode 100644
index 133bd4fbb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedIdMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmEmbeddedIdMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmEmbeddedIdMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEmbeddedIdMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlEmbeddedId(),
- XmlEmbeddedId.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmEmbeddedIdMapping(parent, (XmlEmbeddedId) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlEmbeddedId(ormTypeMapping, (JavaEmbeddedIdMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingDefinition.java
deleted file mode 100644
index 26cd121b1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEmbeddedMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmEmbeddedMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmEmbeddedMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEmbeddedMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlEmbedded(),
- XmlEmbedded.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmEmbeddedMapping(parent, (XmlEmbedded) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlEmbedded(ormTypeMapping, (JavaEmbeddedMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityDefinition.java
deleted file mode 100644
index cf734f64dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityDefinition.java
+++ /dev/null
@@ -1,67 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-/**
- * default ORM Entity provider
- */
-public class OrmEntityDefinition
- implements OrmTypeMappingDefinition
-{
- // singleton
- private static final OrmEntityDefinition INSTANCE =
- new OrmEntityDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEntityDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public XmlTypeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlEntity(),
- XmlEntity.class);
- }
-
- public OrmEntity buildContextMapping(
- OrmPersistentType parent,
- XmlTypeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmEntity(parent, (XmlEntity) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityTextRangeResolver.java
deleted file mode 100644
index 76f6fada2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmEntityTextRangeResolver.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class OrmEntityTextRangeResolver
- implements PrimaryKeyTextRangeResolver
-{
- private OrmEntity entity;
-
-
- public OrmEntityTextRangeResolver(OrmEntity entity) {
- this.entity = entity;
- }
-
-
- public TextRange getTypeMappingTextRange() {
- return this.entity.getValidationTextRange();
- }
-
- public TextRange getIdClassTextRange() {
- return this.entity.getIdClassReference().getValidationTextRange();
- }
-
- public TextRange getAttributeMappingTextRange(String attributeName) {
- return this.entity.getPersistentType().
- getAttributeNamed(attributeName).getMapping().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingDefinition.java
deleted file mode 100644
index afedc490bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmIdMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmIdMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmIdMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmIdMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlId(),
- XmlId.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmIdMapping(parent, (XmlId) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlId(ormTypeMapping, (JavaIdMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingDefinition.java
deleted file mode 100644
index c719454455..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToManyMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmManyToManyMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmManyToManyMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmManyToManyMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlManyToMany(),
- XmlManyToMany.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmManyToManyMapping(parent, (XmlManyToMany) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlManyToMany(ormTypeMapping, (JavaManyToManyMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingDefinition.java
deleted file mode 100644
index 2098c673e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmManyToOneMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmManyToOneMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmManyToOneMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmManyToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlManyToOne(),
- XmlManyToOne.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmManyToOneMapping(parent, (XmlManyToOne) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlManyToOne(ormTypeMapping, (JavaManyToOneMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassDefinition.java
deleted file mode 100644
index c0e2f67d6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassDefinition.java
+++ /dev/null
@@ -1,67 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-/**
- * default ORM MappedSuperclass definition
- */
-public class OrmMappedSuperclassDefinition
- implements OrmTypeMappingDefinition
-{
- // singleton
- private static final OrmMappedSuperclassDefinition INSTANCE =
- new OrmMappedSuperclassDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmMappedSuperclassDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public XmlTypeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlMappedSuperclass(),
- XmlMappedSuperclass.class);
- }
-
- public OrmMappedSuperclass buildContextMapping(
- OrmPersistentType parent,
- XmlTypeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmMappedSuperclass(parent, (XmlMappedSuperclass) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassTextRangeResolver.java
deleted file mode 100644
index bb107bb5b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmMappedSuperclassTextRangeResolver.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class OrmMappedSuperclassTextRangeResolver
- implements PrimaryKeyTextRangeResolver
-{
- private OrmMappedSuperclass mappedSuperclass;
-
-
- public OrmMappedSuperclassTextRangeResolver(OrmMappedSuperclass mappedSuperclass) {
- this.mappedSuperclass = mappedSuperclass;
- }
-
-
- public TextRange getTypeMappingTextRange() {
- return this.mappedSuperclass.getValidationTextRange();
- }
-
- public TextRange getIdClassTextRange() {
- return this.mappedSuperclass.getIdClassReference().getValidationTextRange();
- }
-
- public TextRange getAttributeMappingTextRange(String attributeName) {
- return this.mappedSuperclass.getPersistentType().
- getAttributeNamed(attributeName).getMapping().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingDefinition.java
deleted file mode 100644
index f7ea7d8ce8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToManyMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmOneToManyMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmOneToManyMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmOneToManyMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlOneToMany(),
- XmlOneToMany.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmOneToManyMapping(parent, (XmlOneToMany) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlOneToMany(ormTypeMapping, (JavaOneToManyMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingDefinition.java
deleted file mode 100644
index 487b0497ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmOneToOneMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlOneToOne(),
- XmlOneToOne.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmOneToOneMapping(parent, (XmlOneToOne) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlOneToOne(ormTypeMapping, (JavaOneToOneMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingDefinition.java
deleted file mode 100644
index 6177649214..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmTransientMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmTransientMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmTransientMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmTransientMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlTransient(),
- XmlTransient.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmTransientMapping(parent, (XmlTransient) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlTransient(ormTypeMapping, (JavaTransientMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingDefinition.java
deleted file mode 100644
index abc841dda2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmVersionMappingDefinition.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmVersionMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmVersionMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmVersionMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlVersion(),
- XmlVersion.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildOrmVersionMapping(parent, (XmlVersion) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return factory.buildVirtualXmlVersion(ormTypeMapping, (JavaVersionMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.java
deleted file mode 100644
index 6ecb0daf86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualCascadeType.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-
-public class VirtualCascadeType extends CascadeType
-{
- protected Cascade javaCascade;
-
-
- public VirtualCascadeType(Cascade javaCascade) {
- super();
- this.javaCascade = javaCascade;
- }
-
- @Override
- public boolean isCascadeAll() {
- return this.javaCascade.isAll();
- }
-
- @Override
- public void setCascadeAll(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isCascadeMerge() {
- return this.javaCascade.isMerge();
- }
-
- @Override
- public void setCascadeMerge(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isCascadePersist() {
- return this.javaCascade.isPersist();
- }
-
- @Override
- public void setCascadePersist(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isCascadeRefresh() {
- return this.javaCascade.isRefresh();
- }
-
- @Override
- public void setCascadeRefresh(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isCascadeRemove() {
- return this.javaCascade.isRemove();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.java
deleted file mode 100644
index 0b75a5c4d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualMapKey.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-
-public class VirtualMapKey extends MapKey
-{
- CollectionMapping javaCollectionMapping;
-
- public VirtualMapKey(CollectionMapping collectionMapping) {
- super();
- this.javaCollectionMapping = collectionMapping;
- }
-
- @Override
- public String getName() {
- return this.javaCollectionMapping.getSpecifiedMapKey();
- }
-
- @Override
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAssociationOverride.java
deleted file mode 100644
index 6f4af8edab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAssociationOverride.java
+++ /dev/null
@@ -1,59 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class VirtualXmlAssociationOverride extends XmlAssociationOverride
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JoiningStrategy joiningStrategy;
-
-
- public VirtualXmlAssociationOverride(String name, OrmTypeMapping ormTypeMapping, JoiningStrategy joiningStrategy) {
- super();
- this.name = name;
- this.ormTypeMapping = ormTypeMapping;
- this.joiningStrategy = joiningStrategy;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- if (this.joiningStrategy instanceof JoinColumnJoiningStrategy) {
- for (JoinColumn joinColumn :
- CollectionTools.iterable(((JoinColumnJoiningStrategy) this.joiningStrategy).joinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, this.isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- }
- return joinColumns;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.java
deleted file mode 100644
index a071e1ce71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeMapping.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlAttributeMapping extends AbstractJpaEObject implements XmlAttributeMapping
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaAttributeMapping javaAttributeMapping;
-
-
- public VirtualXmlAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- }
-
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getMappingKey() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getPersistentAttribute().getDefaultMappingKey();
- }
- return this.javaAttributeMapping.getKey();
- }
-
- public String getName() {
- return this.javaAttributeMapping.getPersistentAttribute().getName();
- }
-
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public TextRange getNameTextRange() {
- return null;
- }
-
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(
- this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java
deleted file mode 100644
index 86e3490191..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverride.java
+++ /dev/null
@@ -1,44 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-public class VirtualXmlAttributeOverride extends XmlAttributeOverride
-{
-
- public VirtualXmlAttributeOverride(String name, XmlColumn xmlColumn) {
- super();
- this.name = name;
- this.column = xmlColumn;
- }
-
- @Override
- public String getName() {
- return this.name;
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public XmlColumn getColumn() {
- return this.column;
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverrideColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverrideColumn.java
deleted file mode 100644
index d1383f2d92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlAttributeOverrideColumn.java
+++ /dev/null
@@ -1,75 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-
-/**
- * javax.persistence.Column
- */
-public class VirtualXmlAttributeOverrideColumn
- extends VirtualXmlColumn
-{
-
- public VirtualXmlAttributeOverrideColumn(Column column) {
- super(null, column);
- }
-
- @Override
- public String getName() {
- return this.column.getSpecifiedName();
- }
-
- @Override
- public String getColumnDefinition() {
- return this.column.getColumnDefinition();
- }
-
- @Override
- public String getTable() {
- return this.column.getSpecifiedTable();
- }
-
- @Override
- public Boolean getInsertable() {
- return this.column.getSpecifiedInsertable();
- }
-
- @Override
- public Boolean getUpdatable() {
- return this.column.getSpecifiedUpdatable();
- }
-
- @Override
- public Boolean getNullable() {
- return this.column.getSpecifiedNullable();
- }
-
- @Override
- public Boolean getUnique() {
- return this.column.getSpecifiedUnique();
- }
-
- @Override
- public Integer getLength() {
- return this.column.getSpecifiedLength();
- }
-
- @Override
- public Integer getScale() {
- return this.column.getSpecifiedScale();
- }
-
- @Override
- public Integer getPrecision() {
- return this.column.getSpecifiedPrecision();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.java
deleted file mode 100644
index f9d5c52779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlBasic.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlBasic extends XmlBasic
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaBasicMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualXmlColumn column;
-
- public VirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaBasicMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaBasicMapping.getColumn());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.column;
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaAttributeMapping.isDefaultOptional());
- }
- return Boolean.valueOf(this.javaAttributeMapping.isOptional());
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isLob() {
- if (this.isOrmMetadataComplete()) {
- return false;
- }
- return this.javaAttributeMapping.getConverter().getType() == Converter.LOB_CONVERTER;
- }
-
- @Override
- public void setLob(boolean newLob) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TemporalType getTemporal() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Converter.TEMPORAL_CONVERTER) {
- org.eclipse.jpt.core.context.TemporalType javaTemporalType = ((TemporalConverter) this.javaAttributeMapping.getConverter()).getTemporalType();
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(javaTemporalType);
- }
- return null;
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EnumType getEnumerated() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Converter.ENUMERATED_CONVERTER) {
- org.eclipse.jpt.core.context.EnumType javaEnumeratedType = ((EnumeratedConverter) this.javaAttributeMapping.getConverter()).getEnumType();
- return org.eclipse.jpt.core.context.EnumType.toOrmResourceModel(javaEnumeratedType);
- }
- return null;
- }
-
- @Override
- public void setEnumerated(EnumType newEnumerated) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public TextRange getLobTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java
deleted file mode 100644
index fea21486c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlColumn.java
+++ /dev/null
@@ -1,184 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * A virtual column is used to represent the XmlColumn resource object
- * within a virtual mapping. A virtual mapping is one which is not specified
- * in the orm.xml file, but is implied from the underlying java. Virtual column
- * is not used when the mapping is specified in the orm.xml, but the column tag does not exist.
- *
- * A virtual column delegates to the underlying java column for its state. The metadataComplete
- * flag determines whether it will get specified or default information from the java column
- *
- */
-public class VirtualXmlColumn extends XmlColumn
-{
-
- protected Column column;
-
- protected OrmTypeMapping ormTypeMapping;
-
-
- public VirtualXmlColumn(OrmTypeMapping ormTypeMapping, Column column) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.column = column;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getColumnDefinition() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.column.getColumnDefinition();
- }
-
- @Override
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getInsertable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.column.isDefaultInsertable());
- }
- return Boolean.valueOf(this.column.isInsertable());
- }
-
- @Override
- public void setInsertable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getLength() {
- if (this.isOrmMetadataComplete()) {
- return Integer.valueOf(this.column.getDefaultLength());
- }
- return Integer.valueOf(this.column.getLength());
- }
-
- @Override
- public void setLength(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultName();
- }
- return this.column.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getNullable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.column.isDefaultNullable());
- }
- return Boolean.valueOf(this.column.isNullable());
- }
-
- @Override
- public void setNullable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getPrecision() {
- if (this.isOrmMetadataComplete()) {
- return Integer.valueOf(this.column.getDefaultPrecision());
- }
- return Integer.valueOf(this.column.getPrecision());
- }
-
- @Override
- public void setPrecision(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getScale() {
- if (this.isOrmMetadataComplete()) {
- return Integer.valueOf(this.column.getDefaultScale());
- }
- return Integer.valueOf(this.column.getScale());
- }
-
- @Override
- public void setScale(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTable() {
- if (this.isOrmMetadataComplete()) {
- return this.column.getDefaultTable();
- }
- return this.column.getTable();
- }
-
- @Override
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getUnique() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.column.isDefaultUnique());
- }
- return Boolean.valueOf(this.column.isUnique());
- }
-
- @Override
- public void setUnique(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getUpdatable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.column.isDefaultUpdatable());
- }
- return Boolean.valueOf(this.column.isUpdatable());
- }
-
- @Override
- public void setUpdatable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTableTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.java
deleted file mode 100644
index 206598370f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbedded.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.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualEmbedded is an implementation of Embedded used when there is
- * no tag in the orm.xml and an underlying javaEmbeddedMapping exists.
- */
-public class VirtualXmlEmbedded extends XmlEmbedded
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaEmbeddedMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.java
deleted file mode 100644
index 4dae7d00e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlEmbeddedId.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.core.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualEmbeddedId is an implementation of EmbeddedId used when there is
- * no tag in the orm.xml and an underlying javaEmbeddedIdMapping exists.
- */
-public class VirtualXmlEmbeddedId extends XmlEmbeddedId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedIdMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedIdMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java
deleted file mode 100644
index 828999cb40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlGeneratedValue.java
+++ /dev/null
@@ -1,60 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.resource.orm.GenerationType;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlGeneratedValue extends XmlGeneratedValue
-{
- JavaIdMapping javaIdMapping;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlGeneratedValue(JavaIdMapping javaIdMapping, boolean metadataComplete) {
- super();
- this.javaIdMapping = javaIdMapping;
- this.metadataComplete = metadataComplete;
- }
-
- protected JavaGeneratedValue getJavaGeneratedValue() {
- return this.javaIdMapping.getGeneratedValue();
- }
-
-
- @Override
- public String getGenerator() {
- return this.metadataComplete ? null : this.getJavaGeneratedValue().getGenerator();
- }
-
- @Override
- public GenerationType getStrategy() {
- return this.metadataComplete ? null : org.eclipse.jpt.core.context.GenerationType.toOrmResourceModel(this.getJavaGeneratedValue().getStrategy());
- }
-
- @Override
- public void setGenerator(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public void setStrategy(GenerationType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getGeneratorTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.java
deleted file mode 100644
index 00743c702e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlId.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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualId is an implementation of Id used when there is
- * no tag in the orm.xml and an underlying javaIdMapping exists.
- */
-public class VirtualXmlId extends XmlId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaIdMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualXmlColumn column;
-
- protected final VirtualXmlGeneratedValue virtualGeneratedValue;
-
- protected final VirtualXmlTableGenerator virtualTableGenerator;
-
- protected final VirtualXmlSequenceGenerator virtualSequenceGenerator;
-
-
- public VirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaIdMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaIdMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaIdMapping.getColumn());
- this.virtualGeneratedValue = new VirtualXmlGeneratedValue(javaIdMapping, this.isOrmMetadataComplete());
- this.virtualTableGenerator = new VirtualXmlTableGenerator(javaIdMapping.getGeneratorContainer(), this.isOrmMetadataComplete());
- this.virtualSequenceGenerator = new VirtualXmlSequenceGenerator(javaIdMapping.getGeneratorContainer(), this.isOrmMetadataComplete());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.column;
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TemporalType getTemporal() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Converter.TEMPORAL_CONVERTER) {
- org.eclipse.jpt.core.context.TemporalType javaTemporalType = ((TemporalConverter) this.javaAttributeMapping.getConverter()).getTemporalType();
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(javaTemporalType);
- }
- return null;
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public XmlGeneratedValue getGeneratedValue() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getGeneratedValue() != null) {
- return this.virtualGeneratedValue;
- }
- return null;
- }
-
- @Override
- public void setGeneratedValue(XmlGeneratedValue value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlSequenceGenerator getSequenceGenerator() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getGeneratorContainer().getSequenceGenerator() != null) {
- return this.virtualSequenceGenerator;
- }
- return null;
- }
-
- @Override
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTableGenerator getTableGenerator() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getGeneratorContainer().getTableGenerator() != null) {
- return this.virtualTableGenerator;
- }
- return null;
- }
-
- @Override
- public void setTableGenerator(XmlTableGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //see eclipselink bug 247078 for info one why I made the interface XmlConvertibleMapping
- @Override
- public EnumType getEnumerated() {
- throw new UnsupportedOperationException("enumerated not supported on id mappings"); //$NON-NLS-1$
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //see eclipselink bug 247078 for info one why I made the interface XmlConvertibleMapping
- @Override
- public boolean isLob() {
- throw new UnsupportedOperationException("lob not supported on id mappings"); //$NON-NLS-1$
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public TextRange getLobTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java
deleted file mode 100644
index 0e862c7c88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinColumn.java
+++ /dev/null
@@ -1,147 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlJoinColumn extends XmlJoinColumn
-{
- protected JoinColumn javaJoinColumn;
-
- protected boolean metadataComplete;
-
- public VirtualXmlJoinColumn(JoinColumn javaJoinColumn, boolean metadataComplete) {
- super();
- this.javaJoinColumn = javaJoinColumn;
- this.metadataComplete = metadataComplete;
- }
-
- @Override
- public String getColumnDefinition() {
- if (this.metadataComplete) {
- return null;
- }
- return this.javaJoinColumn.getColumnDefinition();
- }
-
- @Override
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getInsertable() {
- if (this.metadataComplete) {
- return Boolean.valueOf(this.javaJoinColumn.isDefaultInsertable());
- }
- return Boolean.valueOf(this.javaJoinColumn.isInsertable());
- }
-
- @Override
- public void setInsertable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultName();
- }
- return this.javaJoinColumn.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getReferencedColumnName() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultReferencedColumnName();
- }
- return this.javaJoinColumn.getReferencedColumnName();
- }
-
- @Override
- public void setReferencedColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getNullable() {
- if (this.metadataComplete) {
- return Boolean.valueOf(this.javaJoinColumn.isDefaultNullable());
- }
- return Boolean.valueOf(this.javaJoinColumn.isNullable());
- }
-
- @Override
- public void setNullable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTable() {
- if (this.metadataComplete) {
- return this.javaJoinColumn.getDefaultTable();
- }
- return this.javaJoinColumn.getTable();
- }
-
- @Override
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getUnique() {
- if (this.metadataComplete) {
- return Boolean.valueOf(this.javaJoinColumn.isDefaultUnique());
- }
- return Boolean.valueOf(this.javaJoinColumn.isUnique());
- }
-
- @Override
- public void setUnique(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getUpdatable() {
- if (this.metadataComplete) {
- return Boolean.valueOf(this.javaJoinColumn.isDefaultUpdatable());
- }
- return Boolean.valueOf(this.javaJoinColumn.isUpdatable());
- }
-
- @Override
- public void setUpdatable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTableTextRange() {
- return null;
- }
-
- @Override
- public TextRange getReferencedColumnNameTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java
deleted file mode 100644
index 1e1fee7ca7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlJoinTable.java
+++ /dev/null
@@ -1,140 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class VirtualXmlJoinTable
- extends XmlJoinTable
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected JoinTable joinTable;
-
-
- public VirtualXmlJoinTable(OrmTypeMapping ormTypeMapping, JoinTable joinTable) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.joinTable = joinTable;
- }
-
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.joinTable.getDefaultName();
- }
- return this.joinTable.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getCatalog() {
- if (this.isOrmMetadataComplete()) {
- return this.joinTable.getDefaultCatalog();
- }
- return this.joinTable.getCatalog();
- }
-
- @Override
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getSchema() {
- if (this.isOrmMetadataComplete()) {
- return this.joinTable.getDefaultSchema();
- }
- return this.joinTable.getSchema();
- }
-
- @Override
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //VirtualXmlJoinTable is rebuilt every time, so just rebuilding the joinColumns list as well
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS);
- if (this.joinTable == null || isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn : CollectionTools.iterable(this.joinTable.specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- //VirtualXmlJoinTable is rebuilt every time, so just rebuilding the joinColumns list as well
- @Override
- public EList<XmlJoinColumn> getInverseJoinColumns() {
- EList<XmlJoinColumn> inverseJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
- if (this.joinTable == null || isOrmMetadataComplete()) {
- return inverseJoinColumns;
- }
- for (JoinColumn joinColumn : CollectionTools.iterable(this.joinTable.specifiedInverseJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- inverseJoinColumns.add(xmlJoinColumn);
- }
-
- return inverseJoinColumns;
- }
-
- @Override
- public EList<XmlUniqueConstraint> getUniqueConstraints() {
- EList<XmlUniqueConstraint> xmlUniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_JOIN_TABLE__UNIQUE_CONSTRAINTS);
- if (this.joinTable == null || isOrmMetadataComplete()) {
- return xmlUniqueConstraints;
- }
- for (UniqueConstraint uniqueConstraint : CollectionTools.iterable(this.joinTable.uniqueConstraints())) {
- XmlUniqueConstraint xmlUniqueConstraint = new VirtualXmlUniqueConstraint(uniqueConstraint, isOrmMetadataComplete());
- xmlUniqueConstraints.add(xmlUniqueConstraint);
- }
-
- return xmlUniqueConstraints;
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getCatalogTextRange() {
- return null;
- }
-
- @Override
- public TextRange getSchemaTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
deleted file mode 100644
index 3364c3cf24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToMany.java
+++ /dev/null
@@ -1,182 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualManyToMany is an implementation of ManyToMany used when there is
- * no tag in the orm.xml and an underlying javaManyToManyMapping exists.
- */
-public class VirtualXmlManyToMany
- extends XmlManyToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToManyMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
-
- public VirtualXmlManyToMany(
- OrmTypeMapping ormTypeMapping,
- JavaManyToManyMapping javaManyToManyMapping) {
-
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToManyMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaManyToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToManyMapping.getCascade());
- this.mapKey = new VirtualMapKey(javaManyToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- if (this.javaAttributeMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable() != null) {
- return new VirtualXmlJoinTable(
- this.ormTypeMapping,
- this.javaAttributeMapping.getRelationshipReference().
- getJoinTableJoiningStrategy().getJoinTable());
- }
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getFullyQualifiedTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute();
- }
-
- @Override
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public MapKey getMapKey() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.isNoMapKey()) {
- return null;
- }
- return this.mapKey;
- }
-
- @Override
- public void setMapKey(MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getOrderBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getOrderable().getSpecifiedOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java
deleted file mode 100644
index e14c5aab8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlManyToOne.java
+++ /dev/null
@@ -1,157 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualManyToOne is an implementation of ManyToOne used when there is
- * no tag in the orm.xml and an underlying javaManyToOneMapping exists.
- */
-public class VirtualXmlManyToOne
- extends XmlManyToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToOneMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualCascadeType virtualCascadeType;
-
-
- public VirtualXmlManyToOne(
- OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToOneMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaManyToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaManyToOneMapping.getCascade());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaAttributeMapping.isDefaultOptional());
- }
- return Boolean.valueOf(this.javaAttributeMapping.isOptional());
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_MANY_TO_ONE__JOIN_COLUMNS);
- if (isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- this.javaAttributeMapping.getRelationshipReference().
- getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getFullyQualifiedTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java
deleted file mode 100644
index 0cc0cd8472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlNullAttributeMapping.java
+++ /dev/null
@@ -1,61 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtualXmlNullAttributeMapping extends XmlNullAttributeMapping
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaAttributeMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getMappingKey() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getPersistentAttribute().getDefaultMappingKey();
- }
- return this.javaAttributeMapping.getKey();
- }
-
- @Override
- public String getName() {
- return this.javaAttributeMapping.getPersistentAttribute().getName();
- }
-
- @Override
- public void setName(String newName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
deleted file mode 100644
index 4b5eb5a99d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToMany.java
+++ /dev/null
@@ -1,198 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualOneToMany is an implementation of OneToMany used when there is
- * no tag in the orm.xml and an underlying javaOneToManyMapping exists.
- */
-public class VirtualXmlOneToMany
- extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaOneToManyMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualCascadeType virtualCascadeType;
-
- protected final MapKey mapKey;
-
- public VirtualXmlOneToMany(
- OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaOneToManyMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToManyMapping.getCascade());
- this.mapKey = new VirtualMapKey(javaOneToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return null;
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public Boolean getOrphanRemoval() {
- throw new UnsupportedOperationException("operation not supported in JPA 1.0"); //$NON-NLS-1$
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("operation not supported in JPA 1.0"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- if (this.javaAttributeMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable() != null) {
- return new VirtualXmlJoinTable(
- this.ormTypeMapping,
- this.javaAttributeMapping.getRelationshipReference().
- getJoinTableJoiningStrategy().getJoinTable());
- }
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getFullyQualifiedTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute();
- }
-
- @Override
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public MapKey getMapKey() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.isNoMapKey()) {
- return null;
- }
- return this.mapKey;
- }
-
- @Override
- public void setMapKey(MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getOrderBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getOrderable().getSpecifiedOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java
deleted file mode 100644
index db5947d2e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOneToOne.java
+++ /dev/null
@@ -1,202 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualOneToOne is an implementation of OneToOne used when there is
- * no tag in the orm.xml and an underlying javaOneToOneMapping exists.
- */
-public class VirtualXmlOneToOne extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaOneToOneMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualCascadeType virtualCascadeType;
-
-
- public VirtualXmlOneToOne(
- OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaOneToOneMapping);
- this.virtualCascadeType = new VirtualCascadeType(javaOneToOneMapping.getCascade());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getOptional() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaAttributeMapping.isDefaultOptional());
- }
- return Boolean.valueOf(this.javaAttributeMapping.isOptional());
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE__JOIN_COLUMNS);
- if (isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- this.javaAttributeMapping.getRelationshipReference().
- getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- throw new UnsupportedOperationException("operation not supported in JPA 1.0"); //$NON-NLS-1$
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("operation not supported in JPA 1.0"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTargetEntity() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetEntity();
- }
- return this.javaAttributeMapping.getFullyQualifiedTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getMappedBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute();
- }
-
- @Override
- public void setMappedBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- EList<XmlPrimaryKeyJoinColumn> joinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS);
- if (!this.isOrmMetadataComplete()) {
- for (JavaPrimaryKeyJoinColumn joinColumn :
- CollectionTools.iterable(
- this.javaAttributeMapping.getRelationshipReference().
- getPrimaryKeyJoinColumnJoiningStrategy().primaryKeyJoinColumns())) {
- XmlPrimaryKeyJoinColumn xmlJoinColumn = new VirtualXmlPrimaryKeyJoinColumn(joinColumn/*, this.metadataComplete*/);
- joinColumns.add(xmlJoinColumn);
- }
- }
- return joinColumns;
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java
deleted file mode 100644
index 371d08a907..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlOrderColumn.java
+++ /dev/null
@@ -1,103 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlOrderColumn extends XmlOrderColumn
-{
- protected OrderColumn2_0 javaOrderColumn;
-
- protected OrmTypeMapping ormTypeMapping;
-
- public VirtualXmlOrderColumn(OrderColumn2_0 javaOrderColumn, OrmTypeMapping ormTypeMapping) {
- super();
- this.javaOrderColumn = javaOrderColumn;
- this.ormTypeMapping = ormTypeMapping;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getColumnDefinition() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaOrderColumn.getColumnDefinition();
- }
-
- @Override
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getInsertable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaOrderColumn.isDefaultInsertable());
- }
- return Boolean.valueOf(this.javaOrderColumn.isInsertable());
- }
-
- @Override
- public void setInsertable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.javaOrderColumn.getDefaultName();
- }
- return this.javaOrderColumn.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public Boolean getNullable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaOrderColumn.isDefaultNullable());
- }
- return Boolean.valueOf(this.javaOrderColumn.isNullable());
- }
-
- @Override
- public void setNullable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getUpdatable() {
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(this.javaOrderColumn.isDefaultUpdatable());
- }
- return Boolean.valueOf(this.javaOrderColumn.isUpdatable());
- }
-
- @Override
- public void setUpdatable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java
deleted file mode 100644
index 34127e1e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,74 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * A virtual primary key join column is used to represent the XmlPrimaryKeyJoinColumn resource object
- * within a virtual secondary table. A virtual secondary table is one which is not specified
- * in the orm.xml file, but is implied from the underlying java. Virtual pk join column
- * is not used when the secondary table is specified in the orm.xml.
- *
- * A virtual pk join column delegates to the underlying java pk join column for its state.
- */
-public class VirtualXmlPrimaryKeyJoinColumn extends XmlPrimaryKeyJoinColumn
-{
-
- protected JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn;
-
-
- protected VirtualXmlPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn) {
- super();
- this.javaPrimaryKeyJoinColumn = javaPrimaryKeyJoinColumn;
- }
-
- @Override
- public String getName() {
- return this.javaPrimaryKeyJoinColumn.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getColumnDefinition() {
- return this.javaPrimaryKeyJoinColumn.getColumnDefinition();
- }
-
- @Override
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getReferencedColumnName() {
- return this.javaPrimaryKeyJoinColumn.getReferencedColumnName();
- }
-
- @Override
- public void setReferencedColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getReferencedColumnNameTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java
deleted file mode 100644
index b25ddcb3f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSecondaryTable.java
+++ /dev/null
@@ -1,111 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * A virtual secondary table is used to represent the XmlSecondaryTable resource object.
- * A virtual secondary table is one which is not specified in the orm.xml file,
- * but is implied from the underlying java. Virtual secondary table
- * is not used when the secondary table is specified in the orm.xml.
- *
- * A virtual secondary table delegates to the underlying java secondary table for its state.
- */
-public class VirtualXmlSecondaryTable extends XmlSecondaryTable
-{
-
- protected JavaSecondaryTable javaSecondaryTable;
-
- protected VirtualXmlSecondaryTable(JavaSecondaryTable javaSecondaryTable) {
- super();
- this.javaSecondaryTable = javaSecondaryTable;
- }
-
- @Override
- public String getName() {
- return this.javaSecondaryTable.getSpecifiedName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getCatalog() {
- return this.javaSecondaryTable.getSpecifiedCatalog();
- }
-
- @Override
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getSchema() {
- return this.javaSecondaryTable.getSpecifiedSchema();
- }
-
- @Override
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //VirtualXmlSecondaryTable is rebuilt everytime, so rebuilding the joinColumns list as well
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS);
-
- for (JavaPrimaryKeyJoinColumn pkJoinColumn : CollectionTools.iterable(this.javaSecondaryTable.specifiedPrimaryKeyJoinColumns())) {
- XmlPrimaryKeyJoinColumn xmlPkJoinColumn = new VirtualXmlPrimaryKeyJoinColumn(pkJoinColumn);
- primaryKeyJoinColumns.add(xmlPkJoinColumn);
- }
-
- return primaryKeyJoinColumns;
- }
-
- @Override
- public EList<XmlUniqueConstraint> getUniqueConstraints() {
- EList<XmlUniqueConstraint> xmlUniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS);
-
- for (JavaUniqueConstraint uniqueConstraint : CollectionTools.iterable(this.javaSecondaryTable.uniqueConstraints())) {
- XmlUniqueConstraint xmlUniqueConstraint = new VirtualXmlUniqueConstraint(uniqueConstraint, true);
- xmlUniqueConstraints.add(xmlUniqueConstraint);
- }
-
- return xmlUniqueConstraints;
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getCatalogTextRange() {
- return null;
- }
-
- @Override
- public TextRange getSchemaTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java
deleted file mode 100644
index 06a8ffb50d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlSequenceGenerator.java
+++ /dev/null
@@ -1,95 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlSequenceGenerator extends XmlSequenceGenerator
-{
- JavaGeneratorContainer javaGeneratorHolder;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlSequenceGenerator(JavaGeneratorContainer javaGeneratorHolder, boolean metadataComplete) {
- super();
- this.javaGeneratorHolder = javaGeneratorHolder;
- this.metadataComplete = metadataComplete;
- }
-
- protected JavaSequenceGenerator getJavaSequenceGenerator() {
- return this.javaGeneratorHolder.getSequenceGenerator();
- }
-
- @Override
- public String getSequenceName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getSequenceName();
- }
-
- @Override
- public void setSequenceName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return Integer.valueOf(this.getJavaSequenceGenerator().getAllocationSize());
- }
-
- @Override
- public void setAllocationSize(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return Integer.valueOf(this.getJavaSequenceGenerator().getInitialValue());
- }
-
- @Override
- public void setInitialValue(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaSequenceGenerator().getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getNameTextRange() {
- return getValidationTextRange();
- }
-
- @Override
- public boolean isVirtual() {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java
deleted file mode 100644
index 26121e2f4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTableGenerator.java
+++ /dev/null
@@ -1,178 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class VirtualXmlTableGenerator extends XmlTableGenerator
-{
- JavaGeneratorContainer javaGeneratorHolder;
-
- protected boolean metadataComplete;
-
-
- public VirtualXmlTableGenerator(JavaGeneratorContainer javaGeneratorHolder, boolean metadataComplete) {
- super();
- this.javaGeneratorHolder = javaGeneratorHolder;
- this.metadataComplete = metadataComplete;
- }
-
- protected JavaTableGenerator getJavaTableGenerator() {
- return this.javaGeneratorHolder.getTableGenerator();
- }
-
- @Override
- public String getCatalog() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getCatalog();
- }
-
- @Override
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getPkColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getPkColumnName();
- }
-
- @Override
- public void setPkColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getPkColumnValue() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getPkColumnValue();
- }
-
- @Override
- public void setPkColumnValue(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getSchema() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getSchema();
- }
-
- @Override
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getTable() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getTable();
- }
-
- @Override
- public void setTable(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getValueColumnName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getValueColumnName();
- }
-
- @Override
- public void setValueColumnName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getAllocationSize() {
- if (this.metadataComplete) {
- return null;
- }
- return Integer.valueOf(this.getJavaTableGenerator().getAllocationSize());
- }
-
- @Override
- public void setAllocationSize(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getInitialValue() {
- if (this.metadataComplete) {
- return null;
- }
- return Integer.valueOf(this.getJavaTableGenerator().getInitialValue());
- }
-
- @Override
- public void setInitialValue(Integer value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (this.metadataComplete) {
- return null;
- }
- return this.getJavaTableGenerator().getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlUniqueConstraint> getUniqueConstraints() {
- EList<XmlUniqueConstraint> xmlUniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
-
- for (JavaUniqueConstraint uniqueConstraint : CollectionTools.iterable(this.getJavaTableGenerator().uniqueConstraints())) {
- XmlUniqueConstraint xmlUniqueConstraint = new VirtualXmlUniqueConstraint(uniqueConstraint, this.metadataComplete);
- xmlUniqueConstraints.add(xmlUniqueConstraint);
- }
-
- return xmlUniqueConstraints;
- }
-
- @Override
- public TextRange getNameTextRange() {
- return getValidationTextRange();
- }
-
- @Override
- public boolean isVirtual() {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java
deleted file mode 100644
index e80ebe5273..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlTransient.java
+++ /dev/null
@@ -1,59 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualTransient is an implementation of Transient used when there is
- * no tag in the orm.xml and an underlying javaTransientMapping exists.
- */
-public class VirtualXmlTransient extends XmlTransient
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaTransientMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransientMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaTransientMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlUniqueConstraint.java
deleted file mode 100644
index 2be593ccbb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlUniqueConstraint.java
+++ /dev/null
@@ -1,41 +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.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class VirtualXmlUniqueConstraint extends XmlUniqueConstraint
-{
- protected UniqueConstraint uniqueConstraint;
-
- protected boolean metadataComplete;
-
- public VirtualXmlUniqueConstraint(UniqueConstraint uniqueConstraint, boolean metadataComplete) {
- super();
- this.uniqueConstraint = uniqueConstraint;
- this.metadataComplete = metadataComplete;
- }
-
- @Override
- public EList<String> getColumnNames() {
- EList<String> columnNames = new EDataTypeEList<String>(String.class, this, OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES);
-
- for (String columnName : CollectionTools.iterable(this.uniqueConstraint.columnNames())) {
- columnNames.add(columnName);
- }
- return columnNames;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java
deleted file mode 100644
index 14be7a4cbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/VirtualXmlVersion.java
+++ /dev/null
@@ -1,132 +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.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtualXmlVersion extends XmlVersion
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaVersionMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final VirtualXmlColumn column;
-
- public VirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVersionMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaVersionMapping);
- this.column = new VirtualXmlColumn(ormTypeMapping, javaVersionMapping.getColumn());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.column;
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TemporalType getTemporal() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == Converter.TEMPORAL_CONVERTER) {
- org.eclipse.jpt.core.context.TemporalType javaTemporalType = ((TemporalConverter) this.javaAttributeMapping.getConverter()).getTemporalType();
- return org.eclipse.jpt.core.context.TemporalType.toOrmResourceModel(javaTemporalType);
- }
- return null;
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //see eclipselink bug 247078 for info one why I made the interface XmlConvertibleMapping
- @Override
- public EnumType getEnumerated() {
- throw new UnsupportedOperationException("enumerated not supported on version mappings"); //$NON-NLS-1$
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //see eclipselink bug 247078 for info one why I made the interface XmlConvertibleMapping
- @Override
- public boolean isLob() {
- throw new UnsupportedOperationException("lob not supported on version mappings"); //$NON-NLS-1$
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public TextRange getLobTextRange() {
- return null;
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractJarFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractJarFileRef.java
deleted file mode 100644
index 6dcf105784..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractJarFileRef.java
+++ /dev/null
@@ -1,310 +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.core.internal.context.persistence;
-
-import java.util.List;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JarFile;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJarFileRef
- extends AbstractPersistenceXmlContextNode
- implements JarFileRef
-{
- protected XmlJarFileRef xmlJarFileRef;
-
- protected String fileName;
-
- protected JarFile jarFile;
-
-
- // **************** construction/initialization ****************************
-
- public AbstractJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- super(parent);
- this.xmlJarFileRef = xmlJarFileRef;
- this.fileName = xmlJarFileRef.getFileName();
- this.jarFile = this.buildJarFile();
- }
-
- protected JarFile buildJarFile() {
- if (StringTools.stringIsEmpty(this.fileName)) {
- return null;
- }
- JavaResourcePackageFragmentRoot jrpfr = this.getJpaProject().getJavaResourcePackageFragmentRoot(this.getFileName());
- return (jrpfr == null) ? null : this.buildJarFile(jrpfr);
- }
-
- @Override
- public PersistenceUnit getParent() {
- return (PersistenceUnit) super.getParent();
- }
-
-
- // **************** file name **********************************************
-
- public String getFileName() {
- return this.fileName;
- }
-
- public void setFileName(String newFileName) {
- String old = this.fileName;
- this.fileName = newFileName;
- this.xmlJarFileRef.setFileName(newFileName);
- this.firePropertyChanged(FILE_NAME_PROPERTY, old, newFileName);
- }
-
- protected void setFileName_(String newFileName) {
- String old = this.fileName;
- this.fileName = newFileName;
- this.firePropertyChanged(FILE_NAME_PROPERTY, old, newFileName);
- }
-
-
- // **************** JAR file ***********************************************
-
- public JarFile getJarFile() {
- return this.jarFile;
- }
-
- protected void setJarFile(JarFile jarFile) {
- JarFile old = this.jarFile;
- this.jarFile = jarFile;
- this.firePropertyChanged(JAR_FILE_PROPERTY, old, jarFile);
- }
-
-
- // ********** JarFileRef implementation **********
-
- public PersistentType getPersistentType(String typeName) {
- return (this.jarFile == null) ? null : this.jarFile.getPersistentType(typeName);
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.xmlJarFileRef != null) && this.xmlJarFileRef.containsOffset(textOffset);
- }
-
-
- // ********** PersistentTypeContainer implementation **********
-
- public Iterable<? extends PersistentType> getPersistentTypes() {
- return (this.jarFile != null) ? this.jarFile.getPersistentTypes() : EmptyIterable.<JavaPersistentType>instance();
- }
-
-
- // **************** JpaStructureNode impl **********************************
-
- public String getId() {
- return PersistenceStructureNodes.JAR_FILE_REF_ID;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public TextRange getSelectionTextRange() {
- return (this.xmlJarFileRef == null) ? null : this.xmlJarFileRef.getSelectionTextRange();
- }
-
- public void dispose() {
- if (this.jarFile != null) {
- this.jarFile.dispose();
- }
- }
-
-
- // **************** XmlContextNode impl ************************************
-
- public TextRange getValidationTextRange() {
- return (this.xmlJarFileRef == null) ? null : this.xmlJarFileRef.getValidationTextRange();
- }
-
-
- // **************** updating ***********************************************
-
- public void update(XmlJarFileRef xjfr) {
- this.xmlJarFileRef = xjfr;
- this.setFileName_(xjfr.getFileName());
- this.updateJarFile();
- }
-
- protected void updateJarFile() {
- JavaResourcePackageFragmentRoot jrpfr = null;
-
- if (! StringTools.stringIsEmpty(this.fileName)) {
-
- // first, attempt to resolve location specifically
- jrpfr = javaPackageRoot_specifically();
-
- // then ... guess, basically
- if (jrpfr == null) {
- jrpfr = javaPackageRoot_guess();
- }
- }
-
- if (jrpfr == null) {
- if (this.jarFile != null) {
- this.jarFile.dispose();
- this.setJarFile(null);
- }
- } else {
- if (this.jarFile == null) {
- this.setJarFile(this.buildJarFile(jrpfr));
- } else {
- this.jarFile.update(jrpfr);
- }
- }
- }
-
- private JavaResourcePackageFragmentRoot javaPackageRoot_specifically() {
- for (IPath deploymentPath : resolveDeploymentJarFilePath(new Path(this.fileName))) {
- IVirtualFile virtualJar = ComponentCore.createFile(this.getProject(), deploymentPath);
- IFile realJar = virtualJar.getUnderlyingFile();
- if (realJar.exists() && realJar.getProject().equals(this.getProject())) {
- return getJpaProject().getJavaResourcePackageFragmentRoot(realJar.getProjectRelativePath().toString());
- }
- }
-
- return null;
- }
-
- private JavaResourcePackageFragmentRoot javaPackageRoot_guess() {
- String jarFileName = new Path(this.fileName).lastSegment();
- for (JpaFile jpaFile : CollectionTools.iterable(getJpaProject().jpaFiles())) {
- if (jpaFile.getFile().getName().equals(jarFileName)
- && JptCorePlugin.JAR_CONTENT_TYPE.equals(jpaFile.getContentType())) {
- return (JavaResourcePackageFragmentRoot) jpaFile.getResourceModel();
- }
- }
-
- return null;
- }
-
- /**
- * Return an array of deployment paths that may correspond
- * to the given persistence.xml jar file entry
- */
- protected IPath[] resolveDeploymentJarFilePath(IPath jarFilePath) {
- IPath root = this.getJarDeploymentRootPath();
- return this.projectHasWebFacet() ?
- this.resolveDeploymentJarFilePathWeb(root, jarFilePath) :
- this.resolveDeploymentJarFilePathNonWeb(root, jarFilePath);
- }
-
- protected IPath getJarDeploymentRootPath() {
- return JptCorePlugin.getJarDeploymentRootPath(this.getProject());
- }
-
- protected boolean projectHasWebFacet() {
- return JptCorePlugin.projectHasWebFacet(this.getProject());
- }
-
- protected IPath[] resolveDeploymentJarFilePathWeb(IPath root, IPath jarFilePath) {
- return new IPath[] {
- // first path entry assumes form "../lib/other.jar"
- root.append(jarFilePath.removeFirstSegments(1)),
- // second path entry assumes form of first, without ".." ("lib/other.jar")
- root.append(jarFilePath)
- };
- }
-
- protected IPath[] resolveDeploymentJarFilePathNonWeb(IPath root, IPath jarFilePath) {
- return new IPath[] {
- // assumes form "../lib/other.jar"
- root.append(jarFilePath)
- };
- }
-
-
- protected JarFile buildJarFile(JavaResourcePackageFragmentRoot jrpfr) {
- return this.getContextNodeFactory().buildJarFile(this, jrpfr);
- }
-
- protected IProject getProject() {
- return this.getJpaProject().getProject();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- if (StringTools.stringIsEmpty(this.xmlJarFileRef.getFileName())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING,
- this,
- this.getValidationTextRange()
- )
- );
-
- if (this.jarFile == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE,
- new String[] {this.xmlJarFileRef.getFileName()},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- this.jarFile.validate(messages, reporter);
- }
-
-
- // **************** misc ***************************************************
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.getFileName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractMappingFileRef.java
deleted file mode 100644
index c38e23e3b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractMappingFileRef.java
+++ /dev/null
@@ -1,277 +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.core.internal.context.persistence;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.MappingFilePersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>persistence.xml</code> file
- * <br>
- * <code>mapping-file</code> element
- */
-public abstract class AbstractMappingFileRef
- extends AbstractPersistenceXmlContextNode
- implements MappingFileRef
-{
- protected String fileName;
-
- /**
- * the mapping file corresponding to the ref's file name;
- * this can be null if the name is invalid
- */
- protected MappingFile mappingFile;
-
-
- // ********** construction/initialization **********
-
- protected AbstractMappingFileRef(PersistenceUnit parent, String resourceFileName) {
- super(parent);
- this.fileName = resourceFileName;
- this.mappingFile = this.buildMappingFile();
- }
-
-
- // ********** overrides **********
-
- @Override
- public PersistenceUnit getParent() {
- return (PersistenceUnit) super.getParent();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.fileName);
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return PersistenceStructureNodes.MAPPING_FILE_REF_ID;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public void dispose() {
- if (this.mappingFile != null) {
- this.mappingFile.dispose();
- }
- }
-
-
- // ********** queries **********
-
- public boolean persistenceUnitDefaultsExists() {
- MappingFilePersistenceUnitDefaults defaults = this.getPersistenceUnitDefaults();
- return (defaults != null) && defaults.resourceExists();
- }
-
- public MappingFilePersistenceUnitDefaults getPersistenceUnitDefaults() {
- MappingFileRoot root = this.getChildMappingFileRoot();
- return (root == null) ? null : root.getPersistenceUnitDefaults();
- }
-
- /**
- * The method {@link #getMappingFileRoot()} is already defined by
- * {@link org.eclipse.jpt.core.internal.context.AbstractJpaContextNode}
- * for getting what would be the "mapping file root" that <em>contains</em>
- * the context node. We want something slightly different here: i.e. the
- * "mapping file root" contained by the mapping file ref (since, actually,
- * the mapping file ref is not even contained by a "mapping file root").
- */
- protected MappingFileRoot getChildMappingFileRoot() {
- return (this.mappingFile == null) ? null : this.mappingFile.getRoot();
- }
-
- public PersistentType getPersistentType(String typeName) {
- return (this.mappingFile == null) ? null : this.mappingFile.getPersistentType(typeName);
- }
-
-
- // ********** file name **********
-
- public String getFileName() {
- return this.fileName;
- }
-
-
- // ********** mapping file **********
-
- public MappingFile getMappingFile() {
- return this.mappingFile;
- }
-
- protected void setMappingFile(MappingFile mappingFile) {
- MappingFile old = this.mappingFile;
- this.mappingFile = mappingFile;
- this.firePropertyChanged(MAPPING_FILE_PROPERTY, old, mappingFile);
- }
-
- protected MappingFile buildMappingFile() {
- JpaXmlResource xmlResource = this.resolveMappingFileXmlResource();
- return (xmlResource == null) ? null : this.buildMappingFile(xmlResource);
- }
-
- protected void updateMappingFile() {
- JpaXmlResource xmlResource = this.resolveMappingFileXmlResource();
-
- if (xmlResource == null) {
- if (this.mappingFile != null) {
- this.mappingFile.dispose();
- this.setMappingFile(null);
- }
- } else {
- if (this.mappingFile == null) {
- this.setMappingFile(this.buildMappingFile(xmlResource));
- } else {
- if (this.mappingFile.getXmlResource() == xmlResource) {
- this.mappingFile.update();
- } else {
- // if the resource's content type has changed, we completely rebuild the mapping file
- this.mappingFile.dispose();
- this.setMappingFile(this.buildMappingFile(xmlResource));
- }
- }
- }
- }
-
- /**
- * The mapping file ref resource is in the persistence xml resource
- * (<code>persistence.xml</code>). This returns the resource of
- * the mapping file itself (<code>orm.xml</code>).
- */
- protected JpaXmlResource resolveMappingFileXmlResource() {
- if (this.fileName == null) {
- return null;
- }
- JpaXmlResource xmlResource = this.getJpaProject().getMappingFileXmlResource(this.fileName);
- if (xmlResource == null) {
- return null;
- }
- if (xmlResource.isReverting()) {
- // 308254 - this can happen when orm.xml is closed without saving;
- // the model is completely whacked in another thread - so wipe our model(?)
- return null;
- }
- JpaResourceType resourceType = xmlResource.getResourceType();
- if (resourceType == null) {
- return null;
- }
- if ( ! this.getJpaPlatform().supportsResourceType(resourceType)) {
- return null;
- }
- return xmlResource;
- }
-
- /**
- * pre-condition: 'resource' is not null
- */
- protected MappingFile buildMappingFile(JpaXmlResource resource) {
- return this.getJpaFactory().buildMappingFile(this, resource);
- }
-
-
- // ********** PersistentTypeContainer implementation **********
-
- public Iterable<? extends PersistentType> getPersistentTypes() {
- return (this.mappingFile != null) ? this.mappingFile.getPersistentTypes() : EmptyIterable.<JavaPersistentType>instance();
- }
-
- // ********** updating **********
-
- protected void update() {
- this.updateMappingFile();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.mappingFile != null) {
- this.mappingFile.postUpdate();
- }
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- if (StringTools.stringIsEmpty(this.fileName)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE,
- this,
- this.getValidationTextRange()));
- return;
- }
-
- if (this.mappingFile == null) {
- messages.add(buildMappingFileValidationMessage());
- return;
- }
-
- this.mappingFile.validate(messages, reporter);
- }
-
- protected IMessage buildMappingFileValidationMessage() {
- int severity = IMessage.HIGH_SEVERITY;
- IFile file = getPlatformFile();
- if (file.exists()) {
- JpaXmlResource xmlResource = getJpaProject().getMappingFileXmlResource(this.fileName);
- if (xmlResource != null
- && ! getJpaPlatform().supportsResourceType(xmlResource.getResourceType())) {
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT,
- new String[] {file.getName()},
- file);
- }
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE,
- new String[] {file.getName()},
- file);
- }
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE,
- new String[] {this.fileName},
- this,
- getValidationTextRange());
- }
-
- protected IFile getPlatformFile() {
- return this.getJpaProject().convertToPlatformFile(this.fileName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java
deleted file mode 100644
index 0a593cef94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnit.java
+++ /dev/null
@@ -1,1940 +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.core.internal.context.persistence;
-
-import java.util.ArrayList;
-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 java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.MappingFilePersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.core.context.persistence.PersistentTypeContainer;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.core.jpa2.context.MappingFilePersistenceUnitDefaults2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.PersistentType2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.ValidationMode;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperties;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.core.utility.BodySourceWriter;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.NotNullFilter;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>persistence.xml</code> file
- * <br>
- * <code>persistence-unit</code> element
- */
-public abstract class AbstractPersistenceUnit
- extends AbstractPersistenceXmlContextNode
- implements PersistenceUnit2_0
-{
- protected XmlPersistenceUnit xmlPersistenceUnit;
-
- protected String name;
-
- protected PersistenceUnitTransactionType specifiedTransactionType;
- protected PersistenceUnitTransactionType defaultTransactionType;
-
- protected String description;
-
- protected String provider;
-
- protected String jtaDataSource;
- protected String nonJtaDataSource;
-
- protected final Vector<MappingFileRef> specifiedMappingFileRefs = new Vector<MappingFileRef>();
- protected MappingFileRef impliedMappingFileRef;
-
- protected final Vector<JarFileRef> jarFileRefs = new Vector<JarFileRef>();
-
- protected final Vector<ClassRef> specifiedClassRefs = new Vector<ClassRef>();
- protected final Vector<ClassRef> impliedClassRefs = new Vector<ClassRef>();
-
- protected Boolean specifiedExcludeUnlistedClasses;
-
- protected final Vector<Property> properties = new Vector<Property>();
-
- /* global generator definitions, defined elsewhere in model */
- protected final Vector<Generator> generators = new Vector<Generator>();
-
- /* global query definitions, defined elsewhere in model */
- protected final Vector<Query> queries = new Vector<Query>();
-
- protected final Set<String> rootEntityNames = Collections.synchronizedSet(new HashSet<String>());
-
- protected AccessType defaultAccess;
- protected String defaultCatalog;
- protected String defaultSchema;
- protected boolean defaultCascadePersist;
- protected boolean defaultDelimitedIdentifiers;
-
- //****** PersistenceUnit2_0 features
- private PersistenceUnitProperties connection;
- private PersistenceUnitProperties options;
-
- protected SharedCacheMode specifiedSharedCacheMode;
- protected SharedCacheMode defaultSharedCacheMode;
-
- protected ValidationMode specifiedValidationMode;
- protected ValidationMode defaultValidationMode;
-
- protected final Set<IFile> metamodelFiles = Collections.synchronizedSet(new HashSet<IFile>());
-
-
- // ********** construction/initialization **********
-
- /**
- * NB: Be careful changing the order of the statements in this method
- * (bug 258701 is one reason).
- */
- protected AbstractPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- super(parent);
- this.xmlPersistenceUnit = xmlPersistenceUnit;
- this.name = xmlPersistenceUnit.getName();
- this.specifiedExcludeUnlistedClasses = xmlPersistenceUnit.getExcludeUnlistedClasses();
- this.specifiedTransactionType = this.buildSpecifiedTransactionType();
- this.defaultTransactionType = this.buildDefaultTransactionType();
- this.description = xmlPersistenceUnit.getDescription();
- this.provider = xmlPersistenceUnit.getProvider();
- this.jtaDataSource = xmlPersistenceUnit.getJtaDataSource();
- this.nonJtaDataSource = xmlPersistenceUnit.getNonJtaDataSource();
- this.specifiedExcludeUnlistedClasses = xmlPersistenceUnit.getExcludeUnlistedClasses();
-
- // initialize the properties before building the entities because the
- // entities will need the properties
- this.initializeProperties();
-
- this.initializeJarFileRefs();
-
- //initialize specified classRefs before mappingFileRefs because of
- //JpaFile rootStructureNode, we want the mapping file to "win",
- //as it would in a Jpa runtime implementation
- this.initializeSpecifiedClassRefs();
- this.initializeMappingFileRefs();
- //initialize implied classRefs last since they depend on both
- //specified classRefs and mappingFileRefs
- this.initializeImpliedClassRefs();
- this.initializePersistenceUnitDefaults();
-
- this.specifiedSharedCacheMode = this.buildSpecifiedSharedCacheMode();
- this.defaultSharedCacheMode = this.buildDefaultSharedCacheMode();
-
- this.specifiedValidationMode = this.buildSpecifiedValidationMode();
- this.defaultValidationMode = this.buildDefaultValidationMode();
-
- this.initializeMetamodelFiles();
- }
-
- /**
- * These lists are just copies of what is distributed across the context
- * model; so, if they have (virtually) changed, the resulting update has
- * already been triggered. We don't need to trigger another one here.
- */
- @Override
- protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
- super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNames.add(GENERATORS_LIST);
- nonUpdateAspectNames.add(QUERIES_LIST);
- }
-
-
- // ********** updating **********
-
- public void update(XmlPersistenceUnit xpu) {
- this.xmlPersistenceUnit = xpu;
-
- // the 'generators' and 'queries' lists are simply cleared out with each
- // "update" and completely rebuilt as the "update" cascades through
- // the persistence unit. When the persistence unit's "update" is
- // complete, the lists have been populated and we fire the change event.
- // @see #addGenerator(Generator) (and references)
- // @see #addQuery(Query) (and references)
- this.generators.clear();
- this.queries.clear();
-
- this.rootEntityNames.clear();
-
- this.setName(xpu.getName());
- this.setSpecifiedTransactionType(this.buildSpecifiedTransactionType());
- this.setDefaultTransactionType(this.buildDefaultTransactionType());
- this.setDescription(xpu.getDescription());
- this.setProvider(xpu.getProvider());
- this.setJtaDataSource(xpu.getJtaDataSource());
- this.setNonJtaDataSource(xpu.getNonJtaDataSource());
- this.updateJarFileRefs();
-
- // update 'specifiedClassRefs' before 'mappingFileRefs' because of
- // JpaFile rootStructureNode, we want the mapping file to "win",
- // as it would in a JPA runtime implementation
- this.updateSpecifiedClassRefs();
- this.updateMappingFileRefs();
-
- // update 'impliedClassRefs' last since it depends on the contents of
- // both 'specifiedClassRefs' and 'mappingFileRefs'
- this.updateImpliedClassRefs();
-
- this.setSpecifiedExcludeUnlistedClasses(xpu.getExcludeUnlistedClasses());
- this.updateProperties();
- this.updatePersistenceUnitDefaults();
-
- this.setSpecifiedSharedCacheMode(this.buildSpecifiedSharedCacheMode());
- this.setDefaultSharedCacheMode(this.buildDefaultSharedCacheMode());
- this.setSpecifiedValidationMode(this.buildSpecifiedValidationMode());
- this.setDefaultValidationMode(this.buildDefaultValidationMode());
-
- // see comment at top of method
- this.fireListChanged(GENERATORS_LIST, this.generators);
- this.fireListChanged(QUERIES_LIST, this.queries);
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- for (ClassRef classRef : this.getSpecifiedClassRefs()) {
- classRef.postUpdate();
- }
- for (ClassRef classRef : this.getImpliedClassRefs()) {
- classRef.postUpdate();
- }
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(this.specifiedMappingFileRefs())) {
- mappingFileRef.postUpdate();
- }
- if (this.impliedMappingFileRef != null) {
- this.impliedMappingFileRef.postUpdate();
- }
- }
-
-
- // ********** JpaContextNode implementation **********
-
- @Override
- public Persistence getParent() {
- return (Persistence) super.getParent();
- }
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- return this;
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_UNIT_ID;
- }
-
- public TextRange getSelectionTextRange() {
- return this.xmlPersistenceUnit.getSelectionTextRange();
- }
-
- public void dispose() {
- for (ClassRef classRef : this.getClassRefs()) {
- classRef.dispose();
- }
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- mappingFileRef.dispose();
- }
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- this.xmlPersistenceUnit.setName(name);
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** transaction type **********
-
- public PersistenceUnitTransactionType getTransactionType() {
- return (this.specifiedTransactionType != null) ? this.specifiedTransactionType : this.defaultTransactionType;
- }
-
- public PersistenceUnitTransactionType getSpecifiedTransactionType() {
- return this.specifiedTransactionType;
- }
-
- public void setSpecifiedTransactionType(PersistenceUnitTransactionType specifiedTransactionType) {
- PersistenceUnitTransactionType old = this.specifiedTransactionType;
- this.specifiedTransactionType = specifiedTransactionType;
- this.xmlPersistenceUnit.setTransactionType(PersistenceUnitTransactionType.toXmlResourceModel(specifiedTransactionType));
- this.firePropertyChanged(SPECIFIED_TRANSACTION_TYPE_PROPERTY, old, specifiedTransactionType);
- }
-
- public PersistenceUnitTransactionType getDefaultTransactionType() {
- return this.defaultTransactionType;
- }
-
- protected void setDefaultTransactionType(PersistenceUnitTransactionType defaultTransactionType) {
- PersistenceUnitTransactionType old = this.defaultTransactionType;
- this.defaultTransactionType = defaultTransactionType;
- this.firePropertyChanged(DEFAULT_TRANSACTION_TYPE_PROPERTY, old, defaultTransactionType);
- }
-
- protected PersistenceUnitTransactionType buildSpecifiedTransactionType() {
- return PersistenceUnitTransactionType.fromXmlResourceModel(this.xmlPersistenceUnit.getTransactionType());
- }
-
- /**
- * TODO - calculate default
- * From the JPA spec: "In a Java EE environment, if this element is not
- * specified, the default is JTA. In a Java SE environment, if this element
- * is not specified, a default of RESOURCE_LOCAL may be assumed."
- */
- protected PersistenceUnitTransactionType buildDefaultTransactionType() {
- return PersistenceUnitTransactionType.JTA; //return JTA for now, fixing regression in bug 277524
- }
-
-
- // ********** description **********
-
- public String getDescription() {
- return this.description;
- }
-
- public void setDescription(String description) {
- String old = this.description;
- this.description = description;
- this.xmlPersistenceUnit.setDescription(description);
- this.firePropertyChanged(DESCRIPTION_PROPERTY, old, description);
- }
-
-
- // ********** provider **********
-
- public String getProvider() {
- return this.provider;
- }
-
- public void setProvider(String provider) {
- String old = this.provider;
- this.provider = provider;
- this.xmlPersistenceUnit.setProvider(provider);
- this.firePropertyChanged(PROVIDER_PROPERTY, old, provider);
- }
-
-
- // ********** JTA/non-JTA data source **********
-
- public String getJtaDataSource() {
- return this.jtaDataSource;
- }
-
- public void setJtaDataSource(String jtaDataSource) {
- String old = this.jtaDataSource;
- this.jtaDataSource = jtaDataSource;
- this.xmlPersistenceUnit.setJtaDataSource(jtaDataSource);
- this.firePropertyChanged(JTA_DATA_SOURCE_PROPERTY, old, jtaDataSource);
- }
-
- public String getNonJtaDataSource() {
- return this.nonJtaDataSource;
- }
-
- public void setNonJtaDataSource(String nonJtaDataSource) {
- String old = this.nonJtaDataSource;
- this.nonJtaDataSource = nonJtaDataSource;
- this.xmlPersistenceUnit.setNonJtaDataSource(nonJtaDataSource);
- this.firePropertyChanged(NON_JTA_DATA_SOURCE_PROPERTY, old, nonJtaDataSource);
- }
-
-
- // ********** mapping file refs **********
-
- public ListIterator<MappingFileRef> mappingFileRefs() {
- return this.getMappingFileRefs().iterator();
- }
-
- protected ListIterable<MappingFileRef> getMappingFileRefs() {
- return (this.impliedMappingFileRef == null) ? this.getSpecifiedMappingFileRefs() : this.getCombinedMappingFileRefs();
- }
-
- protected ListIterator<MappingFileRef> combinedMappingFileRefs() {
- return getCombinedMappingFileRefs().iterator();
- }
-
- protected ListIterable<MappingFileRef> getCombinedMappingFileRefs() {
- return new CompositeListIterable<MappingFileRef>(this.getSpecifiedMappingFileRefs(), this.impliedMappingFileRef);
- }
-
- public int mappingFileRefsSize() {
- return (this.impliedMappingFileRef == null) ? this.specifiedMappingFileRefsSize() : this.combinedMappingFileRefsSize();
- }
-
- protected int combinedMappingFileRefsSize() {
- return this.specifiedMappingFileRefsSize() + 1;
- }
-
- public Iterator<MappingFileRef> mappingFileRefsContaining(final String typeName) {
- return new FilteringIterator<MappingFileRef> (this.mappingFileRefs()) {
- @Override
- protected boolean accept(MappingFileRef mappingFileRef) {
- return mappingFileRef.getPersistentType(typeName) != null;
- }
- };
- }
-
- protected void initializeMappingFileRefs() {
- for (XmlMappingFileRef xmlMappingFileRef : this.xmlPersistenceUnit.getMappingFiles()) {
- this.specifiedMappingFileRefs.add(this.buildSpecifiedMappingFileRef(xmlMappingFileRef));
- }
- if ( ! this.impliedMappingFileIsSpecified() && this.impliedMappingFileExists()) {
- this.impliedMappingFileRef = this.buildImpliedMappingFileRef();
- }
- }
-
- /**
- * Since this is a *list*, we simply loop through the elements and match
- * the context to the resource element by index, not by name like we do
- * with 'impliedClassRefs'.
- */
- protected void updateMappingFileRefs() {
- // first update the specified mapping file refs...
- // make a copy of the XML file refs (to prevent ConcurrentModificationException)
- Iterator<XmlMappingFileRef> xmlFileRefs = new CloneIterator<XmlMappingFileRef>(this.xmlPersistenceUnit.getMappingFiles());
-
- for (Iterator<MappingFileRef> contextFileRefs = this.specifiedMappingFileRefs(); contextFileRefs.hasNext(); ) {
- MappingFileRef contextFileRef = contextFileRefs.next();
- if (xmlFileRefs.hasNext()) {
- contextFileRef.update(xmlFileRefs.next());
- } else {
- this.removeSpecifiedMappingFileRef_(contextFileRef);
- }
- }
-
- while (xmlFileRefs.hasNext()) {
- this.addSpecifiedMappingFileRef_(this.buildSpecifiedMappingFileRef(xmlFileRefs.next()));
- }
-
- // ...then update the implied mapping file ref
- if (this.impliedMappingFileIsSpecified()) {
- if (this.impliedMappingFileRef != null) {
- this.unsetImpliedMappingFileRef();
- }
- } else {
- if (this.impliedMappingFileExists()) {
- if (this.impliedMappingFileRef == null) {
- this.setImpliedMappingFileRef();
- }
- this.impliedMappingFileRef.update(null);
- } else {
- if (this.impliedMappingFileRef != null) {
- this.unsetImpliedMappingFileRef();
- }
- }
- }
- }
-
- protected MappingFileRef buildSpecifiedMappingFileRef(XmlMappingFileRef xmlMappingFileRef) {
- return this.getContextNodeFactory().buildMappingFileRef(this, xmlMappingFileRef);
- }
-
- protected boolean impliedMappingFileIsSpecified() {
- String impliedMappingFileName = JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH;
- for (Iterator<MappingFileRef> stream = this.specifiedMappingFileRefs(); stream.hasNext(); ) {
- if (impliedMappingFileName.equals(stream.next().getFileName())) {
- return true;
- }
- }
- return false;
- }
-
- protected boolean impliedMappingFileExists() {
- return getJpaProject().getDefaultOrmXmlResource() != null;
- }
-
-
- // ********** specified mapping file refs **********
-
- public ListIterator<MappingFileRef> specifiedMappingFileRefs() {
- return this.getSpecifiedMappingFileRefs().iterator();
- }
-
- protected ListIterable<MappingFileRef> getSpecifiedMappingFileRefs() {
- return new LiveCloneListIterable<MappingFileRef>(this.specifiedMappingFileRefs);
- }
-
- public int specifiedMappingFileRefsSize() {
- return this.specifiedMappingFileRefs.size();
- }
-
- public MappingFileRef addSpecifiedMappingFileRef() {
- return this.addSpecifiedMappingFileRef(this.specifiedMappingFileRefs.size());
- }
-
- public MappingFileRef addSpecifiedMappingFileRef(int index) {
- XmlMappingFileRef xmlMappingFileRef = this.buildXmlMappingFileRef();
- MappingFileRef mappingFileRef = this.buildSpecifiedMappingFileRef(xmlMappingFileRef);
- this.specifiedMappingFileRefs.add(index, mappingFileRef);
- this.xmlPersistenceUnit.getMappingFiles().add(index, xmlMappingFileRef);
- this.fireItemAdded(SPECIFIED_MAPPING_FILE_REFS_LIST, index, mappingFileRef);
- return mappingFileRef;
- }
-
- protected XmlMappingFileRef buildXmlMappingFileRef() {
- return PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- }
-
- public void removeSpecifiedMappingFileRef(MappingFileRef mappingFileRef) {
- this.removeSpecifiedMappingFileRef(this.specifiedMappingFileRefs.indexOf(mappingFileRef));
- }
-
- public void removeSpecifiedMappingFileRef(int index) {
- MappingFileRef mappingFileRef = this.specifiedMappingFileRefs.remove(index);
- mappingFileRef.dispose();
- this.xmlPersistenceUnit.getMappingFiles().remove(index);
- this.fireItemRemoved(SPECIFIED_MAPPING_FILE_REFS_LIST, index, mappingFileRef);
- }
-
- protected void addSpecifiedMappingFileRef_(MappingFileRef mappingFileRef) {
- this.addItemToList(mappingFileRef, this.specifiedMappingFileRefs, SPECIFIED_MAPPING_FILE_REFS_LIST);
- }
-
- protected void removeSpecifiedMappingFileRef_(MappingFileRef mappingFileRef) {
- mappingFileRef.dispose();
- this.removeItemFromList(mappingFileRef, this.specifiedMappingFileRefs, SPECIFIED_MAPPING_FILE_REFS_LIST);
- }
-
-
- // ********** implied mapping file ref **********
-
- public MappingFileRef getImpliedMappingFileRef() {
- return this.impliedMappingFileRef;
- }
-
- protected MappingFileRef setImpliedMappingFileRef() {
- if (this.impliedMappingFileRef != null) {
- throw new IllegalStateException("The implied mapping file ref is already set."); //$NON-NLS-1$
- }
- this.impliedMappingFileRef = this.buildImpliedMappingFileRef();
- this.firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, null, this.impliedMappingFileRef);
- return this.impliedMappingFileRef;
- }
-
- protected MappingFileRef buildImpliedMappingFileRef() {
- return this.getContextNodeFactory().buildImpliedMappingFileRef(this);
- }
-
- protected void unsetImpliedMappingFileRef() {
- if (this.impliedMappingFileRef == null) {
- throw new IllegalStateException("The implied mapping file ref is already unset."); //$NON-NLS-1$
- }
- MappingFileRef old = this.impliedMappingFileRef;
- this.impliedMappingFileRef.dispose();
- this.impliedMappingFileRef = null;
- this.firePropertyChanged(IMPLIED_MAPPING_FILE_REF_PROPERTY, old, null);
- }
-
-
- // ********** JAR file refs **********
-
- public ListIterator<JarFileRef> jarFileRefs() {
- return new CloneListIterator<JarFileRef>(this.jarFileRefs);
- }
-
- protected Iterable<JarFileRef> getJarFileRefs() {
- return new LiveCloneIterable<JarFileRef>(this.jarFileRefs);
- }
-
- public int jarFileRefsSize() {
- return this.jarFileRefs.size();
- }
-
- public JarFileRef addJarFileRef() {
- return this.addJarFileRef(this.jarFileRefs.size());
- }
-
- public JarFileRef addJarFileRef(int index) {
- XmlJarFileRef xmlJarFileRef = this.buildXmlJarFileRef();
- JarFileRef jarFileRef = this.buildJarFileRef(xmlJarFileRef);
- this.jarFileRefs.add(index, jarFileRef);
- this.xmlPersistenceUnit.getJarFiles().add(index, xmlJarFileRef);
- this.fireItemAdded(JAR_FILE_REFS_LIST, index, jarFileRef);
- return jarFileRef;
- }
-
- protected XmlJarFileRef buildXmlJarFileRef() {
- return PersistenceFactory.eINSTANCE.createXmlJarFileRef();
- }
-
- public void removeJarFileRef(JarFileRef jarFileRef) {
- this.removeJarFileRef(this.jarFileRefs.indexOf(jarFileRef));
- }
-
- public void removeJarFileRef(int index) {
- JarFileRef jarFileRef = this.jarFileRefs.remove(index);
- jarFileRef.dispose();
- this.xmlPersistenceUnit.getJarFiles().remove(index);
- this.fireItemRemoved(JAR_FILE_REFS_LIST, index, jarFileRef);
- }
-
- protected void addJarFileRef_(JarFileRef jarFileRef) {
- this.addItemToList(jarFileRef, this.jarFileRefs, JAR_FILE_REFS_LIST);
- }
-
- protected void removeJarFileRef_(JarFileRef jarFileRef) {
- jarFileRef.dispose();
- this.removeItemFromList(jarFileRef, this.jarFileRefs, JAR_FILE_REFS_LIST);
- }
-
- protected void initializeJarFileRefs() {
- for (XmlJarFileRef xmlJarFileRef : this.xmlPersistenceUnit.getJarFiles()) {
- this.jarFileRefs.add(this.buildJarFileRef(xmlJarFileRef));
- }
- }
-
- /**
- * Since this is a *list*, we simply loop through the elements and match
- * the context to the resource element by index, not by name like we do
- * with 'impliedClassRefs'.
- */
- protected void updateJarFileRefs() {
- // make a copy of the XML file refs (to prevent ConcurrentModificationException)
- Iterator<XmlJarFileRef> xmlFileRefs = new CloneIterator<XmlJarFileRef>(this.xmlPersistenceUnit.getJarFiles());
-
- for (Iterator<JarFileRef> contextFileRefs = this.jarFileRefs(); contextFileRefs.hasNext(); ) {
- JarFileRef contextFileRef = contextFileRefs.next();
- if (xmlFileRefs.hasNext()) {
- contextFileRef.update(xmlFileRefs.next());
- } else {
- this.removeJarFileRef_(contextFileRef);
- }
- }
-
- while (xmlFileRefs.hasNext()) {
- this.addJarFileRef_(this.buildJarFileRef(xmlFileRefs.next()));
- }
- }
-
- protected JarFileRef buildJarFileRef(XmlJarFileRef xmlJarFileRef) {
- return this.getContextNodeFactory().buildJarFileRef(this, xmlJarFileRef);
- }
-
-
- // ********** class refs **********
-
- public Iterator<ClassRef> classRefs() {
- return this.getClassRefs().iterator();
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<ClassRef> getClassRefs() {
- return new CompositeIterable<ClassRef>(
- this.getSpecifiedClassRefs(),
- this.getImpliedClassRefs()
- );
- }
-
- public int classRefsSize() {
- return this.specifiedClassRefs.size() + this.impliedClassRefs.size();
- }
-
- protected Iterable<PersistentType> getNonNullClassRefPersistentTypes() {
- return new FilteringIterable<PersistentType>(this.getClassRefPersistentTypes(), NotNullFilter.<PersistentType>instance());
- }
-
- protected Iterable<PersistentType> getClassRefPersistentTypes() {
- return new TransformationIterable<ClassRef, PersistentType>(this.getClassRefs()) {
- @Override
- protected PersistentType transform(ClassRef classRef) {
- return classRef.getJavaPersistentType();
- }
- };
- }
-
-
- // ********** specified class refs **********
-
- public ListIterator<ClassRef> specifiedClassRefs() {
- return new CloneListIterator<ClassRef>(this.specifiedClassRefs);
- }
-
- protected Iterable<ClassRef> getSpecifiedClassRefs() {
- return new LiveCloneIterable<ClassRef>(this.specifiedClassRefs);
- }
-
- public int specifiedClassRefsSize() {
- return this.specifiedClassRefs.size();
- }
-
- public ClassRef addSpecifiedClassRef() {
- return this.addSpecifiedClassRef(this.specifiedClassRefs.size());
- }
-
- public ClassRef addSpecifiedClassRef(int index) {
- XmlJavaClassRef xmlClassRef = this.buildXmlJavaClassRef();
- ClassRef classRef = this.buildClassRef(xmlClassRef);
- this.specifiedClassRefs.add(index, classRef);
- this.xmlPersistenceUnit.getClasses().add(index, xmlClassRef);
- this.fireItemAdded(SPECIFIED_CLASS_REFS_LIST, index, classRef);
- return classRef;
- }
-
- protected XmlJavaClassRef buildXmlJavaClassRef() {
- return PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- }
-
- public void removeSpecifiedClassRef(ClassRef classRef) {
- this.removeSpecifiedClassRef(this.specifiedClassRefs.indexOf(classRef));
- }
-
- public void removeSpecifiedClassRef(int index) {
- ClassRef classRef = this.specifiedClassRefs.remove(index);
- classRef.dispose();
- this.xmlPersistenceUnit.getClasses().remove(index);
- this.fireItemRemoved(SPECIFIED_CLASS_REFS_LIST, index, classRef);
- }
-
- protected void addSpecifiedClassRef_(int index, ClassRef classRef) {
- this.addItemToList(index, classRef, this.specifiedClassRefs, SPECIFIED_CLASS_REFS_LIST);
- }
-
- protected void removeSpecifiedClassRef_(ClassRef classRef) {
- classRef.dispose();
- this.removeItemFromList(classRef, this.specifiedClassRefs, SPECIFIED_CLASS_REFS_LIST);
- }
-
- private void moveSpecifiedClassRef_(int index, ClassRef classRef) {
- this.moveItemInList(index, this.specifiedClassRefs.indexOf(classRef), this.specifiedClassRefs, SPECIFIED_CLASS_REFS_LIST);
- }
-
- protected void initializeSpecifiedClassRefs() {
- for (XmlJavaClassRef xmlJavaClassRef : this.xmlPersistenceUnit.getClasses()) {
- this.specifiedClassRefs.add(this.buildClassRef(xmlJavaClassRef));
- }
- }
-
- /**
- * Since this is a *list*, we simply loop through the elements and match
- * the context to the resource element by index, not by name like we do
- * with 'impliedClassRefs'.
- */
- protected void updateSpecifiedClassRefs() {
- HashBag<ClassRef> contextClassRefsToRemove = CollectionTools.bag(this.specifiedClassRefs(), this.specifiedClassRefsSize());
- ArrayList<ClassRef> contextClassRefsToUpdate = new ArrayList<ClassRef>(this.specifiedClassRefsSize());
- int resourceIndex = 0;
-
- for (Iterator<XmlJavaClassRef> xmlClassRefs = new CloneIterator<XmlJavaClassRef>(this.xmlPersistenceUnit.getClasses()); xmlClassRefs.hasNext(); ) {
- XmlJavaClassRef resourceClassRef = xmlClassRefs.next();
- boolean match = false;
- for (Iterator<ClassRef> contextClassRefs = contextClassRefsToRemove.iterator(); contextClassRefs.hasNext(); ) {
- ClassRef contextClassRef = contextClassRefs.next();
- if (contextClassRef.getResourceClassRef() == resourceClassRef) {
- this.moveSpecifiedClassRef_(resourceIndex, contextClassRef);
- contextClassRefs.remove();
- contextClassRefsToUpdate.add(contextClassRef);
- match = true;
- break;
- }
- }
- if ( ! match) {
- this.addSpecifiedClassRef_(resourceIndex, this.buildClassRef(resourceClassRef));
- }
- resourceIndex++;
- }
- for (ClassRef contextClassRef : contextClassRefsToRemove) {
- this.removeSpecifiedClassRef_(contextClassRef);
- }
- // handle adding and removing class refs first, update the
- // remaining class refs last; this reduces the churn during "update"
- for (ClassRef contextClassRef : contextClassRefsToUpdate) {
- contextClassRef.update();
- }
- }
-
- protected ClassRef buildClassRef(XmlJavaClassRef xmlClassRef) {
- return this.getContextNodeFactory().buildClassRef(this, xmlClassRef);
- }
-
-
- // ********** implied class refs **********
-
- public Iterator<ClassRef> impliedClassRefs() {
- return new CloneIterator<ClassRef>(this.impliedClassRefs);
- }
-
- protected Iterable<ClassRef> getImpliedClassRefs() {
- return new LiveCloneIterable<ClassRef>(this.impliedClassRefs);
- }
-
- public int impliedClassRefsSize() {
- return this.impliedClassRefs.size();
- }
-
- protected ClassRef addImpliedClassRef(String className) {
- ClassRef classRef = this.buildClassRef(className);
- this.addItemToCollection(classRef, this.impliedClassRefs, IMPLIED_CLASS_REFS_COLLECTION);
- return classRef;
- }
-
- protected ClassRef buildClassRef(String className) {
- return this.getContextNodeFactory().buildClassRef(this, className);
- }
-
- protected void removeImpliedClassRef(ClassRef classRef) {
- classRef.dispose();
- this.removeItemFromCollection(classRef, this.impliedClassRefs, IMPLIED_CLASS_REFS_COLLECTION);
- }
-
- protected void initializeImpliedClassRefs() {
- if ( ! this.excludesUnlistedClasses()) {
- this.initializeImpliedClassRefs_();
- }
- }
-
- protected void initializeImpliedClassRefs_() {
- for (Iterator<String> stream = this.getJpaProject().mappedJavaSourceClassNames(); stream.hasNext(); ) {
- String typeName = stream.next();
- if ( ! this.specifiesPersistentType(typeName)) {
- this.impliedClassRefs.add(this.buildClassRef(typeName));
- }
- }
- }
-
- protected void updateImpliedClassRefs() {
- if (this.excludesUnlistedClasses()) {
- this.clearImpliedClassRefs_();
- } else {
- this.updateImpliedClassRefs_();
- }
- }
-
- protected void updateImpliedClassRefs_() {
- HashBag<ClassRef> impliedRefsToRemove = CollectionTools.bag(this.impliedClassRefs(), this.impliedClassRefsSize());
- ArrayList<ClassRef> impliedRefsToUpdate = new ArrayList<ClassRef>(this.impliedClassRefsSize());
-
- for (Iterator<String> mappedClassNames = this.getJpaProject().mappedJavaSourceClassNames(); mappedClassNames.hasNext(); ) {
- String mappedClassName = mappedClassNames.next();
- if ( ! this.specifiesPersistentType(mappedClassName)) {
- boolean match = false;
- for (Iterator<ClassRef> classRefs = impliedRefsToRemove.iterator(); classRefs.hasNext(); ) {
- ClassRef classRef = classRefs.next();
- if (mappedClassName.equals(classRef.getClassName())) {
- classRefs.remove();
- impliedRefsToUpdate.add(classRef);
- match = true;
- break;
- }
- }
- if ( ! match) {
- this.addImpliedClassRef(mappedClassName);
- }
- }
- }
- for (ClassRef classRef : impliedRefsToRemove) {
- this.removeImpliedClassRef(classRef);
- }
- // handle adding and removing implied class refs first, update the
- // remaining implied class refs last; this reduces the churn during "update"
- for (ClassRef classRef : impliedRefsToUpdate) {
- classRef.update(classRef.getClassName());
- }
- }
-
- protected void clearImpliedClassRefs_() {
- for (ClassRef classRef : this.getImpliedClassRefs()) {
- this.removeImpliedClassRef(classRef);
- }
- }
-
-
- // ********** exclude unlisted classes **********
-
- public boolean excludesUnlistedClasses() {
- return (this.specifiedExcludeUnlistedClasses != null) ? this.specifiedExcludeUnlistedClasses.booleanValue() : this.getDefaultExcludeUnlistedClasses();
- }
-
- public Boolean getSpecifiedExcludeUnlistedClasses() {
- return this.specifiedExcludeUnlistedClasses;
- }
-
- public void setSpecifiedExcludeUnlistedClasses(Boolean specifiedExcludeUnlistedClasses) {
- Boolean old = this.specifiedExcludeUnlistedClasses;
- this.specifiedExcludeUnlistedClasses = specifiedExcludeUnlistedClasses;
- this.xmlPersistenceUnit.setExcludeUnlistedClasses(this.specifiedExcludeUnlistedClasses);
- this.firePropertyChanged(SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY, old, specifiedExcludeUnlistedClasses);
- }
-
- public boolean getDefaultExcludeUnlistedClasses() {
- return false; // ???
- }
-
-
- // ********** properties **********
-
- public ListIterator<Property> properties() {
- return new CloneListIterator<Property>(this.properties);
- }
-
- protected Iterable<Property> getProperties() {
- return new LiveCloneIterable<Property>(this.properties);
- }
-
- public int propertiesSize() {
- return this.properties.size();
- }
-
- public Property getProperty(String propertyName) {
- if (propertyName == null) {
- throw new NullPointerException();
- }
- for (Property property : this.getProperties()) {
- if (propertyName.equals(property.getName())) {
- return property;
- }
- }
- return null;
- }
-
- public Iterator<Property> propertiesWithNamePrefix(final String propertyNamePrefix) {
- if (propertyNamePrefix == null) {
- throw new NullPointerException();
- }
- return new FilteringIterator<Property>(this.properties()) {
- @Override
- protected boolean accept(Property property) {
- String pName = property.getName();
- return (pName != null) && pName.startsWith(propertyNamePrefix);
- }
- };
- }
-
- public Property addProperty() {
- return this.addProperty(this.properties.size());
- }
-
- public Property addProperty(int index) {
- return this.addProperty(this.buildXmlProperty(), index);
- }
-
- protected XmlProperty buildXmlProperty() {
- return PersistenceFactory.eINSTANCE.createXmlProperty();
- }
-
- protected Property addProperty(XmlProperty xmlProperty, int index) {
- Property property = this.buildProperty(xmlProperty);
-
- XmlProperties xmlProperties = this.xmlPersistenceUnit.getProperties();
- if (xmlProperties == null) {
- xmlProperties = this.buildXmlProperties();
- this.xmlPersistenceUnit.setProperties(xmlProperties);
- }
-
- this.properties.add(index, property);
- xmlProperties.getProperties().add(index, xmlProperty);
- this.fireItemAdded(PROPERTIES_LIST, index, property);
- if (property.getName() != null) {
- this.propertyAdded(property.getName(), property.getValue());
- }
- return property;
- }
-
- protected Property buildProperty(XmlProperty xmlProperty) {
- return this.getContextNodeFactory().buildProperty(this, xmlProperty);
- }
-
- protected XmlProperties buildXmlProperties() {
- return PersistenceFactory.eINSTANCE.createXmlProperties();
- }
-
- public void setProperty(String propertyName, String value) {
- this.setProperty(propertyName, value, false);
- }
-
- public void setProperty(String propertyName, String value, boolean duplicatePropertyNamesAllowed) {
- Property prev = this.getProperty(propertyName);
- if (prev == null) {
- if (value != null) {
- this.addProperty(propertyName, value); // add [first] property
- }
- } else {
- if (duplicatePropertyNamesAllowed) {
- if (value == null) {
- // do nothing?
- } else {
- this.addProperty(propertyName, value); // add [duplicate] property
- }
- } else {
- if (value == null) {
- this.removeProperty(prev); // remove existing property
- } else {
- prev.setValue(value); // change existing property
- }
- }
- }
- }
-
- protected void addProperty(String propertyName, String value) {
- Property property = this.addProperty();
- property.setName(propertyName);
- property.setValue(value);
- }
-
- public void removeProperty(Property property) {
- this.removeProperty(this.properties.indexOf(property));
- }
-
- public void removeProperty(String propertyName) {
- if (propertyName == null) {
- throw new NullPointerException();
- }
- for (ListIterator<Property> stream = this.properties.listIterator(); stream.hasNext(); ) {
- Property property = stream.next();
- if (propertyName.equals(property.getName())) {
- this.removeProperty(stream.previousIndex());
- return;
- }
- }
- throw new IllegalArgumentException("invalid property name: " + propertyName); //$NON-NLS-1$
- }
-
- public void removeProperty(String propertyName, String value) {
- if ((propertyName == null) || (value == null)) {
- throw new NullPointerException();
- }
- for (ListIterator<Property> stream = this.properties.listIterator(); stream.hasNext(); ) {
- Property property = stream.next();
- if (propertyName.equals(property.getName()) && value.equals(property.getValue())) {
- this.removeProperty(stream.previousIndex());
- return;
- }
- }
- throw new IllegalArgumentException("invalid property name/value pair: " + propertyName + " = " + value); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected void removeProperty(int index) {
- Property removedProperty = this.properties.remove(index);
- this.xmlPersistenceUnit.getProperties().getProperties().remove(index);
-
- if (this.xmlPersistenceUnit.getProperties().getProperties().isEmpty()) {
- this.xmlPersistenceUnit.setProperties(null);
- }
-
- this.fireItemRemoved(PROPERTIES_LIST, index, removedProperty);
- if (removedProperty.getName() != null) {
- this.propertyRemoved(removedProperty.getName());
- }
- }
-
- protected void addProperty_(int index, Property property) {
- this.addItemToList(index, property, this.properties, PROPERTIES_LIST);
- if (property.getName() != null) {
- this.propertyAdded(property.getName(), property.getValue());
- }
- }
-
- protected void removeProperty_(int index) {
- removeProperty_(this.properties.get(index));
- }
-
- protected void removeProperty_(Property property) {
- this.removeItemFromList(property, this.properties, PROPERTIES_LIST);
- if (property.getName() != null) {
- this.propertyRemoved(property.getName());
- }
- }
-
- protected void moveProperty_(int index, Property property) {
- this.moveItemInList(index, this.properties.indexOf(property), this.properties, PROPERTIES_LIST);
- }
-
- public void propertyNameChanged(String oldPropertyName, String newPropertyName, String value) {
- if (oldPropertyName == null && value == null) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return;
- }
- if (oldPropertyName != null) {
- this.propertyRemoved(oldPropertyName);
- }
- if (newPropertyName != null) {
- this.propertyAdded(newPropertyName, value);
- }
- }
-
- public void propertyValueChanged(String propertyName, String newValue) {
- this.connection.propertyValueChanged(propertyName, newValue);
- this.options.propertyValueChanged(propertyName, newValue);
- }
-
- public void propertyAdded(String propertyName, String value) {
- this.propertyValueChanged(propertyName, value);
- }
-
- public void propertyRemoved(String propertyName) {
- this.connection.propertyRemoved(propertyName);
- this.options.propertyRemoved(propertyName);
- }
-
- protected void initializeProperties() {
- XmlProperties xmlProperties = this.xmlPersistenceUnit.getProperties();
- if (xmlProperties != null) {
- for (XmlProperty xmlProperty : xmlProperties.getProperties()) {
- this.properties.add(this.buildProperty(xmlProperty));
- }
- }
- this.connection = this.getContextNodeFactory().buildConnection(this);
- this.options = this.getContextNodeFactory().buildOptions(this);
- }
-
- /**
- * Match the elements based on the XmlProperty resource object and also keep the order
- * the same as the source.
- */
- protected void updateProperties() {
- HashBag<Property> contextPropertiesToRemove = CollectionTools.bag(this.properties(), this.propertiesSize());
- int resourceIndex = 0;
-
- for (Iterator<XmlProperty> xmlProperties = this.xmlProperties(); xmlProperties.hasNext(); ) {
- XmlProperty xmlProperty = xmlProperties.next();
- boolean match = false;
- for (Iterator<Property> contextProperties = contextPropertiesToRemove.iterator(); contextProperties.hasNext();) {
- Property contextProperty = contextProperties.next();
- if (contextProperty.getXmlProperty() == xmlProperty) {
- contextProperties.remove();
- this.moveProperty_(resourceIndex, contextProperty);
- contextProperty.update();
- match = true;
- break;
- }
- }
- if ( ! match) {
- this.addProperty_(resourceIndex, this.buildProperty(xmlProperty));
- }
- resourceIndex++;
- }
- for (Property contextProperty : contextPropertiesToRemove) {
- this.removeProperty_(contextProperty);
- }
- }
-
- protected Iterator<XmlProperty> xmlProperties() {
- XmlProperties xmlProperties = this.xmlPersistenceUnit.getProperties();
- // make a copy of the XML properties (to prevent ConcurrentModificationException)
- return (xmlProperties != null) ? new CloneIterator<XmlProperty>(xmlProperties.getProperties()) : EmptyIterator.<XmlProperty>instance();
- }
-
- protected int xmlPropertiesSize() {
- XmlProperties xmlProperties = this.xmlPersistenceUnit.getProperties();
- return xmlProperties == null ? 0 : xmlProperties.getProperties().size();
- }
-
-
- // ********** ORM persistence unit defaults **********
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType defaultAccess) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = defaultAccess;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, defaultAccess);
- }
-
- protected AccessType buildDefaultAccess(MappingFilePersistenceUnitDefaults defaults) {
- return (defaults == null) ? null : defaults.getAccess();
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String defaultCatalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = defaultCatalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, defaultCatalog);
- }
-
- protected String buildDefaultCatalog(MappingFilePersistenceUnitDefaults defaults) {
- String catalog = (defaults == null) ? null : defaults.getCatalog();
- return (catalog != null) ? catalog : this.getJpaProject().getDefaultCatalog();
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String defaultSchema) {
- String old = this.defaultSchema;
- this.defaultSchema = defaultSchema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, defaultSchema);
- }
-
- protected String buildDefaultSchema(MappingFilePersistenceUnitDefaults defaults) {
- String schema = (defaults == null) ? null : defaults.getSchema();
- return (schema != null) ? schema : this.getJpaProject().getDefaultSchema();
- }
-
- public boolean getDefaultCascadePersist() {
- return this.defaultCascadePersist;
- }
-
- protected void setDefaultCascadePersist(boolean defaultCascadePersist) {
- boolean old = this.defaultCascadePersist;
- this.defaultCascadePersist = defaultCascadePersist;
- this.firePropertyChanged(DEFAULT_CASCADE_PERSIST_PROPERTY, old, defaultCascadePersist);
- }
-
- protected boolean buildDefaultCascadePersist(MappingFilePersistenceUnitDefaults defaults) {
- return (defaults == null) ? false : defaults.isCascadePersist();
- }
-
- public boolean getDefaultDelimitedIdentifiers() {
- return this.defaultDelimitedIdentifiers;
- }
-
- protected void setDefaultDelimitedIdentifiers(boolean defaultDelimitedIdentifiers) {
- boolean old = this.defaultDelimitedIdentifiers;
- this.defaultDelimitedIdentifiers = defaultDelimitedIdentifiers;
- this.firePropertyChanged(DEFAULT_DELIMITED_IDENTIFIERS_PROPERTY, old, defaultDelimitedIdentifiers);
- }
-
- protected boolean buildDefaultDelimitedIdentifiers(MappingFilePersistenceUnitDefaults defaults) {
- return ( ! this.isJpa2_0Compatible()) ? false :
- (defaults == null) ? false : ((MappingFilePersistenceUnitDefaults2_0) defaults).isDelimitedIdentifiers();
- }
-
- protected void initializePersistenceUnitDefaults() {
- MappingFilePersistenceUnitDefaults defaults = this.getDefaults();
- this.defaultAccess = this.buildDefaultAccess(defaults);
- this.defaultCatalog = this.buildDefaultCatalog(defaults);
- this.defaultSchema = this.buildDefaultSchema(defaults);
- this.defaultCascadePersist = this.buildDefaultCascadePersist(defaults);
- this.defaultDelimitedIdentifiers = this.buildDefaultDelimitedIdentifiers(defaults);
- }
-
- protected void updatePersistenceUnitDefaults() {
- MappingFilePersistenceUnitDefaults defaults = this.getDefaults();
- this.setDefaultAccess(this.buildDefaultAccess(defaults));
- this.setDefaultCatalog(this.buildDefaultCatalog(defaults));
- this.setDefaultSchema(this.buildDefaultSchema(defaults));
- this.setDefaultDelimitedIdentifiers(this.buildDefaultDelimitedIdentifiers(defaults));
- }
-
- /**
- * return the first persistence unit defaults we encounter in a mapping file
- */
- protected MappingFilePersistenceUnitDefaults getDefaults() {
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- if (mappingFileRef.persistenceUnitDefaultsExists()) {
- return mappingFileRef.getPersistenceUnitDefaults();
- }
- }
- return null;
- }
-
-
- //************** PersistenceUnit2_0 implementation ***********
-
- public PersistenceUnitProperties getConnection() {
- return this.connection;
- }
-
- public PersistenceUnitProperties getOptions() {
- return this.options;
- }
-
- // ********** shared cache mode **********
-
- public SharedCacheMode getSharedCacheMode() {
- return (this.specifiedSharedCacheMode != null) ? this.specifiedSharedCacheMode : this.defaultSharedCacheMode;
- }
-
- public SharedCacheMode getSpecifiedSharedCacheMode() {
- return this.specifiedSharedCacheMode;
- }
-
- public void setSpecifiedSharedCacheMode(SharedCacheMode specifiedSharedCacheMode) {
- SharedCacheMode old = this.specifiedSharedCacheMode;
- this.specifiedSharedCacheMode = specifiedSharedCacheMode;
- this.xmlPersistenceUnit.setSharedCacheMode(SharedCacheMode.toXmlResourceModel(specifiedSharedCacheMode));
- this.firePropertyChanged(SPECIFIED_SHARED_CACHE_MODE_PROPERTY, old, specifiedSharedCacheMode);
- }
-
- public SharedCacheMode getDefaultSharedCacheMode() {
- return this.defaultSharedCacheMode;
- }
-
- protected void setDefaultSharedCacheMode(SharedCacheMode defaultSharedCacheMode) {
- SharedCacheMode old = this.defaultSharedCacheMode;
- this.defaultSharedCacheMode = defaultSharedCacheMode;
- this.firePropertyChanged(DEFAULT_SHARED_CACHE_MODE_PROPERTY, old, defaultSharedCacheMode);
- }
-
- public boolean calculateDefaultCacheable() {
- switch (getSharedCacheMode()) {
- case NONE:
- case ENABLE_SELECTIVE:
- case UNSPECIFIED:
- return false;
- case ALL:
- case DISABLE_SELECTIVE:
- return true;
- }
- return false;//null
- }
-
- protected SharedCacheMode buildSpecifiedSharedCacheMode() {
- return SharedCacheMode.fromXmlResourceModel(this.xmlPersistenceUnit.getSharedCacheMode());
- }
-
- protected SharedCacheMode buildDefaultSharedCacheMode() {
- return SharedCacheMode.UNSPECIFIED;
- }
-
- // ********** validation mode **********
-
- public ValidationMode getValidationMode() {
- return (this.specifiedValidationMode != null) ? this.specifiedValidationMode : this.defaultValidationMode;
- }
-
- public ValidationMode getSpecifiedValidationMode() {
- return this.specifiedValidationMode;
- }
-
- public void setSpecifiedValidationMode(ValidationMode specifiedValidationMode) {
- ValidationMode old = this.specifiedValidationMode;
- this.specifiedValidationMode = specifiedValidationMode;
- this.xmlPersistenceUnit.setValidationMode(ValidationMode.toXmlResourceModel(specifiedValidationMode));
- this.firePropertyChanged(SPECIFIED_VALIDATION_MODE_PROPERTY, old, specifiedValidationMode);
- }
-
- public ValidationMode getDefaultValidationMode() {
- return this.defaultValidationMode;
- }
-
- protected void setDefaultValidationMode(ValidationMode defaultValidationMode) {
- ValidationMode old = this.defaultValidationMode;
- this.defaultValidationMode = defaultValidationMode;
- this.firePropertyChanged(DEFAULT_VALIDATION_MODE_PROPERTY, old, defaultValidationMode);
- }
-
- protected ValidationMode buildSpecifiedValidationMode() {
- return ValidationMode.fromXmlResourceModel(this.xmlPersistenceUnit.getValidationMode());
- }
-
- protected ValidationMode buildDefaultValidationMode() {
- return DEFAULT_VALIDATION_MODE;
- }
-
-
- // ********** generators **********
-
- public ListIterator<Generator> generators() {
- return new CloneListIterator<Generator>(this.generators);
- }
-
- public int generatorsSize() {
- return this.generators.size();
- }
-
- public void addGenerator(Generator generator) {
- this.generators.add(generator);
- }
-
- public String[] uniqueGeneratorNames() {
- HashSet<String> names = new HashSet<String>(this.generators.size());
- this.addNonNullGeneratorNamesTo(names);
- return names.toArray(new String[names.size()]);
- }
-
- protected void addNonNullGeneratorNamesTo(Set<String> names) {
- for (Iterator<Generator> stream = this.generators(); stream.hasNext(); ) {
- String generatorName = stream.next().getName();
- if (generatorName != null) {
- names.add(generatorName);
- }
- }
- }
-
-
- // ********** queries **********
-
- public ListIterator<Query> queries() {
- return new CloneListIterator<Query>(this.queries);
- }
-
- public int queriesSize() {
- return this.queries.size();
- }
-
- public void addQuery(Query query) {
- this.queries.add(query);
- }
-
-
- // ********** root entities **********
-
- public void addRootEntityWithSubEntities(String entityName) {
- this.rootEntityNames.add(entityName);
- }
-
- public boolean entityIsRootWithSubEntities(String entityName) {
- return this.rootEntityNames.contains(entityName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateMappingFiles(messages, reporter);
- this.validateClassRefs(messages, reporter);
- this.validateJarFileRefs(messages, reporter);
- this.validateProperties(messages, reporter);
- }
-
- protected void validateMappingFiles(List<IMessage> messages, IReporter reporter) {
- this.checkForMultiplePersistenceUnitDefaults(messages);
- this.checkForDuplicateMappingFiles(messages);
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- mappingFileRef.validate(messages, reporter);
- }
- }
-
- protected void checkForMultiplePersistenceUnitDefaults(List<IMessage> messages) {
- boolean first = true;
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- if (mappingFileRef.persistenceUnitDefaultsExists()) {
- if (first) {
- first = false;
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS,
- new String[] {mappingFileRef.getFileName()},
- mappingFileRef
- )
- );
- }
- }
- }
- }
-
- protected void checkForDuplicateMappingFiles(List<IMessage> messages) {
- HashBag<String> fileNames = new HashBag<String>();
- CollectionTools.addAll(fileNames, this.mappingFileRefNames());
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- String fileName = mappingFileRef.getFileName();
- if (fileNames.count(fileName) > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE,
- new String[] {fileName},
- mappingFileRef,
- mappingFileRef.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected Iterator<String> mappingFileRefNames() {
- return new TransformationIterator<MappingFileRef, String>(this.mappingFileRefs()) {
- @Override
- protected String transform(MappingFileRef mappingFileRef) {
- return mappingFileRef.getFileName();
- }
- };
- }
-
- protected void validateClassRefs(List<IMessage> messages, IReporter reporter) {
- this.checkForDuplicateClasses(messages);
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- }
-
- protected void checkForDuplicateClasses(List<IMessage> messages) {
- HashBag<String> classNames = new HashBag<String>();
- CollectionTools.addAll(classNames, this.classRefNames());
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- ClassRef classRef = stream.next();
- String className = classRef.getClassName();
- if ((className != null) && (classNames.count(className) > 1)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_CLASS,
- new String[] {className},
- classRef,
- classRef.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected Iterator<String> classRefNames() {
- return new TransformationIterator<ClassRef, String>(this.classRefs()) {
- @Override
- protected String transform(ClassRef classRef) {
- return classRef.getClassName();
- }
- };
- }
-
- protected void validateJarFileRefs(List<IMessage> messages, IReporter reporter) {
- checkForDuplicateJarFileRefs(messages);
- for (JarFileRef each : CollectionTools.iterable(jarFileRefs())) {
- each.validate(messages, reporter);
- }
- }
-
- protected void checkForDuplicateJarFileRefs(List<IMessage> messages) {
- HashBag<String> jarFileNames = new HashBag<String>();
- CollectionTools.addAll(jarFileNames, jarFileNames());
- for (JarFileRef jarFileRef : CollectionTools.iterable(jarFileRefs())) {
- String jarFileName = jarFileRef.getFileName();
- if ((jarFileName != null) && (jarFileNames.count(jarFileName) > 1)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_JAR_FILE,
- new String[] {jarFileName},
- jarFileRef,
- jarFileRef.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected Iterator<String> jarFileNames() {
- return new TransformationIterator<JarFileRef, String>(jarFileRefs()) {
- @Override
- protected String transform(JarFileRef jarFileRef) {
- return jarFileRef.getFileName();
- }
- };
- }
-
- @SuppressWarnings("unused")
- protected void validateProperties(List<IMessage> messages, IReporter reporter) {
- // do nothing by default
- }
-
-
- // ********** misc **********
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (Iterator<JarFileRef> stream = this.jarFileRefs(); stream.hasNext(); ) {
- JarFileRef jarFileRef = stream.next();
- if (jarFileRef.containsOffset(textOffset)) {
- return jarFileRef;
- }
- }
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- if (mappingFileRef.containsOffset(textOffset)) {
- return mappingFileRef;
- }
- }
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- ClassRef classRef = stream.next();
- if (classRef.containsOffset(textOffset)) {
- return classRef;
- }
- }
- return this;
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return connectionProfileIsActive();
- }
-
- public TextRange getValidationTextRange() {
- return this.xmlPersistenceUnit.getValidationTextRange();
- }
-
- public PersistentType getPersistentType(String typeName) {
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- PersistentType persistentType = mappingFileRef.getPersistentType(typeName);
- if (persistentType != null) {
- return persistentType;
- }
- }
- for (Iterator<ClassRef> stream = this.classRefs(); stream.hasNext(); ) {
- ClassRef classRef = stream.next();
- if (classRef.isFor(typeName)) {
- return classRef.getJavaPersistentType();
- }
- }
- for (Iterator<JarFileRef> stream = this.jarFileRefs(); stream.hasNext(); ) {
- PersistentType persistentType = stream.next().getPersistentType(typeName);
- if (persistentType != null) {
- return persistentType;
- }
- }
- return null;
- }
-
- public boolean specifiesPersistentType(String className) {
- for (ClassRef classRef : this.getSpecifiedClassRefs()) {
- if (classRef.isFor(className)) {
- return true;
- }
- }
- for (MappingFileRef mappingFileRef : this.getMappingFileRefs()) {
- if (mappingFileRef.getPersistentType(className) != null) {
- return true;
- }
- }
- return false;
- }
-
- public Entity getEntity(String typeName) {
- PersistentType persistentType = this.getPersistentType(typeName);
- if (persistentType == null) {
- return null;
- }
- TypeMapping typeMapping = persistentType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
- public Embeddable getEmbeddable(String typeName) {
- PersistentType persistentType = this.getPersistentType(typeName);
- if (persistentType == null) {
- return null;
- }
- TypeMapping typeMapping = persistentType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.xmlPersistenceUnit != null) && this.xmlPersistenceUnit.containsOffset(textOffset);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(this.name);
- }
-
-
- // ********** metamodel **********
- // put metamodel stuff here so it can be shared by Generic and EclipseLink implementations
-
- public void initializeMetamodel() {
- this.initializeMetamodelFiles();
- }
-
- protected void initializeMetamodelFiles() {
- CollectionTools.addAll(this.metamodelFiles, this.getGeneratedMetamodelFiles());
- }
-
- protected Iterable<IFile> getGeneratedMetamodelFiles() {
- return new TransformationIterable<JavaResourcePersistentType2_0, IFile>(this.getGeneratedMetamodelTopLevelTypes()) {
- @Override
- protected IFile transform(JavaResourcePersistentType2_0 jrpt) {
- return jrpt.getFile();
- }
- };
- }
-
- protected Iterable<JavaResourcePersistentType2_0> getGeneratedMetamodelTopLevelTypes() {
- return ((JpaProject2_0) this.getJpaProject()).getGeneratedMetamodelTopLevelTypes();
- }
-
- /**
- * Not the prettiest code....
- */
- public void synchronizeMetamodel() {
- // gather up the persistent unit's types, eliminating duplicates;
- // if we have persistent types with the same name in multiple locations,
- // the last one we encounter wins (i.e. the classes in the orm.xml take
- // precedence)
- HashMap<String, PersistentType2_0> allPersistentTypes = new HashMap<String, PersistentType2_0>();
- this.addPersistentTypesTo_(this.getJarFileRefs(), allPersistentTypes);
- this.addPersistentTypesTo(this.getNonNullClassRefPersistentTypes(), allPersistentTypes);
- this.addPersistentTypesTo_(this.getMappingFileRefs(), allPersistentTypes);
-
- // build a list of the top-level types and a tree of their associated
- // member types etc.
- ArrayList<MetamodelSourceType> topLevelTypes = new ArrayList<MetamodelSourceType>(allPersistentTypes.size());
- HashMap<String, Collection<MetamodelSourceType>> memberTypeTree = new HashMap<String, Collection<MetamodelSourceType>>();
- for (PersistentType2_0 type : allPersistentTypes.values()) {
- String declaringTypeName = type.getDeclaringTypeName();
- MetamodelSourceType memberType = type;
- while (true) {
- if (declaringTypeName == null) {
- topLevelTypes.add(memberType);
- break; // stop at the top-level type
- }
-
- // associate the member type with its declaring type
- Collection<MetamodelSourceType> memberTypes = memberTypeTree.get(declaringTypeName);
- if (memberTypes == null) {
- memberTypes = new ArrayList<MetamodelSourceType>();
- memberTypeTree.put(declaringTypeName, memberTypes);
- }
- memberTypes.add(memberType);
-
- // move out to the member type's declaring type
- String memberTypeName = declaringTypeName;
- // check for a context persistent type
- memberType = allPersistentTypes.get(memberTypeName);
- if (memberType != null) {
- break; // stop - this will be processed in the outer 'for' loop
- }
- // check for a Java resource persistent type
- JavaResourcePersistentType jrpt = this.getJpaProject().getJavaResourcePersistentType(memberTypeName);
- if (jrpt != null) {
- declaringTypeName = jrpt.getDeclaringTypeName();
- } else {
- // check for a JDT type
- IType jdtType = this.findJdtType(memberTypeName);
- if (jdtType != null) {
- IType jdtDeclaringType = jdtType.getDeclaringType();
- declaringTypeName = (jdtDeclaringType == null) ? null : jdtDeclaringType.getFullyQualifiedName('.');
- } else {
- // assume we have a non-persistent top-level type...?
- declaringTypeName = null;
- }
- }
- if (declaringTypeName == null) {
- memberType = this.selectSourceType(topLevelTypes, memberTypeName);
- } else {
- memberType = this.selectSourceType(memberTypeTree.get(declaringTypeName), memberTypeName);
- }
- if (memberType != null) {
- break; // stop - this type has already been processed
- }
- memberType = this.buildNonPersistentMetamodelSourceType(memberTypeName);
- }
- }
-
- // remove any top-level type whose name differs from another only by case,
- // since, on Windows, file names are case-insensitive :-(
- // sort the original list so we end up with the same top-level type
- // remaining every time (i.e. the one that sorts out first)
- Collections.sort(topLevelTypes, MetamodelSourceType.COMPARATOR);
- HashSet<String> names = new HashSet<String>(topLevelTypes.size());
- for (Iterator<MetamodelSourceType> stream = topLevelTypes.iterator(); stream.hasNext(); ) {
- MetamodelSourceType topLevelType = stream.next();
- // hopefully this is case-insensitive enough...
- if ( ! names.add(topLevelType.getName().toLowerCase())) {
- stream.remove();
- }
- }
-
- // copy the list of metamodel files...
- HashSet<IFile> deadMetamodelFiles = new HashSet<IFile>(this.metamodelFiles);
- this.metamodelFiles.clear();
- for (MetamodelSourceType topLevelType : topLevelTypes) {
- IFile metamodelFile = topLevelType.getMetamodelFile();
- // ...remove whatever files are still present...
- deadMetamodelFiles.remove(metamodelFile);
- // ...rebuild the list of metamodel files...
- if (this.fileIsGeneratedMetamodel(metamodelFile)) { // only add files with the Dali tag
- this.metamodelFiles.add(metamodelFile);
- }
- }
- // ...delete the files that are now gone
- // [perform the deletes first - this is critical when a file has been
- // renamed by only altering its name's case; since we will try to write
- // out a new file that, on Windows, collides with the old file :-( ]
- for (IFile deadMetamodelFile : deadMetamodelFiles) {
- this.deleteMetamodelFile(deadMetamodelFile);
- }
-
- // now generate the metamodel classes
- for (MetamodelSourceType topLevelType : topLevelTypes) {
- topLevelType.synchronizeMetamodel(memberTypeTree);
- }
- }
-
- protected void addPersistentTypesTo_(Iterable<? extends PersistentTypeContainer> ptContainers, HashMap<String, PersistentType2_0> persistentTypeMap) {
- for (PersistentTypeContainer ptContainer : ptContainers) {
- this.addPersistentTypesTo(ptContainer.getPersistentTypes(), persistentTypeMap);
- }
- }
-
- protected void addPersistentTypesTo(Iterable<? extends PersistentType> persistentTypes, HashMap<String, PersistentType2_0> persistentTypeMap) {
- for (PersistentType persistentType : persistentTypes) {
- if (persistentType.getName() != null) {
- persistentTypeMap.put(persistentType.getName(), (PersistentType2_0) persistentType);
- }
- }
- }
-
- protected MetamodelSourceType selectSourceType(Iterable<MetamodelSourceType> types, String typeName) {
- if (types != null) {
- for (MetamodelSourceType type : types) {
- if (type.getName().equals(typeName)) {
- return type;
- }
- }
- }
- return null;
- }
-
- protected MetamodelSourceType buildNonPersistentMetamodelSourceType(String nonPersistentTypeName) {
- return new NonPersistentMetamodelSourceType(nonPersistentTypeName, this.getJpaProject());
- }
-
- protected IType findJdtType(String typeName) {
- try {
- return this.getJpaProject().getJavaProject().findType(typeName);
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- protected void deleteMetamodelFile(IFile file) {
- try {
- this.deleteMetamodelFile_(file);
- } catch (CoreException ex) {
- JptCorePlugin.log(ex);
- }
- }
-
- protected void deleteMetamodelFile_(IFile file) throws CoreException {
- if (this.fileIsGeneratedMetamodel(file)) {
- file.delete(true, null); // true = force
- }
- }
-
- protected boolean fileIsGeneratedMetamodel(IFile file) {
- return ((JpaProject2_0) this.getJpaProject()).getGeneratedMetamodelTopLevelType(file) != null;
- }
-
- public void disposeMetamodel() {
- this.metamodelFiles.clear();
- }
-
- // ***** Metamodel source for non-persistent types
- protected static class NonPersistentMetamodelSourceType
- implements MetamodelSourceType
- {
- protected final String name;
- protected final JpaProject jpaProject;
- protected final MetamodelSourceType.Synchronizer metamodelSynchronizer;
-
- protected NonPersistentMetamodelSourceType(String name, JpaProject jpaProject) {
- super();
- this.name = name;
- this.jpaProject = jpaProject;
- this.metamodelSynchronizer = this.buildMetamodelSynchronizer();
- }
-
- protected MetamodelSourceType.Synchronizer buildMetamodelSynchronizer() {
- return this.getJpaFactory().buildMetamodelSynchronizer(this);
- }
-
- protected JpaFactory2_0 getJpaFactory() {
- return (JpaFactory2_0) this.getJpaProject().getJpaPlatform().getJpaFactory();
- }
-
- public String getName() {
- return this.name;
- }
-
- public boolean isManaged() {
- return false;
- }
-
- public PersistentType getSuperPersistentType() {
- return null;
- }
-
- public <T extends PersistentAttribute> ListIterator<T> attributes() {
- return EmptyListIterator.instance();
- }
-
- public IFile getMetamodelFile() {
- return this.metamodelSynchronizer.getFile();
- }
-
- public JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
- public void synchronizeMetamodel(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- this.metamodelSynchronizer.synchronize(memberTypeTree);
- }
-
- public void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- this.metamodelSynchronizer.printBodySourceOn(pw, memberTypeTree);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnitProperties.java
deleted file mode 100644
index b1af233b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceUnitProperties.java
+++ /dev/null
@@ -1,412 +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.core.internal.context.persistence;
-
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-/**
- * AbstractPersistenceUnitProperties
- */
-public abstract class AbstractPersistenceUnitProperties extends AbstractModel
- implements PersistenceUnitProperties
-{
- private PersistenceUnit persistenceUnit;
-
- // key = PersistenceUnit property key; value = property id
- private Map<String, String> propertyNames;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors / initialization **********
- protected AbstractPersistenceUnitProperties(PersistenceUnit parent) {
- super();
- this.initialize();
- this.initialize(parent);
- this.postInitialize();
- }
-
- /**
- * Base initialization.
- */
- protected void initialize() {
- this.propertyNames = new HashMap<String, String>();
- }
-
- /**
- * Initialization based on the persistence unit.
- */
- protected void initialize(PersistenceUnit parent) {
- this.persistenceUnit = parent;
-
- this.initializePropertyNames();
- this.initializeProperties();
- }
-
- protected void initializePropertyNames() {
- this.addPropertyNames(this.propertyNames);
- }
-
- /**
- * Initializes properties with values from the persistence unit.
- */
- protected abstract void initializeProperties();
-
- /**
- * Does all post treatment in this method after the properties are initialized
- */
- protected void postInitialize() {
- // do nothing by default
- }
-
- // ********** behavior **********
- public PersistenceUnit getPersistenceUnit() {
- return this.persistenceUnit;
- }
-
- public JpaProject getJpaProject() {
- return this.persistenceUnit.getJpaProject();
- }
-
- private Map<String, String> propertyNames() {
- return this.propertyNames;
- }
- /**
- * Adds property names key/value pairs, used by the methods: itemIsProperty
- * and propertyIdFor.
- *
- * key = property key; value = property id
- */
- protected abstract void addPropertyNames(Map<String, String> pNames);
-
- /**
- * Method used for identifying the given property.
- */
- public boolean itemIsProperty(PersistenceUnit.Property item) {
- if (item == null) {
- throw new NullPointerException();
- }
- return this.propertyNames().keySet().contains(item.getName());
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- public String propertyIdOf(PersistenceUnit.Property property) {
- String propertyId = this.propertyNames().get(property.getName());
- if (propertyId == null) {
- throw new IllegalArgumentException("Illegal property: " + property); //$NON-NLS-1$
- }
- return propertyId;
- }
-
- public String propertyIdOf(String eclipseLinkkey) {
- String propertyId = this.propertyNames().get(eclipseLinkkey);
- if (propertyId == null) {
- throw new IllegalArgumentException("Illegal property: " + eclipseLinkkey); //$NON-NLS-1$
- }
- return propertyId;
- }
-
- /*
- * Get the PersistenceUnit property key of the given property
- */
- protected String persistenceUnitKeyOf(String propertyId) {
- for (String persistenceUnitKey : this.propertyNames().keySet()) {
- if (this.propertyNames().get(persistenceUnitKey).equals(propertyId)) {
- return persistenceUnitKey;
- }
- }
- throw new IllegalArgumentException("Illegal property ID: " + propertyId); //$NON-NLS-1$
- }
-
- // ******** Convenience methods ********
- /**
- * Put into persistenceUnit properties.
- *
- * @param key -
- * property name
- * @param value -
- * property value
- */
- protected void putProperty(String key, Object value) {
- this.putProperty(key, value, false);
- }
-
- @SuppressWarnings("unchecked")
- protected void putProperty(String key, Object value, boolean allowDuplicates) {
- String persistenceUnitKey = this.persistenceUnitKeyOf(key);
- if ((value != null) && value.getClass().isEnum()) {
- this.putEnumValue(persistenceUnitKey, (Enum) value, allowDuplicates);
- }
- else {
- this.putPersistenceUnitProperty(persistenceUnitKey, null, value, allowDuplicates);
- }
- }
-
- private void putPersistenceUnitProperty(String key, String keySuffix, Object value, boolean allowDuplicates) {
- String persistenceUnitKey = (keySuffix == null) ? key : key + keySuffix;
- String stringValue = (value == null) ? null : value.toString();
- this.getPersistenceUnit().setProperty(persistenceUnitKey, stringValue, allowDuplicates);
- }
-
- /**
- * Removes a persistenceUnit property.
- *
- * @param key -
- * property name
- * @param value -
- * property value
- */
- protected void removeProperty(String key, String value) {
- String persistenceUnitKey = this.persistenceUnitKeyOf(key);
-
- this.getPersistenceUnit().removeProperty(persistenceUnitKey, value);
- }
-
- /**
- * Returns true when the given key exits in the PersistenceXml.
- */
- protected boolean persistenceUnitKeyExists(String persistenceUnitKey) {
- return (this.getStringValue(persistenceUnitKey) != null);
- }
-
- // ****** get/set String convenience methods *******
- /**
- * Returns the String value of the given Property from the PersistenceXml.
- */
- protected String getStringValue(String persistenceUnitKey) {
- PersistenceUnit.Property p = this.getPersistenceUnit().getProperty(persistenceUnitKey);
- return (p == null) ? null : p.getValue();
- }
-
- protected String getStringValue(String key, String keySuffix) {
- return this.getStringValue((keySuffix == null) ? key : key + keySuffix);
- }
-
- /**
- * Put the given String value into the PersistenceXml.
- * @param key -
- * property key
- * @param newValue
- * value to be associated with the key
- */
- protected void putStringValue(String key, String newValue) {
- this.putStringValue(key, null, newValue, false);
- }
-
- /**
- * Put the given String value into the PersistenceXml.
- * @param key
- * property key
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putStringValue(String key, String newValue, boolean allowDuplicate) {
- this.putStringValue(key, null, newValue, allowDuplicate);
- }
-
- /**
- * Put the given String value into the PersistenceXml.
- * @param key
- * property key
- * @param keySuffix
- * e.g. entity name
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putStringValue(String key, String keySuffix, String newValue, boolean allowDuplicate) {
- this.putPersistenceUnitProperty(key, keySuffix, newValue, allowDuplicate);
- }
-
- // ****** Integer convenience methods *******
- /**
- * Returns the Integer value of the given Property from the PersistenceXml.
- */
- protected Integer getIntegerValue(String persistenceUnitKey) {
- PersistenceUnit.Property p = this.getPersistenceUnit().getProperty(persistenceUnitKey);
- return (p == null) ? null : getIntegerValueOf(p.getValue());
- }
-
- protected Integer getIntegerValue(String key, String keySuffix) {
- return this.getIntegerValue((keySuffix == null) ? key : key + keySuffix);
- }
-
- /**
- * Put the given Integer value into the PersistenceXml.
- * @param key -
- * property key
- * @param newValue
- * value to be associated with the key
- */
- protected void putIntegerValue(String key, Integer newValue) {
- this.putIntegerValue(key, null, newValue, false);
- }
-
- /**
- * Put the given Integer value into the PersistenceXml.
- * @param key
- * property key
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putIntegerValue(String key, Integer newValue, boolean allowDuplicate) {
- this.putIntegerValue(key, null, newValue, allowDuplicate);
- }
-
- /**
- * Put the given Integer value into the PersistenceXml.
- * @param key
- * property key
- * @param keySuffix
- * e.g. entity name
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putIntegerValue(String key, String keySuffix, Integer newValue, boolean allowDuplicate) {
- this.putPersistenceUnitProperty(key, keySuffix, newValue, allowDuplicate);
- }
-
- // ****** Boolean convenience methods *******
- /**
- * Returns the Boolean value of the given Property from the PersistenceXml.
- */
- protected Boolean getBooleanValue(String persistenceUnitKey) {
- PersistenceUnit.Property p = this.getPersistenceUnit().getProperty(persistenceUnitKey);
- return (p == null) ? null : getBooleanValueOf(p.getValue());
- }
-
- protected Boolean getBooleanValue(String key, String keySuffix) {
- return this.getBooleanValue((keySuffix == null) ? key : key + keySuffix);
- }
-
- /**
- * Put the given Boolean value into the PersistenceXml.
- * @param key
- * property key
- * @param newValue
- * value to be associated with the key
- */
- protected void putBooleanValue(String key, Boolean newValue) {
- this.putBooleanValue(key, null, newValue, false);
- }
-
- /**
- * Put the given Boolean value into the PersistenceXml.
- * @param key
- * property key
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putBooleanValue(String key, Boolean newValue, boolean allowDuplicate) {
- this.putBooleanValue(key, null, newValue, allowDuplicate);
- }
-
- /**
- * Put the given Boolean value into the PersistenceXml.
- * @param key
- * property key
- * @param keySuffix
- * e.g. entity name
- * @param newValue
- * value to be associated with the key
- * @param allowDuplicate
- */
- protected void putBooleanValue(String key, String keySuffix, Boolean newValue, boolean allowDuplicate) {
- this.putPersistenceUnitProperty(key, keySuffix, newValue, allowDuplicate);
- }
-
- // ****** Enum convenience methods *******
- /**
- * Returns the Enum value of the given Property from the PersistenceXml.
- */
- protected <T extends Enum<T>> T getEnumValue(String persistenceUnitKey, T[] enumValues) {
- PersistenceUnit.Property p = this.getPersistenceUnit().getProperty(persistenceUnitKey);
- return (p == null) ? null : getEnumValueOf(p.getValue(), enumValues);
- }
-
- protected <T extends Enum<T>> T getEnumValue(String key, String keySuffix, T[] enumValues) {
- return this.getEnumValue((keySuffix == null) ? key : key + keySuffix, enumValues);
- }
-
- /**
- * Put the given Enum value into the PersistenceXml.
- *
- * @param key -
- * property key
- */
- protected <T extends Enum<T>> void putEnumValue(String key, T newValue) {
- this.putEnumValue(key, null, newValue, false);
- }
-
- protected <T extends Enum<T>> void putEnumValue(String key, T newValue, boolean allowDuplicate) {
- this.putEnumValue(key, null, newValue, allowDuplicate);
- }
-
- protected <T extends Enum<T>> void putEnumValue(String key, String keySuffix, T newValue, boolean allowDuplicate) {
- this.putPersistenceUnitProperty(key, keySuffix, getPropertyStringValueOf(newValue), allowDuplicate);
- }
-
- // ****** Static methods *******
-
- public static Boolean getBooleanValueOf(String puStringValue) {
- if (puStringValue == null) {
- return null;
- }
- return Boolean.valueOf(puStringValue);
- }
-
- public static Integer getIntegerValueOf(String puStringValue) {
- if (puStringValue == null) {
- return null;
- }
- return Integer.valueOf(puStringValue);
- }
-
- /**
- * Returns the enum constant of the specified enum type with the specified
- * Property string value.
- */
- public static <T extends Enum<T>> T getEnumValueOf(String puStringValue, T[] enumValues) {
- for (T enumValue : enumValues) {
- if (getPropertyStringValueOf(enumValue).equals(puStringValue)) {
- return enumValue;
- }
- }
- return null;
- }
-
- /**
- * Returns the Property string value of the given property value.
- */
- public static 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();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNode.java
deleted file mode 100644
index 71a4449f83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNode.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.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-
-/**
- * Use this abstract class for context nodes that are part of an
- * <code>orm.xml</code> file.
- * This will not work for a pure {@link org.eclipse.jpt.core.context.MappingFile}
- * implementation.
- */
-public abstract class AbstractPersistenceXmlContextNode
- extends AbstractXmlContextNode
-{
- // ********** constructor **********
-
- protected AbstractPersistenceXmlContextNode(JpaContextNode parent) {
- super(parent);
- }
-
-
- // ********** convenience methods **********
-
- protected PersistenceXmlDefinition getPersistenceXmlDefinition() {
- return (PersistenceXmlDefinition) this.getJpaPlatform().getResourceDefinition(this.getResourceType());
- }
-
- protected EFactory getResourceNodeFactory() {
- return this.getPersistenceXmlDefinition().getResourceNodeFactory();
- }
-
- protected PersistenceXmlContextNodeFactory getContextNodeFactory() {
- return this.getPersistenceXmlDefinition().getContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 271ee5dd6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,76 +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.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.java.JarFile;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJarFile;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericClassRef;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericJarFileRef;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericMappingFileRef;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistence;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistenceUnit;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistenceUnitProperty;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.ImpliedMappingFileRef;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-
-public abstract class AbstractPersistenceXmlContextNodeFactory implements PersistenceXmlContextNodeFactory
-{
-
- public Persistence buildPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- return new GenericPersistence(parent, xmlPersistence);
- }
-
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- return new GenericPersistenceUnit(parent, xmlPersistenceUnit);
- }
-
- public MappingFileRef buildMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef) {
- return new GenericMappingFileRef(parent, xmlMappingFileRef);
- }
-
- public MappingFileRef buildImpliedMappingFileRef(PersistenceUnit parent) {
- return new ImpliedMappingFileRef(parent, JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH );
- }
-
- public ClassRef buildClassRef(PersistenceUnit parent, XmlJavaClassRef classRef) {
- return new GenericClassRef(parent, classRef);
- }
-
- public ClassRef buildClassRef(PersistenceUnit parent, String className) {
- return new GenericClassRef(parent, className);
- }
-
- public JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- return new GenericJarFileRef(parent, xmlJarFileRef);
- }
-
- public JarFile buildJarFile(JarFileRef parent, JavaResourcePackageFragmentRoot jarResourcePackageFragmentRoot) {
- return new GenericJarFile(parent, jarResourcePackageFragmentRoot);
- }
-
- public PersistenceUnit.Property buildProperty(PersistenceUnit parent, XmlProperty xmlProperty) {
- return new GenericPersistenceUnitProperty(parent, xmlProperty);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlDefinition.java
deleted file mode 100644
index 86c07e8b1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/AbstractPersistenceXmlDefinition.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.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-
-/**
- * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractPersistenceXmlDefinition
- implements PersistenceXmlDefinition
-{
-
- private final PersistenceXmlContextNodeFactory factory;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractPersistenceXmlDefinition() {
- super();
- this.factory = buildContextNodeFactory();
- }
-
-
- protected abstract PersistenceXmlContextNodeFactory buildContextNodeFactory();
-
- public PersistenceXmlContextNodeFactory getContextNodeFactory() {
- return this.factory;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 64b67b65b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/persistence/GenericPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,29 +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.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.internal.jpa2.context.persistence.connection.NullConnection2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.persistence.options.NullOptions2_0;
-
-
-public class GenericPersistenceXmlContextNodeFactory extends AbstractPersistenceXmlContextNodeFactory
-{
-
- public PersistenceUnitProperties buildConnection(PersistenceUnit parent) {
- return new NullConnection2_0(parent);
- }
-
- public PersistenceUnitProperties buildOptions(PersistenceUnit parent) {
- return new NullOptions2_0(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java
deleted file mode 100644
index 77e242db5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetActionDelegate.java
+++ /dev/null
@@ -1,81 +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.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.NullProgressMonitor;
-import org.eclipse.jpt.core.JptCorePlugin;
-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;
-
-/**
- * Performs things common to install, version change
- */
-public abstract class JpaFacetActionDelegate
- implements IDelegate, JpaFacetDataModelProperties
-{
- public final void execute(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- monitor = this.nonNullMonitor(monitor);
- try {
- this.execute_(project, fv, config, monitor);
- } finally {
- monitor.done();
- }
- }
-
- protected void execute_(
- IProject project, @SuppressWarnings("unused") IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- monitor.beginTask("", 1); //$NON-NLS-1$
-
- // NB: WTP Natures (including the JavaEMFNature)
- // should already be added, as this facet should
- // always coexist with a module facet.
-
- IDataModel dataModel = (IDataModel) config;
-
- // project settings
- JptCorePlugin.setJpaPlatformId(project, dataModel.getStringProperty(PLATFORM_ID));
-
- // do NOT use IDataModel.getStringProperty(String) - or the connection profile name can
- // be set to an empty string - we want it to be null
- JptCorePlugin.setConnectionProfileName(project, (String) dataModel.getProperty(CONNECTION));
-
- if (dataModel.getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG)) {
- JptCorePlugin.setUserOverrideDefaultCatalog(project, dataModel.getStringProperty(USER_OVERRIDE_DEFAULT_CATALOG));
- }
- if (dataModel.getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- JptCorePlugin.setUserOverrideDefaultSchema(project, dataModel.getStringProperty(USER_OVERRIDE_DEFAULT_SCHEMA));
- }
-
- JptCorePlugin.setDiscoverAnnotatedClasses(project, dataModel.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES));
-
- // defaults settings
- JptCorePlugin.setDefaultJpaPlatformId(fv.getVersionString(), dataModel.getStringProperty(PLATFORM_ID));
-
- //Delegate to LibraryInstallDelegate to configure the project classpath
- ((LibraryInstallDelegate) dataModel.getProperty(JpaFacetInstallDataModelProperties.LIBRARY_PROVIDER_DELEGATE)).execute(new NullProgressMonitor());
-
- monitor.worked(1);
- }
-
- private IProgressMonitor nonNullMonitor(IProgressMonitor monitor) {
- return (monitor != null) ? monitor : new NullProgressMonitor();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.java
deleted file mode 100644
index 4b3eb38bf5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProperties.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.core.internal.facet;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProperties;
-
-public interface JpaFacetDataModelProperties
- extends IDataModelProperties
-{
- String PREFIX = "JpaFacetDataModelProperties";
- String PREFIX_ = PREFIX + '.';
-
- /**
- * Internal, type IRuntime, identifies runtime associated with project
- * Used only in conjunction with validation of other properties, because this information
- * is otherwise inaccessible to this data model
- */
- String RUNTIME = PREFIX_ + "RUNTIME";
-
- /**
- * Required, type String, identifies Jpa Platform
- */
- String PLATFORM_ID = PREFIX_ + "PLATFORM_ID";
-
- /**
- * Required, type LibraryInstallDelegate, the library install delegate used to configure JPA provider library
- */
- String LIBRARY_PROVIDER_DELEGATE = PREFIX_ + "LIBRARY_PROVIDER_DELEGATE";
-
- /**
- * Not required, type String, identifies database connection
- */
- String CONNECTION = PREFIX_ + "CONNECTION";
-
- /**
- * Required, type Boolean, identifies whether database connection is active
- */
- String CONNECTION_ACTIVE = PREFIX_ + "CONNECTION_ACTIVE";
-
- /**
- * Required, type Boolean, identifies if the user wishes to override default Catalog name
- */
- String USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG = PREFIX_ + "USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG";
-
- /**
- * Not required, type String, identifies the user overridden default Catalog name
- */
- String USER_OVERRIDE_DEFAULT_CATALOG = PREFIX_ + "USER_OVERRIDE_DEFAULT_CATALOG";
-
- /**
- * Required, type Boolean, identifies if the user wishes to override default schema name
- */
- String USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA = PREFIX_ + "USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA";
-
- /**
- * Not required, type String, identifies the user overridden default schema name
- */
- String USER_OVERRIDE_DEFAULT_SCHEMA = PREFIX_ + "USER_OVERRIDE_DEFAULT_SCHEMA";
-
- /**
- * Required, type boolean, opposite of LIST_ANNOTATED_CLASSES, identifies
- * whether all annotated classes are to be automatically included as part of
- * all persistence units
- */
- String DISCOVER_ANNOTATED_CLASSES = PREFIX_ + "DISCOVER_ANNOTATED_CLASSES";
-
- /**
- * Required, type boolean, opposite of DISCOVER_ANNOTATED_CLASSES, identifies
- * if annotated classes should be listed in the persistence.xml in order to
- * be considered part of a persistence unit
- * (This additional setting is necessary in order to use synchHelper within
- * the wizard - there must be a unique property for each radio button. Stupid
- * but true)
- */
- String LIST_ANNOTATED_CLASSES = PREFIX_ + "LIST_ANNOTATED_CLASSES";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
deleted file mode 100644
index 638e9260d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetDataModelProvider.java
+++ /dev/null
@@ -1,689 +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.core.internal.facet;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-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.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public abstract class JpaFacetDataModelProvider
- extends FacetInstallDataModelProvider
- implements JpaFacetDataModelProperties
-{
- protected static final String EJB_FACET_ID = IModuleConstants.JST_EJB_MODULE;
-
- protected static final IStatus PLATFORM_NOT_SPECIFIED_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_PLATFORM_NOT_SPECIFIED);
-
- protected static final IStatus CONNECTION_NOT_CONNECTED_STATUS =
- buildInfoStatus(JptCoreMessages.VALIDATE_CONNECTION_NOT_CONNECTED);
-
- protected static final IStatus USER_OVERRIDE_DEFAULT_CATALOG_NOT_SPECIFIED_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_DEFAULT_CATALOG_NOT_SPECIFIED);
-
- protected static final IStatus USER_OVERRIDE_DEFAULT_SCHEMA_NOT_SPECIFIED_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED);
-
-
- private LibraryInstallDelegate defaultLibraryProvider;
-
- /** cache the connection profile - change it whenever the user selects a different name */
- private ConnectionProfile connectionProfile;
-
-
- /**
- * required default constructor
- */
- protected JpaFacetDataModelProvider() {
- super();
- }
-
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked") Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(RUNTIME);
- propertyNames.add(PLATFORM_ID);
- propertyNames.add(LIBRARY_PROVIDER_DELEGATE);
- propertyNames.add(CONNECTION);
- propertyNames.add(CONNECTION_ACTIVE);
- propertyNames.add(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG);
- propertyNames.add(USER_OVERRIDE_DEFAULT_CATALOG);
- propertyNames.add(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA);
- propertyNames.add(USER_OVERRIDE_DEFAULT_SCHEMA);
- propertyNames.add(DISCOVER_ANNOTATED_CLASSES);
- propertyNames.add(LIST_ANNOTATED_CLASSES);
- return propertyNames;
- }
-
-
- // ********** properties **********
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) this.getProperty(FACETED_PROJECT_WORKING_COPY);
- }
-
- protected IProjectFacetVersion getProjectFacetVersion() {
- return (IProjectFacetVersion) this.getProperty(FACET_VERSION);
- }
-
- protected IRuntime getRuntime() {
- return (IRuntime) this.getProperty(RUNTIME);
- }
-
- protected String getPlatformId() {
- return (String) this.getProperty(PLATFORM_ID);
- }
-
- protected LibraryInstallDelegate getLibraryInstallDelegate() {
- return (LibraryInstallDelegate) this.getProperty(LIBRARY_PROVIDER_DELEGATE);
- }
-
- protected String getConnectionName() {
- return (String) this.getProperty(CONNECTION);
- }
-
- protected boolean userWantsToOverrideDefaultCatalog() {
- return this.getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG);
- }
-
- protected String getUserOverrideDefaultCatalog() {
- return (String) this.getProperty(USER_OVERRIDE_DEFAULT_CATALOG);
- }
-
- protected boolean userWantsToOverrideDefaultSchema() {
- return this.getBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA);
- }
-
- protected String getUserOverrideDefaultSchema() {
- return (String) this.getProperty(USER_OVERRIDE_DEFAULT_SCHEMA);
- }
-
- protected boolean discoverAnnotatedClasses() {
- return this.getBooleanProperty(DISCOVER_ANNOTATED_CLASSES);
- }
-
-
- // ********** enabled **********
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG)) {
- return this.connectionIsActive() && this.databaseSupportsCatalogs();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- return this.userWantsToOverrideDefaultCatalog();
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.connectionIsActive();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.userWantsToOverrideDefaultSchema();
- }
-
- return super.isPropertyEnabled(propertyName);
- }
-
-
- // ********** defaults **********
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FACET_ID)) {
- return JptCorePlugin.FACET_ID;
- }
- if (propertyName.equals(RUNTIME)) {
- return null;
- }
- if (propertyName.equals(PLATFORM_ID)) {
- return getDefaultPlatformId();
- }
- if (propertyName.equals(LIBRARY_PROVIDER_DELEGATE)) {
- return getDefaultLibraryProvider();
- }
- if (propertyName.equals(CONNECTION)) {
- return getDefaultConnection();
- }
- if (propertyName.equals(CONNECTION_ACTIVE)) {
- return Boolean.valueOf(this.connectionIsActive());
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG)) {
- return getDefaultUserWantsToOverrideDefaultCatalog();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- return getDefaultCatalogIdentifier();
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- return getDefaultUserWantsToOverrideDefaultSchema();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return getDefaultSchemaIdentifier();
- }
- if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return getDefaultDiscoverAnnotatedClasses();
- }
- if (propertyName.equals(LIST_ANNOTATED_CLASSES)) {
- return getDefaultListAnnotatedClasses();
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- protected abstract String getDefaultPlatformId();
-
- protected LibraryInstallDelegate getDefaultLibraryProvider() {
- // delegate itself changes, not the instance of delegate
- if (this.defaultLibraryProvider == null) {
- this.defaultLibraryProvider = this.buildDefaultLibraryProvider();
- }
- return defaultLibraryProvider;
- }
-
- protected LibraryInstallDelegate buildDefaultLibraryProvider() {
- IFacetedProjectWorkingCopy fpjwc = this.getFacetedProjectWorkingCopy();
- if (fpjwc == null) {
- return null;
- }
- IProjectFacetVersion pfv = this.getProjectFacetVersion();
- if (pfv == null) {
- return null;
- }
- LibraryInstallDelegate lp = new LibraryInstallDelegate(fpjwc, pfv, this.buildEnablementVariables());
- lp.addListener(this.buildLibraryProviderListener());
- return lp;
- }
-
- protected Map<String, Object> buildEnablementVariables() {
- Map<String, Object> enablementVariables = new HashMap<String, Object>();
- enablementVariables.put(JpaLibraryProviderConstants.EXPR_VAR_JPA_PLATFORM, this.getPlatformId());
- return enablementVariables;
- }
-
- protected IPropertyChangeListener buildLibraryProviderListener() {
- return new IPropertyChangeListener() {
- public void propertyChanged(String property, Object oldValue, Object newValue ) {
- JpaFacetDataModelProvider.this.getDataModel().notifyPropertyChange(
- LIBRARY_PROVIDER_DELEGATE, IDataModel.VALUE_CHG);
- }
- };
- }
-
- protected abstract String getDefaultConnection();
-
- protected abstract Boolean getDefaultUserWantsToOverrideDefaultCatalog();
-
- protected abstract String getDefaultCatalogIdentifier();
-
- protected abstract Boolean getDefaultUserWantsToOverrideDefaultSchema();
-
- protected abstract String getDefaultSchemaIdentifier();
-
- protected abstract Boolean getDefaultDiscoverAnnotatedClasses();
-
- protected Boolean getDefaultListAnnotatedClasses() {
- return Boolean.valueOf( ! this.discoverAnnotatedClasses());
- }
-
- protected boolean runtimeSupportsEjb30() {
- IRuntime runtime = this.getRuntime();
- return (runtime != null) && runtime.supports(this.getEJB30());
- }
-
- protected IProjectFacetVersion getEJB30() {
- return ProjectFacetsManager.getProjectFacet(EJB_FACET_ID).getVersion("3.0"); //$NON-NLS-1$
- }
-
-
- // ********** synchronize data model **********
-
- /**
- * The specified property's value has changed to the specified value.
- * Return whether to fire a VALUE_CHG DataModelEvent.
- */
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(FACETED_PROJECT_WORKING_COPY)) {
- //no-op
- }
- else if (propertyName.equals(FACET_VERSION)) {
- this.model.notifyPropertyChange(PLATFORM_ID, IDataModel.DEFAULT_CHG);
- resetLibraryProviderEnablementContext();
- this.model.notifyPropertyChange(LIBRARY_PROVIDER_DELEGATE, IDataModel.DEFAULT_CHG);
- }
- else if (propertyName.equals(RUNTIME)) {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- // may be null while model is being built up
- // ... or in tests
- lid.refresh();
- }
- this.model.notifyPropertyChange(DISCOVER_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(LIST_ANNOTATED_CLASSES, IDataModel.DEFAULT_CHG);
- }
- else if (propertyName.equals(PLATFORM_ID)) {
- resetLibraryProviderEnablementContext();
- }
- else if (propertyName.equals(CONNECTION)) {
- this.setBooleanProperty(CONNECTION_ACTIVE, this.connectionIsActive());
-
- // JpaFacetWizardPage sets the connection when the user adds a new connection
- // implying that there is a new set of valid connections to choose from
- this.model.notifyPropertyChange(CONNECTION, IDataModel.VALID_VALUES_CHG);
-
- // catalog
- if ((propertyValue != null) && this.databaseSupportsCatalogs()) { // connection set to something that supports catalogs
- this.setProperty(USER_OVERRIDE_DEFAULT_CATALOG, this.getDefaultCatalogIdentifier());
- } else { // connection either '<None>' or non-catalog database
- this.setBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG, false);
- }
- this.model.notifyPropertyChange(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_CATALOG, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_CATALOG, IDataModel.VALID_VALUES_CHG);
-
- // schema
- if (propertyValue == null) { // connection set to '<None>'
- this.setBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA, false);
- } else {
- this.setProperty(USER_OVERRIDE_DEFAULT_SCHEMA, this.getDefaultSchemaIdentifier());
- }
- this.model.notifyPropertyChange(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.VALID_VALUES_CHG);
- }
- else if (propertyName.equals(CONNECTION_ACTIVE)) {
- // catalog
- if (this.propertyValueIsFalse(propertyValue)) { // connection is inactive
- this.setBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG, false);
- }
- this.model.notifyPropertyChange(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_CATALOG, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_CATALOG, IDataModel.VALID_VALUES_CHG);
-
- // schema
- if (this.propertyValueIsFalse(propertyValue)) { // connection is inactive
- this.setBooleanProperty(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA, false);
- }
- this.model.notifyPropertyChange(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.VALID_VALUES_CHG);
- }
- else if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG)) {
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_CATALOG, IDataModel.ENABLE_CHG);
- if (this.propertyValueIsFalse(propertyValue)) {
- this.setProperty(USER_OVERRIDE_DEFAULT_CATALOG, null);
- }
- }
- else if (propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- this.setProperty(USER_OVERRIDE_DEFAULT_SCHEMA, this.getDefaultSchemaIdentifier());
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.VALID_VALUES_CHG);
- }
- else if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)) {
- this.model.notifyPropertyChange(USER_OVERRIDE_DEFAULT_SCHEMA, IDataModel.ENABLE_CHG);
- if (this.propertyValueIsFalse(propertyValue)) {
- this.setProperty(USER_OVERRIDE_DEFAULT_SCHEMA, null);
- }
- }
- else if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- this.setBooleanProperty(LIST_ANNOTATED_CLASSES, this.propertyValueIsFalse(propertyValue));
- }
- else if (propertyName.equals(LIST_ANNOTATED_CLASSES)) {
- this.setBooleanProperty(DISCOVER_ANNOTATED_CLASSES, this.propertyValueIsFalse(propertyValue));
- }
- return ok;
- }
-
- protected boolean propertyValueIsFalse(Object propertyValue) {
- return ! this.propertyValueIsTrue(propertyValue);
- }
-
- protected boolean propertyValueIsTrue(Object propertyValue) {
- return ((Boolean) propertyValue).booleanValue();
- }
-
- protected void resetLibraryProviderEnablementContext() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
- if (lid != null) {
- // may be null while model is being built up
- // ... or in tests
- lid.setEnablementContextVariable(JpaLibraryProviderConstants.EXPR_VAR_JPA_PLATFORM, getPlatformId());
- }
- }
-
-
- // ********** property descriptors **********
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return this.buildValidPlatformDescriptors();
- }
- if (propertyName.equals(CONNECTION)) {
- return this.buildValidConnectionDescriptors();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- return this.buildValidCatalogDescriptors();
- }
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.buildValidSchemaDescriptors();
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- protected DataModelPropertyDescriptor[] buildValidPlatformDescriptors() {
- Iterable<String> validPlatformIds = buildValidPlatformIds();
- Iterable<DataModelPropertyDescriptor> validPlatformDescriptors =
- new TransformationIterable<String, DataModelPropertyDescriptor>(validPlatformIds) {
- @Override
- protected DataModelPropertyDescriptor transform(String platformId) {
- return JpaFacetDataModelProvider.this.buildPlatformIdDescriptor(platformId);
- }
- };
- return ArrayTools.sort(ArrayTools.array(validPlatformDescriptors, EMPTY_DMPD_ARRAY), DESCRIPTOR_COMPARATOR);
- }
-
- protected Iterable<String> buildValidPlatformIds() {
- String jpaFacetVersion = this.getProjectFacetVersion().getVersionString();
- return JpaPlatformRegistry.instance().getJpaPlatformIdsForJpaFacetVersion(jpaFacetVersion);
- }
-
- protected static final Comparator<DataModelPropertyDescriptor> DESCRIPTOR_COMPARATOR =
- new Comparator<DataModelPropertyDescriptor>() {
- public int compare(DataModelPropertyDescriptor dmpd1, DataModelPropertyDescriptor dmpd2) {
- return dmpd1.getPropertyDescription().compareTo(dmpd2.getPropertyDescription());
- }
- };
-
- protected DataModelPropertyDescriptor[] buildValidConnectionDescriptors() {
- List<String> connectionNames = this.buildValidConnectionNames();
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[connectionNames.size()];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = this.buildConnectionDescriptor(connectionNames.get(i));
- }
- return descriptors;
- }
-
- /**
- * put a null entry at the top of the list (for <none>)
- */
- protected List<String> buildValidConnectionNames() {
- List<String> connectionNames = CollectionTools.sort(CollectionTools.list(this.getConnectionProfileNames()));
- connectionNames.add(0, null);
- return connectionNames;
- }
-
- protected DataModelPropertyDescriptor[] buildValidCatalogDescriptors() {
- Database db = this.getDatabase();
- return (db == null) ? EMPTY_DMPD_ARRAY : this.buildDescriptors(this.buildValidCatalogIdentifiers(db));
- }
-
- /**
- * pre-condition: 'db' is not null
- */
- protected List<String> buildValidCatalogIdentifiers(Database db) {
- // use catalog *identifiers* since the string ends up being the "default" for various text entries
- return this.buildValidStrings(db.getSortedCatalogIdentifiers(), this.getDefaultCatalogIdentifier());
- }
-
- protected DataModelPropertyDescriptor[] buildValidSchemaDescriptors() {
- Database db = this.getDatabase();
- return (db == null) ? EMPTY_DMPD_ARRAY : this.buildDescriptors(this.buildValidSchemaIdentifiers());
- }
-
- protected List<String> buildValidSchemaIdentifiers() {
- return this.buildValidStrings(this.getSchemaIdentifiers(), this.getDefaultSchemaIdentifier());
- }
-
- protected Iterable<String> getSchemaIdentifiers() {
- SchemaContainer sc = this.getSchemaContainer();
- // use schema *identifiers* since the string ends up being the "default" for various text entries
- return (sc != null) ? sc.getSortedSchemaIdentifiers() : EmptyIterable.<String>instance();
- }
-
- /**
- * put an entry for the default at the top of the list
- */
- protected List<String> buildValidStrings(Iterable<String> strings, String defaultString) {
- List<String> validStrings = CollectionTools.list(strings);
- if ((defaultString != null) && ! validStrings.contains(defaultString)) {
- validStrings.add(0, defaultString);
- }
- return validStrings;
- }
-
- protected DataModelPropertyDescriptor[] buildDescriptors(List<String> strings) {
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[strings.size()];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new DataModelPropertyDescriptor(strings.get(i));
- }
- return descriptors;
- }
-
- protected static final DataModelPropertyDescriptor[] EMPTY_DMPD_ARRAY = new DataModelPropertyDescriptor[0];
-
- /**
- * platform and connection have 'description's (in addition to 'value's)
- */
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return buildPlatformIdDescriptor(this.getPlatformId());
- }
- if (propertyName.equals(CONNECTION)) {
- return buildConnectionDescriptor(this.getConnectionName());
- }
- return super.getPropertyDescriptor(propertyName);
- }
-
- protected DataModelPropertyDescriptor buildPlatformIdDescriptor(String platformId) {
- return new DataModelPropertyDescriptor(platformId, this.getPlatformLabel(platformId));
- }
-
- protected String getPlatformLabel(String platformId) {
- return JpaPlatformRegistry.instance().getJpaPlatformLabel(platformId);
- }
-
- protected DataModelPropertyDescriptor buildConnectionDescriptor(String connectionName) {
- String description = (connectionName == null) ? JptCoreMessages.NONE : null;
- return new DataModelPropertyDescriptor(connectionName, description);
- }
-
-
- // ********** database **********
-
- protected SchemaContainer getSchemaContainer() {
- return this.databaseSupportsCatalogs() ? this.getCatalog() : this.getDatabase();
- }
-
- protected Catalog getCatalog() {
- String name = this.getUserOverrideDefaultCatalog();
- return (name == null) ? null : this.getCatalog(name);
- }
-
- /**
- * pre-condition: 'name' is not null
- */
- protected Catalog getCatalog(String name) {
- Database db = this.getDatabase();
- return (db == null) ? null : db.getCatalogForIdentifier(name);
- }
-
- protected boolean databaseSupportsCatalogs() {
- Database db = this.getDatabase();
- return (db != null) && db.supportsCatalogs();
- }
-
- protected Database getDatabase() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp == null) ? null : cp.getDatabase();
- }
-
- protected boolean connectionIsActive() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp != null) && cp.isActive();
- }
-
- protected ConnectionProfile getConnectionProfile() {
- String name = this.getConnectionName();
- return (name == null) ? null : this.getConnectionProfile(name);
- }
-
- /**
- * pre-condition: 'name' is not null
- */
- protected ConnectionProfile getConnectionProfile(String name) {
- if (this.cachedConnectionProfileIsStale(name)) {
- this.connectionProfile = this.buildConnectionProfile(name);
- }
- return this.connectionProfile;
- }
-
- protected boolean cachedConnectionProfileIsStale(String name) {
- return (this.connectionProfile == null) || ! this.connectionProfile.getName().equals(name);
- }
-
- protected ConnectionProfile buildConnectionProfile(String name) {
- return this.getConnectionProfileFactory().buildConnectionProfile(name, DatabaseIdentifierAdapter.Default.instance());
- }
-
- protected Iterable<String> getConnectionProfileNames() {
- return this.getConnectionProfileFactory().getConnectionProfileNames();
- }
-
- protected ConnectionProfileFactory getConnectionProfileFactory() {
- // we don't have a JPA project yet, so go to the db plug-in directly to get the factory
- return JptDbPlugin.instance().getConnectionProfileFactory();
- }
-
-
- // ********** validation **********
-
- @Override
- public IStatus validate(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return this.validatePlatformId();
- }
- if (propertyName.equals(LIBRARY_PROVIDER_DELEGATE)) {
- return this.getLibraryInstallDelegate().validate();
- }
- if (propertyName.equals(CONNECTION)) {
- return this.validateConnection();
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG)
- || propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- return this.validateUserOverrideDefaultCatalog();
- }
- if (propertyName.equals(USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA)
- || propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.validateUserOverrideDefaultSchema();
- }
- if (propertyName.equals(DISCOVER_ANNOTATED_CLASSES)) {
- return this.validatePersistentClassManagement();
- }
-
- return super.validate(propertyName);
- }
-
- protected IStatus validatePlatformId() {
- return (this.getPlatformId() == null) ? PLATFORM_NOT_SPECIFIED_STATUS : OK_STATUS;
- }
-
- protected IStatus validateConnection() {
- String connectionName = this.getConnectionName();
- return (connectionName == null) ? OK_STATUS : this.validateNonNullConnection(connectionName);
- }
-
- protected IStatus validateNonNullConnection(String connectionName) {
- ConnectionProfile cp = this.getConnectionProfile(connectionName);
- if (cp == null) {
- return buildErrorStatus(NLS.bind(JptCoreMessages.VALIDATE_CONNECTION_INVALID, connectionName));
- }
- if ( ! cp.isActive()) {
- return CONNECTION_NOT_CONNECTED_STATUS;
- }
- return OK_STATUS;
- }
-
- protected IStatus validateUserOverrideDefaultCatalog() {
- if (this.userWantsToOverrideDefaultCatalog()) {
- if (this.getUserOverrideDefaultCatalog() == null) {
- return USER_OVERRIDE_DEFAULT_CATALOG_NOT_SPECIFIED_STATUS;
- }
- }
- return OK_STATUS;
- }
-
- protected IStatus validateUserOverrideDefaultSchema() {
- if (this.userWantsToOverrideDefaultSchema()) {
- if (this.getUserOverrideDefaultSchema() == null) {
- return USER_OVERRIDE_DEFAULT_SCHEMA_NOT_SPECIFIED_STATUS;
- }
- }
- return OK_STATUS;
- }
-
- protected IStatus validatePersistentClassManagement() {
- // TODO warning if "discovery" is used, but no runtime specified ??
- // boolean discoverAnnotatedClasses = this.discoverAnnotatedClasses();
- return OK_STATUS;
- }
-
-
- // ********** static methods **********
-
- protected static IStatus buildInfoStatus(String message) {
- return buildStatus(IStatus.INFO, message);
- }
-
-// private static IStatus buildWarningStatus(String message) {
-// return buildStatus(IStatus.WARNING, message);
-// }
-
- protected static IStatus buildErrorStatus(String message) {
- return buildStatus(IStatus.ERROR, message);
- }
-
- protected static IStatus buildStatus(int severity, String message) {
- return new Status(severity, JptCorePlugin.PLUGIN_ID, message);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProperties.java
deleted file mode 100644
index 4a0bfb1c57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProperties.java
+++ /dev/null
@@ -1,33 +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.core.internal.facet;
-
-@SuppressWarnings("nls")
-public interface JpaFacetInstallDataModelProperties
- extends JpaFacetDataModelProperties
-{
- String PREFIX = "JpaFacetInstallDataModelProperties";
- String PREFIX_ = PREFIX + '.';
-
- /**
- * Required, type Boolean, identifies if the user wishes to add the database driver jars to the classpath
- */
- String USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH = PREFIX_ + "USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH";
-
- /**
- * Not required, type String, identifies the database driver library added to the classpath
- */
- String DB_DRIVER_NAME = PREFIX_ + "DB_DRIVER_NAME";
-
- /**
- * Required, type boolean, details whether orm.xml should be created
- */
- String CREATE_ORM_XML = PREFIX_ + "CREATE_ORM_XML";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java
deleted file mode 100644
index 2832f2fdc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDataModelProvider.java
+++ /dev/null
@@ -1,205 +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.core.internal.facet;
-
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class JpaFacetInstallDataModelProvider
- extends JpaFacetDataModelProvider
- implements JpaFacetInstallDataModelProperties
-{
- /**
- * required default constructor
- */
- public JpaFacetInstallDataModelProvider() {
- super();
- }
-
- @Override
- public Set<String> getPropertyNames() {
- Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH);
- propertyNames.add(DB_DRIVER_NAME);
- propertyNames.add(CREATE_ORM_XML);
- return propertyNames;
- }
-
-
- // ********** properties **********
-
- protected boolean userWantsToAddDbDriverJarsToClasspath() {
- return this.getBooleanProperty(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH);
- }
-
- protected String getDriverName() {
- return (String) this.getProperty(DB_DRIVER_NAME);
- }
-
-
- // ********** enabled **********
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return (this.getConnectionProfile() != null);
- }
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return this.userWantsToAddDbDriverJarsToClasspath();
- }
-
- return super.isPropertyEnabled(propertyName);
- }
-
-
- // ********** defaults **********
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return Boolean.FALSE;
- }
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return this.getDefaultDriverName();
- }
- if (propertyName.equals(CREATE_ORM_XML)) {
- return Boolean.FALSE;
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- protected String getDefaultPlatformId() {
- return JptCorePlugin.getDefaultJpaPlatformId(getProjectFacetVersion().getVersionString());
- }
-
- @Override
- protected String getDefaultConnection() {
- return null;
- }
-
- @Override
- protected Boolean getDefaultUserWantsToOverrideDefaultCatalog() {
- return Boolean.FALSE;
- }
-
- @Override
- protected String getDefaultCatalogIdentifier() {
- Database db = this.getDatabase();
- return (db == null) ? null : db.getDefaultCatalogIdentifier();
- }
-
- @Override
- protected Boolean getDefaultUserWantsToOverrideDefaultSchema() {
- return Boolean.FALSE;
- }
-
- @Override
- protected String getDefaultSchemaIdentifier() {
- SchemaContainer sc = this.getSchemaContainer();
- return (sc == null) ? null : sc.getDefaultSchemaIdentifier();
- }
-
- protected String getDefaultDriverName() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp == null) ? null : cp.getDriverName();
- }
-
- @Override
- protected Boolean getDefaultDiscoverAnnotatedClasses() {
- return Boolean.valueOf(this.runtimeSupportsEjb30());
- }
-
-
- // ********** synchronize data model **********
-
- /**
- * The specified property's value has changed to the specified value.
- * Return whether to fire a VALUE_CHG DataModelEvent.
- */
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
-
- if (propertyName.equals(CONNECTION)) {
- // db driver
- if (propertyValue == null) { // connection set to '<None>'
- this.setBooleanProperty(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH, false);
- }
- this.model.notifyPropertyChange(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.VALID_VALUES_CHG);
- }
- else if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- this.model.notifyPropertyChange(DB_DRIVER_NAME, IDataModel.ENABLE_CHG);
- if (this.propertyValueIsFalse(propertyValue)) {
- this.setProperty(DB_DRIVER_NAME, null);
- }
- }
-
- return ok;
- }
-
-
- // ********** property descriptors **********
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PLATFORM_ID)) {
- return this.buildValidPlatformDescriptors();
- }
-
- if (propertyName.equals(CONNECTION)) {
- return this.buildValidConnectionDescriptors();
- }
-
- if (propertyName.equals(DB_DRIVER_NAME)) {
- return this.buildValidDriverDescriptors();
- }
-
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_CATALOG)) {
- return this.buildValidCatalogDescriptors();
- }
-
- if (propertyName.equals(USER_OVERRIDE_DEFAULT_SCHEMA)) {
- return this.buildValidSchemaDescriptors();
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- protected DataModelPropertyDescriptor[] buildValidDriverDescriptors() {
- return new DataModelPropertyDescriptor[] { new DataModelPropertyDescriptor(this.getDriverName()) };
- }
-
-
- // ********** validation **********
-
- @Override
- public IStatus validate(String propertyName) {
- if (propertyName.equals(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)
- || propertyName.equals(DB_DRIVER_NAME)) {
- return this.validateDbDriverName();
- }
-
- return super.validate(propertyName);
- }
-
- protected IStatus validateDbDriverName() {
- return OK_STATUS;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
deleted file mode 100644
index 9cc71791d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetInstallDelegate.java
+++ /dev/null
@@ -1,132 +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.core.internal.facet;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.core.internal.operations.PersistenceFileCreationDataModelProvider;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-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;
-
-/**
- * We don't really "install" the JPA facet here. We simply store all the various
- * data model properties in the appropriate preferences. These settings will
- * used in the POST_INSTALL event listener to build the JPA project.
- */
-public class JpaFacetInstallDelegate
- extends JpaFacetActionDelegate
- implements JpaFacetInstallDataModelProperties
-{
- @Override
- protected void execute_(
- IProject project, @SuppressWarnings("unused") IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- // NB: WTP Natures (including the JavaEMFNature)
- // should already be added, as this facet should
- // always coexist with a module facet.
-
- super.execute_(project, fv, config, monitor);
-
- IJavaProject javaProject = JavaCore.create(project);
- IDataModel dataModel = (IDataModel) config;
-
- try {
- monitor.beginTask("", 3); //$NON-NLS-1$
-
- // project settings
- this.addDbDriverLibraryToClasspath(javaProject, dataModel, monitor);
-
- monitor.worked(1);
-
- // create project XML files
- this.createProjectXml(project, dataModel.getBooleanProperty(CREATE_ORM_XML));
-
- monitor.worked(2);
- }
- finally {
- monitor.done();
- }
- }
-
- protected void addDbDriverLibraryToClasspath(
- IJavaProject javaProject, IDataModel dataModel,
- IProgressMonitor monitor) throws CoreException {
-
- if( ! dataModel.getBooleanProperty(USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH)) {
- return;
- }
- String driverName = dataModel.getStringProperty(DB_DRIVER_NAME);
-
- IClasspathContainer container = JptDbPlugin.instance().buildDriverClasspathContainerFor(driverName);
- IClasspathEntry entry = JavaCore.newContainerEntry(container.getPath());
- this.addClasspathEntryToProject(entry, javaProject, monitor);
- }
-
- private void addClasspathEntryToProject(
- IClasspathEntry classpathEntry, IJavaProject javaProject, IProgressMonitor monitor)
- throws CoreException {
-
- // if the classpathEntry is already there, do nothing
- IClasspathEntry[] classpath = javaProject.getRawClasspath();
- if (ArrayTools.contains(classpath, classpathEntry)) {
- return;
- }
-
- // add the given classpathEntry to the project classpath
- int len = classpath.length;
- IClasspathEntry[] newClasspath = new IClasspathEntry[len + 1];
- System.arraycopy(classpath, 0, newClasspath, 0, len);
- newClasspath[len] = classpathEntry;
- javaProject.setRawClasspath(newClasspath, monitor);
- }
-
- private void createProjectXml(IProject project, boolean buildOrmXml) {
- this.createPersistenceXml(project);
-
- if (buildOrmXml) {
- this.createOrmXml(project);
- }
- }
-
- private void createPersistenceXml(IProject project) {
- IDataModel config = DataModelFactory.createDataModel(new PersistenceFileCreationDataModelProvider());
- config.setProperty(JpaFileCreationDataModelProperties.PROJECT_NAME, project.getName());
- // default values for all other properties should suffice
- try {
- config.getDefaultOperation().execute(null, null);
- } catch (ExecutionException ex) {
- JptCorePlugin.log(ex);
- }
- }
-
- private void createOrmXml(IProject project) {
- IDataModel config = DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JpaFileCreationDataModelProperties.PROJECT_NAME, project.getName());
- // default values for all other properties should suffice
- try {
- config.getDefaultOperation().execute(null, null);
- } catch (ExecutionException ex) {
- JptCorePlugin.log(ex);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
deleted file mode 100644
index acdfa2dff5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetUninstallDelegate.java
+++ /dev/null
@@ -1,31 +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
- ******************************************************************************/
-package org.eclipse.jpt.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 JpaFacetUninstallDelegate
- implements IDelegate
-{
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- // There is nothing to do here. Everything is taken care of by the
- // JpaModelManager *whenever* the facet is removed (even via meta-file
- // editing and CVS updating), but this delegate needs to be here because
- // it is required by the facet extension point action element, and that
- // is required by the facet UI to allow uninstallation of this facet.
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.java
deleted file mode 100644
index 17a394b0f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDataModelProvider.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.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-
-public class JpaFacetVersionChangeDataModelProvider
- extends JpaFacetDataModelProvider
- implements JpaFacetDataModelProperties
-{
- protected static final IStatus PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION_STATUS =
- buildErrorStatus(JptCoreMessages.VALIDATE_PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION);
-
-
- /**
- * required default constructor
- */
- public JpaFacetVersionChangeDataModelProvider() {
- super();
- }
-
-
- protected String getProjectName() {
- return getStringProperty(FACET_PROJECT_NAME);
- }
-
- protected JpaProject getJpaProject() {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(getProjectName());
- return JptCorePlugin.getJpaProject(project);
- }
-
-
- // **************** defaults **********************************************
-
- @Override
- protected String getDefaultPlatformId() {
- return getJpaProject().getJpaPlatform().getId();
- }
-
- @Override
- protected String getDefaultConnection() {
- return getJpaProject().getDataSource().getConnectionProfileName();
- }
-
- @Override
- protected Boolean getDefaultUserWantsToOverrideDefaultCatalog() {
- return getJpaProject().getUserOverrideDefaultCatalog() != null;
- }
-
- @Override
- protected String getDefaultCatalogIdentifier() {
- return getJpaProject().getUserOverrideDefaultCatalog();
- }
-
- @Override
- protected Boolean getDefaultUserWantsToOverrideDefaultSchema() {
- return getJpaProject().getUserOverrideDefaultSchema() != null;
- }
-
- @Override
- protected String getDefaultSchemaIdentifier() {
- return getJpaProject().getDefaultSchema();
- }
-
- @Override
- protected Boolean getDefaultDiscoverAnnotatedClasses() {
- return getJpaProject().discoversAnnotatedClasses();
- }
-
-
- // **************** valid property descriptors ****************************
-
- @Override
- protected Iterable<String> buildValidPlatformIds() {
- // add existing platform id to list of choices
- Iterable<String> validPlatformIds = super.buildValidPlatformIds();
- if (! CollectionTools.contains(validPlatformIds, getDefaultPlatformId())) {
- validPlatformIds = new CompositeIterable(getDefaultPlatformId(), validPlatformIds);
- }
- return validPlatformIds;
- }
-
-
- // **************** validation ********************************************
-
- @Override
- protected IStatus validatePlatformId() {
- IStatus status = super.validatePlatformId();
-
- if (status.isOK()) {
- if (! JpaPlatformRegistry.instance().platformSupportsJpaFacetVersion(
- getPlatformId(), getProjectFacetVersion().getVersionString())) {
- status = PLATFORM_DOES_NOT_SUPPORT_FACET_VERSION_STATUS;
- }
- }
-
- return status;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDelegate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDelegate.java
deleted file mode 100644
index 157bf080cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaFacetVersionChangeDelegate.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.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-public class JpaFacetVersionChangeDelegate
- extends JpaFacetActionDelegate
-{
- @Override
- protected void execute_(
- IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- super.execute_(project, fv, config, monitor);
-
- // need to do a rebuild here
-
- monitor.beginTask("", 1); //$NON-NLS-1$
-
- JptCorePlugin.rebuildJpaProject(project);
-
- monitor.worked(1);
-
- // nothing further to do here *just* yet
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaLibraryProviderConstants.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaLibraryProviderConstants.java
deleted file mode 100644
index 626ae91738..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/JpaLibraryProviderConstants.java
+++ /dev/null
@@ -1,17 +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.core.internal.facet;
-
-public interface JpaLibraryProviderConstants
-{
- public static final String EXPR_VAR_JPA_PLATFORM
- = "jpaPlatform"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderDetector.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderDetector.java
deleted file mode 100644
index 3c3bef9618..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderDetector.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.core.internal.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LegacyLibraryProviderDetector;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderFramework;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-
-public class LegacyJpaLibraryProviderDetector
- extends LegacyLibraryProviderDetector
-{
- public static final String LEGACY_JPA_LIBRARY_PROVIDER_ID
- = "jpa-legacy-library-provider"; //$NON-NLS-1$
-
-
- @Override
- public ILibraryProvider detect(
- final IProject project, final IProjectFacet facet) {
- if (facet.getId().equals(JptCorePlugin.FACET_ID)) {
- return LibraryProviderFramework.getProvider(LEGACY_JPA_LIBRARY_PROVIDER_ID);
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderInstallOperation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderInstallOperation.java
deleted file mode 100644
index 2b286e642d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/LegacyJpaLibraryProviderInstallOperation.java
+++ /dev/null
@@ -1,27 +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.core.internal.facet;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperation;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-
-public class LegacyJpaLibraryProviderInstallOperation
- extends LibraryProviderOperation
-{
- @Override
- public void execute(
- LibraryProviderOperationConfig config, IProgressMonitor monitor)
- throws CoreException {
- // no op - nothing to uninstall
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/RuntimeChangedListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/RuntimeChangedListener.java
deleted file mode 100644
index 4aed10fdeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/facet/RuntimeChangedListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.eclipse.jpt.core.internal.facet;
-
-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.NullProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-
-public class RuntimeChangedListener
- implements IFacetedProjectListener {
-
- public void handleEvent(IFacetedProjectEvent facetedProjectEvent) {
-
- IFacetedProjectBase fpb = facetedProjectEvent.getWorkingCopy();
- if (fpb == null) {
- fpb = facetedProjectEvent.getProject();
- }
- IProjectFacetVersion pfv =
- fpb.getProjectFacetVersion(ProjectFacetsManager.getProjectFacet(JptCorePlugin.FACET_ID));
- if (pfv != null) {
- Map<String, Object> enablementVariables = new HashMap<String, Object>();
- enablementVariables.put(JpaLibraryProviderConstants.EXPR_VAR_JPA_PLATFORM, getJpaPlatformId(fpb.getProject()));
- LibraryInstallDelegate lp = new LibraryInstallDelegate(fpb, pfv, enablementVariables);
- try {
- lp.execute(new NullProgressMonitor());
- }
- catch (CoreException ce) {
- JptCorePlugin.log(ce);
- }
- }
- }
-
- protected String getJpaPlatformId(IProject project) {
- JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- return (jpaProject == null) ? null : jpaProject.getJpaPlatform().getId();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaDataSource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaDataSource.java
deleted file mode 100644
index e71d6b5f79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaDataSource.java
+++ /dev/null
@@ -1,232 +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.core.internal.jpa1;
-
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.AbstractJpaNode;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.db.ConnectionAdapter;
-import org.eclipse.jpt.db.ConnectionListener;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.ConnectionProfileListener;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.db.DatabaseObject;
-
-/**
- * GenericJpaDataSource
- */
-public class GenericJpaDataSource
- extends AbstractJpaNode
- implements JpaDataSource
-{
- /**
- * cache the connection profile name so we can detect when
- * it changes and notify listeners
- */
- protected String connectionProfileName;
-
- protected transient ConnectionProfile connectionProfile;
-
- /**
- * listen for the connection to be added or removed or its name changed
- */
- protected final ConnectionProfileListener connectionProfileListener;
-
- /**
- * listen for the connection to be opened or closed
- */
- protected final ConnectionListener connectionListener;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor/initialization **********
-
- public GenericJpaDataSource(JpaProject jpaProject, String connectionProfileName) {
- super(jpaProject);
- //moving the building of the connection profile before the connectionProfileListener
- //is added. Need to make sure the loading of db profiles is completed before
- //listening, otherwise we get notifications before our model is finished being built.
- //this means our updater is called before it is set which results in an IllegalStateException.
- //Hopefully this change is temporary and DTP will fix bug 246270 where I suggest they
- //not fire events when building profiles.
- this.connectionProfileName = connectionProfileName;
- this.connectionProfile = this.buildConnectionProfile(connectionProfileName);
-
- this.connectionProfileListener = this.buildConnectionProfileListener();
- this.getConnectionProfileFactory().addConnectionProfileListener(this.connectionProfileListener);
-
- this.connectionListener = this.buildConnectionListener();
- if (this.connectionProfile != null) {
- this.connectionProfile.addConnectionListener(this.connectionListener);
- }
- }
-
- protected ConnectionProfileFactory getConnectionProfileFactory() {
- return this.getJpaPlatform().getConnectionProfileFactory();
- }
-
- protected ConnectionProfileListener buildConnectionProfileListener() {
- return new LocalConnectionProfileListener();
- }
-
- protected ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
-
- // ********** JpaDataSource implementation **********
-
- public String getConnectionProfileName() {
- return this.connectionProfileName;
- }
-
- public void setConnectionProfileName(String connectionProfileName) {
- String old = this.connectionProfileName;
- this.connectionProfileName = connectionProfileName;
- if (this.attributeValueHasChanged(old, connectionProfileName)) {
- this.firePropertyChanged(CONNECTION_PROFILE_NAME_PROPERTY, old, connectionProfileName);
- // synch the connection profile when the name changes
- this.setConnectionProfile(this.buildConnectionProfile(connectionProfileName));
- JptCorePlugin.setConnectionProfileName(this.getJpaProject().getProject(), connectionProfileName);
- }
- }
-
- public ConnectionProfile getConnectionProfile() {
- return this.connectionProfile;
- }
-
- @Override
- public boolean connectionProfileIsActive() {
- ConnectionProfile cp = this.connectionProfile;
- return (cp != null) && cp.isActive();
- }
-
- @Override
- public Database getDatabase() {
- ConnectionProfile cp = this.connectionProfile;
- return (cp == null) ? null : cp.getDatabase();
- }
-
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier) {
- Database db = this.getDatabase();
- return (db == null) ? null : db.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- public void dispose() {
- if (this.connectionProfile != null) {
- this.connectionProfile.removeConnectionListener(this.connectionListener);
- }
- this.getConnectionProfileFactory().removeConnectionProfileListener(this.connectionProfileListener);
- }
-
-
- // ********** internal methods **********
-
- protected ConnectionProfile buildConnectionProfile(String name) {
- return this.getConnectionProfileFactory().buildConnectionProfile(name, this.buildDatabaseIdentifierAdapter());
- }
-
- protected DatabaseIdentifierAdapter buildDatabaseIdentifierAdapter() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildDatabaseIdentifierAdapter(this) :
- DatabaseIdentifierAdapter.Default.instance();
- }
-
- protected void setConnectionProfile(ConnectionProfile connectionProfile) {
- ConnectionProfile old = this.connectionProfile;
- if (old != null) {
- old.removeConnectionListener(this.connectionListener);
- }
- this.connectionProfile = connectionProfile;
- if (connectionProfile != null) {
- connectionProfile.addConnectionListener(this.connectionListener);
- }
- this.firePropertyChanged(CONNECTION_PROFILE_PROPERTY, old, connectionProfile);
- }
-
-
- // ********** overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.connectionProfileName);
- }
-
-
- // ********** member classes **********
-
- /**
- * Listen for a connection profile with our name being removed.
- * Also listen for our connection's name being changed.
- */
- protected class LocalConnectionProfileListener implements ConnectionProfileListener {
-
- protected LocalConnectionProfileListener() {
- super();
- }
-
- public void connectionProfileAdded(String name) {
- // check to see if a connection profile with our name was added
- // (assume our connection profile is null)
- if (GenericJpaDataSource.this.connectionProfile == null) {
- if (name.equals(GenericJpaDataSource.this.getConnectionProfileName())) {
- GenericJpaDataSource.this.setConnectionProfileName(name); // this will trigger creation of CP
- }
- }
- }
-
- public void connectionProfileRemoved(String name) {
- if (GenericJpaDataSource.this.connectionProfile == null) {
- return;
- }
- if (name.equals(GenericJpaDataSource.this.connectionProfile.getName())) {
- GenericJpaDataSource.this.setConnectionProfile(null);
- }
- }
-
- public void connectionProfileRenamed(String oldName, String newName) {
- if (GenericJpaDataSource.this.connectionProfile == null) {
- if (newName.equals(GenericJpaDataSource.this.connectionProfileName)) {
- GenericJpaDataSource.this.setConnectionProfileName(newName);
- }
- return;
- }
- // the connection profile will already have the new name,
- // we just need to synch the name held by the data source
- if (newName.equals(GenericJpaDataSource.this.connectionProfile.getName())) {
- GenericJpaDataSource.this.setConnectionProfileName(newName);
- }
- }
- }
-
-
- /**
- * Whenever the connection is opened or closed trigger a project update.
- */
- protected class LocalConnectionListener extends ConnectionAdapter {
-
- @Override
- public void opened(ConnectionProfile profile) {
- GenericJpaDataSource.this.getJpaProject().update();
- }
-
- @Override
- public void closed(ConnectionProfile profile) {
- GenericJpaDataSource.this.getJpaProject().update();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFactory.java
deleted file mode 100644
index 65c0f5237c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFactory.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1;
-
-import org.eclipse.jpt.core.internal.AbstractJpaFactory;
-
-/**
- * Generic JPA
- */
-public class GenericJpaFactory
- extends AbstractJpaFactory
-{
- public GenericJpaFactory() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFile.java
deleted file mode 100644
index 7fb2a0f7b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaFile.java
+++ /dev/null
@@ -1,150 +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.core.internal.jpa1;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.internal.AbstractJpaNode;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * The transition between a JPA project and the resource model associated
- * with a file.
- * Hold the associated root structure nodes, which are hooks to the
- * context model.
- */
-public class GenericJpaFile
- extends AbstractJpaNode
- implements JpaFile
-{
- /**
- * typically a .java or .xml file.
- */
- protected final IFile file;
-
- /**
- * cache the content type - if the content type changes, the JPA project
- * will throw out the JPA file and build a new one
- */
- protected final IContentType contentType;
-
- /**
- * the resource model corresponding to the file
- */
- protected final JpaResourceModel resourceModel;
-
- /**
- * the root structure (context model) nodes corresponding to the resource
- * model
- */
- protected final Hashtable<Object, JpaStructureNode> rootStructureNodes;
-
-
- // ********** construction **********
-
- public GenericJpaFile(JpaProject jpaProject, IFile file, IContentType contentType, JpaResourceModel resourceModel) {
- super(jpaProject);
- 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 JpaResourceModel getResourceModel() {
- return this.resourceModel;
- }
-
- public JpaResourceModel 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaProject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaProject.java
deleted file mode 100644
index 7d0c986d6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/GenericJpaProject.java
+++ /dev/null
@@ -1,28 +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.core.internal.jpa1;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.AbstractJpaProject;
-
-/**
- * Not much different from the abstract JPA project.
- */
-public class GenericJpaProject
- extends AbstractJpaProject
-{
-
- // ********** constructor/initialization **********
-
- public GenericJpaProject(JpaProject.Config config) {
- super(config);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java
deleted file mode 100644
index b39e362915..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.IdClassReference;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractPrimaryKeyValidator
- implements PrimaryKeyValidator
-{
- private TypeMapping typeMapping;
-
- private PrimaryKeyTextRangeResolver textRangeResolver;
-
-
- protected AbstractPrimaryKeyValidator(
- TypeMapping typeMapping, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- this.typeMapping = typeMapping;
- this.textRangeResolver = textRangeResolver;
- }
-
-
- protected TypeMapping typeMapping() {
- return this.typeMapping;
- }
-
- protected abstract IdClassReference idClassReference();
-
- protected PrimaryKeyTextRangeResolver textRangeResolver() {
- return this.textRangeResolver;
- }
-
- // for JPA portability, a hierarchy must define its primary key on one class
- // (entity *or* mapped superclass)
- protected void validatePrimaryKeyIsNotRedefined(List<IMessage> messages, IReporter reporter) {
- if (definesPrimaryKeyOnAncestor(typeMapping())) {
- if (idClassReference().isSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_PK_REDEFINED_ID_CLASS,
- new String[0],
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- for (AttributeMapping each : getPrimaryKeyMappingsDefinedLocally(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE,
- new String[0],
- each,
- textRangeResolver().getAttributeMappingTextRange(each.getName())));
- }
- return;
- }
- }
-
- // if a primary key defining class has multiple primary keys, it must use an id class
- protected void validateIdClassIsUsedIfNecessary(List<IMessage> messages, IReporter reporter) {
- if (! specifiesIdClass() && idClassIsRequired()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REQUIRED,
- new String[0],
- typeMapping(),
- textRangeResolver().getTypeMappingTextRange()));
- }
- }
-
- // only one composite primary key strategy may be used
- protected void validateOneOfIdClassOrEmbeddedIdIsUsed(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified()
- && CollectionTools.size(typeMapping().getAllAttributeMappings(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) > 0) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED,
- new String[0],
- typeMapping(),
- textRangeResolver().getTypeMappingTextRange()));
- }
- }
-
- // only one embedded id may be used
- protected void validateOneEmbeddedId(List<IMessage> messages, IReporter reporter) {
- if (CollectionTools.size(getEmbeddedIdMappings(typeMapping())) > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_MULTIPLE_EMBEDDED_ID,
- new String[0],
- typeMapping(),
- textRangeResolver().getTypeMappingTextRange()));
- }
- }
-
- protected void validateMapsIdMappings(List<IMessage> messages, IReporter reporter) {
- for (SingleRelationshipMapping2_0 mapsIdRelationshipMapping : getMapsIdMappingsDefinedLocally(typeMapping())) {
- // can't use maps id mappings with an id class
- if (definesIdClass(typeMapping())) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID,
- new String[] {mapsIdRelationshipMapping.getName()},
- mapsIdRelationshipMapping,
- textRangeResolver().getAttributeMappingTextRange(mapsIdRelationshipMapping.getName())));
- }
-
- AttributeMapping resolvedAttributeMapping =
- mapsIdRelationshipMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getResolvedAttributeMappingValue();
- if (resolvedAttributeMapping != null
- && ! ClassName.areAutoboxEquivalents(
- resolvedAttributeMapping.getPersistentAttribute().getTypeName(),
- getTargetEntityPrimaryKeyTypeName(mapsIdRelationshipMapping))) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE,
- new String[] {mapsIdRelationshipMapping.getName()},
- mapsIdRelationshipMapping,
- textRangeResolver().getAttributeMappingTextRange(mapsIdRelationshipMapping.getName())));
- }
- }
- }
-
- protected void validateIdClass(JavaPersistentType idClass, List<IMessage> messages, IReporter reporter) {
- // there should already be a validation error if the id class does not resolve to a class
- if (idClass == null) {
- return;
- }
-
- if (hasDerivedIdMappingMatchingIdClass(idClass)) {
- validateIdClass_derivedIdMappingMatchingIdClass(idClass, messages, reporter);
- return;
- }
- for (JavaPersistentAttribute idClassAttribute :
- new SubIterableWrapper<PersistentAttribute, JavaPersistentAttribute>(
- CollectionTools.iterable(idClass.allAttributes()))) {
- boolean foundMatch = false;
- for (AttributeMapping attributeMapping : getAttributeMappings(typeMapping())) {
- if (idClassAttribute.getName().equals(attributeMapping.getName())) {
- foundMatch = true;
-
- // the matching attribute should be a primary key
- if (! definesPrimaryKey(attributeMapping)) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY,
- new String[] {idClassAttribute.getName()},
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
-
- // the matching attribute's type should agree
- String idClassAttributeTypeName = idClassAttribute.getTypeName();
- String attributeMappingTypeName = getTypeNameForIdClass(attributeMapping);
- if (attributeMappingTypeName != null // if it's null, there should be
- // another failing validation elsewhere
- && ! ClassName.areAutoboxEquivalents(idClassAttributeTypeName, attributeMappingTypeName)) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE,
- new String[] {idClassAttribute.getName(), idClassAttributeTypeName},
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
- }
-
- if (! foundMatch) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH,
- new String[] {idClassAttribute.getName()},
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
- }
-
- protected void validateIdClass_derivedIdMappingMatchingIdClass(
- JavaPersistentType idClass, List<IMessage> messages, IReporter reporter) {
-
- Collection<AttributeMapping> errorMappings = new HashBag<AttributeMapping>();
- for (AttributeMapping each
- : new CompositeIterable<AttributeMapping>(getIdMappings(typeMapping()), getEmbeddedIdMappings(typeMapping()))) {
- errorMappings.add(each);
- }
- Collection<AttributeMapping> errorDerivedIdMappings = new HashBag<AttributeMapping>();
- for (SingleRelationshipMapping2_0 each : getDerivedIdMappings(typeMapping())) {
- if (idClass.getName().equals(getTargetEntityPrimaryKeyTypeName(each))) {
- errorDerivedIdMappings.add(each);
- }
- else {
- errorMappings.add(each);
- }
- }
- for (AttributeMapping each : errorMappings) {
- addNoIdClassAttributeMatchError(each, messages);
- }
- if (CollectionTools.size(errorDerivedIdMappings) > 1) {
- for (AttributeMapping each : errorDerivedIdMappings) {
- addDuplicateIdClassAttributeMatchError(each, messages);
- }
- }
- }
-
- protected void addNoIdClassAttributeMatchError(AttributeMapping attributeMapping, List<IMessage> messages) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH,
- new String[] {attributeMapping.getName()},
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
-
- protected void addDuplicateIdClassAttributeMatchError(AttributeMapping attributeMapping, List<IMessage> messages) {
- messages.add(DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH,
- new String[] {attributeMapping.getName()},
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
-
-
- // **************** convenience methods ********************************************************
-
- // **************** primary key overall ********************************************************
-
- /**
- * Return whether an ancestor class has defined any aspect of the primary key
- */
- protected boolean definesPrimaryKeyOnAncestor(TypeMapping typeMapping) {
- for (TypeMapping each : CollectionTools.iterable(typeMapping.inheritanceHierarchy())) {
- if (each != typeMapping && definesPrimaryKey(each)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the type mapping has defined any aspect of the primary key
- */
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
- return getIdClass(typeMapping) != null
- || ! CollectionTools.isEmpty(getPrimaryKeyMappings(typeMapping));
- }
-
- /**
- * Return true if the type mapping has defined any aspect of a complex primary key
- */
- protected boolean definesComplexPrimaryKey(TypeMapping typeMapping) {
- return definesIdClass(typeMapping)
- || getEmbeddedIdMapping(typeMapping) != null;
- }
-
- /**
- * Return the overriding type name of the primary key for the type mapping.
- * This may be
- * - type of the single simple primary key (id) attribute
- * - type of the single complex primary key (embedded id) attribute
- * - type of the id class
- * - null if none of the above are coherent (i.e. there are multiple possibilities, or the
- * primary key is invalid)
- */
- protected String getPrimaryKeyTypeName(TypeMapping typeMapping) {
- JavaPersistentType idClass = getIdClass(typeMapping);
- if (idClass != null) {
- return idClass.getName();
- }
- EmbeddedIdMapping embeddedId = getEmbeddedIdMapping(typeMapping);
- if (embeddedId != null) {
- return embeddedId.getPersistentAttribute().getTypeName();
- }
- IdMapping id = getIdMapping(typeMapping);
- if (id != null) {
- return id.getPersistentAttribute().getTypeName();
- }
- return null;
- }
-
- /**
- * Return whether the attribute mapping has defined any aspect of the primary key
- */
- protected boolean definesPrimaryKey(AttributeMapping attributeMapping) {
- String mappingKey = attributeMapping.getKey();
- if (StringTools.stringsAreEqual(mappingKey, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(mappingKey, MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY)) {
- return true;
- }
- if (StringTools.stringsAreEqual(mappingKey, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(mappingKey, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY)) {
- SingleRelationshipMapping2_0 relationshipMapping = (SingleRelationshipMapping2_0) attributeMapping;
- return (relationshipMapping.getDerivedIdentity().usesIdDerivedIdentityStrategy()
- || relationshipMapping.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy());
- }
- return false;
- }
-
-
- // **************** id class **********************************************
-
- protected boolean specifiesIdClass() {
- return idClassReference().isSpecified();
- }
-
- /**
- * Return whether an id class is defined on the class
- * NOTE: this is different from whether an id class is *specified*. If a specified id class
- * is not resolved, it is not defined. There will be a validation error to that effect.
- */
- protected boolean definesIdClass(TypeMapping typeMapping) {
- return getIdClass(typeMapping) != null;
- }
-
- /**
- * Return whether an ancestor class has defined an id class
- */
- protected boolean definesIdClassOnAncestor(TypeMapping typeMapping) {
- for (TypeMapping each : CollectionTools.iterable(typeMapping.inheritanceHierarchy())) {
- if (each != typeMapping && definesIdClass(each)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the id class to be used for the type mapping, whether that be locally
- * or on an ancestor
- */
- protected JavaPersistentType getIdClass(TypeMapping typeMapping) {
- for (Iterator<TypeMapping> stream = typeMapping.inheritanceHierarchy(); stream.hasNext(); ) {
- TypeMapping next = stream.next();
- if (next.getIdClass() != null) {
- return next.getIdClass();
- }
- }
- return null;
- }
-
-
- // **************** attribute mappings in general *************************
-
- protected Iterable<AttributeMapping> getAttributeMappings(TypeMapping typeMapping) {
- return CollectionTools.collection(typeMapping.allAttributeMappings());
- }
-
- /**
- * Return all primary key mappings, defined on and above the type mapping
- */
- protected Iterable<AttributeMapping> getPrimaryKeyMappings(TypeMapping typeMapping) {
- return new CompositeIterable<AttributeMapping>(
- getIdMappings(typeMapping),
- getEmbeddedIdMappings(typeMapping),
- getDerivedIdMappings(typeMapping),
- getMapsIdMappings(typeMapping));
- }
-
- /**
- * Return primary key mappings declared directly on the type mapping
- */
- protected Iterable<AttributeMapping> getPrimaryKeyMappingsDefinedLocally(TypeMapping typeMapping) {
- return new CompositeIterable<AttributeMapping>(
- getIdMappingsDefinedLocally(typeMapping),
- getEmbeddedIdMappingsDefinedLocally(typeMapping),
- getDerivedIdMappingsDefinedLocally(typeMapping),
- getMapsIdMappingsDefinedLocally(typeMapping));
- }
-
- protected boolean hasAnyPrimaryKeyMappings(TypeMapping typeMapping) {
- return ! CollectionTools.isEmpty(getPrimaryKeyMappings(typeMapping));
- }
-
- // **************** id mappings *******************************************
-
- protected IdMapping getIdMapping(TypeMapping typeMapping) {
- Iterable<IdMapping> idMappings = getIdMappings(typeMapping);
- if (CollectionTools.size(idMappings) == 1) {
- return idMappings.iterator().next();
- }
- return null;
- }
-
- protected Iterable<IdMapping> getIdMappings(TypeMapping typeMapping) {
- return new SubIterableWrapper<AttributeMapping, IdMapping>(
- typeMapping.getAllAttributeMappings(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- }
-
- protected Iterable<IdMapping> getIdMappingsDefinedLocally(TypeMapping typeMapping) {
- return new SubIterableWrapper<AttributeMapping, IdMapping>(
- typeMapping.getAttributeMappings(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- // **************** embedded id mappings **********************************
-
- /**
- * Return whether an embedded id is defined for this class, whether that be locally
- * or on an ancestor
- */
- protected boolean definesEmbeddedIdMapping(TypeMapping typeMapping) {
- return ! CollectionTools.isEmpty(getEmbeddedIdMappings(typeMapping));
- }
-
- protected EmbeddedIdMapping getEmbeddedIdMapping(TypeMapping typeMapping) {
- Iterable<EmbeddedIdMapping> embeddedIdMappings = getEmbeddedIdMappings(typeMapping);
- if (CollectionTools.size(embeddedIdMappings) == 1) {
- return embeddedIdMappings.iterator().next();
- }
- return null;
- }
-
- protected Iterable<EmbeddedIdMapping> getEmbeddedIdMappings(TypeMapping typeMapping) {
- return new SubIterableWrapper<AttributeMapping, EmbeddedIdMapping>(
- typeMapping.getAllAttributeMappings(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- }
-
- protected Iterable<EmbeddedIdMapping> getEmbeddedIdMappingsDefinedLocally(TypeMapping typeMapping) {
- return new SubIterableWrapper<AttributeMapping, EmbeddedIdMapping>(
- typeMapping.getAttributeMappings(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- // **************** derived id mappings ***********************************
-
- protected Iterable<SingleRelationshipMapping2_0> getDerivedIdMappings(TypeMapping typeMapping) {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- typeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- typeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesIdDerivedIdentityStrategy();
- }
- };
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getDerivedIdMappingsDefinedLocally(TypeMapping typeMapping) {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- typeMapping.getAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- typeMapping.getAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // **************** maps id mappings **************************************
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdMappings(TypeMapping typeMapping) {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- typeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- typeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdMappingsDefinedLocally(TypeMapping typeMapping) {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- typeMapping.getAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- typeMapping.getAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // **************** misc **************************************************
-
- /**
- * Return whether an id class is required for this class
- */
- protected boolean idClassIsRequired() {
- // An id class is required if
- // - there are multiple "simple" primary key mappings
- // - or there is at least one "complex" primary key mapping
- // A simple primary key mapping can be
- // - an id mapping
- // - a derived id relationship mapping to an entity with a simple primary key
- // A complex primary key mapping can be
- // - a derived id relationship mapping to an entity with a complex primary key
- int simplePrimaryKeyMappingCount =
- CollectionTools.size(getIdMappings(typeMapping()));
- if (simplePrimaryKeyMappingCount > 1) {
- return true;
- }
- for (SingleRelationshipMapping2_0 relationshipMapping : getDerivedIdMappings(typeMapping())) {
- Entity entity = relationshipMapping.getResolvedTargetEntity();
- if (entity != null) {
- if (definesComplexPrimaryKey(entity)) {
- return true;
- }
- else {
- simplePrimaryKeyMappingCount++;
- }
- if (simplePrimaryKeyMappingCount > 1) {
- return true;
- }
- }
- }
- return false;
- }
-
- protected boolean hasDerivedIdMappingMatchingIdClass(JavaPersistentType idClass) {
- for (SingleRelationshipMapping2_0 each : getDerivedIdMappings(typeMapping())) {
- String primaryKeyTypeName = getTargetEntityPrimaryKeyTypeName(each);
- if (idClass.getName().equals(primaryKeyTypeName)) {
- return true;
- }
- }
- return false;
- }
-
- protected String getTargetEntityPrimaryKeyTypeName(SingleRelationshipMapping2_0 relationshipMapping) {
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity != null) {
- return getPrimaryKeyTypeName(targetEntity);
- }
- return null;
- }
-
- protected String getTypeNameForIdClass(AttributeMapping attributeMapping) {
- if (StringTools.stringsAreEqual(attributeMapping.getKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(attributeMapping.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) {
- return attributeMapping.getPersistentAttribute().getTypeName();
- }
- if (StringTools.stringsAreEqual(attributeMapping.getKey(), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(attributeMapping.getKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY)) {
- SingleRelationshipMapping2_0 relationshipMapping = (SingleRelationshipMapping2_0) attributeMapping;
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity != null) {
- return getPrimaryKeyTypeName(targetEntity);
- }
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericEntityPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericEntityPrimaryKeyValidator.java
deleted file mode 100644
index 82eb610503..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericEntityPrimaryKeyValidator.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.core.internal.jpa1.context;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.IdClassReference;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericEntityPrimaryKeyValidator
- extends AbstractPrimaryKeyValidator
-{
- public GenericEntityPrimaryKeyValidator(Entity entity, PrimaryKeyTextRangeResolver textRangeResolver) {
- super(entity, textRangeResolver);
- }
-
-
- protected Entity entity() {
- return (Entity) this.typeMapping();
- }
-
- @Override
- protected IdClassReference idClassReference() {
- return entity().getIdClassReference();
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- // if an entity is non-root, it is not allowed to define primary keys
- if (! entity().isRoot()) {
- validatePrimaryKeyForNonRoot(messages, reporter);
- }
- else {
- validatePrimaryKeyForRoot(messages, reporter);
- }
- }
-
- protected void validatePrimaryKeyForNonRoot(List<IMessage> messages, IReporter reporter) {
- validateNonRootEntityDoesNotSpecifyIdClass(messages, reporter);
- validateNonRootEntityDoesNotSpecifyPrimaryKeyAttributes(messages, reporter);
- }
-
- protected void validatePrimaryKeyForRoot(List<IMessage> messages, IReporter reporter) {
- validatePrimaryKeyIsNotRedefined(messages, reporter);
- validateIdClassIsUsedIfNecessary(messages, reporter);
-
- // if the primary key is not defined on an ancestor, it must be defined here
- if (! definesPrimaryKey(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NO_PK,
- new String[0],
- entity(),
- textRangeResolver().getTypeMappingTextRange()));
- }
-
- // if primary key is composite, it may either use an id class or embedded id, not both
- validateOneOfIdClassOrEmbeddedIdIsUsed(messages, reporter);
- // ... and only one embedded id
- validateOneEmbeddedId(messages, reporter);
-
- validateMapsIdMappings(messages, reporter);
-
- if (specifiesIdClass()) {
- validateIdClass(idClassReference().getIdClass(), messages, reporter);
- }
- }
-
- protected void validateNonRootEntityDoesNotSpecifyIdClass(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NON_ROOT_ID_CLASS_SPECIFIED,
- new String[0],
- entity(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
-
- protected void validateNonRootEntityDoesNotSpecifyPrimaryKeyAttributes(List<IMessage> messages, IReporter reporter) {
- for (AttributeMapping each : getPrimaryKeyMappingsDefinedLocally(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED,
- new String[0],
- each,
- textRangeResolver().getAttributeMappingTextRange(each.getName())));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericMappedSuperclassPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericMappedSuperclassPrimaryKeyValidator.java
deleted file mode 100644
index 55fe5150c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericMappedSuperclassPrimaryKeyValidator.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.core.internal.jpa1.context;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.IdClassReference;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericMappedSuperclassPrimaryKeyValidator
- extends AbstractPrimaryKeyValidator
-{
- public GenericMappedSuperclassPrimaryKeyValidator(
- MappedSuperclass mappedSuperclass, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- super(mappedSuperclass, textRangeResolver);
- }
-
-
- protected MappedSuperclass mappedSuperclass() {
- return (MappedSuperclass) this.typeMapping();
- }
-
- @Override
- protected IdClassReference idClassReference() {
- return mappedSuperclass().getIdClassReference();
- }
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- validatePrimaryKeyIsNotRedefined(messages, reporter);
- validateIdClassIsUsedIfNecessary(messages, reporter);
-
- // if primary key is composite, it may either use an id class or embedded id, not both
- validateOneOfIdClassOrEmbeddedIdIsUsed(messages, reporter);
- // ... and only one embedded id
- validateOneEmbeddedId(messages, reporter);
-
- if (specifiesIdClass()) {
- validateIdClass(idClassReference().getIdClass(), messages, reporter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericRootContextNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericRootContextNode.java
deleted file mode 100644
index 1625ac7ff4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/GenericRootContextNode.java
+++ /dev/null
@@ -1,282 +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.core.internal.jpa1.context;
-
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.JpaRootContextNode2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceXml2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-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;
-
-/**
- * the context model root
- */
-public class GenericRootContextNode
- extends AbstractJpaContextNode
- implements JpaRootContextNode2_0
-{
- /* This object has no parent, so it must point to the JPA project explicitly. */
- protected final JpaProject jpaProject;
-
- /* Main context object. */
- protected PersistenceXml persistenceXml;
-
-
- public GenericRootContextNode(JpaProject jpaProject) {
- super(null); // the JPA project is not really a "parent"...
- if (jpaProject == null) {
- throw new NullPointerException();
- }
- this.jpaProject = jpaProject;
- this.initialize();
- }
-
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- protected void initialize() {
- JpaXmlResource resource = this.resolvePersistenceXmlResource();
- if (resource != null) {
- this.persistenceXml = this.buildPersistenceXml(resource);
- }
- }
-
- public void update(IProgressMonitor monitor) {
- JpaXmlResource xmlResource = this.resolvePersistenceXmlResource();
- if (xmlResource == null) {
- if (this.persistenceXml != null) {
- this.persistenceXml.dispose();
- this.setPersistenceXml(null);
- }
- } else {
- if (this.persistenceXml == null) {
- this.setPersistenceXml(this.buildPersistenceXml(xmlResource));
- } else {
- this.persistenceXml.update();
- }
- }
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.persistenceXml != null) {
- this.persistenceXml.postUpdate();
- }
- }
-
-
- // ********** AbstractJpaNode overrides **********
-
- @Override
- public JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
- @Override
- public IResource getResource() {
- return this.getProject();
- }
-
- protected IProject getProject() {
- return this.jpaProject.getProject();
- }
-
-
- // ********** AbstractJpaContextNode overrides **********
-
- @Override
- public PersistenceUnit getPersistenceUnit() {
- return null;
- }
-
- @Override
- public MappingFileRoot getMappingFileRoot() {
- return null;
- }
-
-
- // ********** persistence.xml **********
-
- public PersistenceXml getPersistenceXml() {
- return this.persistenceXml;
- }
-
- protected void setPersistenceXml(PersistenceXml persistenceXml) {
- PersistenceXml old = this.persistenceXml;
- this.persistenceXml = persistenceXml;
- this.firePropertyChanged(PERSISTENCE_XML_PROPERTY, old, persistenceXml);
- }
-
- protected JpaXmlResource resolvePersistenceXmlResource() {
- JpaXmlResource xmlResource = this.jpaProject.getPersistenceXmlResource();
- if (xmlResource == null) {
- return null;
- }
- if (xmlResource.isReverting()) {
- // 308254 - this can happen when persistence.xml is closed without saving;
- // the model is completely whacked in another thread - so wipe our model(?)
- return null;
- }
- JpaResourceType resourceType = xmlResource.getResourceType();
- if (resourceType == null) {
- return null;
- }
- if ( ! this.getJpaPlatform().supportsResourceType(resourceType)) {
- return null;
- }
- return xmlResource;
- }
-
- protected PersistenceXml buildPersistenceXml(JpaXmlResource resource) {
- return this.getJpaFactory().buildPersistenceXml(this, resource);
- }
-
-
- // ********** metamodel **********
-
- public void initializeMetamodel() {
- if (this.persistenceXml != null) {
- ((PersistenceXml2_0) this.persistenceXml).initializeMetamodel();
- }
- }
-
- public void synchronizeMetamodel() {
- if (this.persistenceXml != null) {
- ((PersistenceXml2_0) this.persistenceXml).synchronizeMetamodel();
- }
- }
-
- public void disposeMetamodel() {
- if (this.persistenceXml != null) {
- ((PersistenceXml2_0) this.persistenceXml).disposeMetamodel();
- }
- }
-
-
- // ********** validation **********
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
-
- if (this.persistenceXml == null) {
- messages.add(buildPersistenceXmlValidationMessage());
- return;
- }
- if ( ! this.jpaProject.discoversAnnotatedClasses()) {
- this.validateOrphanClasses(messages);
- }
- this.persistenceXml.validate(messages, reporter);
- }
-
- protected IMessage buildPersistenceXmlValidationMessage() {
- int severity = IMessage.HIGH_SEVERITY;
- IFile file = getPlatformFile();
- if (file.exists()) {
- JpaXmlResource xmlResource = this.jpaProject.getPersistenceXmlResource();
- if (xmlResource != null
- && ! getJpaPlatform().supportsResourceType(xmlResource.getResourceType())) {
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PERSISTENCE_XML_UNSUPPORTED_CONTENT,
- file);
- }
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT,
- file);
- }
- return DefaultJpaValidationMessages.buildMessage(
- severity,
- JpaValidationMessages.PROJECT_NO_PERSISTENCE_XML,
- this);
- }
-
- protected IFile getPlatformFile() {
- return this.jpaProject.convertToPlatformFile(JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH);
- }
-
- protected void validateOrphanClasses(List<IMessage> messages) {
- Persistence persistence = this.persistenceXml.getPersistence();
- if (persistence == null) {
- return; // handled with other validation
- }
- if (persistence.persistenceUnitsSize() != 1) {
- return; // the context model currently only supports 1 persistence unit
- }
-
- PersistenceUnit persistenceUnit = persistence.persistenceUnits().next();
- HashBag<String> annotatedClassNames = CollectionTools.bag(this.jpaProject.annotatedJavaSourceClassNames());
- HashBag<String> orphans = annotatedClassNames.clone();
- for (String annotatedClassName : annotatedClassNames) {
- if (persistenceUnit.specifiesPersistentType(annotatedClassName)) {
- orphans.remove(annotatedClassName);
- }
- }
-
- // TODO remove 'jrcu'
- // replace jrcu.getFile() with jrpt.getFile()
- // replace jrpt.getMappingAnnotation().getTextRange(jrcu.buildASTRoot())
- // with jrpt.getMappingAnnotation().getTextRange()
- // (new method #getTextRange() ?)
- for (String orphan : orphans) {
- JavaResourcePersistentType jrpt = this.jpaProject.getJavaResourcePersistentType(orphan);
- JavaResourceCompilationUnit jrcu = jrpt.getJavaResourceCompilationUnit();
- if (jrpt.isMapped()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT,
- new String[] {jrpt.getName()},
- jrpt.getFile(),
- jrpt.getNameTextRange(jrcu.buildASTRoot())
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT,
- new String[] {jrpt.getName()},
- jrpt.getFile(),
- jrpt.getNameTextRange(jrcu.buildASTRoot())
- )
- );
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJarFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJarFile.java
deleted file mode 100644
index f25606219d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJarFile.java
+++ /dev/null
@@ -1,211 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JarFile;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.internal.context.AbstractJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-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;
-
-/**
- * Context JAR file
- */
-public class GenericJarFile
- extends AbstractJpaContextNode
- implements JarFile, PersistentType.Owner
-{
- protected JavaResourcePackageFragmentRoot jarResourcePackageFragmentRoot;
- protected final Vector<JavaPersistentType> javaPersistentTypes = new Vector<JavaPersistentType>();
-
-
- // ********** constructor/initialization **********
-
- public GenericJarFile(JarFileRef parent, JavaResourcePackageFragmentRoot jarResourcePackageFragmentRoot) {
- super(parent);
- this.jarResourcePackageFragmentRoot = jarResourcePackageFragmentRoot;
- CollectionTools.addAll(this.javaPersistentTypes, this.buildJavaPersistentTypes());
- }
-
- protected Iterator<JavaPersistentType> buildJavaPersistentTypes() {
- return new TransformationIterator<JavaResourcePersistentType, JavaPersistentType>(this.javaResourcePersistentTypes()) {
- @Override
- protected JavaPersistentType transform(JavaResourcePersistentType jrpt) {
- return GenericJarFile.this.buildJavaPersistentType(jrpt);
- }
- };
- }
-
- /**
- * the resource JAR holds only annotated types, so we can use them all for
- * building the context types
- */
- protected Iterator<JavaResourcePersistentType> javaResourcePersistentTypes() {
- return this.jarResourcePackageFragmentRoot.persistentTypes();
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType jrpt) {
- return this.getJpaFactory().buildJavaPersistentType(this, jrpt);
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return null;
- }
-
- @Override
- public JpaResourceType getResourceType() {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
-
- public TextRange getSelectionTextRange() {
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return null;
- }
-
- public void dispose() {
- // nothing yet
- }
-
-
- // ********** JarFile implementation **********
-
- public JavaPersistentType getPersistentType(String typeName) {
- for (JavaPersistentType pt : this.getJavaPersistentTypes()) {
- if (pt.getName().equals(typeName)) {
- return pt;
- }
- }
- return null;
- }
-
- public Iterator<JavaPersistentType> javaPersistentTypes() {
- return this.getJavaPersistentTypes().iterator();
- }
-
- protected Iterable<JavaPersistentType> getJavaPersistentTypes() {
- return new LiveCloneIterable<JavaPersistentType>(this.javaPersistentTypes);
- }
-
- public int javaPersistentTypesSize() {
- return this.javaPersistentTypes.size();
- }
-
- protected JavaPersistentType addJavaPersistentType(JavaResourcePersistentType jrpt) {
- JavaPersistentType javaPersistentType = this.buildJavaPersistentType(jrpt);
- this.addItemToCollection(javaPersistentType, this.javaPersistentTypes, JAVA_PERSISTENT_TYPES_COLLECTION);
- return javaPersistentType;
- }
-
- protected void removeJavaPersistentType(JavaPersistentType javaPersistentType ) {
- this.removeItemFromCollection(javaPersistentType, this.javaPersistentTypes, JAVA_PERSISTENT_TYPES_COLLECTION);
- }
-
-
- // ********** PersistentTypeContainer implementation **********
-
- public Iterable<? extends PersistentType> getPersistentTypes() {
- return this.getJavaPersistentTypes();
- }
-
-
- // ********** PersistentType.Owner implementation **********
-
- public AccessType getDefaultPersistentTypeAccess() {
- return this.getPersistenceUnit().getDefaultAccess();
- }
-
- public AccessType getOverridePersistentTypeAccess() {
- // no access type at this level overrides any local access type specification
- return null;
- }
-
-
- // ********** JpaNode implementation **********
-
- @Override
- public IResource getResource() {
- return this.jarResourcePackageFragmentRoot.getFile();
- }
-
-
- // ********** updating **********
-
- public void update(JavaResourcePackageFragmentRoot jrpfr) {
- this.jarResourcePackageFragmentRoot = jrpfr;
- this.updateJavaPersistentTypes();
- }
-
- protected void updateJavaPersistentTypes() {
- HashBag<JavaPersistentType> contextTypesToRemove = CollectionTools.bag(this.javaPersistentTypes(), this.javaPersistentTypes.size());
- ArrayList<JavaPersistentType> contextTypesToUpdate = new ArrayList<JavaPersistentType>(this.javaPersistentTypes.size());
-
- for (Iterator<JavaResourcePersistentType> resourceTypes = this.javaResourcePersistentTypes(); resourceTypes.hasNext(); ) {
- JavaResourcePersistentType resourceType = resourceTypes.next();
- boolean match = false;
- for (Iterator<JavaPersistentType> contextTypes = contextTypesToRemove.iterator(); contextTypes.hasNext(); ) {
- JavaPersistentType contextType = contextTypes.next();
- if (contextType.getResourcePersistentType() == resourceType) {
- contextTypes.remove();
- contextTypesToUpdate.add(contextType);
- match = true;
- break;
- }
- }
- if ( ! match) {
- this.addJavaPersistentType(resourceType);
- }
- }
- for (JavaPersistentType contextType : contextTypesToRemove) {
- this.removeJavaPersistentType(contextType);
- }
- // handle adding and removing java persistent types first, update the
- // remaining java persistent types last; this reduces the churn during "update"
- for (JavaPersistentType contextType : contextTypesToUpdate) {
- contextType.update();
- }
- }
-
-
- // ********** validation **********
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- if (reporter.isCancelled()) {
- throw new ValidationCancelledException();
- }
- // TODO validate 'javaPersistentTypes'
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverride.java
deleted file mode 100644
index a52f96ecf1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverride.java
+++ /dev/null
@@ -1,100 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOverride;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAssociationOverride extends AbstractJavaOverride
- implements JavaAssociationOverride
-{
-
- protected final JavaAssociationOverrideRelationshipReference relationshipReference;
-
- public GenericJavaAssociationOverride(JavaAssociationOverrideContainer parent, JavaAssociationOverride.Owner owner) {
- super(parent, owner);
- this.relationshipReference = buildRelationshipReference();
- }
-
- public void initializeFrom(AssociationOverride oldAssociationOverride) {
- this.setName(oldAssociationOverride.getName());
- this.relationshipReference.initializeFrom(oldAssociationOverride.getRelationshipReference());
- }
-
- protected JavaAssociationOverrideRelationshipReference buildRelationshipReference() {
- return getJpaFactory().buildJavaAssociationOverrideRelationshipReference(this);
- }
-
- public JavaAssociationOverrideRelationshipReference getRelationshipReference() {
- return this.relationshipReference;
- }
-
- @Override
- public JavaAssociationOverride setVirtual(boolean virtual) {
- return (JavaAssociationOverride) super.setVirtual(virtual);
- }
-
- @Override
- public AssociationOverrideAnnotation getOverrideAnnotation() {
- return (AssociationOverrideAnnotation) super.getOverrideAnnotation();
- }
-
- @Override
- public JavaAssociationOverride.Owner getOwner() {
- return (JavaAssociationOverride.Owner) super.getOwner();
- }
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.getOwner().allOverridableAttributeNames();
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.relationshipReference.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- public void initialize(AssociationOverrideAnnotation associationOverride) {
- super.initialize(associationOverride);
- this.relationshipReference.initialize(associationOverride);
- }
-
- public void update(AssociationOverrideAnnotation associationOverride) {
- super.update(associationOverride);
- this.relationshipReference.update(associationOverride);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.relationshipReference.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java
deleted file mode 100644
index 552a6aa8f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java
+++ /dev/null
@@ -1,445 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAssociationOverrideContainer extends AbstractJavaJpaContextNode
- implements JavaAssociationOverrideContainer
-{
- protected JavaResourcePersistentMember javaResourcePersistentMember;
-
- protected final JavaAssociationOverrideContainer.Owner owner;
-
- protected final List<JavaAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<JavaAssociationOverride> virtualAssociationOverrides;
-
- public GenericJavaAssociationOverrideContainer(JavaJpaContextNode parent, JavaAssociationOverrideContainer.Owner owner) {
- super(parent);
- this.owner = owner;
- this.specifiedAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- this.virtualAssociationOverrides = new ArrayList<JavaAssociationOverride>();
- }
-
- protected Owner getOwner() {
- return this.owner;
- }
-
- public JavaAssociationOverride getAssociationOverrideNamed(String name) {
- return (JavaAssociationOverride) getOverrideNamed(name, associationOverrides());
- }
-
- public boolean containsAssociationOverride(String name) {
- return containsOverride(name, associationOverrides());
- }
-
- public boolean containsSpecifiedAssociationOverride(String name) {
- return containsOverride(name, specifiedAssociationOverrides());
- }
-
- public boolean containsDefaultAssociationOverride(String name) {
- return containsOverride(name, virtualAssociationOverrides());
- }
-
- protected BaseOverride getOverrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- protected boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return getOverrideNamed(name, overrides) != null;
- }
-
- protected Iterator<String> allOverridableAssociationNames() {
- return getOwner().allOverridableNames();
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAssociationOverride> associationOverrides() {
- return new CompositeListIterator<JavaAssociationOverride>(specifiedAssociationOverrides(), virtualAssociationOverrides());
- }
-
- public int associationOverridesSize() {
- return this.specifiedAssociationOverridesSize() + this.virtualAssociationOverridesSize();
- }
-
- public ListIterator<JavaAssociationOverride> virtualAssociationOverrides() {
- return new CloneListIterator<JavaAssociationOverride>(this.virtualAssociationOverrides);
- }
-
- public int virtualAssociationOverridesSize() {
- return this.virtualAssociationOverrides.size();
- }
-
- public ListIterator<JavaAssociationOverride> specifiedAssociationOverrides() {
- return new CloneListIterator<JavaAssociationOverride>(this.specifiedAssociationOverrides);
- }
-
- public int specifiedAssociationOverridesSize() {
- return this.specifiedAssociationOverrides.size();
- }
-
- public JavaAssociationOverride addSpecifiedAssociationOverride(int index) {
- JavaAssociationOverride associationOverride = getJpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- this.specifiedAssociationOverrides.add(index, associationOverride);
- AssociationOverrideAnnotation associationOverrideResource =
- (AssociationOverrideAnnotation) this.javaResourcePersistentMember.addAnnotation(
- index, AssociationOverrideAnnotation.ANNOTATION_NAME,
- AssociationOverridesAnnotation.ANNOTATION_NAME);
- associationOverride.initialize(associationOverrideResource);
- this.fireItemAdded(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- return associationOverride;
- }
-
- protected JavaAssociationOverride.Owner createAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- protected void addSpecifiedAssociationOverride(int index, JavaAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.specifiedAssociationOverrides, SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAssociationOverride(JavaAssociationOverride associationOverride) {
- this.addSpecifiedAssociationOverride(this.specifiedAssociationOverrides.size(), associationOverride);
- }
-
- protected void removeSpecifiedAssociationOverride_(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.javaResourcePersistentMember.moveAnnotation(
- targetIndex, sourceIndex, AssociationOverridesAnnotation.ANNOTATION_NAME);
- fireItemMoved(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected JavaAssociationOverride setAssociationOverrideVirtual(boolean virtual, JavaAssociationOverride associationOverride) {
- // Add a new attribute override
- if (virtual) {
- return setAssociationOverrideVirtual(associationOverride);
- }
- return setAssociationOverrideSpecified(associationOverride);
- }
-
- protected JavaAssociationOverride setAssociationOverrideVirtual(JavaAssociationOverride associationOverride) {
- int index = this.specifiedAssociationOverrides.indexOf(associationOverride);
- this.specifiedAssociationOverrides.remove(index);
- String associationOverrideName = associationOverride.getName();
- //add the virtual attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the update. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAssociationOverride virtualAssociationOverride = null;
- if (associationOverrideName != null) {
- for (String name : CollectionTools.iterable(allOverridableAssociationNames())) {
- if (name.equals(associationOverrideName)) {
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAssociationOverride = buildVirtualAssociationOverride(name);
- this.virtualAssociationOverrides.add(virtualAssociationOverride);
- break;
- }
- }
- }
-
- this.javaResourcePersistentMember.removeAnnotation(
- index, AssociationOverrideAnnotation.ANNOTATION_NAME,
- AssociationOverridesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
-
- if (virtualAssociationOverride != null) {
- fireItemAdded(VIRTUAL_ASSOCIATION_OVERRIDES_LIST, virtualAssociationOverridesSize() - 1, virtualAssociationOverride);
- }
- return virtualAssociationOverride;
- }
-
- protected JavaAssociationOverride setAssociationOverrideSpecified(JavaAssociationOverride oldAssociationOverride) {
- int index = specifiedAssociationOverridesSize();
- JavaAssociationOverride newAssociationOverride = getJpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- this.specifiedAssociationOverrides.add(index, newAssociationOverride);
-
- AssociationOverrideAnnotation attributeOverrideResource =
- (AssociationOverrideAnnotation) this.javaResourcePersistentMember.addAnnotation(
- index, AssociationOverrideAnnotation.ANNOTATION_NAME,
- AssociationOverridesAnnotation.ANNOTATION_NAME);
- newAssociationOverride.initialize(attributeOverrideResource);
-
- int virtualIndex = this.virtualAssociationOverrides.indexOf(oldAssociationOverride);
- this.virtualAssociationOverrides.remove(virtualIndex);
-
- newAssociationOverride.initializeFrom(oldAssociationOverride);
-
- this.fireItemRemoved(VIRTUAL_ASSOCIATION_OVERRIDES_LIST, virtualIndex, oldAssociationOverride);
- this.fireItemAdded(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, newAssociationOverride);
-
- return newAssociationOverride;
- }
-
- protected void addVirtualAssociationOverride(JavaAssociationOverride associationOverride) {
- addItemToList(associationOverride, this.virtualAssociationOverrides, VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAssociationOverride(JavaAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.virtualAssociationOverrides, VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
-
-
- public void initialize(JavaResourcePersistentMember resourcePersistentMember) {
- this.javaResourcePersistentMember = resourcePersistentMember;
- this.initializeSpecifiedAssociationOverrides();
- this.initializeVirtualAssociationOverrides();
- }
-
- protected void initializeSpecifiedAssociationOverrides() {
- for (Iterator<NestableAnnotation> stream = this.relavantResourceAssociationOverrides(); stream.hasNext(); ) {
- this.specifiedAssociationOverrides.add(
- buildAssociationOverride((AssociationOverrideAnnotation) stream.next()));
- }
- }
-
- protected void initializeVirtualAssociationOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAssociationNames())) {
- JavaAssociationOverride associationOverride = getAssociationOverrideNamed(name);
- if (associationOverride == null) {
- this.virtualAssociationOverrides.add(buildVirtualAssociationOverride(name));
- }
- }
- }
-
- public void update(JavaResourcePersistentMember resourcePersistentMember) {
- this.javaResourcePersistentMember = resourcePersistentMember;
- this.updateSpecifiedAssociationOverrides();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
-
- //In postUpdate because the joiningStrategy is not initialized on relationship mappings.
- //if we fix the issue that we do not initialize java mappings, but they instead get initialized
- //during the first update, then we can probably move this.
- updateVirtualAssociationOverrides();
- }
-
-
- protected void updateSpecifiedAssociationOverrides() {
- ListIterator<JavaAssociationOverride> associationOverrides = specifiedAssociationOverrides();
- Iterator<NestableAnnotation> resourceAssociationOverrides = this.relavantResourceAssociationOverrides();
-
- while (associationOverrides.hasNext()) {
- JavaAssociationOverride associationOverride = associationOverrides.next();
- if (resourceAssociationOverrides.hasNext()) {
- associationOverride.update((AssociationOverrideAnnotation) resourceAssociationOverrides.next());
- }
- else {
- removeSpecifiedAssociationOverride_(associationOverride);
- }
- }
-
- while (resourceAssociationOverrides.hasNext()) {
- addSpecifiedAssociationOverride(buildAssociationOverride((AssociationOverrideAnnotation) resourceAssociationOverrides.next()));
- }
- }
- protected Iterator<NestableAnnotation> relavantResourceAssociationOverrides() {
- Iterator<NestableAnnotation> resourceAssociationOverrides =
- this.javaResourcePersistentMember.annotations(
- AssociationOverrideAnnotation.ANNOTATION_NAME,
- AssociationOverridesAnnotation.ANNOTATION_NAME);
-
- return new FilteringIterator<NestableAnnotation>(resourceAssociationOverrides) {
- @Override
- protected boolean accept(NestableAnnotation o) {
- String overrideName = ((AssociationOverrideAnnotation) o).getName();
- return overrideName != null && getOwner().isRelevant(overrideName);
- }
- };
- }
-
-
- protected JavaAssociationOverride buildAssociationOverride(AssociationOverrideAnnotation associationOverrideResource) {
- JavaAssociationOverride associationOverride = getJpaFactory().buildJavaAssociationOverride(this, createAssociationOverrideOwner());
- associationOverride.initialize(associationOverrideResource);
- return associationOverride;
- }
-
- protected JavaAssociationOverride buildVirtualAssociationOverride(String name) {
- return buildAssociationOverride(buildVirtualAssociationOverrideAnnotation(name));
- }
-
- protected AssociationOverrideAnnotation buildVirtualAssociationOverrideAnnotation(String name) {
- RelationshipReference relationshipReference = this.resolveAssociationOverrideRelationshipReference(name);
- return getJpaFactory().buildJavaVirtualAssociationOverrideAnnotation(this.javaResourcePersistentMember, name, relationshipReference.getPredominantJoiningStrategy());
- }
-
- private RelationshipReference resolveAssociationOverrideRelationshipReference(String associationOverrideName) {
- return getOwner().resolveRelationshipReference(associationOverrideName);
- }
-
- protected void updateVirtualAssociationOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAssociationNames())) {
- JavaAssociationOverride associationOverride = getAssociationOverrideNamed(name);
- if (associationOverride == null) {
- addVirtualAssociationOverride(buildVirtualAssociationOverride(name));
- }
- else if (associationOverride.isVirtual()) {
- associationOverride.update(buildVirtualAssociationOverrideAnnotation(name));
- }
- }
-
- Collection<String> associationNames = CollectionTools.collection(allOverridableAssociationNames());
-
- //remove any default mappings that are not included in the associationNames collection
- for (JavaAssociationOverride associationOverride : CollectionTools.iterable(virtualAssociationOverrides())) {
- if (!associationNames.contains(associationOverride.getName())
- || containsSpecifiedAssociationOverride(associationOverride.getName())) {
- removeVirtualAssociationOverride(associationOverride);
- }
- }
- }
-
-
- //******************** Code Completion *************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaAssociationOverride override : CollectionTools.iterable(this.associationOverrides())) {
- result = override.javaCompletionProposals(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);
-
- for (Iterator<JavaAssociationOverride> stream = this.associationOverrides(); stream.hasNext();) {
- stream.next().validate(messages, reporter, astRoot);
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getOwner().getValidationTextRange(astRoot);
- }
-
-
- // ********** association override owner **********
-
- protected class AssociationOverrideOwner implements JavaAssociationOverride.Owner {
-
- public RelationshipMapping getRelationshipMapping(String attributeName) {
- return MappingTools.getRelationshipMapping(attributeName, getOwner().getOverridableTypeMapping());
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaAssociationOverrideContainer.this.virtualAssociationOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride attributeOverride) {
- return GenericJavaAssociationOverrideContainer.this.setAssociationOverrideVirtual(virtual, (JavaAssociationOverride) attributeOverride);
- }
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return GenericJavaAssociationOverrideContainer.this.allOverridableAssociationNames();
- }
-
- public String getPossiblePrefix() {
- return getOwner().getPossiblePrefix();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public String getDefaultTableName() {
- return getOwner().getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedReferencedColumnNameMessage(override, column, textRange);
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(override, column, textRange);
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override, column, textRange);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideRelationshipReference.java
deleted file mode 100644
index 9c18c1ee73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideRelationshipReference.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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAssociationOverrideRelationshipReference;
-
-public class GenericJavaAssociationOverrideRelationshipReference extends AbstractJavaAssociationOverrideRelationshipReference
-{
-
- public GenericJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent) {
- super(parent);
- }
-
- public void initializeFrom(AssociationOverrideRelationshipReference oldAssociationOverride) {
- if (oldAssociationOverride.getJoinColumnJoiningStrategy().hasSpecifiedJoinColumns()) {
- getJoinColumnJoiningStrategy().initializeFrom(oldAssociationOverride.getJoinColumnJoiningStrategy());
- }
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverride.java
deleted file mode 100644
index 9ccff4bc9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverride.java
+++ /dev/null
@@ -1,254 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOverride;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.AttributeOverride2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeOverride
- extends AbstractJavaOverride
- implements AttributeOverride2_0, JavaAttributeOverride
-{
- protected final JavaColumn column;
-
- /* 2.0 feature - a relationship may map this attribute override */
- protected boolean mappedByRelationship;
-
-
- public GenericJavaAttributeOverride(
- JavaAttributeOverrideContainer parent,
- JavaAttributeOverride.Owner owner) {
-
- super(parent, owner);
- this.column = getJpaFactory().buildJavaColumn(this, this);
- }
-
-
- @Override
- public JavaAttributeOverride setVirtual(boolean virtual) {
- return (JavaAttributeOverride) super.setVirtual(virtual);
- }
-
- @Override
- public AttributeOverrideAnnotation getOverrideAnnotation() {
- return (AttributeOverrideAnnotation) super.getOverrideAnnotation();
- }
-
- @Override
- public JavaAttributeOverride.Owner getOwner() {
- return (JavaAttributeOverride.Owner) super.getOwner();
- }
-
- public ColumnAnnotation getResourceColumn() {
- return this.getOverrideAnnotation().getNonNullColumn();
- }
-
- public ColumnAnnotation getResourceColumnOrNull() {
- return this.getOverrideAnnotation().getColumn();
- }
-
- protected boolean isColumnSpecified() {
- return getResourceColumn() != null;
- }
-
-
- //************* NamedColumn.Owner implementation **************
-
- public TypeMapping getTypeMapping() {
- return this.getOwner().getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return this.getOwner().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- Column column = resolveOverriddenColumn();
- if (column == null) {
- return getName();
- }
- return column.getName();
- }
-
-
- //************* BaseColumn.Owner implementation **************
-
- public String getDefaultTableName() {
- Column column = resolveOverriddenColumn();
- if (column != null) {
- String tableName = column.getSpecifiedTable();
- if (tableName != null) {
- return tableName;
- }
- }
- return getOwner().getDefaultTableName();
- }
-
- protected Column resolveOverriddenColumn() {
- return isVirtual() ? getOwner().resolveOverriddenColumn(getName()) : null;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
-
- //************* AttributeOverride implementation **************
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
-
- //************* JavaOverride implementation **************
-
- @Override
- protected Iterator<String> candidateNames() {
- return this.getOwner().allOverridableAttributeNames();
- }
-
-
- // **************** AttributeOverride2_0 impl *****************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (getName() == null) {
- return false;
- }
-
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (getName().indexOf('.') > 0) ?
- getName().substring(0, getName().indexOf('.'))
- : getName();
- return qualifier.equals(each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue());
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- //************* java resource model -> java context model **************
-
- public void initialize(AttributeOverrideAnnotation attributeOverrideResource) {
- super.initialize(attributeOverrideResource);
- this.column.initialize(this.getResourceColumn());
- this.mappedByRelationship = calculateMappedByRelationship();
- }
-
- public void update(AttributeOverrideAnnotation attributeOverrideResource) {
- super.update(attributeOverrideResource);
- this.column.update(this.getResourceColumn());
- setMappedByRelationship(calculateMappedByRelationship());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getColumn().javaCompletionProposals(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);
-
- // [JPA 2.0] if the column is specified, or if the override is not mapped by a relationship,
- // then the column is validated.
- // (In JPA 1.0, the column will always be validated, since the override is never mapped by a
- // relationship)
- if (isColumnSpecified() || ! isMappedByRelationship()) {
- getColumn().validate(messages, reporter, astRoot);
- }
-
- // [JPA 2.0] if the override is mapped by a relationship, then that actually is in itself
- // a validation error
- // (We prevent implied overrides that are mapped by a relationship ... hopefully)
- // (In JPA 1.0, this will never occur)
- if (isMappedByRelationship()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED,
- new String[] {},
- this,
- getValidationTextRange(astRoot)));
- }
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(this, column, textRange);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(this, column, textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java
deleted file mode 100644
index 027151e02d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java
+++ /dev/null
@@ -1,451 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.VirtualAttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAttributeOverrideContainer extends AbstractJavaJpaContextNode
- implements JavaAttributeOverrideContainer
-{
- protected JavaResourcePersistentMember javaResourcePersistentMember;
-
- protected final List<JavaAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<JavaAttributeOverride> virtualAttributeOverrides;
-
- protected final Owner owner;
-
- public GenericJavaAttributeOverrideContainer(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- this.specifiedAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<JavaAttributeOverride>();
- }
-
- protected Owner getOwner() {
- return this.owner;
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<JavaAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<JavaAttributeOverride>(specifiedAttributeOverrides(), virtualAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.virtualAttributeOverridesSize();
- }
-
- public ListIterator<JavaAttributeOverride> virtualAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.virtualAttributeOverrides);
- }
-
- public int virtualAttributeOverridesSize() {
- return this.virtualAttributeOverrides.size();
- }
-
- public ListIterator<JavaAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<JavaAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- protected JavaAttributeOverride addSpecifiedAttributeOverride(int index) {
- JavaAttributeOverride attributeOverride = getJpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- AttributeOverrideAnnotation attributeOverrideResource =
- (AttributeOverrideAnnotation) this.javaResourcePersistentMember.addAnnotation(
- index, AttributeOverrideAnnotation.ANNOTATION_NAME,
- AttributeOverridesAnnotation.ANNOTATION_NAME);
- attributeOverride.initialize(attributeOverrideResource);
- this.fireItemAdded(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected JavaAttributeOverride setAttributeOverrideVirtual(boolean virtual, JavaAttributeOverride attributeOverride) {
- // Add a new attribute override
- if (virtual) {
- return setAttributeOverrideVirtual(attributeOverride);
- }
- return setAttributeOverrideSpecified(attributeOverride);
- }
-
- protected JavaAttributeOverride setAttributeOverrideVirtual(JavaAttributeOverride specifiedAttributeOverride) {
- int index = this.specifiedAttributeOverrides.indexOf(specifiedAttributeOverride);
- this.specifiedAttributeOverrides.remove(index);
- String attributeOverrideName = specifiedAttributeOverride.getName();
- //add the virtual attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the update. This causes the UI to be flaky, since change notification might not occur in the correct order
- JavaAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (String name : CollectionTools.iterable(allOverridableAttributeNames())) {
- if (name.equals(attributeOverrideName)) {
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(name);
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- break;
- }
- }
- }
-
- this.javaResourcePersistentMember.removeAnnotation(
- this.resourceIndexOf(specifiedAttributeOverride),
- AttributeOverrideAnnotation.ANNOTATION_NAME,
- AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, specifiedAttributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected JavaAttributeOverride setAttributeOverrideSpecified(JavaAttributeOverride virtualAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- int resourceIndex = 0;
- if (specifiedAttributeOverridesSize() > 0) {
- resourceIndex = this.resourceIndexOf(this.specifiedAttributeOverrides.get(index - 1)) + 1;
- }
- JavaAttributeOverride specifiedAttributeOverride = getJpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
-
- AttributeOverrideAnnotation attributeOverrideResource =
- (AttributeOverrideAnnotation) this.javaResourcePersistentMember.addAnnotation(
- resourceIndex,
- AttributeOverrideAnnotation.ANNOTATION_NAME,
- AttributeOverridesAnnotation.ANNOTATION_NAME);
- specifiedAttributeOverride.initialize(attributeOverrideResource);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(virtualAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- String name = virtualAttributeOverride.getName();
- String prefix = getOwner().getWritePrefix();
- if (prefix != null) {
- name = prefix + name;
- }
- this.specifiedAttributeOverrides.add(index, specifiedAttributeOverride);
- specifiedAttributeOverride.setName(name);
- specifiedAttributeOverride.getColumn().setSpecifiedName(virtualAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, virtualAttributeOverride);
- this.fireItemAdded(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, specifiedAttributeOverride);
-
- return specifiedAttributeOverride;
- }
-
- protected JavaAttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
- protected void addSpecifiedAttributeOverride(int index, JavaAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(JavaAttributeOverride attributeOverride) {
- this.addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.javaResourcePersistentMember.moveAnnotation(
- targetIndex, sourceIndex, AttributeOverridesAnnotation.ANNOTATION_NAME);
- fireItemMoved(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- protected void addVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.virtualAttributeOverrides, VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(JavaAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public JavaAttributeOverride getAttributeOverrideNamed(String name) {
- return (JavaAttributeOverride) getOverrideNamed(name, attributeOverrides());
- }
-
- public boolean containsAttributeOverride(String name) {
- return containsOverride(name, attributeOverrides());
- }
-
- public boolean containsDefaultAttributeOverride(String name) {
- return containsOverride(name, virtualAttributeOverrides());
- }
-
- public boolean containsSpecifiedAttributeOverride(String name) {
- return containsOverride(name, specifiedAttributeOverrides());
- }
-
- protected BaseOverride getOverrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- protected boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return getOverrideNamed(name, overrides) != null;
- }
-
- protected Iterator<String> allOverridableAttributeNames() {
- return getOwner().allOverridableNames();
- }
-
- public void initialize(JavaResourcePersistentMember resourcePersistentMember) {
- this.javaResourcePersistentMember = resourcePersistentMember;
- this.initializeSpecifiedAttributeOverrides();
- this.initializeVirtualAttributeOverrides();
- }
-
- protected void initializeSpecifiedAttributeOverrides() {
- for (Iterator<NestableAnnotation> stream = this.relavantResourceAttributeOverrides(); stream.hasNext(); ) {
- this.specifiedAttributeOverrides.add(
- buildAttributeOverride((AttributeOverrideAnnotation) stream.next()));
- }
- }
-
- protected void initializeVirtualAttributeOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAttributeNames())) {
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(name);
- if (attributeOverride == null) {
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(name));
- }
- }
- }
-
- public void update(JavaResourcePersistentMember resourcePersistentMember) {
- this.javaResourcePersistentMember = resourcePersistentMember;
- this.updateSpecifiedAttributeOverrides();
- this.updateVirtualAttributeOverrides();
- }
-
- protected void updateSpecifiedAttributeOverrides() {
- ListIterator<JavaAttributeOverride> attributeOverrides = specifiedAttributeOverrides();
- Iterator<NestableAnnotation> resourceAttributeOverrides = this.relavantResourceAttributeOverrides();
-
- while (attributeOverrides.hasNext()) {
- JavaAttributeOverride attributeOverride = attributeOverrides.next();
- if (resourceAttributeOverrides.hasNext()) {
- attributeOverride.update((AttributeOverrideAnnotation) resourceAttributeOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(attributeOverride);
- }
- }
-
- while (resourceAttributeOverrides.hasNext()) {
- addSpecifiedAttributeOverride(buildAttributeOverride((AttributeOverrideAnnotation) resourceAttributeOverrides.next()));
- }
- }
-
- protected Iterator<NestableAnnotation> relavantResourceAttributeOverrides() {
- Iterator<NestableAnnotation> resourceAttributeOverrides =
- this.javaResourcePersistentMember.annotations(
- AttributeOverrideAnnotation.ANNOTATION_NAME,
- AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- return new FilteringIterator<NestableAnnotation>(resourceAttributeOverrides) {
- @Override
- protected boolean accept(NestableAnnotation o) {
- String overrideName = ((AttributeOverrideAnnotation) o).getName();
- return overrideName != null && getOwner().isRelevant(overrideName);
- }
- };
- }
-
- protected int resourceIndexOf(JavaAttributeOverride specifiedAttributeOverride) {
- Iterator<NestableAnnotation> overrideAnnotations = this.javaResourcePersistentMember.annotations(
- AttributeOverrideAnnotation.ANNOTATION_NAME,
- AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- return CollectionTools.indexOf(
- overrideAnnotations,
- specifiedAttributeOverride.getOverrideAnnotation());
- }
-
- protected JavaAttributeOverride buildAttributeOverride(AttributeOverrideAnnotation attributeOverrideResource) {
- JavaAttributeOverride attributeOverride = getJpaFactory().buildJavaAttributeOverride(this, createAttributeOverrideOwner());
- attributeOverride.initialize(attributeOverrideResource);
- return attributeOverride;
- }
-
- protected JavaAttributeOverride buildVirtualAttributeOverride(String attributeOverrideName) {
- return buildAttributeOverride(buildVirtualAttributeOverrideAnnotation(attributeOverrideName));
- }
-
- protected VirtualAttributeOverrideAnnotation buildVirtualAttributeOverrideAnnotation(String attributeOverrideName) {
- Column column = resolveOverriddenColumn(attributeOverrideName);
- return new VirtualAttributeOverrideAnnotation(this.javaResourcePersistentMember, attributeOverrideName, column);
- }
-
- private Column resolveOverriddenColumn(String attributeOverrideName) {
- return getOwner().resolveOverriddenColumn(attributeOverrideName);
- }
-
- protected void updateVirtualAttributeOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAttributeNames())) {
- JavaAttributeOverride attributeOverride = getAttributeOverrideNamed(name);
- if (attributeOverride == null) {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(name));
- }
- else if (attributeOverride.isVirtual()) {
- attributeOverride.update(buildVirtualAttributeOverrideAnnotation(name));
- }
- }
-
- Collection<String> attributeNames = CollectionTools.collection(allOverridableAttributeNames());
-
- //remove any default mappings that are not included in the attributeNames collection
- for (JavaAttributeOverride attributeOverride : CollectionTools.iterable(virtualAttributeOverrides())) {
- if (!attributeNames.contains(attributeOverride.getName())
- || containsSpecifiedAttributeOverride(attributeOverride.getName())) {
- removeVirtualAttributeOverride(attributeOverride);
- }
- }
- }
-
-
- //******************** Code Completion *************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaAttributeOverride override : CollectionTools.iterable(this.attributeOverrides())) {
- result = override.javaCompletionProposals(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);
- for (Iterator<JavaAttributeOverride> stream = this.attributeOverrides(); stream.hasNext();) {
- stream.next().validate(messages, reporter, astRoot);
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- Annotation annotation =
- this.javaResourcePersistentMember.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME);
- if (annotation == null) {
- annotation = this.javaResourcePersistentMember.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME);
- }
-
- return (annotation == null) ?
- getOwner().getValidationTextRange(astRoot)
- : annotation.getTextRange(astRoot);
- }
-
-
- // ********** attribute override owner **********
-
- protected class AttributeOverrideOwner implements JavaAttributeOverride.Owner {
-
- public Column resolveOverriddenColumn(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- return GenericJavaAttributeOverrideContainer.this.resolveOverriddenColumn(attributeName);
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericJavaAttributeOverrideContainer.this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride attributeOverride) {
- return GenericJavaAttributeOverrideContainer.this.setAttributeOverrideVirtual(virtual, (JavaAttributeOverride) attributeOverride);
- }
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return GenericJavaAttributeOverrideContainer.this.allOverridableAttributeNames();
- }
-
- public String getPossiblePrefix() {
- return getOwner().getPossiblePrefix();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public String getDefaultTableName() {
- return getOwner().getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(override, column, textRange);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaBasicMapping.java
deleted file mode 100644
index 9d6fa7b60d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaBasicMapping.java
+++ /dev/null
@@ -1,22 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBasicMapping;
-
-
-public class GenericJavaBasicMapping extends AbstractJavaBasicMapping
-{
- public GenericJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaCascade.java
deleted file mode 100644
index a9407bb495..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaCascade.java
+++ /dev/null
@@ -1,175 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCascade2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaCascade
- extends AbstractJavaJpaContextNode
- implements JavaCascade2_0
-{
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
- /* JPA 2.0 */
- protected boolean detach;
-
-
- public GenericJavaCascade(JavaRelationshipMapping2_0 parent) {
- super(parent);
- }
-
-
- protected JavaRelationshipMapping2_0 getMapping() {
- return (JavaRelationshipMapping2_0) getParent();
- }
-
- protected RelationshipMapping2_0Annotation getAnnotation() {
- return getMapping().getMappingAnnotation();
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- getAnnotation().setCascadeAll(newAll);
- firePropertyChanged(Cascade.ALL_PROPERTY, oldAll, newAll);
- }
-
- protected void setAll_(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- firePropertyChanged(Cascade.ALL_PROPERTY, oldAll, newAll);
- }
-
- public boolean isPersist() {
- return this.persist;
- }
-
- public void setPersist(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- getAnnotation().setCascadePersist(newPersist);
- firePropertyChanged(Cascade.PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- protected void setPersist_(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- firePropertyChanged(Cascade.PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- public boolean isMerge() {
- return this.merge;
- }
-
- public void setMerge(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- getAnnotation().setCascadeMerge(newMerge);
- firePropertyChanged(Cascade.MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- protected void setMerge_(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- firePropertyChanged(Cascade.MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- public boolean isRemove() {
- return this.remove;
- }
-
- public void setRemove(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- getAnnotation().setCascadeRemove(newRemove);
- firePropertyChanged(Cascade.REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- protected void setRemove_(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- firePropertyChanged(Cascade.REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- public boolean isRefresh() {
- return this.refresh;
- }
-
- public void setRefresh(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- getAnnotation().setCascadeRefresh(newRefresh);
- firePropertyChanged(Cascade.REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- protected void setRefresh_(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- firePropertyChanged(Cascade.REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- public boolean isDetach() {
- return this.detach;
- }
-
- public void setDetach(boolean newDetach) {
- boolean oldDetach = this.detach;
- this.detach = newDetach;
- getAnnotation().setCascadeDetach(newDetach);
- firePropertyChanged(Cascade2_0.DETACH_PROPERTY, oldDetach, newDetach);
- }
-
- protected void setDetach_(boolean newDetach) {
- boolean oldDetach = this.detach;
- this.detach = newDetach;
- firePropertyChanged(Cascade2_0.DETACH_PROPERTY, oldDetach, newDetach);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getCascadeTextRange(astRoot);
- }
-
- public void initialize() {
- this.all = getAnnotation().isCascadeAll();
- this.persist = getAnnotation().isCascadePersist();
- this.merge = getAnnotation().isCascadeMerge();
- this.remove = getAnnotation().isCascadeRemove();
- this.refresh = getAnnotation().isCascadeRefresh();
- this.detach = getAnnotation().isCascadeDetach();
- }
-
- public void update() {
- this.setAll_(getAnnotation().isCascadeAll());
- this.setPersist_(getAnnotation().isCascadePersist());
- this.setMerge_(getAnnotation().isCascadeMerge());
- this.setRemove_(getAnnotation().isCascadeRemove());
- this.setRefresh_(getAnnotation().isCascadeRefresh());
- this.setDetach_(getAnnotation().isCascadeDetach());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaColumn.java
deleted file mode 100644
index 170a03c628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaColumn.java
+++ /dev/null
@@ -1,134 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseColumn;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-public class GenericJavaColumn extends AbstractJavaBaseColumn<ColumnAnnotation> implements JavaColumn
-{
-
- protected Integer specifiedLength;
-
- protected Integer specifiedPrecision;
-
- protected Integer specifiedScale;
-
- public GenericJavaColumn(JavaJpaContextNode parent, JavaBaseColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(ColumnAnnotation column) {
- super.initialize(column);
- this.specifiedLength = this.getResourceLength();
- this.specifiedPrecision = this.getResourcePrecision();
- this.specifiedScale = this.getResourceScale();
- }
-
- @Override
- public void update(ColumnAnnotation column) {
- super.update(column);
- this.setSpecifiedLength_(this.getResourceLength());
- this.setSpecifiedPrecision_(this.getResourcePrecision());
- this.setSpecifiedScale_(this.getResourceScale());
- }
-
- public int getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength().intValue();
- }
-
- public int getDefaultLength() {
- return Column.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- getResourceColumn().setLength(newSpecifiedLength);
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected Integer getResourceLength() {
- return getResourceColumn().getLength();
- }
-
- public int getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision().intValue();
- }
-
- public int getDefaultPrecision() {
- return Column.DEFAULT_PRECISION;
- }
-
- public Integer getSpecifiedPrecision() {
- return this.specifiedPrecision;
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- getResourceColumn().setPrecision(newSpecifiedPrecision);
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- protected void setSpecifiedPrecision_(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- protected Integer getResourcePrecision() {
- return getResourceColumn().getPrecision();
- }
-
- public int getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale().intValue();
- }
-
- public int getDefaultScale() {
- return Column.DEFAULT_SCALE;
- }
-
- public Integer getSpecifiedScale() {
- return this.specifiedScale;
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- getResourceColumn().setScale(newSpecifiedScale);
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- protected void setSpecifiedScale_(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- protected Integer getResourceScale() {
- return getResourceColumn().getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java
deleted file mode 100644
index 479a3fd7fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaDiscriminatorColumn.java
+++ /dev/null
@@ -1,171 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.java.JavaDiscriminatorColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-
-public class GenericJavaDiscriminatorColumn extends AbstractJavaNamedColumn<DiscriminatorColumnAnnotation>
- implements JavaDiscriminatorColumn
-{
-
- protected DiscriminatorType specifiedDiscriminatorType;
-
- protected DiscriminatorType defaultDiscriminatorType;
-
- protected Integer specifiedLength;
-
- protected int defaultLength;
-
- public GenericJavaDiscriminatorColumn(JavaEntity parent, JavaDiscriminatorColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(DiscriminatorColumnAnnotation column) {
- super.initialize(column);
- this.defaultDiscriminatorType = this.buildDefaultDiscriminatorType();
- this.defaultLength = this.buildDefaultLength();
- this.specifiedDiscriminatorType = this.getResourceDiscriminatorType();
- this.specifiedLength = this.getResourceLength();
- }
-
- @Override
- public JavaDiscriminatorColumn.Owner getOwner() {
- return (JavaDiscriminatorColumn.Owner) super.getOwner();
- }
-
- public boolean isResourceSpecified() {
- return getResourceColumn().isSpecified();
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return this.defaultDiscriminatorType;
- }
-
- protected void setDefaultDiscriminatorType(DiscriminatorType discriminatorType) {
- DiscriminatorType old = this.defaultDiscriminatorType;
- this.defaultDiscriminatorType = discriminatorType;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType);
- }
-
- public DiscriminatorType getSpecifiedDiscriminatorType() {
- return this.specifiedDiscriminatorType;
- }
-
- public void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- getResourceColumn().setDiscriminatorType(DiscriminatorType.toJavaResourceModel(newSpecifiedDiscriminatorType));
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedDiscriminatorType_(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- public int getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength().intValue();
- }
-
- public int getDefaultLength() {
- return this.defaultLength;
- }
-
- protected void setDefaultLength(int defaultLength) {
- int old = this.defaultLength;
- this.defaultLength = defaultLength;
- firePropertyChanged(DEFAULT_LENGTH_PROPERTY, old, defaultLength);
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- getResourceColumn().setLength(newSpecifiedLength);
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
-
- // ********** java annotations -> persistence model **********
-
- @Override
- public void update(DiscriminatorColumnAnnotation discriminatorColumn) {
- //don't call super because postUpdate() handles updating the default column name
- this.resourceColumn = discriminatorColumn;
- this.setSpecifiedName_(discriminatorColumn.getName());
- this.setColumnDefinition_(discriminatorColumn.getColumnDefinition());
- this.setSpecifiedDiscriminatorType_(this.getResourceDiscriminatorType());
- this.setSpecifiedLength_(this.getResourceLength());
- }
-
- @Override
- /**
- * Using postUpdate since these defaults are dependent on the entity hierarchy
- */
- public void postUpdate() {
- super.postUpdate();
- this.setDefaultName(this.buildDefaultName());
- this.setDefaultDiscriminatorType(this.buildDefaultDiscriminatorType());
- this.setDefaultLength(this.buildDefaultLength());
- }
-
- protected DiscriminatorType getResourceDiscriminatorType() {
- return DiscriminatorType.fromJavaResourceModel(getResourceColumn().getDiscriminatorType());
- }
-
- protected Integer getResourceLength() {
- return getResourceColumn().getLength();
- }
-
- @Override
- public JavaEntity getParent() {
- return (JavaEntity) super.getParent();
- }
-
- protected int buildDefaultLength() {
- return this.getOwner().getDefaultLength();
- }
-
- protected DiscriminatorType buildDefaultDiscriminatorType() {
- return this.getOwner().getDefaultDiscriminatorType();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddable.java
deleted file mode 100644
index 38a2c98167..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddable.java
+++ /dev/null
@@ -1,36 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEmbeddable;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-
-public class GenericJavaEmbeddable
- extends AbstractJavaEmbeddable
-{
- public GenericJavaEmbeddable(JavaPersistentType parent) {
- super(parent);
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- //generic only allows basic and transient within an Embeddable
- return ArrayTools.contains(ALLOWED_ATTRIBUTE_MAPPING_KEYS, attributeMappingKey);
- }
-
- public static final String[] ALLOWED_ATTRIBUTE_MAPPING_KEYS =
- new String[] {
- MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedIdMapping.java
deleted file mode 100644
index 6b4045decb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedIdMapping.java
+++ /dev/null
@@ -1,186 +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.core.internal.jpa1.context.java;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseEmbeddedMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.EmbeddedIdMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaEmbeddedIdMapping
- extends AbstractJavaBaseEmbeddedMapping<EmbeddedIdAnnotation>
- implements EmbeddedIdMapping2_0, JavaEmbeddedIdMapping
-{
- /* 2.0 feature - a relationship may map this embedded id */
- protected boolean mappedByRelationship;
-
-
- public GenericJavaEmbeddedIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-
- //****************** JavaAttributeMapping implementation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedIdAnnotation.ANNOTATION_NAME;
- }
-
-
- // **************** EmbeddedId2_0 impl ************************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (getName().equals(each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue())) {
- return true;
- }
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // **************** overrides *********************************************
-
- @Override
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return (isMappedByRelationship()) ?
- EmptyIterator.<String>instance()
- : super.embeddableOverrideableAttributeMappingNames();
- }
-
- @Override
- protected JavaAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() {
- return new AttributeOverrideContainerOwner();
- }
-
-
- protected class AttributeOverrideContainerOwner
- extends AbstractJavaBaseEmbeddedMapping.AttributeOverrideContainerOwner
- {
- @Override
- public Iterator<String> allOverridableNames() {
- return (GenericJavaEmbeddedIdMapping.this.isMappedByRelationship()) ?
- EmptyIterator.<String>instance()
- : super.allOverridableNames();
- }
-
- @Override
- protected Iterator<String> allOverridableAttributeNames_(TypeMapping typeMapping) {
- final Collection<String> mappedByRelationshipAttributes = CollectionTools.collection(
- new TransformationIterator<SingleRelationshipMapping2_0, String>(getMapsIdRelationships()) {
- @Override
- protected String transform(SingleRelationshipMapping2_0 next) {
- return next.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue();
- }
- });
- return new FilteringIterator<String>(super.allOverridableAttributeNames_(typeMapping)) {
- @Override
- protected boolean accept(String o) {
- if (mappedByRelationshipAttributes.isEmpty()) {
- return true;
- }
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (o.indexOf('.') > 0) ?
- o.substring(0, o.indexOf('.'))
- : o;
- return ! mappedByRelationshipAttributes.contains(qualifier);
- }
- };
- }
- }
-
-
- // **************** resource -> context ***********************************
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mappedByRelationship = calculateMappedByRelationship();
- }
-
-
- @Override
- protected void update() {
- super.update();
- setMappedByRelationship(calculateMappedByRelationship());
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- // [JPA 2.0] if the embedded id is mapped by a relationship, then any specified
- // attribute overrides are in error
- // (in JPA 1.0, this will obviously never be reached)
- if (isMappedByRelationship()
- && getAttributeOverrideContainer().specifiedAttributeOverridesSize() > 0) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED,
- new String[] {},
- getAttributeOverrideContainer(),
- getAttributeOverrideContainer().getValidationTextRange(astRoot)));
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java
deleted file mode 100644
index 3f4ca58cdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java
+++ /dev/null
@@ -1,375 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseEmbeddedMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaEmbeddedMapping
- extends AbstractJavaBaseEmbeddedMapping<EmbeddedAnnotation>
- implements JavaEmbeddedMapping2_0
-{
- protected final JavaAssociationOverrideContainer associationOverrideContainer;
-
- public GenericJavaEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.associationOverrideContainer = this.buildAssociationOverrideContainer();
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.associationOverrideContainer.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.associationOverrideContainer.update(this.getResourcePersistentAttribute());
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- this.associationOverrideContainer.postUpdate();
- }
-
- //****************** JavaAttributeMapping implementation *******************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-
- //only putting this in EmbeddedMapping since relationship mappings
- //defined within an embedded id class are not supported by the 2.0 spec.
- //i.e. the mappedBy choices will not include attributes nested in an embedded mapping
- @Override
- public Iterator<String> allMappingNames() {
- return this.isJpa2_0Compatible() ?
- new CompositeIterator<String>(this.getName(), this.allEmbeddableAttributeMappingNames()) :
- super.allMappingNames();
- }
-
- protected Iterator<String> allEmbeddableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- }
- );
- }
-
- @Override
- public AttributeMapping resolveAttributeMapping(String name) {
- AttributeMapping resolvedMapping = super.resolveAttributeMapping(name);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- if (this.isJpa2_0Compatible()) {
- int dotIndex = name.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(name.substring(0, dotIndex))) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(embeddableAttributeMappings())) {
- resolvedMapping = attributeMapping.resolveAttributeMapping(name.substring(dotIndex + 1));
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AssociationOverride override = getAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getRelationshipReference();
- }
- if (this.getTargetEmbeddable() == null) {
- return null;
- }
- return this.getTargetEmbeddable().resolveRelationshipReference(attributeName);
- }
- }
- }
- return null;
- }
-
- //****************** AbstractJavaAttributeMapping implementation *******************
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- if (this.isJpa2_0Compatible()) {
- names.add(JPA.ASSOCIATION_OVERRIDE);
- names.add(JPA.ASSOCIATION_OVERRIDES);
- }
- }
-
-
- //****************** association overrides - 2.0 supports this *******************
-
- protected JavaAssociationOverrideContainer buildAssociationOverrideContainer() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaAssociationOverrideContainer(this, new AssociationOverrideContainerOwner()) :
- new NullJavaAssociationOverrideContainer(this);
- }
-
- public JavaAssociationOverrideContainer getAssociationOverrideContainer() {
- return this.associationOverrideContainer;
- }
-
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
-
- result = getAssociationOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- protected void validateOverrides(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validateOverrides(messages, reporter, astRoot);
- this.getAssociationOverrideContainer().validate(messages, reporter, astRoot);
- }
-
-
- // ********** association override container owner **********
-
- protected class AssociationOverrideContainerOwner
- implements JavaAssociationOverrideContainer.Owner
- {
- public TypeMapping getTypeMapping() {
- return GenericJavaEmbeddedMapping.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return GenericJavaEmbeddedMapping.this.getOverridableTypeMapping();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getPossiblePrefix() {
- return null;
- }
-
- public String getWritePrefix() {
- return null;
- }
-
- //no prefix, so always true
- public boolean isRelevant(String overrideName) {
- return true;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaEmbeddedMapping.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {overrideName, column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEntity.java
deleted file mode 100644
index fed7a6e563..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEntity.java
+++ /dev/null
@@ -1,64 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-public class GenericJavaEntity
- extends AbstractJavaEntity
-{
-
- protected final JavaCacheable2_0 cacheable;
-
- public GenericJavaEntity(JavaPersistentType parent) {
- super(parent);
- this.cacheable = this.buildCacheable();
- }
-
- @Override
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- super.initialize(resourcePersistentType);
- this.cacheable.initialize(resourcePersistentType);
- }
-
- @Override
- public void update(JavaResourcePersistentType resourcePersistentType) {
- super.update(resourcePersistentType);
- this.cacheable.update(resourcePersistentType);
- }
-
- //****************** Entity2_0 implementation *******************
-
- protected JavaCacheable2_0 buildCacheable() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaCacheable(this) :
- new NullJavaCacheable2_0(this);
- }
-
- public JavaCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- CacheableHolder2_0 parentEntity = (CacheableHolder2_0) getParentEntity();
- if (parentEntity != null) {
- return parentEntity.getCacheable().isCacheable();
- }
- return ((PersistenceUnit2_0) getPersistenceUnit()).calculateDefaultCacheable();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEnumeratedConverter.java
deleted file mode 100644
index ee186c564a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEnumeratedConverter.java
+++ /dev/null
@@ -1,103 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaEnumeratedConverter;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaEnumeratedConverter extends AbstractJavaJpaContextNode
- implements JavaEnumeratedConverter
-{
- protected EnumType specifiedEnumType;
-
- protected JavaResourcePersistentAttribute resourcePersistenceAttribute;
-
- public GenericJavaEnumeratedConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.ENUMERATED_CONVERTER;
- }
-
- protected String getAnnotationName() {
- return EnumeratedAnnotation.ANNOTATION_NAME;
- }
-
- public void addToResourceModel() {
- this.resourcePersistenceAttribute.addAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistenceAttribute.removeAnnotation(getAnnotationName());
- }
-
- public EnumType getEnumType() {
- return getSpecifiedEnumType() == null ? getDefaultEnumType() : getSpecifiedEnumType();
- }
-
- public EnumType getDefaultEnumType() {
- return EnumeratedConverter.DEFAULT_ENUM_TYPE;
- }
-
- public EnumType getSpecifiedEnumType() {
- return this.specifiedEnumType;
- }
-
- public void setSpecifiedEnumType(EnumType newSpecifiedEnumType) {
- EnumType oldSpecifiedEnumType = this.specifiedEnumType;
- this.specifiedEnumType = newSpecifiedEnumType;
- this.getResourceEnumerated().setValue(EnumType.toJavaResourceModel(newSpecifiedEnumType));
- firePropertyChanged(EnumeratedConverter.SPECIFIED_ENUM_TYPE_PROPERTY, oldSpecifiedEnumType, newSpecifiedEnumType);
- }
-
- protected void setSpecifiedEnumType_(EnumType newSpecifiedEnumType) {
- EnumType oldSpecifiedEnumType = this.specifiedEnumType;
- this.specifiedEnumType = newSpecifiedEnumType;
- firePropertyChanged(EnumeratedConverter.SPECIFIED_ENUM_TYPE_PROPERTY, oldSpecifiedEnumType, newSpecifiedEnumType);
- }
-
- protected EnumeratedAnnotation getResourceEnumerated() {
- return (EnumeratedAnnotation) this.resourcePersistenceAttribute.
- getAnnotation(getAnnotationName());
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistenceAttribute = jrpa;
- this.specifiedEnumType = this.specifiedEnumType(getResourceEnumerated());
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistenceAttribute = jrpa;
- this.setSpecifiedEnumType_(this.specifiedEnumType(getResourceEnumerated()));
- }
-
- protected EnumType specifiedEnumType(EnumeratedAnnotation resourceEnumerated) {
- return resourceEnumerated == null ? null : EnumType.fromJavaResourceModel(resourceEnumerated.getValue());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getResourceEnumerated().getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratedValue.java
deleted file mode 100644
index d5993917a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratedValue.java
+++ /dev/null
@@ -1,208 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.java.JavaGeneratedValue;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- */
-public class GenericJavaGeneratedValue
- extends AbstractJavaJpaContextNode
- implements JavaGeneratedValue
-{
- protected GeneratedValueAnnotation resourceGeneratedValue;
-
- protected GenerationType specifiedStrategy;
-
- protected String specifiedGenerator;
-
- // always null?
- protected String defaultGenerator = null;
-
-
- public GenericJavaGeneratedValue(JavaIdMapping parent) {
- super(parent);
- }
-
- public void initialize(GeneratedValueAnnotation generatedValueAnnotation) {
- this.resourceGeneratedValue = generatedValueAnnotation;
- this.specifiedStrategy = this.buildSpecifiedStrategy();
- this.specifiedGenerator = generatedValueAnnotation.getGenerator();
- }
-
-
- // ********** strategy **********
-
- public GenerationType getStrategy() {
- return (this.specifiedStrategy != null) ? this.specifiedStrategy : this.getDefaultStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.specifiedStrategy;
- }
-
- public void setSpecifiedStrategy(GenerationType strategy) {
- GenerationType old = this.specifiedStrategy;
- this.specifiedStrategy = strategy;
- this.resourceGeneratedValue.setStrategy(GenerationType.toJavaResourceModel(strategy));
- this.firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, old, strategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType strategy) {
- GenerationType old = this.specifiedStrategy;
- this.specifiedStrategy = strategy;
- this.firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, old, strategy);
- }
-
-
- // ********** generator **********
-
- public String getGenerator() {
- return (this.specifiedGenerator != null) ? this.specifiedGenerator : this.defaultGenerator;
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- public String getSpecifiedGenerator() {
- return this.specifiedGenerator;
- }
-
- public void setSpecifiedGenerator(String generator) {
- String old = this.specifiedGenerator;
- this.specifiedGenerator = generator;
- this.resourceGeneratedValue.setGenerator(generator);
- this.firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, old, generator);
- }
-
- protected void setSpecifiedGenerator_(String generator) {
- String old = this.specifiedGenerator;
- this.specifiedGenerator = generator;
- this.firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, old, generator);
- }
-
-
- // ********** text ranges **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceGeneratedValue.getTextRange(astRoot);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- return this.resourceGeneratedValue.getGeneratorTextRange(astRoot);
- }
-
-
- // ********** completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.generatorTouches(pos, astRoot)) {
- return this.javaCandidateGeneratorNames(filter);
- }
- return null;
- }
-
- protected boolean generatorTouches(int pos, CompilationUnit astRoot) {
- return this.resourceGeneratedValue.generatorTouches(pos, astRoot);
- }
-
- protected Iterator<String> javaCandidateGeneratorNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateGeneratorNames(filter));
- }
-
- protected Iterator<String> candidateGeneratorNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateGeneratorNames(), filter);
- }
-
- protected Iterator<String> candidateGeneratorNames() {
- return new TransformationIterator<Generator, String>(this.candidateGenerators()) {
- @Override
- protected String transform(Generator generator) {
- return generator.getName();
- }
- };
- }
-
- protected Iterator<Generator> candidateGenerators() {
- return this.getPersistenceUnit().generators();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
-
- String generator = this.getGenerator();
- if (generator == null) {
- return;
- }
-
- for (Iterator<Generator> stream = this.getPersistenceUnit().generators(); stream.hasNext(); ) {
- if (generator.equals(stream.next().getName())) {
- return;
- }
- }
-
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME,
- new String[] {generator},
- this.getParent(),
- this.getGeneratorTextRange(astRoot)
- )
- );
- }
-
-
- // ********** update from resource model **********
-
- public void update(GeneratedValueAnnotation generatedValueAnnotation) {
- this.resourceGeneratedValue = generatedValueAnnotation;
- this.setSpecifiedStrategy_(this.buildSpecifiedStrategy());
- this.setSpecifiedGenerator_(generatedValueAnnotation.getGenerator());
- }
-
- protected GenerationType buildSpecifiedStrategy() {
- return GenerationType.fromJavaResourceModel(this.resourceGeneratedValue.getStrategy());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java
deleted file mode 100644
index 1f4586a705..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java
+++ /dev/null
@@ -1,270 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.java.JavaGenerator;
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaGeneratorContainer extends AbstractJavaJpaContextNode
- implements JavaGeneratorContainer
-{
- protected JavaResourcePersistentMember javaResourcePersistentMember;
-
- protected JavaSequenceGenerator sequenceGenerator;
-
- protected JavaTableGenerator tableGenerator;
-
- public GenericJavaGeneratorContainer(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
- public JavaTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists"); //$NON-NLS-1$
- }
- this.tableGenerator = getJpaFactory().buildJavaTableGenerator(this);
- TableGeneratorAnnotation tableGeneratorResource =
- (TableGeneratorAnnotation) this.javaResourcePersistentMember.
- addAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- this.tableGenerator.initialize(tableGeneratorResource);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed"); //$NON-NLS-1$
- }
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.javaResourcePersistentMember.removeAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public JavaTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(JavaTableGenerator newTableGenerator) {
- JavaTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
- public JavaSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists"); //$NON-NLS-1$
- }
- this.sequenceGenerator = getJpaFactory().buildJavaSequenceGenerator(this);
- SequenceGeneratorAnnotation sequenceGeneratorResource =
- (SequenceGeneratorAnnotation) this.javaResourcePersistentMember.
- addAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- this.sequenceGenerator.initialize(sequenceGeneratorResource);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed"); //$NON-NLS-1$
- }
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.javaResourcePersistentMember.removeAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator,null);
- }
-
- public JavaSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(JavaSequenceGenerator newSequenceGenerator) {
- JavaSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
-
- public void initialize(JavaResourcePersistentMember jrpm) {
- this.javaResourcePersistentMember = jrpm;
- this.initializeTableGenerator();
- this.initializeSequenceGenerator();
- }
-
- protected void initializeTableGenerator() {
- TableGeneratorAnnotation tableGeneratorResource = getResourceTableGenerator();
- if (tableGeneratorResource != null) {
- this.tableGenerator = buildTableGenerator(tableGeneratorResource);
- }
- }
-
- protected void initializeSequenceGenerator() {
- SequenceGeneratorAnnotation sequenceGeneratorResource = getResourceSequenceGenerator();
- if (sequenceGeneratorResource != null) {
- this.sequenceGenerator = buildSequenceGenerator(sequenceGeneratorResource);
- }
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- this.javaResourcePersistentMember = jrpm;
- this.updateTableGenerator();
- this.updateSequenceGenerator();
- }
-
- protected void updateTableGenerator() {
- TableGeneratorAnnotation tableGeneratorResource = getResourceTableGenerator();
- if (tableGeneratorResource == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(tableGeneratorResource));
- }
- else {
- getTableGenerator().update(tableGeneratorResource);
- }
- }
- }
-
- protected JavaTableGenerator buildTableGenerator(TableGeneratorAnnotation tableGeneratorResource) {
- JavaTableGenerator generator = getJpaFactory().buildJavaTableGenerator(this);
- generator.initialize(tableGeneratorResource);
- return generator;
- }
-
- protected TableGeneratorAnnotation getResourceTableGenerator() {
- return (TableGeneratorAnnotation) this.javaResourcePersistentMember.
- getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME);
- }
-
- protected void updateSequenceGenerator() {
- SequenceGeneratorAnnotation sequenceGeneratorResource = getResourceSequenceGenerator();
- if (sequenceGeneratorResource == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(sequenceGeneratorResource));
- }
- else {
- getSequenceGenerator().update(sequenceGeneratorResource);
- }
- }
- }
-
- protected JavaSequenceGenerator buildSequenceGenerator(SequenceGeneratorAnnotation sequenceGeneratorResource) {
- JavaSequenceGenerator generator = getJpaFactory().buildJavaSequenceGenerator(this);
- generator.initialize(sequenceGeneratorResource);
- return generator;
- }
-
- protected SequenceGeneratorAnnotation getResourceSequenceGenerator() {
- return (SequenceGeneratorAnnotation) this.javaResourcePersistentMember.
- getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME);
- }
-
-
- //******************** Code Completion *************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.getTableGenerator() != null) {
- result = this.getTableGenerator().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- if (this.getSequenceGenerator() != null) {
- result = this.getSequenceGenerator().javaCompletionProposals(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.validateGenerators(messages, astRoot);
- }
-
- protected void validateGenerators(List<IMessage> messages, CompilationUnit astRoot) {
- for (Iterator<JavaGenerator> localGenerators = this.generators(); localGenerators.hasNext(); ) {
- JavaGenerator localGenerator = localGenerators.next();
- for (Iterator<Generator> globalGenerators = this.getPersistenceUnit().generators(); globalGenerators.hasNext(); ) {
- if (localGenerator.duplicates(globalGenerators.next())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.GENERATOR_DUPLICATE_NAME,
- new String[] {localGenerator.getName()},
- localGenerator,
- localGenerator.getNameTextRange(astRoot)
- )
- );
- }
- }
- }
- }
-
- protected final Iterator<JavaGenerator> generators() {
- ArrayList<JavaGenerator> generators = new ArrayList<JavaGenerator>();
- this.addGeneratorsTo(generators);
- return generators.iterator();
- }
-
- protected void addGeneratorsTo(ArrayList<JavaGenerator> generators) {
- if (this.sequenceGenerator != null) {
- generators.add(this.sequenceGenerator);
- }
- if (this.tableGenerator != null) {
- generators.add(this.tableGenerator);
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.javaResourcePersistentMember.getTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaIdMapping.java
deleted file mode 100644
index 97620c7e05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaIdMapping.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaIdMapping;
-
-
-public class GenericJavaIdMapping
- extends AbstractJavaIdMapping
-{
-
- public GenericJavaIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinColumn.java
deleted file mode 100644
index a357dd5e90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinColumn.java
+++ /dev/null
@@ -1,197 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseColumn;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaJoinColumn extends AbstractJavaBaseColumn<JoinColumnAnnotation> implements JavaJoinColumn
-{
-
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- public GenericJavaJoinColumn(JavaJpaContextNode parent, JavaJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(JoinColumnAnnotation annotation) {
- super.initialize(annotation);
- this.specifiedReferencedColumnName = annotation.getReferencedColumnName();
- this.defaultReferencedColumnName = this.buildDefaultReferencedColumnName();
- }
-
- @Override
- public void update(JoinColumnAnnotation annotation) {
- super.update(annotation);
- this.setSpecifiedReferencedColumnName_(annotation.getReferencedColumnName());
- this.setDefaultReferencedColumnName(this.buildDefaultReferencedColumnName());
- }
-
-
- public String getReferencedColumnName() {
- return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName;
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- this.getResourceColumn().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(BaseJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(BaseJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(BaseJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
-
- @Override
- public JavaJoinColumn.Owner getOwner() {
- return (JavaJoinColumn.Owner) super.getOwner();
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- public Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- public Column getReferencedDbColumn() {
- Table table = this.getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return getResourceColumn().referencedColumnNameTouches(pos, astRoot);
- }
-
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.referencedColumnNameTouches(pos, astRoot)) {
- return this.getJavaCandidateReferencedColumnNames(filter).iterator();
- }
- return null;
- }
-
- private Iterable<String> getJavaCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateReferencedColumnNames(filter));
- }
-
- private Iterable<String> getCandidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateReferencedColumnNames(), filter);
- }
-
- private Iterable<String> getCandidateReferencedColumnNames() {
- Table table = this.getOwner().getReferencedColumnDbTable();
- return (table != null) ? table.getSortedColumnIdentifiers() : EmptyIterable.<String> instance();
- }
-
- public boolean isReferencedColumnResolved() {
- return getReferencedDbColumn() != null;
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- TextRange textRange = getResourceColumn().getReferencedColumnNameTextRange(astRoot);
- return (textRange != null) ? textRange : getOwner().getValidationTextRange(astRoot);
- }
-
- @Override
- protected String buildDefaultName() {
- return MappingTools.buildJoinColumnDefaultName(this, this.getOwner());
- }
-
- protected String buildDefaultReferencedColumnName() {
- return MappingTools.buildJoinColumnDefaultReferencedColumnName(this.getOwner());
- }
-
- @Override
- //this method will only be called if the table validates correctly
- protected void validateName(List<IMessage> messages, CompilationUnit astRoot) {
- this.validateJoinColumnName(messages, astRoot);
- this.validateReferencedColumnName(messages, astRoot);
- }
-
- protected void validateJoinColumnName(List<IMessage> messages, CompilationUnit astRoot) {
- if (getSpecifiedName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedNameMultipleJoinColumnsMessage(astRoot));
- }
- else if (this.getName() != null){
- super.validateName(messages, astRoot);
- }
- //If the name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected void validateReferencedColumnName(List<IMessage> messages, CompilationUnit astRoot) {
- if (getSpecifiedReferencedColumnName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(astRoot));
- }
- else if (this.getSpecifiedReferencedColumnName() != null) {
- if (this.getReferencedColumnDbTable() != null && ! this.isReferencedColumnResolved()) {
- messages.add(getOwner().buildUnresolvedReferencedColumnNameMessage(this, this.getReferencedColumnNameTextRange(astRoot)));
- }
- }
- //If the referenced column name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(CompilationUnit astRoot) {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(this, getNameTextRange(astRoot));
- }
-
- protected IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(CompilationUnit astRoot) {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(this, getReferencedColumnNameTextRange(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinTable.java
deleted file mode 100644
index d9c2c680b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaJoinTable.java
+++ /dev/null
@@ -1,594 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java join table
- */
-public class GenericJavaJoinTable
- extends GenericJavaReferenceTable
- implements JavaJoinTable
-{
-
- protected JavaJoinColumn defaultInverseJoinColumn;
-
- protected final Vector<JavaJoinColumn> specifiedInverseJoinColumns = new Vector<JavaJoinColumn>();
- protected final JavaJoinColumn.Owner inverseJoinColumnOwner;
-
-
- public GenericJavaJoinTable(JavaJoinTableJoiningStrategy parent) {
- super(parent);
- this.inverseJoinColumnOwner = this.buildInverseJoinColumnOwner();
- }
-
- @Override
- protected JavaJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected JavaJoinColumn.Owner buildInverseJoinColumnOwner() {
- return new InverseJoinColumnOwner();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getParent().getRelationshipReference().getRelationshipMapping();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
- public void initialize(JoinTableAnnotation joinTable) {
- super.initialize(joinTable);
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- this.initializeDefaultInverseJoinColumn(joinTable);
- }
-
- public void update(JoinTableAnnotation joinTable) {
- super.update(joinTable);
- this.updateSpecifiedInverseJoinColumns(joinTable);
- this.updateDefaultInverseJoinColumn(joinTable);
- }
-
-
- // ********** AbstractJavaTable implementation **********
-
- @Override
- public JavaJoinTableJoiningStrategy getParent() {
- return (JavaJoinTableJoiningStrategy) super.getParent();
- }
-
- @Override
- protected String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String buildDefaultName() {
- return this.getParent().getJoinTableDefaultName();
- }
-
- @Override
- protected JoinTableAnnotation getAnnotation() {
- return this.getParent().getAnnotation();
- }
-
-
- // ********** inverse join columns **********
-
- public ListIterator<JavaJoinColumn> inverseJoinColumns() {
- return this.hasSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumns() : this.defaultInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.hasSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumnsSize() : this.defaultInverseJoinColumnsSize();
- }
-
- public void convertDefaultToSpecifiedInverseJoinColumn() {
- MappingTools.convertJoinTableDefaultToSpecifiedInverseJoinColumn(this);
- }
-
- protected JavaJoinColumn buildInverseJoinColumn(JoinColumnAnnotation joinColumnAnnotation) {
- return this.buildJoinColumn(joinColumnAnnotation, this.inverseJoinColumnOwner);
- }
-
-
- // ********** default inverse join column **********
-
- public JavaJoinColumn getDefaultInverseJoinColumn() {
- return this.defaultInverseJoinColumn;
- }
-
- protected void setDefaultInverseJoinColumn(JavaJoinColumn defaultInverseJoinColumn) {
- JavaJoinColumn old = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = defaultInverseJoinColumn;
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, old, defaultInverseJoinColumn);
- }
-
- protected ListIterator<JavaJoinColumn> defaultInverseJoinColumns() {
- if (this.defaultInverseJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultInverseJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultInverseJoinColumnsSize() {
- return (this.defaultInverseJoinColumn == null) ? 0 : 1;
- }
-
- protected void initializeDefaultInverseJoinColumn(JoinTableAnnotation joinTableAnnotation) {
- if (this.shouldBuildDefaultInverseJoinColumn()) {
- this.defaultInverseJoinColumn = this.buildInverseJoinColumn(new NullJoinColumnAnnotation(joinTableAnnotation));
- }
- }
-
- protected boolean shouldBuildDefaultInverseJoinColumn() {
- return ! this.hasSpecifiedInverseJoinColumns();
- }
-
- protected void updateDefaultInverseJoinColumn(JoinTableAnnotation joinTableAnnotation) {
- if (this.shouldBuildDefaultInverseJoinColumn()) {
- if (this.defaultInverseJoinColumn == null) {
- this.setDefaultInverseJoinColumn(this.buildInverseJoinColumn(new NullJoinColumnAnnotation(joinTableAnnotation)));
- } else {
- this.defaultInverseJoinColumn.update(new NullJoinColumnAnnotation(joinTableAnnotation));
- }
- } else {
- this.setDefaultInverseJoinColumn(null);
- }
- }
-
-
- // ********** specified inverse join columns **********
-
- public ListIterator<JavaJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- public boolean hasSpecifiedInverseJoinColumns() {
- return this.specifiedInverseJoinColumns.size() != 0;
- }
-
- public JavaJoinColumn addSpecifiedInverseJoinColumn(int index) {
- // Clear out the default now so it doesn't get removed during an update and
- // cause change notifications to be sent to the UI in the wrong order.
- // If the default is already null, nothing will happen.
- JoinColumn oldDefault = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = null;
-
- JavaJoinColumn inverseJoinColumn = this.getJpaFactory().buildJavaJoinColumn(this, this.inverseJoinColumnOwner);
- this.specifiedInverseJoinColumns.add(index, inverseJoinColumn);
- JoinTableAnnotation joinTableAnnotation = this.getAnnotation();
- JoinColumnAnnotation joinColumnAnnotation = joinTableAnnotation.addInverseJoinColumn(index);
- inverseJoinColumn.initialize(joinColumnAnnotation);
- this.fireItemAdded(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, inverseJoinColumn);
-
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, oldDefault, null);
- return inverseJoinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, JavaJoinColumn inverseJoinColumn) {
- this.addItemToList(index, inverseJoinColumn, this.specifiedInverseJoinColumns, SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedInverseJoinColumn(JavaJoinColumn inverseJoinColumn) {
- this.addSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.size(), inverseJoinColumn);
- }
-
- public void removeSpecifiedInverseJoinColumn(JoinColumn inverseJoinColumn) {
- this.removeSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.indexOf(inverseJoinColumn));
- }
-
- public void removeSpecifiedInverseJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedInverseJoinColumns.remove(index);
- if ( ! this.hasSpecifiedInverseJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultInverseJoinColumn = this.buildInverseJoinColumn(new NullJoinColumnAnnotation(this.getAnnotation()));
- }
- this.getAnnotation().removeInverseJoinColumn(index);
- this.fireItemRemoved(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultInverseJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
- }
-
- protected void removeSpecifiedInverseJoinColumn_(JavaJoinColumn joinColumn) {
- this.removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.getAnnotation().moveInverseJoinColumn(targetIndex, sourceIndex);
- this.fireItemMoved(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void clearSpecifiedInverseJoinColumns() {
- // for now, we have to remove annotations one at a time...
- for (int i = this.specifiedInverseJoinColumns.size(); i-- > 0; ) {
- this.removeSpecifiedInverseJoinColumn(i);
- }
- }
-
- protected void initializeSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableAnnotation) {
- for (ListIterator<JoinColumnAnnotation> stream = joinTableAnnotation.inverseJoinColumns(); stream.hasNext(); ) {
- this.specifiedInverseJoinColumns.add(this.buildInverseJoinColumn(stream.next()));
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(JoinTableAnnotation joinTableAnnotation) {
- ListIterator<JavaJoinColumn> joinColumns = this.specifiedInverseJoinColumns();
- ListIterator<JoinColumnAnnotation> joinColumnAnnotations = joinTableAnnotation.inverseJoinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (joinColumnAnnotations.hasNext()) {
- joinColumn.update(joinColumnAnnotations.next());
- } else {
- this.removeSpecifiedInverseJoinColumn_(joinColumn);
- }
- }
-
- while (joinColumnAnnotations.hasNext()) {
- this.addSpecifiedInverseJoinColumn(this.buildInverseJoinColumn(joinColumnAnnotations.next()));
- }
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.inverseJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
-
-
- // ********** validation **********
-
- @Override
- protected void validateJoinColumns(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validateJoinColumns(messages, reporter, astRoot);
- this.validateJoinColumns(this.inverseJoinColumns(), messages, reporter, astRoot);
- }
-
- @Override
- protected boolean shouldValidateAgainstDatabase() {
- return getParent().shouldValidateAgainstDatabase();
- }
-
- @Override
- protected String getUnresolvedCatalogMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getUnresolvedSchemaMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA;
- }
-
- @Override
- protected String getUnresolvedNameMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME;
- }
-
-
- // ********** join column owner adapters **********
-
- /**
- * just a little common behavior
- */
- protected abstract class AbstractJoinColumnOwner
- implements JavaJoinColumn.Owner
- {
- protected AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaJoinTable.this.getParent().getRelationshipReference().getTypeMapping();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return GenericJavaJoinTable.this.getPersistentAttribute();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the join table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- /**
- * the join column can only be on the join table itself
- */
- public Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- if (GenericJavaJoinTable.this.getName() == null) {
- return null;
- }
- return (GenericJavaJoinTable.this.getName().equals(tableName)) ? GenericJavaJoinTable.this.getDbTable() : null;
- }
-
- /**
- * by default, the join column is, obviously, in the join table;
- * not sure whether it can be anywhere else...
- */
- public String getDefaultTableName() {
- return GenericJavaJoinTable.this.getName();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaJoinTable.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getTableNotValidMessage(),
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_JOIN_TABLE},
- column,
- textRange
- );
- }
-
- protected abstract String getTableNotValidMessage();
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedNameMessage(),
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnresolvedNameMessage();
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedReferencedColumnNameMessage(),
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnresolvedReferencedColumnNameMessage();
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnspecifiedNameMultipleJoinColumnsMessage(),
- new String[0],
- column,
- textRange
- );
- }
-
- protected abstract String getUnspecifiedNameMultipleJoinColumnsMessage();
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(),
- new String[0],
- column,
- textRange
- );
- }
- protected abstract String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage();
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- protected class JoinColumnOwner
- extends AbstractJoinColumnOwner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- public Entity getRelationshipTarget() {
- return GenericJavaJoinTable.this.getParent().getRelationshipReference().getEntity();
- }
-
- public String getAttributeName() {
- RelationshipMapping relationshipMapping = GenericJavaJoinTable.this.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- for (PersistentAttribute each :
- CollectionTools.iterable(
- targetEntity.getPersistentType().allAttributes())) {
- if (each.getMapping().isOwnedBy(relationshipMapping)) {
- return each.getName();
- }
- }
- return null;
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaJoinTable.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.joinColumnsSize();
- }
-
- @Override
- protected String getUnresolvedNameMessage() {
- return JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getTableNotValidMessage() {
- return JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- protected String getUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- protected String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- protected class InverseJoinColumnOwner
- extends AbstractJoinColumnOwner
- {
- protected InverseJoinColumnOwner() {
- super();
- }
-
- public Entity getRelationshipTarget() {
- RelationshipMapping relationshipMapping = GenericJavaJoinTable.this.getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- RelationshipMapping relationshipMapping = GenericJavaJoinTable.this.getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getName();
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity relationshipTarget = getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaJoinTable.this.defaultInverseJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericJavaJoinTable.this.inverseJoinColumnsSize();
- }
-
- @Override
- protected String getUnresolvedNameMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getTableNotValidMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- protected String getUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- protected String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaLobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaLobConverter.java
deleted file mode 100644
index 3755a7cd84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaLobConverter.java
+++ /dev/null
@@ -1,70 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaLobConverter;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaLobConverter extends AbstractJavaJpaContextNode
- implements JavaLobConverter
-{
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- public GenericJavaLobConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.LOB_CONVERTER;
- }
-
- protected String getAnnotationName() {
- return LobAnnotation.ANNOTATION_NAME;
- }
-
- public void addToResourceModel() {
- this.resourcePersistentAttribute.addAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeAnnotation(getAnnotationName());
- }
-
- protected TemporalAnnotation getResourceLob() {
- return (TemporalAnnotation) this.resourcePersistentAttribute.
- getAnnotation(getAnnotationName());
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceLob().getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToManyMapping.java
deleted file mode 100644
index 4d0780cc47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToManyMapping.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToManyMapping;
-
-
-public class GenericJavaManyToManyMapping
- extends AbstractJavaManyToManyMapping
-{
- public GenericJavaManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToOneMapping.java
deleted file mode 100644
index d4730b8b38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaManyToOneMapping.java
+++ /dev/null
@@ -1,30 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-
-
-public class GenericJavaManyToOneMapping
- extends AbstractJavaManyToOneMapping
-{
- public GenericJavaManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaManyToOneRelationshipReference(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaMappedSuperclass.java
deleted file mode 100644
index 3b19e3a6e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaMappedSuperclass.java
+++ /dev/null
@@ -1,22 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaMappedSuperclass;
-
-public class GenericJavaMappedSuperclass extends AbstractJavaMappedSuperclass
-{
-
- public GenericJavaMappedSuperclass(JavaPersistentType parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedNativeQuery.java
deleted file mode 100644
index ab5d1a5d28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedNativeQuery.java
+++ /dev/null
@@ -1,86 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaQuery;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-
-
-public class GenericJavaNamedNativeQuery extends AbstractJavaQuery
- implements JavaNamedNativeQuery
-{
-
- protected String resultClass;
-
- protected String resultSetMapping;
-
- public GenericJavaNamedNativeQuery(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected NamedNativeQueryAnnotation getResourceQuery() {
- return (NamedNativeQueryAnnotation) super.getResourceQuery();
- }
-
- public char getResultClassEnclosingTypeSeparator() {
- return '.';
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- getResourceQuery().setResultClass(newResultClass);
- firePropertyChanged(NamedNativeQuery.RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- protected void setResultClass_(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- firePropertyChanged(NamedNativeQuery.RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- getResourceQuery().setResultSetMapping(newResultSetMapping);
- firePropertyChanged(NamedNativeQuery.RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
- protected void setResultSetMapping_(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- firePropertyChanged(NamedNativeQuery.RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
- public void initialize(NamedNativeQueryAnnotation resourceQuery) {
- super.initialize(resourceQuery);
- this.resultClass = resourceQuery.getResultClass();
- this.resultSetMapping = resourceQuery.getResultSetMapping();
- }
-
- public void update(NamedNativeQueryAnnotation resourceQuery) {
- super.update(resourceQuery);
- this.setResultClass_(resourceQuery.getResultClass());
- this.setResultSetMapping_(resourceQuery.getResultSetMapping());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedQuery.java
deleted file mode 100644
index d5d7a9630d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNamedQuery.java
+++ /dev/null
@@ -1,38 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaQuery;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-
-
-public class GenericJavaNamedQuery extends AbstractJavaQuery implements JavaNamedQuery
-{
-
- public GenericJavaNamedQuery(JavaJpaContextNode parent) {
- super(parent);
- }
-
- @Override
- protected NamedQueryAnnotation getResourceQuery() {
- return (NamedQueryAnnotation) super.getResourceQuery();
- }
-
- public void initialize(NamedQueryAnnotation resourceQuery) {
- super.initialize(resourceQuery);
- }
-
- public void update(NamedQueryAnnotation resourceQuery) {
- super.update(resourceQuery);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullAttributeMapping.java
deleted file mode 100644
index 790b932832..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullAttributeMapping.java
+++ /dev/null
@@ -1,51 +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.core.internal.jpa1.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaNullAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation>
-{
- public GenericJavaNullAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return null;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- }
-
-
- // ********** metamodel **********
-
- @Override
- public MetamodelField getMetamodelField() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullConverter.java
deleted file mode 100644
index 7215197f00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaNullConverter.java
+++ /dev/null
@@ -1,52 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaNullConverter extends AbstractJavaJpaContextNode
- implements JavaConverter
-{
-
- public GenericJavaNullConverter(JavaAttributeMapping parent) {
- super(parent);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.NO_CONVERTER;
- }
-
- public void addToResourceModel() {
- //do nothing
- }
-
- public void removeFromResourceModel() {
- //do nothin
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- //do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyMapping.java
deleted file mode 100644
index 68e49c9904..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyMapping.java
+++ /dev/null
@@ -1,31 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-
-
-public class GenericJavaOneToManyMapping
- extends AbstractJavaOneToManyMapping<OneToMany2_0Annotation>
-{
-
- public GenericJavaOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaRelationshipReference buildRelationshipReference() {
- return new GenericJavaOneToManyRelationshipReference(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyRelationshipReference.java
deleted file mode 100644
index d54772a5c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,55 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyRelationshipReference;
-
-public class GenericJavaOneToManyRelationshipReference
- extends AbstractJavaOneToManyRelationshipReference
-{
-
- public GenericJavaOneToManyRelationshipReference(JavaOneToManyMapping parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new NullJavaJoinColumnJoiningStrategy(this);
- }
-
- // **************** join columns *******************************************
-
- @Override
- public boolean usesJoinColumnJoiningStrategy() {
- return false;
- }
-
- @Override
- public void setJoinColumnJoiningStrategy() {
- throw new UnsupportedOperationException("join column joining strategy not supported on a 1.0 1-m mapping"); //$NON-NLS-1$
- }
-
- @Override
- public void unsetJoinColumnJoiningStrategy() {
- throw new UnsupportedOperationException("join column joining strategy not supported on a 1.0 1-m mapping"); //$NON-NLS-1$
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToOneMapping.java
deleted file mode 100644
index 3c9b2f74c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOneToOneMapping.java
+++ /dev/null
@@ -1,30 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-
-
-public class GenericJavaOneToOneMapping
- extends AbstractJavaOneToOneMapping
-{
- public GenericJavaOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaOneToOneRelationshipReference(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java
deleted file mode 100644
index 6ebe7b84fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaOrderable.java
+++ /dev/null
@@ -1,401 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaOrderColumn2_0;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaOrderable
- extends AbstractJavaJpaContextNode
- implements JavaOrderable2_0
-{
-
- protected String specifiedOrderBy = null;
- protected boolean noOrdering = false;
- protected boolean pkOrdering = false;
- protected boolean customOrdering = false;
-
- //JPA 2.0
- protected final Orderable.Owner owner; //the owner is only used for 2.0 projects
- protected boolean orderColumnOrdering = false;
- protected final JavaOrderColumn2_0 orderColumn;
-
- public GenericJavaOrderable(JavaAttributeMapping parent, Orderable.Owner owner) {
- super(parent);
- this.owner = owner;
- this.orderColumn = buildOrderColumn();
- }
-
- public void initialize() {
- this.initializeOrdering();
- }
-
- public void update() {
- this.updateOrdering();
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- protected JavaResourcePersistentAttribute getResourcePersistentAttribute() {
- return this.getPersistentAttribute().getResourcePersistentAttribute();
- }
-
-
- // ********** Orderable2_0 implementation **********
-
- public String getDefaultTableName() {
- return getOwner().getTableName();
- }
-
- /**
- * Only call this for 2.0 projects
- */
- protected Orderable2_0.Owner getOwner() {
- return (Orderable2_0.Owner) this.owner;
- }
-
- // ********** order by **********
-
- public String getSpecifiedOrderBy() {
- return this.specifiedOrderBy;
- }
-
- public void setSpecifiedOrderBy(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (orderBy == null) {
- if (orderByAnnotation != null) {
- this.removeOrderByAnnotation();
- }
- } else {
- if (orderByAnnotation == null) {
- orderByAnnotation = this.addOrderByAnnotation();
- }
- orderByAnnotation.setValue(orderBy);
- }
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void setSpecifiedOrderBy_(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void initializeOrdering() {
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
- if (orderByAnnotation == null && orderColumnAnnotation == null) {
- this.noOrdering = true;
- } else if (orderByAnnotation != null){
- this.specifiedOrderBy = orderByAnnotation.getValue();
- if (this.specifiedOrderBy == null) {
- this.pkOrdering = true;
- } else {
- this.customOrdering = true;
- }
- } else {
- this.orderColumnOrdering = true;
- }
- this.orderColumn.initialize(getResourcePersistentAttribute());
- }
-
- protected void updateOrdering() {
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
- if (orderByAnnotation == null && orderColumnAnnotation == null) {
- this.setSpecifiedOrderBy_(null);
- this.setNoOrdering_(true);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- this.setOrderColumnOrdering_(false);
- } else if (orderByAnnotation != null) {
- String ob = orderByAnnotation.getValue();
- this.setSpecifiedOrderBy_(ob);
- this.setNoOrdering_(false);
- this.setPkOrdering_(ob == null);
- this.setCustomOrdering_(ob != null);
- this.setOrderColumnOrdering_(false);
- } else {
- this.setSpecifiedOrderBy_(null);
- this.setNoOrdering_(false);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- this.setOrderColumnOrdering_(true);
- }
- this.orderColumn.update(getResourcePersistentAttribute());
- }
-
- protected OrderByAnnotation getOrderByAnnotation() {
- return (OrderByAnnotation) this.getResourcePersistentAttribute().getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected OrderByAnnotation addOrderByAnnotation() {
- return (OrderByAnnotation) this.getResourcePersistentAttribute().addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeOrderByAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- }
-
-
- // ********** no ordering **********
-
- public boolean isNoOrdering() {
- return this.noOrdering;
- }
-
- public void setNoOrdering(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- if (noOrdering) {
- if (this.getOrderByAnnotation() != null) {
- this.removeOrderByAnnotation();
- }
- if (this.getOrderColumnAnnotation() != null) {
- this.removeOrderColumnAnnotation();
- }
- } else {
- // the 'noOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setNoOrdering_(boolean)
- }
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
- protected void setNoOrdering_(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
-
- // ********** pk ordering **********
-
- public boolean isPkOrdering() {
- return this.pkOrdering;
- }
-
- public void setPkOrdering(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- if (pkOrdering) {
- if (orderByAnnotation == null) {
- this.addOrderByAnnotation();
- } else {
- orderByAnnotation.setValue(null);
- }
- } else {
- // the 'pkOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setPkOrdering_(boolean)
- }
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
- protected void setPkOrdering_(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
-
- // ********** custom ordering **********
-
- public boolean isCustomOrdering() {
- return this.customOrdering;
- }
-
- public void setCustomOrdering(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- if (customOrdering) {
- this.setSpecifiedOrderBy(""); //$NON-NLS-1$
- } else {
- // the 'customOrdering' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setCustomOrdering_(boolean)
- }
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
-
- protected void setCustomOrdering_(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
-
- // ********** order column 2.0 **********
-
- protected JavaOrderColumn2_0 buildOrderColumn() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) getJpaFactory()).buildJavaOrderColumn(this, new OrderColumnOwner()) :
- new NullJavaOrderColumn2_0(this, new OrderColumnOwner());
- }
-
- public boolean isOrderColumnOrdering() {
- return this.orderColumnOrdering;
- }
-
- public void setOrderColumnOrdering(boolean orderColumnOrdering) {
- boolean old = this.orderColumnOrdering;
- this.orderColumnOrdering = orderColumnOrdering;
- OrderColumn2_0Annotation orderColumnAnnotation = this.getOrderColumnAnnotation();
- if (orderColumnOrdering) {
- if (orderColumnAnnotation == null) {
- this.addOrderColumnAnnotation();
- }
- this.removeOrderByAnnotation();
- } else {
- removeOrderColumnAnnotation();
- }
- this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
- }
-
- protected void setOrderColumnOrdering_(boolean orderColumnOrdering) {
- boolean old = this.orderColumnOrdering;
- this.orderColumnOrdering = orderColumnOrdering;
- this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
- }
-
- public JavaOrderColumn2_0 getOrderColumn() {
- return this.orderColumn;
- }
-
- protected OrderColumn2_0Annotation getOrderColumnAnnotation() {
- return (OrderColumn2_0Annotation) this.getResourcePersistentAttribute().getAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
- }
-
- protected OrderColumn2_0Annotation addOrderColumnAnnotation() {
- return (OrderColumn2_0Annotation) this.getResourcePersistentAttribute().addAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
- }
-
- protected void removeOrderColumnAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getOrderColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getOrderByAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- protected TextRange getOrderByAnnotationTextRange(CompilationUnit astRoot) {
- OrderByAnnotation orderByAnnotation = this.getOrderByAnnotation();
- return (orderByAnnotation == null) ? null : orderByAnnotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getOrderColumnAnnotation() != null && getOrderByAnnotation() != null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED,
- new String[] {getPersistentAttribute().getName()},
- this.getParent(),
- this.getOrderByAnnotationTextRange(astRoot)
- )
- );
- }
- if (isOrderColumnOrdering()) {
- //TODO validation message if type is not List
- this.getOrderColumn().validate(messages, reporter, astRoot);
- }
- }
-
- // ********** JavaNamedColumn.Owner implementation- JPA 2.0 **********
-
- protected class OrderColumnOwner implements JavaNamedColumn.Owner {
-
- public String getDefaultTableName() {
- return GenericJavaOrderable.this.getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return getPersistentAttribute().getName() + "_ORDER"; //$NON-NLS-1$
- }
-
- public TypeMapping getTypeMapping() {
- return getPersistentAttribute().getOwningTypeMapping();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaOrderable.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ORDER_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentAttribute.java
deleted file mode 100644
index 7d052c2afb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentAttribute.java
+++ /dev/null
@@ -1,42 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * Generic Java persistent attribute
- */
-public class GenericJavaPersistentAttribute
- extends AbstractJavaPersistentAttribute
-{
-
- public GenericJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
- super(parent, jrpa);
- }
-
-
- // ********** AccessHolder implementation **********
-
- /**
- * GenericJavaPersistentAttribute does not support specified access (no access element in 1.0), so we return null
- */
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentType.java
deleted file mode 100644
index a18bb0ff37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPersistentType.java
+++ /dev/null
@@ -1,49 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * JPA 1.0 Java persistent type.
- * The specified access is always null.
- */
-public class GenericJavaPersistentType
- extends AbstractJavaPersistentType
-{
-
- public GenericJavaPersistentType(PersistentType.Owner parent, JavaResourcePersistentType jrpt) {
- super(parent, jrpt);
- }
-
-
- // ********** access **********
-
- /**
- * GenericJavaPersistentType does not support specified access (no Access
- * annotation in 1.0), so we return null
- */
- @Override
- protected AccessType buildSpecifiedAccess() {
- return null;
- }
-
- /**
- * GenericJavaPersistentType does not support specified access
- * (no Access annotation in 1.0)
- */
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java
deleted file mode 100644
index 6a66e6da61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaPrimaryKeyJoinColumn.java
+++ /dev/null
@@ -1,209 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericJavaPrimaryKeyJoinColumn extends AbstractJavaNamedColumn<PrimaryKeyJoinColumnAnnotation>
- implements JavaPrimaryKeyJoinColumn
-{
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- public GenericJavaPrimaryKeyJoinColumn(JavaJpaContextNode parent, JavaBaseJoinColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public void initialize(PrimaryKeyJoinColumnAnnotation column) {
- super.initialize(column);
- this.specifiedReferencedColumnName = this.getResourceReferencedColumnName();
- this.defaultReferencedColumnName = this.buildDefaultReferencedColumnName();
- }
-
- @Override
- public void update(PrimaryKeyJoinColumnAnnotation resourceColumn) {
- super.update(resourceColumn);
- this.setSpecifiedReferencedColumnName_(this.getResourceReferencedColumnName());
- this.setDefaultReferencedColumnName(this.buildDefaultReferencedColumnName());
- }
-
- //************** JavaNamedColumn implementation ***************
- @Override
- public JavaBaseJoinColumn.Owner getOwner() {
- return (JavaBaseJoinColumn.Owner) super.getOwner();
- }
-
- //************** BaseJoinColumn implementation ***************
-
- public String getReferencedColumnName() {
- return (this.specifiedReferencedColumnName == null) ? this.defaultReferencedColumnName : this.specifiedReferencedColumnName;
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- getResourceColumn().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- @Override
- public String getTable() {
- return getOwner().getDefaultTableName();
- }
-
- public Column getReferencedDbColumn() {
- Table table = this.getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
- }
-
- public Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceColumn().referencedColumnNameTouches(pos, astRoot);
- }
-
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.referencedColumnNameTouches(pos, astRoot)) {
- return this.getJavaCandidateReferencedColumnNames(filter).iterator();
- }
- return null;
- }
-
- private Iterable<String> getJavaCandidateReferencedColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateReferencedColumnNames(filter));
- }
-
- private Iterable<String> getCandidateReferencedColumnNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateReferencedColumnNames(), filter);
- }
-
- private Iterable<String> getCandidateReferencedColumnNames() {
- Table table = this.getOwner().getReferencedColumnDbTable();
- return (table != null) ? table.getSortedColumnIdentifiers() : EmptyIterable.<String> instance();
- }
-
- public boolean isReferencedColumnResolved() {
- return getReferencedDbColumn() != null;
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getResourceColumn().getReferencedColumnNameTextRange(astRoot);
- return textRange != null ? textRange : getValidationTextRange(astRoot);
- }
-
- protected String getResourceReferencedColumnName() {
- return getResourceColumn().getReferencedColumnName();
- }
-
- //TODO not correct when we start supporting primaryKeyJoinColumns in 1-1 mappings
- protected String buildDefaultReferencedColumnName() {
- return buildDefaultName();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append("=>"); //$NON-NLS-1$
- sb.append(this.getReferencedColumnName());
- }
-
- @Override
- //this method will only be called if the table validates correctly
- protected void validateName(List<IMessage> messages, CompilationUnit astRoot) {
- this.validateJoinColumnName(messages, astRoot);
- this.validateReferencedColumnName(messages, astRoot);
- }
-
- protected void validateJoinColumnName(List<IMessage> messages, CompilationUnit astRoot) {
- if (getSpecifiedName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedNameMultipleJoinColumnsMessage(astRoot));
- }
- else if (this.getName() != null){
- super.validateName(messages, astRoot);
- }
- //If the name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected void validateReferencedColumnName(List<IMessage> messages, CompilationUnit astRoot) {
- if (getSpecifiedReferencedColumnName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(astRoot));
- }
- else if (this.getReferencedColumnName() != null) {
- if (this.getReferencedColumnDbTable() != null && ! this.isReferencedColumnResolved()) {
- messages.add(getOwner().buildUnresolvedReferencedColumnNameMessage(this, this.getReferencedColumnNameTextRange(astRoot)));
- }
- }
- //If the referenced column name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(CompilationUnit astRoot) {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(this, getNameTextRange(astRoot));
- }
-
- protected IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(CompilationUnit astRoot) {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(this, getReferencedColumnNameTextRange(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java
deleted file mode 100644
index 3baaedc7bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryContainer.java
+++ /dev/null
@@ -1,293 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaQueryContainer extends AbstractJavaJpaContextNode
- implements JavaQueryContainer
-{
- protected JavaResourcePersistentMember javaResourcePersistentMember;
-
- protected final List<JavaNamedQuery> namedQueries;
-
- protected final List<JavaNamedNativeQuery> namedNativeQueries;
-
- public GenericJavaQueryContainer(JavaJpaContextNode parent) {
- super(parent);
- this.namedQueries = new ArrayList<JavaNamedQuery>();
- this.namedNativeQueries = new ArrayList<JavaNamedNativeQuery>();
- }
-
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
-
- public ListIterator<JavaNamedQuery> namedQueries() {
- return new CloneListIterator<JavaNamedQuery>(this.namedQueries);
- }
-
- public int namedQueriesSize() {
- return this.namedQueries.size();
- }
-
- public JavaNamedQuery addNamedQuery(int index) {
- JavaNamedQuery namedQuery = getJpaFactory().buildJavaNamedQuery(this);
- this.namedQueries.add(index, namedQuery);
- NamedQueryAnnotation namedQueryAnnotation =
- (NamedQueryAnnotation) this.javaResourcePersistentMember.
- addAnnotation(
- index, NamedQueryAnnotation.ANNOTATION_NAME,
- NamedQueriesAnnotation.ANNOTATION_NAME);
- namedQuery.initialize(namedQueryAnnotation);
- fireItemAdded(NAMED_QUERIES_LIST, index, namedQuery);
- return namedQuery;
- }
-
- protected void addNamedQuery(int index, JavaNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, NAMED_QUERIES_LIST);
- }
-
- protected void addNamedQuery(JavaNamedQuery namedQuery) {
- this.addNamedQuery(this.namedQueries.size(), namedQuery);
- }
-
- public void removeNamedQuery(NamedQuery namedQuery) {
- removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- JavaNamedQuery removedNamedQuery = this.namedQueries.remove(index);
- this.javaResourcePersistentMember.removeAnnotation(
- index, NamedQueryAnnotation.ANNOTATION_NAME, NamedQueriesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(NAMED_QUERIES_LIST, index, removedNamedQuery);
- }
-
- protected void removeNamedQuery_(JavaNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.javaResourcePersistentMember.moveAnnotation(
- targetIndex, sourceIndex, NamedQueriesAnnotation.ANNOTATION_NAME);
- fireItemMoved(NAMED_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<JavaNamedNativeQuery> namedNativeQueries() {
- return new CloneListIterator<JavaNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int namedNativeQueriesSize() {
- return this.namedNativeQueries.size();
- }
-
- public JavaNamedNativeQuery addNamedNativeQuery(int index) {
- JavaNamedNativeQuery namedNativeQuery = getJpaFactory().buildJavaNamedNativeQuery(this);
- this.namedNativeQueries.add(index, namedNativeQuery);
- NamedNativeQueryAnnotation namedNativeQueryAnnotation =
- (NamedNativeQueryAnnotation) this.javaResourcePersistentMember.
- addAnnotation(
- index, NamedNativeQueryAnnotation.ANNOTATION_NAME,
- NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- namedNativeQuery.initialize(namedNativeQueryAnnotation);
- fireItemAdded(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- return namedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, JavaNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- protected void addNamedNativeQuery(JavaNamedNativeQuery namedNativeQuery) {
- this.addNamedNativeQuery(this.namedNativeQueries.size(), namedNativeQuery);
- }
-
- public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
- this.removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- JavaNamedNativeQuery removedNamedNativeQuery = this.namedNativeQueries.remove(index);
- this.javaResourcePersistentMember.removeAnnotation(
- index, NamedNativeQueryAnnotation.ANNOTATION_NAME,
- NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- fireItemRemoved(NAMED_NATIVE_QUERIES_LIST, index, removedNamedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(JavaNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.javaResourcePersistentMember.moveAnnotation(
- targetIndex, sourceIndex, NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- fireItemMoved(NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
-
-
- public void initialize(JavaResourcePersistentMember jrpm) {
- this.javaResourcePersistentMember = jrpm;
- this.initializeNamedQueries();
- this.initializeNamedNativeQueries();
- }
-
- protected void initializeNamedQueries() {
- for (Iterator<NestableAnnotation> stream = this.javaResourcePersistentMember.
- annotations(
- NamedQueryAnnotation.ANNOTATION_NAME,
- NamedQueriesAnnotation.ANNOTATION_NAME);
- stream.hasNext(); ) {
- this.namedQueries.add(buildNamedQuery((NamedQueryAnnotation) stream.next()));
- }
- }
-
- protected void initializeNamedNativeQueries() {
- for (Iterator<NestableAnnotation> stream = this.javaResourcePersistentMember.
- annotations(
- NamedNativeQueryAnnotation.ANNOTATION_NAME,
- NamedNativeQueriesAnnotation.ANNOTATION_NAME);
- stream.hasNext(); ) {
- this.namedNativeQueries.add(buildNamedNativeQuery((NamedNativeQueryAnnotation) stream.next()));
- }
- }
-
- protected JavaNamedQuery buildNamedQuery(NamedQueryAnnotation namedQueryResource) {
- JavaNamedQuery namedQuery = getJpaFactory().buildJavaNamedQuery(this);
- namedQuery.initialize(namedQueryResource);
- return namedQuery;
- }
-
- protected JavaNamedNativeQuery buildNamedNativeQuery(NamedNativeQueryAnnotation namedNativeQueryResource) {
- JavaNamedNativeQuery namedNativeQuery = getJpaFactory().buildJavaNamedNativeQuery(this);
- namedNativeQuery.initialize(namedNativeQueryResource);
- return namedNativeQuery;
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- this.javaResourcePersistentMember = jrpm;
- this.updateNamedQueries();
- this.updateNamedNativeQueries();
- }
-
- protected void updateNamedQueries() {
- ListIterator<JavaNamedQuery> queries = namedQueries();
- Iterator<NestableAnnotation> resourceNamedQueries =
- this.javaResourcePersistentMember.annotations(
- NamedQueryAnnotation.ANNOTATION_NAME,
- NamedQueriesAnnotation.ANNOTATION_NAME);
-
- while (queries.hasNext()) {
- JavaNamedQuery namedQuery = queries.next();
- if (resourceNamedQueries.hasNext()) {
- namedQuery.update((NamedQueryAnnotation) resourceNamedQueries.next());
- }
- else {
- removeNamedQuery_(namedQuery);
- }
- }
-
- while (resourceNamedQueries.hasNext()) {
- addNamedQuery(buildNamedQuery((NamedQueryAnnotation) resourceNamedQueries.next()));
- }
- }
-
- protected void updateNamedNativeQueries() {
- ListIterator<JavaNamedNativeQuery> queries = namedNativeQueries();
- Iterator<NestableAnnotation> resourceNamedNativeQueries =
- this.javaResourcePersistentMember.annotations(
- NamedNativeQueryAnnotation.ANNOTATION_NAME,
- NamedNativeQueriesAnnotation.ANNOTATION_NAME);
-
- while (queries.hasNext()) {
- JavaNamedNativeQuery namedQuery = queries.next();
- if (resourceNamedNativeQueries.hasNext()) {
- namedQuery.update((NamedNativeQueryAnnotation) resourceNamedNativeQueries.next());
- }
- else {
- removeNamedNativeQuery_(namedQuery);
- }
- }
-
- while (resourceNamedNativeQueries.hasNext()) {
- addNamedNativeQuery(buildNamedNativeQuery((NamedNativeQueryAnnotation) resourceNamedNativeQueries.next()));
- }
- }
-
-
- //********** Validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateQueries(messages, astRoot);
- }
-
- protected void validateQueries(List<IMessage> messages, CompilationUnit astRoot) {
- for (Iterator<JavaQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
- JavaQuery localQuery = localQueries.next();
- for (Iterator<Query> globalQueries = this.getPersistenceUnit().queries(); globalQueries.hasNext(); ) {
- if (localQuery.duplicates(globalQueries.next())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.QUERY_DUPLICATE_NAME,
- new String[] {localQuery.getName()},
- localQuery,
- localQuery.getNameTextRange(astRoot)
- )
- );
- }
- }
- }
- }
-
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaQuery> queries() {
- return new CompositeIterator<JavaQuery>(this.namedNativeQueries(), this.namedQueries());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.javaResourcePersistentMember.getTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryHint.java
deleted file mode 100644
index e785903ef3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaQueryHint.java
+++ /dev/null
@@ -1,77 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.java.JavaQuery;
-import org.eclipse.jpt.core.context.java.JavaQueryHint;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaQueryHint extends AbstractJavaJpaContextNode implements JavaQueryHint
-{
- protected String name;
-
- protected String value;
-
- protected QueryHintAnnotation resourceQueryHint;
-
- public GenericJavaQueryHint(JavaQuery parent) {
- super(parent);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceQueryHint.setName(newName);
- firePropertyChanged(QueryHint.NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.resourceQueryHint.setValue(newValue);
- firePropertyChanged(QueryHint.VALUE_PROPERTY, oldValue, newValue);
- }
-
-
- public void initialize(QueryHintAnnotation resourceQueryHint) {
- this.resourceQueryHint = resourceQueryHint;
- this.name = resourceQueryHint.getName();
- this.value = resourceQueryHint.getValue();
- }
-
- public void update(QueryHintAnnotation resourceQueryHint) {
- this.resourceQueryHint = resourceQueryHint;
- this.setName(resourceQueryHint.getName());
- this.setValue(resourceQueryHint.getValue());
- }
-
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceQueryHint.getTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaReferenceTable.java
deleted file mode 100644
index 51691fe363..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaReferenceTable.java
+++ /dev/null
@@ -1,365 +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.core.internal.jpa1.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaReferenceTable;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTable;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.ReferenceTableAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Java join table
- */
-public abstract class GenericJavaReferenceTable
- extends AbstractJavaTable
- implements JavaReferenceTable
-{
-
- protected JavaJoinColumn defaultJoinColumn;
-
- protected final Vector<JavaJoinColumn> specifiedJoinColumns = new Vector<JavaJoinColumn>();
- protected final JavaJoinColumn.Owner joinColumnOwner;
-
-
- protected GenericJavaReferenceTable(JavaJpaContextNode parent) {
- super(parent);
- this.joinColumnOwner = this.buildJoinColumnOwner();
- }
-
- protected abstract JavaJoinColumn.Owner buildJoinColumnOwner();
-
- public void initialize(ReferenceTableAnnotation referenceTableAnnotation) {
- super.initialize(referenceTableAnnotation);
- this.initializeSpecifiedJoinColumns(referenceTableAnnotation);
- this.initializeDefaultJoinColumn(referenceTableAnnotation);
- }
-
- public void update(ReferenceTableAnnotation referenceTableAnnotation) {
- super.update(referenceTableAnnotation);
- this.updateSpecifiedJoinColumns(referenceTableAnnotation);
- this.updateDefaultJoinColumn(referenceTableAnnotation);
- }
-
-
- // ********** AbstractJavaTable implementation **********
-
- @Override
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- @Override
- protected abstract ReferenceTableAnnotation getAnnotation();
-
-
- // ********** Table implementation **********
-
- public boolean isResourceSpecified() {
- return this.getAnnotation().isSpecified();
- }
-
-
- // ********** join columns **********
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- return this.hasSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.hasSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public void convertDefaultToSpecifiedJoinColumn() {
- MappingTools.convertReferenceTableDefaultToSpecifiedJoinColumn(this);
- }
-
- protected JavaJoinColumn buildJoinColumn(JoinColumnAnnotation joinColumnAnnotation) {
- return this.buildJoinColumn(joinColumnAnnotation, this.joinColumnOwner);
- }
-
-
- // ********** default join column **********
-
- public JavaJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(JavaJoinColumn defaultJoinColumn) {
- JavaJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = defaultJoinColumn;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, old, defaultJoinColumn);
- }
-
- protected ListIterator<JavaJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<JavaJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
- protected void initializeDefaultJoinColumn(ReferenceTableAnnotation referenceTableAnnotation) {
- if (this.shouldBuildDefaultJoinColumn()) {
- this.defaultJoinColumn = this.buildJoinColumn(new NullJoinColumnAnnotation(referenceTableAnnotation));
- }
- }
-
- protected void updateDefaultJoinColumn(ReferenceTableAnnotation referenceTableAnnotation) {
- if (this.shouldBuildDefaultJoinColumn()) {
- if (this.defaultJoinColumn == null) {
- this.setDefaultJoinColumn(this.buildJoinColumn(new NullJoinColumnAnnotation(referenceTableAnnotation)));
- } else {
- this.defaultJoinColumn.update(new NullJoinColumnAnnotation(referenceTableAnnotation));
- }
- } else {
- this.setDefaultJoinColumn(null);
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return ! this.hasSpecifiedJoinColumns();
- }
-
-
- // ********** specified join columns **********
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<JavaJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return this.specifiedJoinColumns.size() != 0;
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- // Clear out the default now so it doesn't get removed during an update and
- // cause change notifications to be sent to the UI in the wrong order.
- // If the default is already null, nothing will happen.
- JoinColumn oldDefault = this.defaultJoinColumn;
- this.defaultJoinColumn = null;
-
- JavaJoinColumn joinColumn = this.getJpaFactory().buildJavaJoinColumn(this, this.joinColumnOwner);
- this.specifiedJoinColumns.add(index, joinColumn);
- ReferenceTableAnnotation referenceTableAnnotation = this.getAnnotation();
- JoinColumnAnnotation joinColumnAnnotation = referenceTableAnnotation.addJoinColumn(index);
- joinColumn.initialize(joinColumnAnnotation);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
-
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, oldDefault, null);
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, JavaJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(JavaJoinColumn joinColumn) {
- this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- JavaJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if ( ! this.hasSpecifiedJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = this.buildJoinColumn(new NullJoinColumnAnnotation(this.getAnnotation()));
- }
- this.getAnnotation().removeJoinColumn(index);
- this.fireItemRemoved(SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(JavaJoinColumn joinColumn) {
- this.removeItemFromList(joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.getAnnotation().moveJoinColumn(targetIndex, sourceIndex);
- this.fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void clearSpecifiedJoinColumns() {
- // for now, we have to remove annotations one at a time...
- for (int i = this.specifiedJoinColumns.size(); i-- > 0; ) {
- this.removeSpecifiedJoinColumn(i);
- }
- }
-
- protected void initializeSpecifiedJoinColumns(ReferenceTableAnnotation referenceTableAnnotation) {
- for (ListIterator<JoinColumnAnnotation> stream = referenceTableAnnotation.joinColumns(); stream.hasNext(); ) {
- this.specifiedJoinColumns.add(this.buildJoinColumn(stream.next()));
- }
- }
-
- protected void updateSpecifiedJoinColumns(ReferenceTableAnnotation referenceTableAnnotation) {
- ListIterator<JavaJoinColumn> joinColumns = this.specifiedJoinColumns();
- ListIterator<JoinColumnAnnotation> joinColumnAnnotations = referenceTableAnnotation.joinColumns();
-
- while (joinColumns.hasNext()) {
- JavaJoinColumn joinColumn = joinColumns.next();
- if (joinColumnAnnotations.hasNext()) {
- joinColumn.update(joinColumnAnnotations.next());
- } else {
- this.removeSpecifiedJoinColumn_(joinColumn);
- }
- }
-
- while (joinColumnAnnotations.hasNext()) {
- this.addSpecifiedJoinColumn(this.buildJoinColumn(joinColumnAnnotations.next()));
- }
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaJoinColumn column : CollectionTools.iterable(this.joinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
-
- // ********** misc **********
-
- protected JavaJoinColumn buildJoinColumn(JoinColumnAnnotation joinColumnAnnotation, JavaJoinColumn.Owner owner) {
- JavaJoinColumn joinColumn = this.getJpaFactory().buildJavaJoinColumn(this, owner);
- joinColumn.initialize(joinColumnAnnotation);
- return joinColumn;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- boolean continueValidating = true;
- if (this.shouldValidateAgainstDatabase()) {
- continueValidating = this.validateAgainstDatabase(messages, reporter, astRoot);
- }
- //join column validation will handle the check for whether to validate against the database
- //some validation messages are not database specific. If the database validation for the
- //table fails we will stop there and not validate the join columns at all
- if (continueValidating) {
- this.validateJoinColumns(messages, reporter, astRoot);
- }
- }
-
- protected abstract boolean shouldValidateAgainstDatabase();
-
- protected boolean validateAgainstDatabase(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if ( ! this.hasResolvedCatalog()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedCatalogMessageId(),
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange(astRoot)
- )
- );
- return false;
- }
-
- if ( ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedSchemaMessageId(),
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange(astRoot)
- )
- );
- return false;
- }
-
- if ( ! this.isResolved()) {
- if (getName() != null) { //if name is null, the validation will be handled elsewhere, such as the target entity is not defined
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedNameMessageId(),
- new String[] {this.getName()},
- this,
- this.getNameTextRange(astRoot))
- );
- }
- return false;
- }
- return true;
- }
-
- protected void validateJoinColumns(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- this.validateJoinColumns(this.joinColumns(), messages, reporter, astRoot);
- }
-
- protected void validateJoinColumns(Iterator<JavaJoinColumn> joinColumns, List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- while (joinColumns.hasNext()) {
- joinColumns.next().validate(messages, reporter, astRoot);
- }
- }
-
- protected abstract String getUnresolvedCatalogMessageId();
-
- protected abstract String getUnresolvedSchemaMessageId();
-
- protected abstract String getUnresolvedNameMessageId();
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSecondaryTable.java
deleted file mode 100644
index e3a8df4319..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSecondaryTable.java
+++ /dev/null
@@ -1,466 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTable;
-import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- */
-public class GenericJavaSecondaryTable
- extends AbstractJavaTable
- implements JavaSecondaryTable
-{
- protected final List<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns;
- protected final JavaBaseJoinColumn.Owner primaryKeyJoinColumnOwner;
-
- protected JavaPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected SecondaryTableAnnotation resourceSecondaryTable;
-
- public GenericJavaSecondaryTable(JavaEntity parent) {
- super(parent);
- this.specifiedPrimaryKeyJoinColumns = new ArrayList<JavaPrimaryKeyJoinColumn>();
- this.primaryKeyJoinColumnOwner = this.buildPrimaryKeyJoinColumnOwner();
- }
-
- protected JavaBaseJoinColumn.Owner buildPrimaryKeyJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- @Override
- public JavaEntity getParent() {
- return (JavaEntity) super.getParent();
- }
-
-
- //***************** AbstractJavaTable implementation ********************
-
- @Override
- protected String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected SecondaryTableAnnotation getAnnotation() {
- return this.resourceSecondaryTable;
- }
-
- public boolean isResourceSpecified() {
- return true;
- }
-
- // a secondary table doesn't have a default name
- @Override
- protected String buildDefaultName() {
- return null;
- }
-
- @Override
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
-
- //***************** ISecondaryTable implementation ********************
-
- public ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumns() : this.defaultPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<JavaPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<JavaPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public JavaPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- return this.defaultPrimaryKeyJoinColumn;
- }
-
- protected void setDefaultPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn newPkJoinColumn) {
- JavaPrimaryKeyJoinColumn oldPkJoinColumn = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = newPkJoinColumn;
- firePropertyChanged(DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldPkJoinColumn, newPkJoinColumn);
- }
-
- protected ListIterator<JavaPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- if (this.defaultPrimaryKeyJoinColumn != null) {
- return new SingleElementListIterator<JavaPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultPrimaryKeyJoinColumnsSize() {
- return (this.defaultPrimaryKeyJoinColumn == null) ? 0 : 1;
- }
-
- public JavaPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- // Clear out the default now so it doesn't get removed during an update and
- // cause change notifications to be sent to the UI in the wrong order.
- JavaPrimaryKeyJoinColumn oldDefault = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = null;
-
- JavaPrimaryKeyJoinColumn pkJoinColumn = this.getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, this.primaryKeyJoinColumnOwner);
- this.specifiedPrimaryKeyJoinColumns.add(index, pkJoinColumn);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAnnotation = this.resourceSecondaryTable.addPkJoinColumn(index);
- pkJoinColumn.initialize(pkJoinColumnAnnotation);
- this.fireItemAdded(SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, pkJoinColumn);
-
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefault, null);
- return pkJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.addSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.size(), primaryKeyJoinColumn);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn joinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- JavaPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(this.resourceSecondaryTable));
- }
- this.resourceSecondaryTable.removePkJoinColumn(index);
- fireItemRemoved(SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (this.defaultPrimaryKeyJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, null, this.defaultPrimaryKeyJoinColumn);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(JavaPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.resourceSecondaryTable.movePkJoinColumn(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public JavaEntity getJavaEntity() {
- return getParent();
- }
-
-
- //********************* updating ************************
-
- public void initialize(SecondaryTableAnnotation secondaryTable) {
- super.initialize(secondaryTable);
- this.resourceSecondaryTable = secondaryTable;
- this.initializeSpecifiedPrimaryKeyJoinColumns(secondaryTable);
- this.initializeDefaultPrimaryKeyJoinColumn(secondaryTable);
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns(SecondaryTableAnnotation secondaryTable) {
- ListIterator<PrimaryKeyJoinColumnAnnotation> annotations = secondaryTable.pkJoinColumns();
-
- while(annotations.hasNext()) {
- this.specifiedPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(annotations.next()));
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn(SecondaryTableAnnotation secondaryTable) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(secondaryTable));
- }
-
-
- public void update(SecondaryTableAnnotation sta) {
- this.resourceSecondaryTable = sta;
- super.update(sta);
- this.updateSpecifiedPrimaryKeyJoinColumns(sta);
- this.updateDefaultPrimaryKeyJoinColumn(sta);
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns(SecondaryTableAnnotation sta) {
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = specifiedPrimaryKeyJoinColumns();
- ListIterator<PrimaryKeyJoinColumnAnnotation> resourcePrimaryKeyJoinColumns = sta.pkJoinColumns();
-
- while (primaryKeyJoinColumns.hasNext()) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = primaryKeyJoinColumns.next();
- if (resourcePrimaryKeyJoinColumns.hasNext()) {
- primaryKeyJoinColumn.update(resourcePrimaryKeyJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(primaryKeyJoinColumn);
- }
- }
-
- while (resourcePrimaryKeyJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(resourcePrimaryKeyJoinColumns.next()));
- }
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn(SecondaryTableAnnotation sta) {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- this.setDefaultPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(new NullPrimaryKeyJoinColumnAnnotation(sta)));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(new NullPrimaryKeyJoinColumnAnnotation(sta));
- }
- }
-
- protected JavaPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(PrimaryKeyJoinColumnAnnotation resourcePrimaryKeyJoinColumn) {
- JavaPrimaryKeyJoinColumn primaryKeyJoinColumn = getJpaFactory().buildJavaPrimaryKeyJoinColumn(this, this.primaryKeyJoinColumnOwner);
- primaryKeyJoinColumn.initialize(resourcePrimaryKeyJoinColumn);
- return primaryKeyJoinColumn;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- boolean continueValidating = true;
- if (this.connectionProfileIsActive()) {
- continueValidating = this.validateAgainstDatabase(messages, astRoot);
- }
- //join column validation will handle the check for whether to validate against the database
- //some validation messages are not database specific. If the database validation for the
- //table fails we will stop there and not validate the join columns at all
- if (continueValidating) {
- for (Iterator<JavaPrimaryKeyJoinColumn> stream = this.primaryKeyJoinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter, astRoot);
- }
- }
- }
-
- protected boolean validateAgainstDatabase(List<IMessage> messages, CompilationUnit astRoot) {
- if ( ! this.hasResolvedCatalog()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_CATALOG,
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange(astRoot)
- )
- );
- return false;
- }
-
- if ( ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange(astRoot)
- )
- );
- return false;
- }
-
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange(astRoot)
- )
- );
- return false;
- }
- return true;
- }
-
-
- // ********** code completion **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaPrimaryKeyJoinColumn column : CollectionTools.iterable(this.primaryKeyJoinColumns())) {
- result = column.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- public boolean isVirtual() {
- return false;
- }
-
-
- // ********** PK join column owner adapter **********
-
- protected class PrimaryKeyJoinColumnOwner
- implements JavaBaseJoinColumn.Owner
- {
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaSecondaryTable.this.getValidationTextRange(astRoot);
- }
-
- public TypeMapping getTypeMapping() {
- return GenericJavaSecondaryTable.this.getJavaEntity();
- }
-
- public String getDefaultTableName() {
- return GenericJavaSecondaryTable.this.getName();
- }
-
- public Table getDbTable(String tableName) {
- return GenericJavaSecondaryTable.this.getDbTable();
- }
-
- public Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaSecondaryTable.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- return getJavaEntity().getPrimaryKeyColumnName();
-
- }
-
- public int joinColumnsSize() {
- return GenericJavaSecondaryTable.this.primaryKeyJoinColumnsSize();
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (((BaseJoinColumn) column).isVirtual()) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- if (column.isVirtual()) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSequenceGenerator.java
deleted file mode 100644
index 66ff8640b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaSequenceGenerator.java
+++ /dev/null
@@ -1,43 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaSequenceGenerator;
-
-/**
- *
- */
-public class GenericJavaSequenceGenerator extends AbstractJavaSequenceGenerator
-{
-
- public GenericJavaSequenceGenerator(JavaJpaContextNode parent) {
- super(parent);
- }
-
- // ********** database stuff **********
-
- /**
- * The JPA spec does not allow a sequence to have a schema.
- */
- @Override
- protected String getSchema() {
- return this.getContextDefaultSchema();
- }
-
- /**
- * The JPA spec does not allow a sequence to have a catalog.
- */
- @Override
- protected String getCatalog() {
- return this.getContextDefaultCatalog();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTable.java
deleted file mode 100644
index ec81d5fb15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTable.java
+++ /dev/null
@@ -1,153 +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.core.internal.jpa1.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaTable;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaTable
- extends AbstractJavaTable
- implements JavaTable
-{
- protected JavaResourcePersistentMember resourcePersistentMember;
-
- public GenericJavaTable(JavaEntity parent) {
- super(parent);
- }
-
- public void initialize(JavaResourcePersistentMember pr) {
- this.resourcePersistentMember = pr;
- initialize(getAnnotation());
- }
-
- //query for the table resource every time on setters.
- //call one setter and the tableResource could change.
- //You could call more than one setter before this object has received any notification
- //from the java resource model
- @Override
- protected TableAnnotation getAnnotation() {
- //TODO get the NullTable from the resource model or build it here in the context model??
- return (TableAnnotation) this.resourcePersistentMember.
- getNonNullAnnotation(getAnnotationName());
- }
-
- public boolean isResourceSpecified() {
- return getAnnotation().isSpecified();
- }
-
- @Override
- protected String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public JavaEntity getParent() {
- return (JavaEntity) super.getParent();
- }
-
- protected JavaEntity getJavaEntity() {
- return getParent();
- }
-
- @Override
- protected String buildDefaultName() {
- return this.getJavaEntity().getDefaultTableName();
- }
-
- /**
- * Just to remember:
- * Entity.getDefaultSchema()
- * check inheritance - get default schema from root
- * EntityMappings.getSchema()
- * check for specified schema
- * PersistenceUnit.getDefaultSchema()
- * OrmPersistenceUnitDefaults.getSchema()
- * JpaProject.getDefaultSchema()
- * check for user override project setting
- * Catalog.getDefaultSchema()
- * or
- * Database.getDefaultSchema()
- */
- @Override
- protected String buildDefaultSchema() {
- return this.getJavaEntity().getDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getJavaEntity().getDefaultCatalog();
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- this.resourcePersistentMember = jrpm;
- this.update(getAnnotation());
- }
-
-
- //******************* validation **********************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages, astRoot);
- }
- }
-
- protected void validateAgainstDatabase(List<IMessage> messages, CompilationUnit astRoot) {
- if ( ! this.hasResolvedCatalog()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_CATALOG,
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange(astRoot)
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTableGenerator.java
deleted file mode 100644
index 14d6d12607..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTableGenerator.java
+++ /dev/null
@@ -1,533 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaGenerator;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- *
- */
-public class GenericJavaTableGenerator
- extends AbstractJavaGenerator
- implements JavaTableGenerator, UniqueConstraint.Owner
-{
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedPkColumnName;
- protected String defaultPkColumnName;
-
- protected String specifiedValueColumnName;
- protected String defaultValueColumnName;
-
- protected String specifiedPkColumnValue;
- protected String defaultPkColumnValue;
-
- protected final List<JavaUniqueConstraint> uniqueConstraints;
-
-
- // ********** constructor **********
-
- public GenericJavaTableGenerator(JavaJpaContextNode parent) {
- super(parent);
- this.uniqueConstraints = new ArrayList<JavaUniqueConstraint>();
- }
-
-
- // ********** table **********
-
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.getResourceGenerator().setTable(table);
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- /**
- * The default table is determined by the JPA implementation.
- */
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.getResourceGenerator().setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.getResourceGenerator().setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
-
- // ********** primary key column name **********
-
- public String getPkColumnName() {
- return (this.specifiedPkColumnName != null) ? this.specifiedPkColumnName : this.defaultPkColumnName;
- }
-
- public String getSpecifiedPkColumnName() {
- return this.specifiedPkColumnName;
- }
-
- public void setSpecifiedPkColumnName(String name) {
- String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.getResourceGenerator().setPkColumnName(name);
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
- }
-
- protected void setSpecifiedPkColumnName_(String name) {
- String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
- }
-
- /**
- * The default primary key column name is determined by the JPA
- * implementation.
- */
- public String getDefaultPkColumnName() {
- return this.defaultPkColumnName;
- }
-
-
- // ********** value column name **********
-
- public String getValueColumnName() {
- return (this.specifiedValueColumnName != null) ? this.specifiedValueColumnName : this.defaultValueColumnName;
- }
-
- public String getSpecifiedValueColumnName() {
- return this.specifiedValueColumnName;
- }
-
- public void setSpecifiedValueColumnName(String name) {
- String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.getResourceGenerator().setValueColumnName(name);
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
- }
-
- protected void setSpecifiedValueColumnName_(String name) {
- String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultValueColumnName() {
- return this.defaultValueColumnName;
- }
-
-
- // ********** primary key column value **********
-
- public String getPkColumnValue() {
- return (this.specifiedPkColumnValue != null) ? this.specifiedPkColumnValue : this.defaultPkColumnValue;
- }
-
- public String getSpecifiedPkColumnValue() {
- return this.specifiedPkColumnValue;
- }
-
- public void setSpecifiedPkColumnValue(String value) {
- String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.getResourceGenerator().setPkColumnValue(value);
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
- }
-
- protected void setSpecifiedPkColumnValue_(String value) {
- String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
- }
-
- public String getDefaultPkColumnValue() {
- return this.defaultPkColumnValue;
- }
-
-
- // ********** unique constraints **********
-
- public ListIterator<JavaUniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<JavaUniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public JavaUniqueConstraint addUniqueConstraint(int index) {
- JavaUniqueConstraint uniqueConstraint = getJpaFactory().buildJavaUniqueConstraint(this, this);
- this.uniqueConstraints.add(index, uniqueConstraint);
- UniqueConstraintAnnotation uniqueConstraintAnnotation = this.getResourceGenerator().addUniqueConstraint(index);
- uniqueConstraint.initialize(uniqueConstraintAnnotation);
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- return uniqueConstraint;
- }
-
- public void removeUniqueConstraint(UniqueConstraint uniqueConstraint) {
- this.removeUniqueConstraint(this.uniqueConstraints.indexOf(uniqueConstraint));
- }
-
- public void removeUniqueConstraint(int index) {
- JavaUniqueConstraint uniqueConstraint = this.uniqueConstraints.remove(index);
- this.getResourceGenerator().removeUniqueConstraint(index);
- this.fireItemRemoved(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- this.getResourceGenerator().moveUniqueConstraint(targetIndex, sourceIndex);
- this.fireItemMoved(UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
- protected void addUniqueConstraint(int index, JavaUniqueConstraint uniqueConstraint) {
- this.addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- protected void addUniqueConstraint(JavaUniqueConstraint uniqueConstraint) {
- this.addUniqueConstraint(this.uniqueConstraints.size(), uniqueConstraint);
- }
-
- protected void removeUniqueConstraint_(JavaUniqueConstraint uniqueConstraint) {
- this.removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
-
- //******************* UniqueConstraint.Owner implementation ******************
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers().iterator() : EmptyIterator.<String>instance();
- }
-
-
- // ********** resource => context **********
-
- public void initialize(TableGeneratorAnnotation tableGeneratorAnnotation) {
- super.initialize(tableGeneratorAnnotation);
- this.specifiedTable = tableGeneratorAnnotation.getTable();
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = tableGeneratorAnnotation.getSchema();
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = tableGeneratorAnnotation.getCatalog();
- this.specifiedPkColumnName = tableGeneratorAnnotation.getPkColumnName();
- this.specifiedValueColumnName = tableGeneratorAnnotation.getValueColumnName();
- this.specifiedPkColumnValue = tableGeneratorAnnotation.getPkColumnValue();
- this.initializeUniqueConstraints(tableGeneratorAnnotation);
- }
-
- protected void initializeUniqueConstraints(TableGeneratorAnnotation tableGeneratorAnnotation) {
- for (Iterator<UniqueConstraintAnnotation> stream = tableGeneratorAnnotation.uniqueConstraints(); stream.hasNext(); ) {
- this.uniqueConstraints.add(this.buildUniqueConstraint(stream.next()));
- }
- }
-
- public void update(TableGeneratorAnnotation tableGeneratorAnnotation) {
- super.update(tableGeneratorAnnotation);
- this.setSpecifiedTable_(tableGeneratorAnnotation.getTable());
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(tableGeneratorAnnotation.getSchema());
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(tableGeneratorAnnotation.getCatalog());
- this.setSpecifiedPkColumnName_(tableGeneratorAnnotation.getPkColumnName());
- this.setSpecifiedValueColumnName_(tableGeneratorAnnotation.getValueColumnName());
- this.setSpecifiedPkColumnValue_(tableGeneratorAnnotation.getPkColumnValue());
- this.updateUniqueConstraints(tableGeneratorAnnotation);
- }
-
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- protected void updateUniqueConstraints(TableGeneratorAnnotation tableGeneratorAnnotation) {
- ListIterator<JavaUniqueConstraint> contextConstraints = this.uniqueConstraints();
- ListIterator<UniqueConstraintAnnotation> resourceConstraints = tableGeneratorAnnotation.uniqueConstraints();
-
- while (contextConstraints.hasNext()) {
- JavaUniqueConstraint uniqueConstraint = contextConstraints.next();
- if (resourceConstraints.hasNext()) {
- uniqueConstraint.update(resourceConstraints.next());
- }
- else {
- removeUniqueConstraint_(uniqueConstraint);
- }
- }
-
- while (resourceConstraints.hasNext()) {
- addUniqueConstraint(buildUniqueConstraint(resourceConstraints.next()));
- }
- }
-
- protected JavaUniqueConstraint buildUniqueConstraint(UniqueConstraintAnnotation uniqueConstraintAnnotation) {
- JavaUniqueConstraint uniqueConstraint = getJpaFactory().buildJavaUniqueConstraint(this, this);
- uniqueConstraint.initialize(uniqueConstraintAnnotation);
- return uniqueConstraint;
- }
-
-
- // ********** database stuff **********
-
- public Table getDbTable() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema == null) ? null : dbSchema.getTableForIdentifier(this.getTable());
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaUniqueConstraint constraint : CollectionTools.iterable(this.uniqueConstraints())) {
- result = constraint.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * called if the database is connected:
- * table, schema, catalog, pkColumnName, valueColumnName
- */
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos, astRoot)) {
- return this.getJavaCandidateTables(filter).iterator();
- }
- if (this.schemaTouches(pos, astRoot)) {
- return this.getJavaCandidateSchemata(filter).iterator();
- }
- if (this.catalogTouches(pos, astRoot)) {
- return this.getJavaCandidateCatalogs(filter).iterator();
- }
- if (this.pkColumnNameTouches(pos, astRoot)) {
- return this.getJavaCandidateColumnNames(filter).iterator();
- }
- if (this.valueColumnNameTouches(pos, astRoot)) {
- return this.getJavaCandidateColumnNames(filter).iterator();
- }
- return null;
- }
-
- // ********** code assist: table
-
- protected boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().tableTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateTables(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateTables(filter));
- }
-
- protected Iterable<String> getCandidateTables(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateTables(), filter);
- }
-
- protected Iterable<String> getCandidateTables() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.getSortedTableIdentifiers() : EmptyIterable.<String> instance();
- }
-
- // ********** code assist: schema
-
- protected boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().schemaTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateSchemata(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateSchemata(filter));
- }
-
- protected Iterable<String> getCandidateSchemata(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateSchemata(), filter);
- }
-
- protected Iterable<String> getCandidateSchemata() {
- SchemaContainer schemaContainer = this.getDbSchemaContainer();
- return (schemaContainer != null) ? schemaContainer.getSortedSchemaIdentifiers() : EmptyIterable.<String> instance();
- }
-
- // ********** code assist: catalog
-
- protected boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().catalogTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateCatalogs(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateCatalogs(filter));
- }
-
- protected Iterable<String> getCandidateCatalogs(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateCatalogs(), filter);
- }
-
- protected Iterable<String> getCandidateCatalogs() {
- Database db = this.getDatabase();
- return (db != null) ? db.getSortedCatalogIdentifiers() : EmptyIterable.<String> instance();
- }
-
- // ********** code assist: pkColumnName
-
- protected boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().pkColumnNameTouches(pos, astRoot);
- }
-
- protected Iterable<String> getJavaCandidateColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateColumnNames(filter));
- }
-
- protected Iterable<String> getCandidateColumnNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateColumnNames(), filter);
- }
-
- protected Iterable<String> getCandidateColumnNames() {
- Table table = this.getDbTable();
- return (table != null) ? table.getSortedColumnIdentifiers() : EmptyIterable.<String> instance();
- }
-
- // ********** code assist: valueColumnName
-
- protected boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.getResourceGenerator().valueColumnNameTouches(pos, astRoot);
- }
-
-
- // ********** misc **********
-
- @Override
- protected TableGeneratorAnnotation getResourceGenerator() {
- return (TableGeneratorAnnotation) super.getResourceGenerator();
- }
-
- public int getDefaultInitialValue() {
- return DEFAULT_INITIAL_VALUE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTemporalConverter.java
deleted file mode 100644
index 10e125fbab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTemporalConverter.java
+++ /dev/null
@@ -1,95 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaTemporalConverter;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaTemporalConverter extends AbstractJavaJpaContextNode
- implements JavaTemporalConverter
-{
- protected TemporalType temporalType;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public GenericJavaTemporalConverter(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.TEMPORAL_CONVERTER;
- }
-
- protected String getAnnotationName() {
- return TemporalAnnotation.ANNOTATION_NAME;
- }
-
- public void addToResourceModel() {
- this.resourcePersistentAttribute.addAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeAnnotation(getAnnotationName());
- }
-
- public TemporalType getTemporalType() {
- return this.temporalType;
- }
-
- public void setTemporalType(TemporalType newTemporalType) {
- TemporalType oldTemporalType = this.temporalType;
- this.temporalType = newTemporalType;
- this.getResourceTemporal().setValue(TemporalType.toJavaResourceModel(newTemporalType));
- firePropertyChanged(TEMPORAL_TYPE_PROPERTY, oldTemporalType, newTemporalType);
- }
-
- protected void setTemporalType_(TemporalType newTemporalType) {
- TemporalType oldTemporalType = this.temporalType;
- this.temporalType = newTemporalType;
- firePropertyChanged(TEMPORAL_TYPE_PROPERTY, oldTemporalType, newTemporalType);
- }
-
-
- protected TemporalAnnotation getResourceTemporal() {
- return (TemporalAnnotation) this.resourcePersistentAttribute.
- getAnnotation(getAnnotationName());
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.temporalType = this.temporalType(getResourceTemporal());
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.setTemporalType_(this.temporalType(getResourceTemporal()));
- }
-
- protected TemporalType temporalType(TemporalAnnotation resourceTemporal) {
- return resourceTemporal == null ? null : TemporalType.fromJavaResourceModel(resourceTemporal.getValue());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getResourceTemporal().getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTransientMapping.java
deleted file mode 100644
index 53f7a781d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaTransientMapping.java
+++ /dev/null
@@ -1,53 +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.core.internal.jpa1.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericJavaTransientMapping
- extends AbstractJavaAttributeMapping<TransientAnnotation>
- implements JavaTransientMapping
-{
- public GenericJavaTransientMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return TransientAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- }
-
-
- // ********** metamodel **********
-
- @Override
- public MetamodelField getMetamodelField() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaUniqueConstraint.java
deleted file mode 100644
index a24d8e8e73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaUniqueConstraint.java
+++ /dev/null
@@ -1,168 +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.core.internal.jpa1.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-public class GenericJavaUniqueConstraint extends AbstractJavaJpaContextNode
- implements JavaUniqueConstraint
-{
-
- protected final List<String> columnNames;
-
- protected UniqueConstraintAnnotation resourceUniqueConstraint;
-
- protected Owner owner;
- public GenericJavaUniqueConstraint(JavaJpaContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- this.columnNames = new ArrayList<String>();
- }
-
- public Owner getOwner() {
- return this.owner;
- }
-
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(int index, String columnName) {
- this.columnNames.add(index, columnName);
- this.resourceUniqueConstraint.addColumnName(index, columnName);
- fireItemAdded(UniqueConstraint.COLUMN_NAMES_LIST, index, columnName);
- }
-
- protected void addColumnName_(int index, String columnName) {
- this.columnNames.add(index, columnName);
- fireItemAdded(UniqueConstraint.COLUMN_NAMES_LIST, index, columnName);
- }
-
- public void removeColumnName(String columnName) {
- this.removeColumnName(this.columnNames.indexOf(columnName));
- }
-
- public void removeColumnName(int index) {
- String removedColumnName = this.columnNames.remove(index);
- this.resourceUniqueConstraint.removeColumnName(index);
- fireItemRemoved(UniqueConstraint.COLUMN_NAMES_LIST, index, removedColumnName);
- }
-
- protected void removeColumnName_(int index) {
- String removedColumnName = this.columnNames.remove(index);
- fireItemRemoved(UniqueConstraint.COLUMN_NAMES_LIST, index, removedColumnName);
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.columnNames, targetIndex, sourceIndex);
- this.resourceUniqueConstraint.moveColumnName(targetIndex, sourceIndex);
- fireItemMoved(UniqueConstraint.COLUMN_NAMES_LIST, targetIndex, sourceIndex);
- }
-
- public void initialize(UniqueConstraintAnnotation uca) {
- this.resourceUniqueConstraint = uca;
- this.initializeColumnNames(uca);
- }
-
- protected void initializeColumnNames(UniqueConstraintAnnotation uca) {
- ListIterator<String> annotationColumnNames = uca.columnNames();
-
- for (String resourceColumnName : CollectionTools.iterable(annotationColumnNames)) {
- this.columnNames.add(resourceColumnName);
- }
- }
-
- public void update(UniqueConstraintAnnotation uca) {
- this.resourceUniqueConstraint = uca;
- this.updateColumnNames(uca);
- }
-
- protected void updateColumnNames(UniqueConstraintAnnotation uca) {
- ListIterator<String> annotationColumnNames = uca.columnNames();
-
- int index = 0;
- for (String resourceColumnName : CollectionTools.iterable(annotationColumnNames)) {
- if (columnNamesSize() > index) {
- if (this.columnNames.get(index) != resourceColumnName) {
- addColumnName_(index, resourceColumnName);
- }
- }
- else {
- addColumnName_(index, resourceColumnName);
- }
- index++;
- }
-
- for ( ; index < columnNamesSize(); ) {
- removeColumnName_(index);
- }
- }
-
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceUniqueConstraint.getTextRange(astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.columnNames);
- }
-
-
- // ********** code-assist **********
-
- @Override
- public Iterator<String> connectedJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.connectedJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.columnNamesTouches(pos, astRoot)) {
- return this.javaCandidateColumnNames(filter);
- }
- return null;
- }
-
- private boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- return this.resourceUniqueConstraint.columnNamesTouches(pos, astRoot);
- }
-
- private Iterator<String> javaCandidateColumnNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateColumnNames(filter));
- }
-
- private Iterator<String> candidateColumnNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateColumnNames(), filter);
- }
-
- private Iterator<String> candidateColumnNames() {
- return this.getOwner().candidateUniqueConstraintColumnNames();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaVersionMapping.java
deleted file mode 100644
index 2c989ab68a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaVersionMapping.java
+++ /dev/null
@@ -1,24 +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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaVersionMapping;
-
-
-public class GenericJavaVersionMapping
- extends AbstractJavaVersionMapping
-{
-
- public GenericJavaVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaAssociationOverrideContainer.java
deleted file mode 100644
index faf6749089..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaAssociationOverrideContainer.java
+++ /dev/null
@@ -1,75 +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.core.internal.jpa1.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-public class NullJavaAssociationOverrideContainer extends AbstractJavaJpaContextNode
- implements JavaAssociationOverrideContainer
-{
- public NullJavaAssociationOverrideContainer(JavaJpaContextNode parent) {
- super(parent);
- }
-
- public void initialize(JavaResourcePersistentMember jrpm) {
- // no-op
- }
-
- public void update(JavaResourcePersistentMember jrpm) {
- // no-op
- }
-
- public JavaAssociationOverride getAssociationOverrideNamed(String name) {
- return null;
- }
-
- public ListIterator<JavaAssociationOverride> associationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int associationOverridesSize() {
- return 0;
- }
-
- public ListIterator<JavaAssociationOverride> virtualAssociationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int virtualAssociationOverridesSize() {
- return 0;
- }
-
- public ListIterator<JavaAssociationOverride> specifiedAssociationOverrides() {
- return EmptyListIterator.instance();
- }
-
- public int specifiedAssociationOverridesSize() {
- return 0;
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
-
- //********** Validation ********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinColumnJoiningStrategy.java
deleted file mode 100644
index 44ebd876a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-
-public class NullJavaJoinColumnJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaJoinColumnJoiningStrategy
-{
-
- protected NullJavaJoinColumnJoiningStrategy(JoinColumnEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public void initializeFrom(JoinColumnJoiningStrategy oldStrategy) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JoinColumnEnabledRelationshipReference getParent() {
- return (JoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public JoinColumnEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public void addStrategy() {
- throw new UnsupportedOperationException();
- }
-
- public void removeStrategy() {
- //do nothing, no join column to remove
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
- public TypeMapping getRelationshipTarget() {
- return null;
- }
-
- // **************** join columns *******************************************
-
- public ListIterator<JavaJoinColumn> joinColumns() {
- throw new UnsupportedOperationException();
-
- }
-
- public int joinColumnsSize() {
- throw new UnsupportedOperationException();
- }
-
-
- // **************** default join column ************************************
-
- public JavaJoinColumn getDefaultJoinColumn() {
- throw new UnsupportedOperationException();
- }
-
- // **************** specified join columns *********************************
-
- public ListIterator<JavaJoinColumn> specifiedJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
- public int specifiedJoinColumnsSize() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return false;
- }
-
- public JavaJoinColumn addSpecifiedJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
-
- // **************** resource => context ************************************
-
- public void initialize() {
- //no-op
- }
-
-
- public void update() {
- //no-op
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getColumnTableNotValidDescription() {
- throw new UnsupportedOperationException();
- }
-
- public Table getDbTable(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public Table getReferencedColumnDbTable() {
- throw new UnsupportedOperationException();
- }
-
- public String getTableName() {
- return null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public TypeMapping getRelationshipSource() {
- return getRelationshipMapping().getTypeMapping();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinTableJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinTableJoiningStrategy.java
deleted file mode 100644
index 47bb72157d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/NullJavaJoinTableJoiningStrategy.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-
-public class NullJavaJoinTableJoiningStrategy
- extends AbstractJavaJpaContextNode
- implements JavaJoinTableJoiningStrategy
-{
-
- public NullJavaJoinTableJoiningStrategy(JoinTableEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public void initializeFrom(JoinTableJoiningStrategy oldStrategy) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JoinTableEnabledRelationshipReference getParent() {
- return (JoinTableEnabledRelationshipReference) super.getParent();
- }
-
- public JoinTableEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public void addStrategy() {
- //do nothing
- }
-
- public void removeStrategy() {
- //do nothing, no join table to remove
- }
-
-
-
- // **************** resource => context ************************************
-
- public void initialize() {
- //no-op
- }
-
-
- public void update() {
- //no-op
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getColumnTableNotValidDescription() {
- throw new UnsupportedOperationException();
- }
-
- public Table getDbTable(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public String getTableName() {
- return null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public TypeMapping getTypeMapping() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- public JoinTableAnnotation getAnnotation() {
- return null;
- }
-
- public JavaJoinTable getJoinTable() {
- return null;
- }
-
- public String getJoinTableDefaultName() {
- return null;
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/VirtualAssociationOverride1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/VirtualAssociationOverride1_0Annotation.java
deleted file mode 100644
index 2738d5cfb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/VirtualAssociationOverride1_0Annotation.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.core.internal.jpa1.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.VirtualAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public class VirtualAssociationOverride1_0Annotation
- extends VirtualAssociationOverrideAnnotation
-{
-
- public VirtualAssociationOverride1_0Annotation(JavaResourcePersistentMember parent, String name, JoiningStrategy joiningStrategy) {
- super(parent, name, joiningStrategy);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java
deleted file mode 100644
index b735003d5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java
+++ /dev/null
@@ -1,90 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class AbstractOrmOverride extends AbstractOrmXmlContextNode
-{
-
- protected String name;
-
- protected final BaseOverride.Owner owner;
-
- protected XmlOverride resourceOverride;
-
- public AbstractOrmOverride(XmlContextNode parent, BaseOverride.Owner owner, XmlOverride resourceOverride) {
- super(parent);
- this.owner = owner;
- this.resourceOverride = resourceOverride;
- this.name = getResourceName();
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public BaseOverride.Owner getOwner() {
- return this.owner;
- }
-
- protected XmlOverride getResourceOverride() {
- return this.resourceOverride;
- }
-
- protected void update(XmlOverride resourceOverride) {
- this.resourceOverride = resourceOverride;
- this.setName_(this.getResourceName());
- }
-
-
- // ********************* name ****************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceOverride.setName(newName);
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(BaseOverride.NAME_PROPERTY, oldName, newName);
- }
-
- protected String getResourceName() {
- return this.resourceOverride.getName();
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.resourceOverride.getValidationTextRange();
- return textRange == null ? getParent().getValidationTextRange() : textRange;
- }
-
-
- //****************** miscellaneous ********************
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericEntityMappings.java
deleted file mode 100644
index 43ba8c6637..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericEntityMappings.java
+++ /dev/null
@@ -1,33 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.internal.context.orm.AbstractEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-
-/**
- * <code>orm.xml</code> file
- * <br>
- * <code>entity-mappings</code> element
- */
-public class GenericEntityMappings
- extends AbstractEntityMappings
-{
- public GenericEntityMappings(OrmXml parent, XmlEntityMappings resource) {
- super(parent, resource);
- }
-
- @Override
- protected String latestDocumentVersion() {
- return this.getJpaPlatform().getMostRecentSupportedResourceType(JptCorePlugin.ORM_XML_CONTENT_TYPE).getVersion();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java
deleted file mode 100644
index df01a97628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java
+++ /dev/null
@@ -1,84 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmAssociationOverride extends AbstractOrmOverride
- implements OrmAssociationOverride
-{
- protected final OrmAssociationOverrideRelationshipReference relationshipReference;
-
-
- public GenericOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
- super(parent, owner, xmlAssociationOverride);
- this.relationshipReference = this.buildRelationshipReference();
- }
-
- @Override
- public OrmAssociationOverrideContainer getParent() {
- return (OrmAssociationOverrideContainer) super.getParent();
- }
-
- @Override
- public Owner getOwner() {
- return (Owner) super.getOwner();
- }
-
- protected OrmAssociationOverrideRelationshipReference buildRelationshipReference() {
- return getXmlContextNodeFactory().buildOrmAssociationOverrideRelationshipReference(this, getResourceOverride());
- }
-
- public void initializeFrom(AssociationOverride oldAssociationOverride) {
- this.setName(oldAssociationOverride.getName());
- this.relationshipReference.initializeFrom(oldAssociationOverride.getRelationshipReference());
- }
-
- public void update(XmlAssociationOverride xao) {
- super.update(xao);
- this.relationshipReference.update(xao);
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- public OrmAssociationOverride setVirtual(boolean virtual) {
- return (OrmAssociationOverride) getOwner().setVirtual(virtual, this);
- }
-
- @Override
- protected XmlAssociationOverride getResourceOverride() {
- return (XmlAssociationOverride) super.getResourceOverride();
- }
-
- public OrmAssociationOverrideRelationshipReference getRelationshipReference() {
- return this.relationshipReference;
- }
-
-
- // ********** OrmAssociationOverride implementation **********
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.relationshipReference.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java
deleted file mode 100644
index c0e87d796a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java
+++ /dev/null
@@ -1,380 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmAssociationOverrideContainer extends AbstractOrmXmlContextNode
- implements OrmAssociationOverrideContainer
-{
-
- protected final List<OrmAssociationOverride> specifiedAssociationOverrides;
-
- protected final List<OrmAssociationOverride> virtualAssociationOverrides;
-
- protected final OrmAssociationOverrideContainer.Owner owner;
-
- public GenericOrmAssociationOverrideContainer(XmlContextNode parent, OrmAssociationOverrideContainer.Owner owner) {
- super(parent);
- this.owner = owner;
- this.specifiedAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.virtualAssociationOverrides = new ArrayList<OrmAssociationOverride>();
- this.initializeSpecifiedAssociationOverrides();
- this.initializeVirtualAssociationOverrides();
- }
-
- protected Owner getOwner() {
- return this.owner;
- }
-
- protected EList<XmlAssociationOverride> getResourceAssociationOverrides() {
- return getOwner().getResourceAssociationOverrides();
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmAssociationOverride> associationOverrides() {
- return new CompositeListIterator<OrmAssociationOverride>(specifiedAssociationOverrides(), virtualAssociationOverrides());
- }
-
- public int associationOverridesSize() {
- return this.specifiedAssociationOverridesSize() + this.virtualAssociationOverridesSize();
- }
-
- public ListIterator<OrmAssociationOverride> virtualAssociationOverrides() {
- return new CloneListIterator<OrmAssociationOverride>(this.virtualAssociationOverrides);
- }
-
- public int virtualAssociationOverridesSize() {
- return this.virtualAssociationOverrides.size();
- }
-
- protected void addVirtualAssociationOverride(OrmAssociationOverride associationOverride) {
- addItemToList(associationOverride, this.virtualAssociationOverrides, VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAssociationOverride(OrmAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.virtualAssociationOverrides, VIRTUAL_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected OrmAssociationOverride setAssociationOverrideVirtual(boolean virtual, OrmAssociationOverride associationOverride) {
- if (virtual) {
- return setAssociationOverrideVirtual(associationOverride);
- }
- return setAssociationOverrideSpecified(associationOverride);
- }
-
- protected OrmAssociationOverride setAssociationOverrideVirtual(OrmAssociationOverride associationOverride) {
- int index = this.specifiedAssociationOverrides.indexOf(associationOverride);
- this.specifiedAssociationOverrides.remove(index);
- String associationOverrideName = associationOverride.getName();
- //add the virtual attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the udpate. This causes the UI to be flaky, since change notification might not occur in the correct order
- OrmAssociationOverride virtualAssociationOverride = null;
- if (associationOverrideName != null) {
- for (String name : CollectionTools.iterable(allOverridableAssociationNames())) {
- if (name.equals(associationOverrideName)) {
- //store the virtualAssociationOverride so we can fire change notification later
- virtualAssociationOverride = buildVirtualAssociationOverride(name);
- this.virtualAssociationOverrides.add(virtualAssociationOverride);
- }
- }
- }
-
- this.getResourceAssociationOverrides().remove(index);
- fireItemRemoved(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
-
- if (virtualAssociationOverride != null) {
- fireItemAdded(VIRTUAL_ASSOCIATION_OVERRIDES_LIST, virtualAssociationOverridesSize() - 1, virtualAssociationOverride);
- }
- return virtualAssociationOverride;
- }
-
- protected OrmAssociationOverride setAssociationOverrideSpecified(OrmAssociationOverride oldAssociationOverride) {
- int index = specifiedAssociationOverridesSize();
- XmlAssociationOverride xmlAssociationOverride = buildResourceAssociationOverride();
- OrmAssociationOverride newAssociationOverride = buildAssociationOverride(xmlAssociationOverride);
- this.specifiedAssociationOverrides.add(index, newAssociationOverride);
-
- this.getResourceAssociationOverrides().add(xmlAssociationOverride);
-
- int defaultIndex = this.virtualAssociationOverrides.indexOf(oldAssociationOverride);
- this.virtualAssociationOverrides.remove(defaultIndex);
-
- newAssociationOverride.initializeFrom(oldAssociationOverride);
-
- this.fireItemRemoved(VIRTUAL_ASSOCIATION_OVERRIDES_LIST, defaultIndex, oldAssociationOverride);
- this.fireItemAdded(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, index, newAssociationOverride);
-
- return newAssociationOverride;
- }
-
- public ListIterator<OrmAssociationOverride> specifiedAssociationOverrides() {
- return new CloneListIterator<OrmAssociationOverride>(this.specifiedAssociationOverrides);
- }
-
- public int specifiedAssociationOverridesSize() {
- return this.specifiedAssociationOverrides.size();
- }
-
- protected void addSpecifiedAssociationOverride(int index, OrmAssociationOverride associationOverride) {
- addItemToList(index, associationOverride, this.specifiedAssociationOverrides, SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAssociationOverride(OrmAssociationOverride associationOverride) {
- this.addSpecifiedAssociationOverride(this.specifiedAssociationOverrides.size(), associationOverride);
- }
-
- protected void removeSpecifiedAssociationOverride_(OrmAssociationOverride associationOverride) {
- removeItemFromList(associationOverride, this.specifiedAssociationOverrides, SPECIFIED_ASSOCIATION_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAssociationOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAssociationOverrides, targetIndex, sourceIndex);
- this.getResourceAssociationOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_ASSOCIATION_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public OrmAssociationOverride getAssociationOverrideNamed(String name) {
- return (OrmAssociationOverride) getOverrideNamed(name, associationOverrides());
- }
-
- public boolean containsAssociationOverride(String name) {
- return containsOverride(name, associationOverrides());
- }
-
- public boolean containsSpecifiedAssociationOverride(String name) {
- return containsOverride(name, specifiedAssociationOverrides());
- }
-
- public boolean containsDefaultAssociationOverride(String name) {
- return containsOverride(name, virtualAssociationOverrides());
- }
-
- private BaseOverride getOverrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- private boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return getOverrideNamed(name, overrides) != null;
- }
-
- protected Iterator<String> allOverridableAssociationNames() {
- return getOwner().allOverridableNames();
- }
-
- protected void initializeVirtualAssociationOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAssociationNames())) {
- OrmAssociationOverride ormAssociationOverride = getAssociationOverrideNamed(name);
- if (ormAssociationOverride == null) {
- this.virtualAssociationOverrides.add(buildVirtualAssociationOverride(name));
- }
- }
- }
-
- protected OrmAssociationOverride buildVirtualAssociationOverride(String name) {
- return buildAssociationOverride(buildVirtualXmlAssociationOverride(name));
- }
-
- protected XmlAssociationOverride buildVirtualXmlAssociationOverride(String name) {
- RelationshipReference relationshipReference = this.resolveAssociationOverrideRelationshipReference(name);
- return buildVirtualXmlAssociationOverride(name, relationshipReference.getPredominantJoiningStrategy());
- }
-
- protected XmlAssociationOverride buildVirtualXmlAssociationOverride(String name, JoiningStrategy joiningStrategy) {
- return getXmlContextNodeFactory().buildVirtualXmlAssociationOverride(name, getOwner().getTypeMapping(), joiningStrategy);
- }
-
- private RelationshipReference resolveAssociationOverrideRelationshipReference(String associationOverrideName) {
- return getOwner().resolveRelationshipReference(associationOverrideName);
- }
-
-
- protected void initializeSpecifiedAssociationOverrides() {
- for (XmlAssociationOverride associationOverride : this.getResourceAssociationOverrides()) {
- this.specifiedAssociationOverrides.add(buildAssociationOverride(associationOverride));
- }
- }
-
- public void update() {
- this.updateSpecifiedAssociationOverrides();
- this.updateVirtualAssociationOverrides();
- }
-
- protected void updateSpecifiedAssociationOverrides() {
- // make a copy of the XML overrides (to prevent ConcurrentModificationException)
- Iterator<XmlAssociationOverride> xmlOverrides = new CloneIterator<XmlAssociationOverride>(this.getResourceAssociationOverrides());
-
- for (Iterator<OrmAssociationOverride> contextOverrides = this.specifiedAssociationOverrides(); contextOverrides.hasNext(); ) {
- OrmAssociationOverride contextOverride = contextOverrides.next();
- if (xmlOverrides.hasNext()) {
- contextOverride.update(xmlOverrides.next());
- }
- else {
- removeSpecifiedAssociationOverride_(contextOverride);
- }
- }
-
- while (xmlOverrides.hasNext()) {
- addSpecifiedAssociationOverride(buildAssociationOverride(xmlOverrides.next()));
- }
- }
-
- protected void updateVirtualAssociationOverrides() {
- Iterator<String> overridableAssociations = allOverridableAssociationNames();
- ListIterator<OrmAssociationOverride> virtualAssociationOverridesCopy = virtualAssociationOverrides();
-
- for (String name : CollectionTools.iterable(overridableAssociations)) {
- OrmAssociationOverride ormAssociationOverride = getAssociationOverrideNamed(name);
- if (ormAssociationOverride != null && !ormAssociationOverride.isVirtual()) {
- continue;
- }
- if (ormAssociationOverride != null) {
- if (virtualAssociationOverridesCopy.hasNext()) {
- OrmAssociationOverride virtualAssociationOverride = virtualAssociationOverridesCopy.next();
- virtualAssociationOverride.update(buildVirtualXmlAssociationOverride(name));
- }
- else {
- addVirtualAssociationOverride(buildVirtualAssociationOverride(name));
- }
- }
- else {
- addVirtualAssociationOverride(buildVirtualAssociationOverride(name));
- }
- }
- for (OrmAssociationOverride virtualAssociationOverride : CollectionTools.iterable(virtualAssociationOverridesCopy)) {
- removeVirtualAssociationOverride(virtualAssociationOverride);
- }
- }
-
- protected OrmAssociationOverride buildAssociationOverride(XmlAssociationOverride associationOverride) {
- return getXmlContextNodeFactory().buildOrmAssociationOverride(this, buildAssociationOverrideOwner(), associationOverride);
- }
-
- protected XmlAssociationOverride buildResourceAssociationOverride() {
- return OrmFactory.eINSTANCE.createXmlAssociationOverride();
- }
-
- protected AssociationOverride.Owner buildAssociationOverrideOwner() {
- return new AssociationOverrideOwner();
- }
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- for (Iterator<OrmAssociationOverride> stream = this.associationOverrides(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- }
-
- public TextRange getValidationTextRange() {
- return getOwner().getValidationTextRange();
- }
-
-
- protected class AssociationOverrideOwner implements AssociationOverride.Owner {
-
- public RelationshipMapping getRelationshipMapping(String attributeName) {
- return MappingTools.getRelationshipMapping(attributeName, getOwner().getOverridableTypeMapping());
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmAssociationOverrideContainer.this.virtualAssociationOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- return GenericOrmAssociationOverrideContainer.this.setAssociationOverrideVirtual(virtual, (OrmAssociationOverride) override);
- }
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return GenericOrmAssociationOverrideContainer.this.allOverridableAssociationNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public String getDefaultTableName() {
- return getOwner().getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedReferencedColumnNameMessage(override, column, textRange);
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(override, column, textRange);
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override, column, textRange);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideRelationshipReference.java
deleted file mode 100644
index 32e785991e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideRelationshipReference.java
+++ /dev/null
@@ -1,28 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-public class GenericOrmAssociationOverrideRelationshipReference extends AbstractOrmAssociationOverrideRelationshipReference
-{
-
- public GenericOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, XmlAssociationOverride xao) {
- super(parent, xao);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- return this.joinColumnJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java
deleted file mode 100644
index 267264314b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java
+++ /dev/null
@@ -1,241 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.AttributeOverride2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmAttributeOverride
- extends AbstractOrmOverride
- implements AttributeOverride2_0, OrmAttributeOverride, OrmColumn.Owner
-{
- protected final OrmColumn column;
-
- /* 2.0 feature - a relationship may map this attribute override */
- protected boolean mappedByRelationship;
-
-
- public GenericOrmAttributeOverride(
- OrmAttributeOverrideContainer parent,
- AttributeOverride.Owner owner,
- XmlAttributeOverride resourceAttributeOverride) {
-
- super(parent, owner, resourceAttributeOverride);
- this.column = getXmlContextNodeFactory().buildOrmColumn(this, this);
- this.column.initialize(resourceAttributeOverride.getColumn());
-
- this.mappedByRelationship = //calculateMappedByRelationship();
- // TODO - move this real calculation to a (currently nonexistent) initialize method
- false;
- }
-
-
- public OrmAttributeOverride setVirtual(boolean virtual) {
- return (OrmAttributeOverride) getOwner().setVirtual(virtual, this);
- }
-
- @Override
- public Owner getOwner() {
- return (Owner) super.getOwner();
- }
-
- @Override
- protected XmlAttributeOverride getResourceOverride() {
- return (XmlAttributeOverride) super.getResourceOverride();
- }
-
-
- // ********************* column ****************
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- //************* NamedColumn.Owner implementation **************
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- return this.getOwner().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- Column column = resolveOverriddenColumn();
- if (column == null) {
- return getName();
- }
- return column.getName();
- }
-
-
- //************* BaseColumn.Owner implementation **************
-
- public String getDefaultTableName() {
- Column column = resolveOverriddenColumn();
- if (column != null) {
- String tableName = column.getSpecifiedTable();
- if (tableName != null) {
- return tableName;
- }
- }
- return getOwner().getDefaultTableName();
- }
-
- protected Column resolveOverriddenColumn() {
- return isVirtual() ? getOwner().resolveOverriddenColumn(getName()) : null;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
-
- //***************** OrmColumn.Owner implementation ****************
-
- public XmlColumn getResourceColumn() {
- return this.getResourceOverride().getColumn();
- }
-
- protected boolean isColumnSpecified() {
- return getResourceColumn() != null;
- }
-
- public void addResourceColumn() {
- this.getResourceOverride().setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- this.getResourceOverride().setColumn(null);
- }
-
-
- // **************** AttributeOverride2_0 impl *****************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (getName() == null) {
- return false;
- }
-
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (getName().indexOf('.') > 0) ?
- getName().substring(0, getName().indexOf('.'))
- : getName();
- return qualifier.equals(each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue());
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // **************** resource -> context ***********************************
-
- public void update(XmlAttributeOverride xmlAttributeOverride) {
- super.update(xmlAttributeOverride);
- this.column.update(xmlAttributeOverride.getColumn());
- setMappedByRelationship(calculateMappedByRelationship());
- }
-
-
- //****************** validation ********************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- // [JPA 2.0] if the column is specified, or if the override is not mapped by a relationship,
- // then the column is validated.
- // (In JPA 1.0, the column will always be validated, since the override is never mapped by a
- // relationship)
- if (isColumnSpecified() || ! isMappedByRelationship()) {
- getColumn().validate(messages, reporter);
- }
-
- // [JPA 2.0] if the override is mapped by a relationship, then that actually is in itself
- // a validation error
- // (We prevent implied overrides that are mapped by a relationship ... hopefully)
- // (In JPA 1.0, this will never occur)
- if (isMappedByRelationship()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED,
- new String[] {},
- this,
- getValidationTextRange()));
- }
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(this, column, textRange);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(this, column, textRange);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java
deleted file mode 100644
index 59e42b7749..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java
+++ /dev/null
@@ -1,383 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmAttributeOverrideContainer
- extends AbstractOrmXmlContextNode
- implements OrmAttributeOverrideContainer
-{
- protected final List<OrmAttributeOverride> specifiedAttributeOverrides;
-
- protected final List<OrmAttributeOverride> virtualAttributeOverrides;
-
- protected final Owner owner;
-
-
- public GenericOrmAttributeOverrideContainer(XmlContextNode parent, Owner owner) {
- super(parent);
- this.owner = owner;
- this.specifiedAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.virtualAttributeOverrides = new ArrayList<OrmAttributeOverride>();
- this.initializeSpecifiedAttributeOverrides();
- this.initializeVirtualAttributeOverrides();
- }
-
-
- public void initializeFromAttributeOverrideContainer(OrmAttributeOverrideContainer oldContainer) {
- int index = 0;
- for (OrmAttributeOverride attributeOverride : CollectionTools.iterable(oldContainer.specifiedAttributeOverrides())) {
- OrmAttributeOverride newAttributeOverride = addSpecifiedAttributeOverride(index++);
- newAttributeOverride.setName(attributeOverride.getName());
- newAttributeOverride.getColumn().initializeFrom(attributeOverride.getColumn());
- }
- }
-
- protected Owner getOwner() {
- return this.owner;
- }
-
- protected EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return getOwner().getResourceAttributeOverrides();
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmAttributeOverride> attributeOverrides() {
- return new CompositeListIterator<OrmAttributeOverride>(specifiedAttributeOverrides(), virtualAttributeOverrides());
- }
-
- public int attributeOverridesSize() {
- return this.specifiedAttributeOverridesSize() + this.virtualAttributeOverridesSize();
- }
-
- public ListIterator<OrmAttributeOverride> virtualAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.virtualAttributeOverrides);
- }
-
- public int virtualAttributeOverridesSize() {
- return this.virtualAttributeOverrides.size();
- }
-
- protected void addVirtualAttributeOverride(OrmAttributeOverride attributeOverride) {
- addItemToList(attributeOverride, this.virtualAttributeOverrides, VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void removeVirtualAttributeOverride(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.virtualAttributeOverrides, VIRTUAL_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected OrmAttributeOverride setAttributeOverrideVirtual(boolean virtual, OrmAttributeOverride attributeOverride) {
- if (virtual) {
- return setAttributeOverrideVirtual(attributeOverride);
- }
- return setAttributeOverrideSpecified(attributeOverride);
- }
-
- protected OrmAttributeOverride setAttributeOverrideVirtual(OrmAttributeOverride attributeOverride) {
- int index = this.specifiedAttributeOverrides.indexOf(attributeOverride);
- this.specifiedAttributeOverrides.remove(index);
- String attributeOverrideName = attributeOverride.getName();
- //add the virtual attribute override so that I can control the order that change notification is sent.
- //otherwise when we remove the annotation from java we will get an update and add the attribute override
- //during the update. This causes the UI to be flaky, since change notification might not occur in the correct order
- OrmAttributeOverride virtualAttributeOverride = null;
- if (attributeOverrideName != null) {
- for (String name : CollectionTools.iterable(allOverridableAttributeNames())) {
- if (name.equals(attributeOverrideName)) {
- //store the virtualAttributeOverride so we can fire change notification later
- virtualAttributeOverride = buildVirtualAttributeOverride(name);
- this.virtualAttributeOverrides.add(virtualAttributeOverride);
- }
- }
- }
-
- this.getResourceAttributeOverrides().remove(index);
- fireItemRemoved(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
-
- if (virtualAttributeOverride != null) {
- fireItemAdded(VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, virtualAttributeOverridesSize() - 1, virtualAttributeOverride);
- }
- return virtualAttributeOverride;
- }
-
- protected OrmAttributeOverride setAttributeOverrideSpecified(OrmAttributeOverride oldAttributeOverride) {
- int index = specifiedAttributeOverridesSize();
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverride();
- OrmAttributeOverride newAttributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, newAttributeOverride);
-
- this.getResourceAttributeOverrides().add(xmlAttributeOverride);
-
- int defaultIndex = this.virtualAttributeOverrides.indexOf(oldAttributeOverride);
- this.virtualAttributeOverrides.remove(defaultIndex);
-
- newAttributeOverride.setName(oldAttributeOverride.getName());
- newAttributeOverride.getColumn().setSpecifiedName(oldAttributeOverride.getColumn().getName());
-
- this.fireItemRemoved(VIRTUAL_ATTRIBUTE_OVERRIDES_LIST, defaultIndex, oldAttributeOverride);
- this.fireItemAdded(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, newAttributeOverride);
-
- return newAttributeOverride;
- }
-
- public ListIterator<OrmAttributeOverride> specifiedAttributeOverrides() {
- return new CloneListIterator<OrmAttributeOverride>(this.specifiedAttributeOverrides);
- }
-
- public int specifiedAttributeOverridesSize() {
- return this.specifiedAttributeOverrides.size();
- }
-
- protected OrmAttributeOverride addSpecifiedAttributeOverride(int index) {
- XmlAttributeOverride xmlAttributeOverride = OrmFactory.eINSTANCE.createXmlAttributeOverride();
- OrmAttributeOverride attributeOverride = buildAttributeOverride(xmlAttributeOverride);
- this.specifiedAttributeOverrides.add(index, attributeOverride);
- this.getResourceAttributeOverrides().add(index, xmlAttributeOverride);
- this.fireItemAdded(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- return attributeOverride;
- }
-
- protected void addSpecifiedAttributeOverride(int index, OrmAttributeOverride attributeOverride) {
- addItemToList(index, attributeOverride, this.specifiedAttributeOverrides, SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- protected void addSpecifiedAttributeOverride(OrmAttributeOverride attributeOverride) {
- this.addSpecifiedAttributeOverride(this.specifiedAttributeOverrides.size(), attributeOverride);
- }
-
- protected void removeSpecifiedAttributeOverride_(OrmAttributeOverride attributeOverride) {
- removeItemFromList(attributeOverride, this.specifiedAttributeOverrides, SPECIFIED_ATTRIBUTE_OVERRIDES_LIST);
- }
-
- public void moveSpecifiedAttributeOverride(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedAttributeOverrides, targetIndex, sourceIndex);
- this.getResourceAttributeOverrides().move(targetIndex, sourceIndex);
- fireItemMoved(SPECIFIED_ATTRIBUTE_OVERRIDES_LIST, targetIndex, sourceIndex);
- }
-
- public OrmAttributeOverride getAttributeOverrideNamed(String name) {
- return (OrmAttributeOverride) getOverrideNamed(name, attributeOverrides());
- }
-
- public boolean containsAttributeOverride(String name) {
- return containsOverride(name, attributeOverrides());
- }
-
- public boolean containsDefaultAttributeOverride(String name) {
- return containsOverride(name, virtualAttributeOverrides());
- }
-
- public boolean containsSpecifiedAttributeOverride(String name) {
- return containsOverride(name, specifiedAttributeOverrides());
- }
-
- private BaseOverride getOverrideNamed(String name, ListIterator<? extends BaseOverride> overrides) {
- for (BaseOverride override : CollectionTools.iterable(overrides)) {
- String overrideName = override.getName();
- if (overrideName == null && name == null) {
- return override;
- }
- if (overrideName != null && overrideName.equals(name)) {
- return override;
- }
- }
- return null;
- }
-
- private boolean containsOverride(String name, ListIterator<? extends BaseOverride> overrides) {
- return getOverrideNamed(name, overrides) != null;
- }
-
- protected Iterator<String> allOverridableAttributeNames() {
- return getOwner().allOverridableNames();
- }
-
- protected void initializeVirtualAttributeOverrides() {
- for (String name : CollectionTools.iterable(allOverridableAttributeNames())) {
- OrmAttributeOverride ormAttributeOverride = getAttributeOverrideNamed(name);
- if (ormAttributeOverride == null) {
- this.virtualAttributeOverrides.add(buildVirtualAttributeOverride(name));
- }
- }
- }
-
- protected void initializeSpecifiedAttributeOverrides() {
- for (XmlAttributeOverride attributeOverride : this.getResourceAttributeOverrides()) {
- this.specifiedAttributeOverrides.add(buildAttributeOverride(attributeOverride));
- }
- }
-
- public void update() {
- this.updateSpecifiedAttributeOverrides();
- this.updateVirtualAttributeOverrides();
- }
-
- protected OrmAttributeOverride buildVirtualAttributeOverride(String name) {
- return buildAttributeOverride(buildVirtualXmlAttributeOverride(name));
- }
-
- protected XmlAttributeOverride buildVirtualXmlAttributeOverride(String name) {
- Column column = resolveOverriddenColumn(name);
- XmlColumn xmlColumn = getOwner().buildVirtualXmlColumn(column, name, getOwner().getTypeMapping().isMetadataComplete());
- return new VirtualXmlAttributeOverride(name, xmlColumn);
- }
-
- private Column resolveOverriddenColumn(String attributeOverrideName) {
- return getOwner().resolveOverriddenColumn(attributeOverrideName);
- }
-
- protected void updateSpecifiedAttributeOverrides() {
- // make a copy of the XML overrides (to prevent ConcurrentModificationException)
- Iterator<XmlAttributeOverride> xmlOverrides = new CloneIterator<XmlAttributeOverride>(this.getResourceAttributeOverrides());
-
- for (Iterator<OrmAttributeOverride> contextOverrides = this.specifiedAttributeOverrides(); contextOverrides.hasNext(); ) {
- OrmAttributeOverride contextOverride = contextOverrides.next();
- if (xmlOverrides.hasNext()) {
- contextOverride.update(xmlOverrides.next());
- }
- else {
- removeSpecifiedAttributeOverride_(contextOverride);
- }
- }
-
- while (xmlOverrides.hasNext()) {
- addSpecifiedAttributeOverride(buildAttributeOverride(xmlOverrides.next()));
- }
- }
-
- protected void updateVirtualAttributeOverrides() {
- Iterator<String> overridableAttributes = allOverridableAttributeNames();
- ListIterator<OrmAttributeOverride> virtualAttributeOverridesCopy = virtualAttributeOverrides();
-
- for (String name : CollectionTools.iterable(overridableAttributes)) {
- OrmAttributeOverride ormAttributeOverride = getAttributeOverrideNamed(name);
- if (ormAttributeOverride != null && !ormAttributeOverride.isVirtual()) {
- continue;
- }
- if (ormAttributeOverride != null) {
- if (virtualAttributeOverridesCopy.hasNext()) {
- OrmAttributeOverride virtualAttributeOverride = virtualAttributeOverridesCopy.next();
- virtualAttributeOverride.update(buildVirtualXmlAttributeOverride(name));
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(name));
- }
- }
- else {
- addVirtualAttributeOverride(buildVirtualAttributeOverride(name));
- }
- }
- for (OrmAttributeOverride virtualAttributeOverride : CollectionTools.iterable(virtualAttributeOverridesCopy)) {
- removeVirtualAttributeOverride(virtualAttributeOverride);
- }
- }
-
- protected OrmAttributeOverride buildAttributeOverride(XmlAttributeOverride attributeOverride) {
- return getXmlContextNodeFactory().buildOrmAttributeOverride(this, createAttributeOverrideOwner(), attributeOverride);
- }
-
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
- return new AttributeOverrideOwner();
- }
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- for (Iterator<OrmAttributeOverride> stream = this.attributeOverrides(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- }
-
- public TextRange getValidationTextRange() {
- return getOwner().getValidationTextRange();
- }
-
-
- protected class AttributeOverrideOwner implements AttributeOverride.Owner {
-
- public Column resolveOverriddenColumn(String attributeName) {
- if (attributeName == null) {
- return null;
- }
- return GenericOrmAttributeOverrideContainer.this.resolveOverriddenColumn(attributeName);
- }
-
- public boolean isVirtual(BaseOverride override) {
- return GenericOrmAttributeOverrideContainer.this.virtualAttributeOverrides.contains(override);
- }
-
- public BaseOverride setVirtual(boolean virtual, BaseOverride override) {
- return GenericOrmAttributeOverrideContainer.this.setAttributeOverrideVirtual(virtual, (OrmAttributeOverride) override);
- }
-
- public TypeMapping getTypeMapping() {
- return getOwner().getTypeMapping();
- }
-
- public Iterator<String> allOverridableAttributeNames() {
- return GenericOrmAttributeOverrideContainer.this.allOverridableAttributeNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getOwner().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getOwner().candidateTableNames();
- }
-
- public String getDefaultTableName() {
- return getOwner().getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- return getOwner().buildColumnTableNotValidMessage(override, column, textRange);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- return getOwner().buildColumnUnresolvedNameMessage(override, column, textRange);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmBasicMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmBasicMapping.java
deleted file mode 100644
index 406105dc9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmBasicMapping.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBasicMapping;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-
-
-public class GenericOrmBasicMapping extends AbstractOrmBasicMapping<XmlBasic>
-{
-
- public GenericOrmBasicMapping(OrmPersistentAttribute parent, XmlBasic resourceMapping) {
- super(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmCascade.java
deleted file mode 100644
index 149b0031e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmCascade.java
+++ /dev/null
@@ -1,281 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmRelationshipMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCascade2_0;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class GenericOrmCascade
- extends AbstractOrmXmlContextNode
- implements OrmCascade2_0
-{
- protected boolean all;
-
- protected boolean persist;
-
- protected boolean merge;
-
- protected boolean remove;
-
- protected boolean refresh;
-
- /* JPA 2.0 */
- protected boolean detach;
-
- protected final AbstractXmlRelationshipMapping relationshipMapping;
-
-
- public GenericOrmCascade(OrmRelationshipMapping parent, AbstractXmlRelationshipMapping relationshipMapping) {
- super(parent);
- this.relationshipMapping = relationshipMapping;
- CascadeType cascade = getResourceCascade();
- this.all = this.getResourceAll(cascade);
- this.persist = this.getResourcePersist(cascade);
- this.merge = this.getResourceMerge(cascade);
- this.remove = this.getResourceRemove(cascade);
- this.refresh = this.getResourceRefresh(cascade);
- this.detach = this.getResourceDetach(cascade);
- }
-
-
- public void initializeFrom(Cascade2_0 oldCascade) {
- setAll(oldCascade.isAll());
- setPersist(oldCascade.isPersist());
- setMerge(oldCascade.isMerge());
- setRemove(oldCascade.isRemove());
- setRefresh(oldCascade.isRefresh());
- setDetach(oldCascade.isDetach());
- }
-
- public boolean isAll() {
- return this.all;
- }
-
- public void setAll(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- if (oldAll != newAll) {
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadeAll(newAll);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newAll != false) {
- addResourceCascade();
- getResourceCascade().setCascadeAll(newAll);
- }
- }
- firePropertyChanged(ALL_PROPERTY, oldAll, newAll);
- }
-
- protected void setAll_(boolean newAll) {
- boolean oldAll = this.all;
- this.all = newAll;
- firePropertyChanged(ALL_PROPERTY, oldAll, newAll);
- }
-
- public boolean isPersist() {
- return this.persist;
- }
-
- public void setPersist(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- if (oldPersist != newPersist) {
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadePersist(newPersist);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newPersist != false) {
- addResourceCascade();
- getResourceCascade().setCascadePersist(newPersist);
- }
- }
- firePropertyChanged(PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- protected void setPersist_(boolean newPersist) {
- boolean oldPersist = this.persist;
- this.persist = newPersist;
- firePropertyChanged(PERSIST_PROPERTY, oldPersist, newPersist);
- }
-
- public boolean isMerge() {
- return this.merge;
- }
-
- public void setMerge(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- if (oldMerge != newMerge) {
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadeMerge(newMerge);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newMerge != false) {
- addResourceCascade();
- getResourceCascade().setCascadeMerge(newMerge);
- }
- }
- firePropertyChanged(MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- protected void setMerge_(boolean newMerge) {
- boolean oldMerge = this.merge;
- this.merge = newMerge;
- firePropertyChanged(MERGE_PROPERTY, oldMerge, newMerge);
- }
-
- public boolean isRemove() {
- return this.remove;
- }
-
- public void setRemove(boolean newRemove) {
- boolean oldRemove = this.remove;
- if (oldRemove != newRemove) {
- this.remove = newRemove;
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadeRemove(newRemove);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newRemove != false) {
- addResourceCascade();
- getResourceCascade().setCascadeRemove(newRemove);
- }
- }
- firePropertyChanged(REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- protected void setRemove_(boolean newRemove) {
- boolean oldRemove = this.remove;
- this.remove = newRemove;
- firePropertyChanged(REMOVE_PROPERTY, oldRemove, newRemove);
- }
-
- public boolean isRefresh() {
- return this.refresh;
- }
-
- public void setRefresh(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- if (oldRefresh != newRefresh) {
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadeRefresh(newRefresh);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newRefresh != false) {
- addResourceCascade();
- getResourceCascade().setCascadeRefresh(newRefresh);
- }
- }
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- protected void setRefresh_(boolean newRefresh) {
- boolean oldRefresh = this.refresh;
- this.refresh = newRefresh;
- firePropertyChanged(REFRESH_PROPERTY, oldRefresh, newRefresh);
- }
-
- public boolean isDetach() {
- return this.detach;
- }
-
- public void setDetach(boolean newDetach) {
- boolean oldDetach = this.detach;
- this.detach = newDetach;
- if (oldDetach != newDetach) {
- if (this.getResourceCascade() != null) {
- this.getResourceCascade().setCascadeDetach(newDetach);
- if (this.getResourceCascade().isUnset()) {
- removeResourceCascade();
- }
- }
- else if (newDetach != false) {
- addResourceCascade();
- getResourceCascade().setCascadeDetach(newDetach);
- }
- }
- firePropertyChanged(DETACH_PROPERTY, oldDetach, newDetach);
- }
-
- protected void setDetach_(boolean newDetach) {
- boolean oldDetach = this.detach;
- this.detach = newDetach;
- firePropertyChanged(DETACH_PROPERTY, oldDetach, newDetach);
- }
-
- protected CascadeType getResourceCascade() {
- return this.relationshipMapping.getCascade();
- }
-
- protected void removeResourceCascade() {
- this.relationshipMapping.setCascade(null);
- }
-
- protected void addResourceCascade() {
- this.relationshipMapping.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- }
-
- public void update() {
- CascadeType cascade = getResourceCascade();
- this.setAll_(this.getResourceAll(cascade));
- this.setPersist_(this.getResourcePersist(cascade));
- this.setMerge_(this.getResourceMerge(cascade));
- this.setRemove_(this.getResourceRemove(cascade));
- this.setRefresh_(this.getResourceRefresh(cascade));
- this.setDetach_(this.getResourceDetach(cascade));
- }
-
- protected boolean getResourceAll(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeAll();
- }
-
- protected boolean getResourcePersist(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadePersist();
- }
-
- protected boolean getResourceMerge(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeMerge();
- }
-
- protected boolean getResourceRemove(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRemove();
- }
-
- protected boolean getResourceRefresh(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeRefresh();
- }
-
- protected boolean getResourceDetach(CascadeType cascade) {
- return cascade == null ? false : cascade.isCascadeDetach();
- }
-
- public TextRange getValidationTextRange() {
- return this.getResourceCascade().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java
deleted file mode 100644
index ef90cfc1df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmColumn.java
+++ /dev/null
@@ -1,186 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBaseColumn;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-
-public class GenericOrmColumn extends AbstractOrmBaseColumn<XmlColumn> implements OrmColumn
-{
- protected Integer specifiedLength;
-
- protected Integer specifiedPrecision;
-
- protected Integer specifiedScale;
-
- public GenericOrmColumn(XmlContextNode parent, OrmColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public OrmColumn.Owner getOwner() {
- return (OrmColumn.Owner) super.getOwner();
- }
-
- public void initializeFrom(Column oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedLength(oldColumn.getSpecifiedLength());
- setSpecifiedPrecision(oldColumn.getSpecifiedPrecision());
- setSpecifiedScale(oldColumn.getSpecifiedScale());
- }
-
- public int getLength() {
- return (this.getSpecifiedLength() == null) ? getDefaultLength() : this.getSpecifiedLength().intValue();
- }
-
- public int getDefaultLength() {
- return Column.DEFAULT_LENGTH;
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (this.valuesAreDifferent(oldSpecifiedLength, newSpecifiedLength)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setLength(newSpecifiedLength);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedLength != null) {
- addResourceColumn();
- getResourceColumn().setLength(newSpecifiedLength);
- }
- }
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- public int getPrecision() {
- return (this.getSpecifiedPrecision() == null) ? getDefaultPrecision() : this.getSpecifiedPrecision().intValue();
- }
-
- public int getDefaultPrecision() {
- return Column.DEFAULT_PRECISION;
- }
-
- public Integer getSpecifiedPrecision() {
- return this.specifiedPrecision;
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- if (this.valuesAreDifferent(oldSpecifiedPrecision, newSpecifiedPrecision)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setPrecision(newSpecifiedPrecision);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedPrecision != null) {
- addResourceColumn();
- getResourceColumn().setPrecision(newSpecifiedPrecision);
- }
- }
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- protected void setSpecifiedPrecision_(Integer newSpecifiedPrecision) {
- Integer oldSpecifiedPrecision = this.specifiedPrecision;
- this.specifiedPrecision = newSpecifiedPrecision;
- firePropertyChanged(SPECIFIED_PRECISION_PROPERTY, oldSpecifiedPrecision, newSpecifiedPrecision);
- }
-
- public int getScale() {
- return (this.getSpecifiedScale() == null) ? getDefaultScale() : this.getSpecifiedScale().intValue();
- }
-
- public int getDefaultScale() {
- return Column.DEFAULT_SCALE;
- }
-
- public Integer getSpecifiedScale() {
- return this.specifiedScale;
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- if (this.valuesAreDifferent(oldSpecifiedScale, newSpecifiedScale)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setScale(newSpecifiedScale);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedScale != null) {
- addResourceColumn();
- getResourceColumn().setScale(newSpecifiedScale);
- }
- }
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- protected void setSpecifiedScale_(Integer newSpecifiedScale) {
- Integer oldSpecifiedScale = this.specifiedScale;
- this.specifiedScale = newSpecifiedScale;
- firePropertyChanged(SPECIFIED_SCALE_PROPERTY, oldSpecifiedScale, newSpecifiedScale);
- }
-
- @Override
- protected XmlColumn getResourceColumn() {
- return getOwner().getResourceColumn();
- }
-
- @Override
- protected void addResourceColumn() {
- getOwner().addResourceColumn();
- }
-
- @Override
- protected void removeResourceColumn() {
- getOwner().removeResourceColumn();
- }
-
- @Override
- public void initialize(XmlColumn column) {
- super.initialize(column);
- this.specifiedLength = this.getResourceLength(column);
- this.specifiedPrecision = this.getResourcePrecision(column);
- this.specifiedScale = this.getResourceScale(column);
- }
-
- @Override
- public void update(XmlColumn column) {
- super.update(column);
- this.setSpecifiedLength_(this.getResourceLength(column));
- this.setSpecifiedPrecision_(this.getResourcePrecision(column));
- this.setSpecifiedScale_(this.getResourceScale(column));
- }
-
- protected Integer getResourceLength(XmlColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected Integer getResourcePrecision(XmlColumn column) {
- return column == null ? null : column.getPrecision();
- }
-
- protected Integer getResourceScale(XmlColumn column) {
- return column == null ? null : column.getScale();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java
deleted file mode 100644
index f917ea3900..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmDiscriminatorColumn.java
+++ /dev/null
@@ -1,199 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.core.context.DiscriminatorType;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmNamedColumn;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-public class GenericOrmDiscriminatorColumn extends AbstractOrmNamedColumn<XmlDiscriminatorColumn>
- implements OrmDiscriminatorColumn
-{
-
- protected DiscriminatorType specifiedDiscriminatorType;
-
- protected DiscriminatorType defaultDiscriminatorType;
-
- protected Integer specifiedLength;
-
- protected int defaultLength;
-
- protected XmlEntity entity;
-
- public GenericOrmDiscriminatorColumn(XmlContextNode parent, OrmDiscriminatorColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public OrmDiscriminatorColumn.Owner getOwner() {
- return (OrmDiscriminatorColumn.Owner) super.getOwner();
- }
-
- public DiscriminatorType getDiscriminatorType() {
- return (this.getSpecifiedDiscriminatorType() == null) ? this.getDefaultDiscriminatorType() : this.getSpecifiedDiscriminatorType();
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return this.defaultDiscriminatorType;
- }
-
- protected void setDefaultDiscriminatorType(DiscriminatorType discriminatorType) {
- DiscriminatorType old = this.defaultDiscriminatorType;
- this.defaultDiscriminatorType = discriminatorType;
- firePropertyChanged(DEFAULT_DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType);
- }
-
- public DiscriminatorType getSpecifiedDiscriminatorType() {
- return this.specifiedDiscriminatorType;
- }
-
- public void setSpecifiedDiscriminatorType(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- if (oldDiscriminatorType != newSpecifiedDiscriminatorType) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setDiscriminatorType(DiscriminatorType.toOrmResourceModel(newSpecifiedDiscriminatorType));
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedDiscriminatorType != null) {
- addResourceColumn();
- this.getResourceColumn().setDiscriminatorType(DiscriminatorType.toOrmResourceModel(newSpecifiedDiscriminatorType));
- }
- }
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- protected void setSpecifiedDiscriminatorType_(DiscriminatorType newSpecifiedDiscriminatorType) {
- DiscriminatorType oldDiscriminatorType = this.specifiedDiscriminatorType;
- this.specifiedDiscriminatorType = newSpecifiedDiscriminatorType;
- firePropertyChanged(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY, oldDiscriminatorType, newSpecifiedDiscriminatorType);
- }
-
- public int getLength() {
- return (this.getSpecifiedLength() == null) ? this.getDefaultLength() : this.getSpecifiedLength().intValue();
- }
-
- public int getDefaultLength() {
- return this.defaultLength;
- }
-
- protected void setDefaultLength(int defaultLength) {
- int old = this.defaultLength;
- this.defaultLength = defaultLength;
- firePropertyChanged(DEFAULT_LENGTH_PROPERTY, old, defaultLength);
- }
-
- public Integer getSpecifiedLength() {
- return this.specifiedLength;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- if (this.valuesAreDifferent(oldSpecifiedLength, newSpecifiedLength)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setLength(newSpecifiedLength);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedLength != null) {
- addResourceColumn();
- getResourceColumn().setLength(newSpecifiedLength);
- }
- }
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
- protected void setSpecifiedLength_(Integer newSpecifiedLength) {
- Integer oldSpecifiedLength = this.specifiedLength;
- this.specifiedLength = newSpecifiedLength;
- firePropertyChanged(SPECIFIED_LENGTH_PROPERTY, oldSpecifiedLength, newSpecifiedLength);
- }
-
-
- @Override
- public XmlDiscriminatorColumn getResourceColumn() {
- return this.entity.getDiscriminatorColumn();
- }
-
- @Override
- protected void addResourceColumn() {
- this.entity.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- }
-
- @Override
- protected void removeResourceColumn() {
- this.entity.setDiscriminatorColumn(null);
- }
-
- public boolean isResourceSpecified() {
- return getResourceColumn() != null;
- }
-
- public void initialize(XmlEntity xmlEntity) {
- this.entity = xmlEntity;
- this.initialize(this.getResourceColumn());
- }
-
- public void update(XmlEntity xmlEntity) {
- this.entity = xmlEntity;
- this.update(this.getResourceColumn());
- }
-
-
- @Override
- protected void initialize(XmlDiscriminatorColumn column) {
- super.initialize(column);
- this.defaultDiscriminatorType = this.buildDefaultDiscriminatorType();
- this.defaultLength = this.buildDefaultLength();
- this.specifiedLength = this.getResourceLength(column);
- this.specifiedDiscriminatorType = this.getResourceDiscriminatorType(column);
- }
-
- @Override
- protected void update(XmlDiscriminatorColumn column) {
- //don't call super because postUpdate() handles updating the default column name
- this.setSpecifiedName_(this.getResourceColumnName(column));
- this.setColumnDefinition_(this.getResourceColumnDefinition(column));
- this.setSpecifiedLength_(this.getResourceLength(column));
- this.setSpecifiedDiscriminatorType_(this.getResourceDiscriminatorType(column));
- }
-
- @Override
- /**
- * Using postUpdate since these defaults are dependent on the entity hierarchy
- */
- public void postUpdate() {
- super.postUpdate();
- this.setDefaultName(this.buildDefaultName());
- this.setDefaultDiscriminatorType(this.buildDefaultDiscriminatorType());
- this.setDefaultLength(this.buildDefaultLength());
- }
-
- protected Integer getResourceLength(XmlDiscriminatorColumn column) {
- return column == null ? null : column.getLength();
- }
-
- protected DiscriminatorType getResourceDiscriminatorType(XmlDiscriminatorColumn column) {
- return column == null ? null : DiscriminatorType.fromOrmResourceModel(column.getDiscriminatorType());
- }
-
- protected int buildDefaultLength() {
- return this.getOwner().getDefaultLength();
- }
-
- protected DiscriminatorType buildDefaultDiscriminatorType() {
- return this.getOwner().getDefaultDiscriminatorType();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddable.java
deleted file mode 100644
index f0c0c8d0a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddable.java
+++ /dev/null
@@ -1,30 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmEmbeddable;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaEmbeddable;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-
-public class GenericOrmEmbeddable
- extends AbstractOrmEmbeddable
-{
- public GenericOrmEmbeddable(OrmPersistentType parent, XmlEmbeddable resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return ArrayTools.contains(GenericJavaEmbeddable.ALLOWED_ATTRIBUTE_MAPPING_KEYS, attributeMappingKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java
deleted file mode 100644
index 21619f2025..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.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.core.internal.jpa1.context.orm;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.EmbeddedIdMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericOrmEmbeddedIdMapping
- extends AbstractOrmBaseEmbeddedMapping<XmlEmbeddedId>
- implements EmbeddedIdMapping2_0, OrmEmbeddedIdMapping
-{
- /* 2.0 feature - a relationship may map this embedded id */
- protected boolean mappedByRelationship;
-
-
- public GenericOrmEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId resourceMapping) {
- super(parent, resourceMapping);
- this.mappedByRelationship = calculateMappedByRelationship();
- }
-
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmEmbeddedIdMapping(this);
- }
-
- public int getXmlSequence() {
- return 10;
- }
-
-
- //*************** AttributeMapping implementation *********************
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getEmbeddedIds().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getEmbeddedIds().remove(this.resourceAttributeMapping);
- }
-
-
- // **************** EmbeddedId2_0 impl ************************************
-
- public boolean isMappedByRelationship() {
- return this.mappedByRelationship;
- }
-
- protected void setMappedByRelationship(boolean newValue) {
- boolean oldValue = this.mappedByRelationship;
- this.mappedByRelationship = newValue;
- firePropertyChanged(MAPPED_BY_RELATIONSHIP_PROPERTY, oldValue, newValue);
- }
-
- protected boolean calculateMappedByRelationship() {
- for (SingleRelationshipMapping2_0 each : getMapsIdRelationships()) {
- if (Tools.valuesAreEqual(getName(), each.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue())) {
- return true;
- }
- }
- return false;
- }
-
- protected Iterable<SingleRelationshipMapping2_0> getMapsIdRelationships() {
- return new FilteringIterable<SingleRelationshipMapping2_0>(
- new SubIterableWrapper<AttributeMapping, SingleRelationshipMapping2_0>(
- new CompositeIterable<AttributeMapping>(
- getTypeMapping().getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY),
- getTypeMapping().getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY)))) {
- @Override
- protected boolean accept(SingleRelationshipMapping2_0 o) {
- return o.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- // **************** overrides *********************************************
-
- @Override
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return (isMappedByRelationship()) ?
- EmptyIterator.<String>instance()
- : super.embeddableOverrideableAttributeMappingNames();
- }
-
- @Override
- protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() {
- return new AttributeOverrideContainerOwner();
- }
-
-
- protected class AttributeOverrideContainerOwner
- extends AbstractOrmBaseEmbeddedMapping.AttributeOverrideContainerOwner
- {
- @Override
- public Iterator<String> allOverridableNames() {
- return (GenericOrmEmbeddedIdMapping.this.isMappedByRelationship()) ?
- EmptyIterator.<String>instance()
- : super.allOverridableNames();
- }
-
- @Override
- protected Iterator<String> allOverridableAttributeNames_(TypeMapping typeMapping) {
- final Collection<String> mappedByRelationshipAttributes = CollectionTools.collection(
- new TransformationIterator<SingleRelationshipMapping2_0, String>(getMapsIdRelationships()) {
- @Override
- protected String transform(SingleRelationshipMapping2_0 next) {
- return next.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getValue();
- }
- });
- return new FilteringIterator<String>(super.allOverridableAttributeNames_(typeMapping)) {
- @Override
- protected boolean accept(String o) {
- if (mappedByRelationshipAttributes.isEmpty()) {
- return true;
- }
- // overrideable names are (usually?) qualified with a container mapping,
- // which may also be the one mapped by a relationship
- String qualifier =
- (o.indexOf('.') > 0) ?
- o.substring(0, o.indexOf('.'))
- : o;
- return ! mappedByRelationshipAttributes.contains(qualifier);
- }
- };
- }
- }
-
-
- // **************** resource -> context ***********************************
-
- @Override
- public void update() {
- super.update();
- setMappedByRelationship(calculateMappedByRelationship());
- }
-
-
- // **************** validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- // [JPA 2.0] if the embedded id is mapped by a relationship, then any specified
- // attribute overrides are in error
- // (in JPA 1.0, this will obviously never be reached)
- if (isMappedByRelationship()
- && getAttributeOverrideContainer().specifiedAttributeOverridesSize() > 0) {
- TextRange textRange = getAttributeOverrideContainer().getValidationTextRange();
- if (!isVirtual()) {
- textRange = getAttributeOverrideContainer().specifiedAttributeOverrides().next().getValidationTextRange();
- }
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED,
- new String[] {},
- getAttributeOverrideContainer(),
- textRange));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java
deleted file mode 100644
index 85bb6269bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java
+++ /dev/null
@@ -1,482 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SubIteratorWrapper;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class GenericOrmEmbeddedMapping
- extends AbstractOrmBaseEmbeddedMapping<XmlEmbedded>
- implements OrmEmbeddedMapping2_0
-{
- protected OrmAssociationOverrideContainer associationOverrideContainer;
-
- public GenericOrmEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded resourceMapping) {
- super(parent, resourceMapping);
- this.associationOverrideContainer =
- getXmlContextNodeFactory().
- buildOrmAssociationOverrideContainer(
- this,
- new AssociationOverrideContainerOwner());
- }
-
- @Override
- public void update() {
- super.update();
- getAssociationOverrideContainer().update();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- getAssociationOverrideContainer().postUpdate();
- }
-
- @Override
- public JavaEmbeddedMapping2_0 getJavaEmbeddedMapping() {
- return (JavaEmbeddedMapping2_0) super.getJavaEmbeddedMapping();
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmEmbeddedMapping(this);
- }
-
- public int getXmlSequence() {
- return 80;
- }
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getEmbeddeds().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getEmbeddeds().remove(this.resourceAttributeMapping);
- }
-
- //only putting this in EmbeddedMapping since relationship mappings
- //defined within an embedded id class are not supported by the 2.0 spec.
- //i.e. the mappedBy choices will not include attributes nested in an embedded mapping
- @Override
- public Iterator<String> allMappingNames() {
- return this.isJpa2_0Compatible() ?
- new CompositeIterator<String>(this.getName(),this.allEmbeddableAttributeMappingNames()) :
- super.allMappingNames();
- }
-
- protected Iterator<String> allEmbeddableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- }
- );
- }
-
- @Override
- public AttributeMapping resolveAttributeMapping(String attributeName) {
- if (getName() == null) {
- return null;
- }
- AttributeMapping resolvedMapping = super.resolveAttributeMapping(attributeName);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(embeddableAttributeMappings())) {
- resolvedMapping = attributeMapping.resolveAttributeMapping(attributeName.substring(dotIndex + 1));
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- if (getName() == null) {
- return null;
- }
- if (this.isJpa2_0Compatible()) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AssociationOverride override = getAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getRelationshipReference();
- }
- if (this.getTargetEmbeddable() == null) {
- return null;
- }
- return this.getTargetEmbeddable().resolveRelationshipReference(attributeName);
- }
- }
- }
- return null;
- }
-
- public OrmAssociationOverrideContainer getAssociationOverrideContainer() {
- return this.associationOverrideContainer;
- }
-
- protected JavaAssociationOverride getJavaAssociationOverrideNamed(String attributeName) {
- if (getJavaEmbeddedMapping() != null) {
- return getJavaEmbeddedMapping().getAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- }
- return null;
- }
-
-
- //************* AttributeOverrideContainer.Owner implementation ********************
-
- public Iterator<String> allOverridableAssociationNames() {
- return new TransformationIterator<RelationshipMapping, String>(this.allOverridableAssociations()) {
- @Override
- protected String transform(RelationshipMapping overridableAssociation) {
- return overridableAssociation.getName();
- }
- };
- }
-
- public Iterator<RelationshipMapping> allOverridableAssociations() {
- return (this.getTargetEmbeddable() == null) ?
- EmptyIterator.<RelationshipMapping>instance() :
- new SubIteratorWrapper<AttributeMapping, RelationshipMapping>(this.allOverridableAssociations_());
- }
-
- protected Iterator<AttributeMapping> allOverridableAssociations_() {
- return new FilteringIterator<AttributeMapping>(this.getTargetEmbeddable().attributeMappings()) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return o.isOverridableAssociationMapping();
- }
- };
- }
-
-
- // ********** validation **********
- @Override
- protected void validateOverrides(List<IMessage> messages, IReporter reporter) {
- super.validateOverrides(messages, reporter);
- this.getAssociationOverrideContainer().validate(messages, reporter);
- }
-
-
- //********** OrmAssociationOverrideContainer.Owner implementation *********
-
- protected class AssociationOverrideContainerOwner
- implements OrmAssociationOverrideContainer.Owner
- {
- public OrmTypeMapping getTypeMapping() {
- return GenericOrmEmbeddedMapping.this.getTypeMapping();
- }
-
- public TypeMapping getOverridableTypeMapping() {
- return GenericOrmEmbeddedMapping.this.getTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public EList<XmlAssociationOverride> getResourceAssociationOverrides() {
- return GenericOrmEmbeddedMapping.this.resourceAttributeMapping.getAssociationOverrides();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAssociationOverride javaAssociationOverride = getJavaAssociationOverrideNamed(associationOverrideName);
- if (javaAssociationOverride != null && !javaAssociationOverride.isVirtual()) {
- return javaAssociationOverride.getRelationshipReference();
- }
- }
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterator<String> candidateTableNames() {
- return getTypeMapping().associatedTableNamesIncludingInherited();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return getTypeMapping().getDbTable(tableName);
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmEmbeddedMapping.this.getValidationTextRange();
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- GenericOrmEmbeddedMapping.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.NOT_VALID_FOR_THIS_ENTITY},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {
- GenericOrmEmbeddedMapping.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {
- GenericOrmEmbeddedMapping.this.getName(),
- overrideName,
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {
- overrideName,
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {GenericOrmEmbeddedMapping.this.getName(), overrideName},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {GenericOrmEmbeddedMapping.this.getName(), overrideName},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEntity.java
deleted file mode 100644
index 867a738828..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEntity.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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmEntity;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-
-public class GenericOrmEntity
- extends AbstractOrmEntity
-
-{
-
- protected final OrmCacheable2_0 cacheable;
-
- public GenericOrmEntity(OrmPersistentType parent, XmlEntity resourceMapping) {
- super(parent, resourceMapping);
- this.cacheable = ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).buildOrmCacheable(this, resourceMapping);
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- if (!isMetadataComplete()) {
- CacheableHolder2_0 javaEntity = (CacheableHolder2_0) getJavaEntity();
- if (javaEntity != null) {
- return javaEntity.getCacheable().isCacheable();
- }
- }
-
- CacheableHolder2_0 parentEntity = (CacheableHolder2_0) getParentEntity();
- if (parentEntity != null) {
- return parentEntity.getCacheable().isCacheable();
- }
- return ((PersistenceUnit2_0) getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- @Override
- public void update() {
- super.update();
- getCacheable().update();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEnumeratedConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEnumeratedConverter.java
deleted file mode 100644
index ad4abac133..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEnumeratedConverter.java
+++ /dev/null
@@ -1,94 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.EnumType;
-import org.eclipse.jpt.core.context.EnumeratedConverter;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmEnumeratedConverter extends AbstractOrmXmlContextNode
- implements EnumeratedConverter, OrmConverter
-{
- protected EnumType specifiedEnumType;
-
- protected XmlConvertibleMapping resourceConvertibleMapping;
-
- public GenericOrmEnumeratedConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- super(parent);
- this.initialize(resourceMapping);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.ENUMERATED_CONVERTER;
- }
-
- public EnumType getEnumType() {
- return getSpecifiedEnumType() == null ? getDefaultEnumType() : getSpecifiedEnumType();
- }
-
- public EnumType getDefaultEnumType() {
- //there is no default enumType in xml, if you specify the enumerated element, you must
- //specify either ORDINAL or STRING
- return null;
- }
-
- public EnumType getSpecifiedEnumType() {
- return this.specifiedEnumType;
- }
-
- public void setSpecifiedEnumType(EnumType newSpecifiedEnumType) {
- EnumType oldSpecifiedEnumType = this.specifiedEnumType;
- this.specifiedEnumType = newSpecifiedEnumType;
- this.resourceConvertibleMapping.setEnumerated(EnumType.toOrmResourceModel(newSpecifiedEnumType));
- firePropertyChanged(EnumeratedConverter.SPECIFIED_ENUM_TYPE_PROPERTY, oldSpecifiedEnumType, newSpecifiedEnumType);
- }
-
- protected void setSpecifiedEnumType_(EnumType newSpecifiedEnumType) {
- EnumType oldSpecifiedEnumType = this.specifiedEnumType;
- this.specifiedEnumType = newSpecifiedEnumType;
- firePropertyChanged(EnumeratedConverter.SPECIFIED_ENUM_TYPE_PROPERTY, oldSpecifiedEnumType, newSpecifiedEnumType);
- }
-
- protected void initialize(XmlConvertibleMapping resourceConvertibleMapping) {
- this.resourceConvertibleMapping = resourceConvertibleMapping;
- this.specifiedEnumType = this.specifiedEnumType();
- }
-
- public void update() {
- this.setSpecifiedEnumType_(this.specifiedEnumType());
- }
-
- protected EnumType specifiedEnumType() {
- return EnumType.fromOrmResourceModel(this.resourceConvertibleMapping.getEnumerated());
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceConvertibleMapping.getEnumeratedTextRange();
- }
-
- public void addToResourceModel() {
- this.resourceConvertibleMapping.setEnumerated(org.eclipse.jpt.core.resource.orm.EnumType.ORDINAL);
- }
-
- public void removeFromResourceModel() {
- this.resourceConvertibleMapping.setEnumerated(null);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratedValue.java
deleted file mode 100644
index 860d5a8f61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratedValue.java
+++ /dev/null
@@ -1,180 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.context.GeneratedValue;
-import org.eclipse.jpt.core.context.GenerationType;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- */
-public class GenericOrmGeneratedValue
- extends AbstractOrmXmlContextNode
- implements OrmGeneratedValue
-{
- protected XmlGeneratedValue resourceGeneratedValue;
-
- protected GenerationType specifiedStrategy;
-
- protected String specifiedGenerator;
- protected String defaultGenerator;
-
-
- public GenericOrmGeneratedValue(XmlContextNode parent, XmlGeneratedValue resourceGeneratedValue) {
- super(parent);
- this.initialize(resourceGeneratedValue);
- }
-
- protected void initialize(XmlGeneratedValue xmlGeneratedValue) {
- this.resourceGeneratedValue = xmlGeneratedValue;
- this.specifiedStrategy = this.buildStrategy();
- this.specifiedGenerator = xmlGeneratedValue.getGenerator();
- //TODO
- this.defaultGenerator = null;
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
-
- // ********** strategy **********
-
- public GenerationType getStrategy() {
- return (this.specifiedStrategy != null) ? this.specifiedStrategy : this.getDefaultStrategy();
- }
-
- public GenerationType getDefaultStrategy() {
- return GeneratedValue.DEFAULT_STRATEGY;
- }
-
- public GenerationType getSpecifiedStrategy() {
- return this.specifiedStrategy;
- }
-
- public void setSpecifiedStrategy(GenerationType strategy) {
- GenerationType old = this.specifiedStrategy;
- this.specifiedStrategy = strategy;
- this.resourceGeneratedValue.setStrategy(GenerationType.toOrmResourceModel(strategy));
- this.firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, old, strategy);
- }
-
- protected void setSpecifiedStrategy_(GenerationType strategy) {
- GenerationType old = this.specifiedStrategy;
- this.specifiedStrategy = strategy;
- this.firePropertyChanged(SPECIFIED_STRATEGY_PROPERTY, old, strategy);
- }
-
-
- // ********** generator **********
-
- public String getGenerator() {
- return (this.specifiedGenerator != null) ? this.specifiedGenerator : this.defaultGenerator;
- }
-
- public String getDefaultGenerator() {
- return this.defaultGenerator;
- }
-
- protected void setDefaultGenerator(String generator) {
- String old = this.defaultGenerator;
- this.defaultGenerator = generator;
- this.firePropertyChanged(DEFAULT_GENERATOR_PROPERTY, old, generator);
- }
-
- public String getSpecifiedGenerator() {
- return this.specifiedGenerator;
- }
-
- public void setSpecifiedGenerator(String generator) {
- String old = this.specifiedGenerator;
- this.specifiedGenerator = generator;
- this.resourceGeneratedValue.setGenerator(generator);
- this.firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, old, generator);
- }
-
- protected void setSpecifiedGenerator_(String generator) {
- String old = this.specifiedGenerator;
- this.specifiedGenerator = generator;
- this.firePropertyChanged(SPECIFIED_GENERATOR_PROPERTY, old, generator);
- }
-
-
- // ********** text ranges **********
-
- public TextRange getValidationTextRange() {
- TextRange validationTextRange = this.resourceGeneratedValue.getValidationTextRange();
- return validationTextRange != null ? validationTextRange : getParent().getValidationTextRange();
- }
-
- public TextRange getGeneratorTextRange() {
- TextRange textRange = this.resourceGeneratedValue.getGeneratorTextRange();
- return textRange != null ? textRange : getValidationTextRange();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- String generator = this.getGenerator();
- if (generator == null) {
- return;
- }
-
- for (Iterator<Generator> stream = this.getPersistenceUnit().generators(); stream.hasNext(); ) {
- if (generator.equals(stream.next().getName())) {
- return;
- }
- }
-
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME,
- new String[] {generator},
- this.getParent(),
- this.getGeneratorTextRange()
- )
- );
- }
-
-
- // ********** update from resource model **********
-
- public void update(XmlGeneratedValue xmlGeneratedValue) {
- this.resourceGeneratedValue = xmlGeneratedValue;
- this.setSpecifiedStrategy_(this.buildStrategy());
- this.setSpecifiedGenerator_(xmlGeneratedValue.getGenerator());
- //TODO
- this.setDefaultGenerator(null);
- }
-
- protected GenerationType buildStrategy() {
- return GenerationType.fromOrmResourceModel(this.resourceGeneratedValue.getStrategy());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratorContainer.java
deleted file mode 100644
index 2ec03ec9a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmGeneratorContainer.java
+++ /dev/null
@@ -1,220 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.core.context.Generator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmGenerator;
-import org.eclipse.jpt.core.context.orm.OrmGeneratorContainer;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmGeneratorContainer extends AbstractOrmXmlContextNode
- implements OrmGeneratorContainer
-{
- protected OrmSequenceGenerator sequenceGenerator;
-
- protected OrmTableGenerator tableGenerator;
-
- protected final XmlGeneratorContainer resourceGeneratorContainer;
-
- public GenericOrmGeneratorContainer(XmlContextNode parent, XmlGeneratorContainer resourceGeneratorContainer) {
- super(parent);
- this.resourceGeneratorContainer = resourceGeneratorContainer;
- this.initializeSequenceGenerator();
- this.initializeTableGenerator();
- }
-
- public OrmSequenceGenerator addSequenceGenerator() {
- if (getSequenceGenerator() != null) {
- throw new IllegalStateException("sequenceGenerator already exists"); //$NON-NLS-1$
- }
- XmlSequenceGenerator resourceSequenceGenerator = buildResourceSequenceGenerator();
- this.sequenceGenerator = buildSequenceGenerator(resourceSequenceGenerator);
- this.resourceGeneratorContainer.setSequenceGenerator(resourceSequenceGenerator);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, null, this.sequenceGenerator);
- return this.sequenceGenerator;
- }
-
- public void removeSequenceGenerator() {
- if (getSequenceGenerator() == null) {
- throw new IllegalStateException("sequenceGenerator does not exist, cannot be removed"); //$NON-NLS-1$
- }
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = null;
- this.resourceGeneratorContainer.setSequenceGenerator(null);
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, null);
- }
-
- public OrmSequenceGenerator getSequenceGenerator() {
- return this.sequenceGenerator;
- }
-
- protected void setSequenceGenerator(OrmSequenceGenerator newSequenceGenerator) {
- OrmSequenceGenerator oldSequenceGenerator = this.sequenceGenerator;
- this.sequenceGenerator = newSequenceGenerator;
- firePropertyChanged(SEQUENCE_GENERATOR_PROPERTY, oldSequenceGenerator, newSequenceGenerator);
- }
-
- public OrmTableGenerator addTableGenerator() {
- if (getTableGenerator() != null) {
- throw new IllegalStateException("tableGenerator already exists"); //$NON-NLS-1$
- }
- XmlTableGenerator resourceTableGenerator = buildResourceTableGenerator();
- this.tableGenerator = buildTableGenerator(resourceTableGenerator);
- this.resourceGeneratorContainer.setTableGenerator(resourceTableGenerator);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, null, this.tableGenerator);
- return this.tableGenerator;
- }
-
- public void removeTableGenerator() {
- if (getTableGenerator() == null) {
- throw new IllegalStateException("tableGenerator does not exist, cannot be removed"); //$NON-NLS-1$
- }
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = null;
- this.resourceGeneratorContainer.setTableGenerator(null);
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, null);
- }
-
- public OrmTableGenerator getTableGenerator() {
- return this.tableGenerator;
- }
-
- protected void setTableGenerator(OrmTableGenerator newTableGenerator) {
- OrmTableGenerator oldTableGenerator = this.tableGenerator;
- this.tableGenerator = newTableGenerator;
- firePropertyChanged(TABLE_GENERATOR_PROPERTY, oldTableGenerator, newTableGenerator);
- }
-
- protected void initializeSequenceGenerator() {
- if (this.resourceGeneratorContainer.getSequenceGenerator() != null) {
- this.sequenceGenerator = buildSequenceGenerator(this.resourceGeneratorContainer.getSequenceGenerator());
- }
- }
-
- protected XmlSequenceGenerator buildResourceSequenceGenerator() {
- return OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- }
-
- protected OrmSequenceGenerator buildSequenceGenerator(XmlSequenceGenerator resourceSequenceGenerator) {
- return getXmlContextNodeFactory().buildOrmSequenceGenerator(this, resourceSequenceGenerator);
- }
-
- protected void initializeTableGenerator() {
- if (this.resourceGeneratorContainer.getTableGenerator() != null) {
- this.tableGenerator = buildTableGenerator(this.resourceGeneratorContainer.getTableGenerator());
- }
- }
-
- protected XmlTableGenerator buildResourceTableGenerator() {
- return OrmFactory.eINSTANCE.createXmlTableGenerator();
- }
-
- protected OrmTableGenerator buildTableGenerator(XmlTableGenerator resourceTableGenerator) {
- return getXmlContextNodeFactory().buildOrmTableGenerator(this, resourceTableGenerator);
- }
-
- public void update() {
- this.updateSequenceGenerator();
- this.updateTableGenerator();
- }
-
- protected void updateSequenceGenerator() {
- if (this.resourceGeneratorContainer.getSequenceGenerator() == null) {
- if (getSequenceGenerator() != null) {
- setSequenceGenerator(null);
- }
- }
- else {
- if (getSequenceGenerator() == null) {
- setSequenceGenerator(buildSequenceGenerator(this.resourceGeneratorContainer.getSequenceGenerator()));
- }
- else {
- getSequenceGenerator().update(this.resourceGeneratorContainer.getSequenceGenerator());
- }
- }
- }
-
- protected void updateTableGenerator() {
- if (this.resourceGeneratorContainer.getTableGenerator() == null) {
- if (getTableGenerator() != null) {
- setTableGenerator(null);
- }
- }
- else {
- if (getTableGenerator() == null) {
- setTableGenerator(buildTableGenerator(this.resourceGeneratorContainer.getTableGenerator()));
- }
- else {
- getTableGenerator().update(this.resourceGeneratorContainer.getTableGenerator());
- }
- }
- }
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateGenerators(messages);
- }
-
- protected void validateGenerators(List<IMessage> messages) {
- for (Iterator<OrmGenerator> localGenerators = this.generators(); localGenerators.hasNext(); ) {
- OrmGenerator localGenerator = localGenerators.next();
- for (Iterator<Generator> globalGenerators = this.getPersistenceUnit().generators(); globalGenerators.hasNext(); ) {
- if (localGenerator.duplicates(globalGenerators.next())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.GENERATOR_DUPLICATE_NAME,
- new String[] {localGenerator.getName()},
- localGenerator,
- localGenerator.getNameTextRange()
- )
- );
- }
- }
- }
- }
-
- protected Iterator<OrmGenerator> generators() {
- ArrayList<OrmGenerator> generators = new ArrayList<OrmGenerator>();
- this.addGeneratorsTo(generators);
- return generators.iterator();
- }
-
- protected void addGeneratorsTo(ArrayList<OrmGenerator> generators) {
- if (this.sequenceGenerator != null) {
- generators.add(this.sequenceGenerator);
- }
- if (this.tableGenerator != null) {
- generators.add(this.tableGenerator);
- }
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceGeneratorContainer.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmIdMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmIdMapping.java
deleted file mode 100644
index 7675b12575..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmIdMapping.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmIdMapping;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-
-public class GenericOrmIdMapping extends AbstractOrmIdMapping<XmlId>
-{
-
- public GenericOrmIdMapping(OrmPersistentAttribute parent, XmlId resourceMapping) {
- super(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinColumn.java
deleted file mode 100644
index c9b27ba0c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinColumn.java
+++ /dev/null
@@ -1,202 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBaseColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmJoinColumn extends AbstractOrmBaseColumn<XmlJoinColumn> implements OrmJoinColumn
-{
-
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected XmlJoinColumn resourceJoinColumn;
-
- public GenericOrmJoinColumn(XmlContextNode parent, OrmJoinColumn.Owner owner, XmlJoinColumn resourceJoinColumn) {
- super(parent, owner);
- this.initialize(resourceJoinColumn);
- }
-
- public void initializeFrom(JoinColumn oldColumn) {
- super.initializeFrom(oldColumn);
- setSpecifiedReferencedColumnName(oldColumn.getSpecifiedReferencedColumnName());
- }
-
- public String getReferencedColumnName() {
- return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName();
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- getResourceColumn().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- @Override
- public OrmJoinColumn.Owner getOwner() {
- return (OrmJoinColumn.Owner) this.owner;
- }
-
- public Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- public Column getReferencedDbColumn() {
- Table table = getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(getReferencedColumnName());
- }
-
- public boolean isReferencedColumnResolved() {
- return getReferencedDbColumn() != null;
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- if (getResourceColumn() != null) {
- TextRange textRange = getResourceColumn().getReferencedColumnNameTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return getOwner().getValidationTextRange();
- }
-
-
- @Override
- protected XmlJoinColumn getResourceColumn() {
- return this.resourceJoinColumn;
- }
-
- @Override
- protected void addResourceColumn() {
- //joinColumns are part of a collection, the join-column element will be removed/added
- //when the XmlJoinColumn is removed/added to the XmlEntity collection
- }
-
- @Override
- protected void removeResourceColumn() {
- //joinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlJoinColumn is removed/added to the XmlEntity collection
- }
-
-
- @Override
- protected void initialize(XmlJoinColumn xjc) {
- this.resourceJoinColumn = xjc;
- super.initialize(xjc);
- this.specifiedReferencedColumnName = buildSpecifiedReferencedColumnName(xjc);
- this.defaultReferencedColumnName = buildDefaultReferencedColumnName();
- }
-
- @Override
- public void update(XmlJoinColumn xjc) {
- this.resourceJoinColumn = xjc;
- super.update(xjc);
- this.setSpecifiedReferencedColumnName_(buildSpecifiedReferencedColumnName(xjc));
- this.setDefaultReferencedColumnName(buildDefaultReferencedColumnName());
- }
-
- protected String buildSpecifiedReferencedColumnName(XmlJoinColumn xjc) {
- return (xjc == null) ? null : xjc.getReferencedColumnName();
- }
-
- @Override
- protected String buildDefaultName() {
- return MappingTools.buildJoinColumnDefaultName(this, this.getOwner());
- }
-
- protected String buildDefaultReferencedColumnName() {
- return MappingTools.buildJoinColumnDefaultReferencedColumnName(this.getOwner());
- }
-
-
- //******************* validation ***********************
-
- @Override
- //this method will only be called if the table validates correctly
- protected void validateName(List<IMessage> messages) {
- //do not call super here, first need to check for multiple join columns errors
- this.validateJoinColumnName(messages);
- this.validateReferencedColumnName(messages);
- }
-
- protected void validateJoinColumnName(List<IMessage> messages) {
- if (this.getSpecifiedName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedNameMultipleJoinColumnsMessage());
- }
- else if (this.getName() != null){
- super.validateName(messages);
- }
- //If the name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected void validateReferencedColumnName(List<IMessage> messages) {
- if (this.getSpecifiedReferencedColumnName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage());
- }
- else if (this.getSpecifiedReferencedColumnName() != null) {
- Table refColumnDbTable = this.getReferencedColumnDbTable();
- if (refColumnDbTable != null && ! this.isReferencedColumnResolved()) {
- messages.add(getOwner().buildUnresolvedReferencedColumnNameMessage(this, this.getReferencedColumnNameTextRange()));
- }
- }
- //If the referenced column name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected IMessage buildUnspecifiedNameMultipleJoinColumnsMessage() {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(this, getNameTextRange());
- }
-
- protected IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(this, getReferencedColumnNameTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinTable.java
deleted file mode 100644
index 4f5d33555b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmJoinTable.java
+++ /dev/null
@@ -1,766 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * orm.xml join table
- */
-public class GenericOrmJoinTable
- extends GenericOrmReferenceTable
- implements OrmJoinTable
-{
-
- protected OrmJoinColumn defaultInverseJoinColumn;
-
- protected final Vector<OrmJoinColumn> specifiedInverseJoinColumns = new Vector<OrmJoinColumn>();
- protected final OrmJoinColumn.Owner inverseJoinColumnOwner;
-
-
- public GenericOrmJoinTable(OrmJoinTableJoiningStrategy parent, XmlJoinTable resourceJoinTable) {
- super(parent);
- this.inverseJoinColumnOwner = this.buildInverseJoinColumnOwner();
- this.initialize(resourceJoinTable);
- }
-
- @Override
- protected OrmJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- protected OrmJoinColumn.Owner buildInverseJoinColumnOwner() {
- return new InverseJoinColumnOwner();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return getParent().getRelationshipReference().getRelationshipMapping();
- }
-
- public void initializeFrom(JoinTable oldJoinTable) {
- super.initializeFrom(oldJoinTable);
- for (Iterator<OrmJoinColumn> stream = oldJoinTable.specifiedInverseJoinColumns(); stream.hasNext(); ) {
- this.addSpecifiedInverseJoinColumnFrom(stream.next());
- }
- }
-
- protected void initialize(XmlJoinTable joinTable) {
- super.initialize(joinTable);
- this.initializeSpecifiedInverseJoinColumns(joinTable);
- this.initializeDefaultInverseJoinColumn();
- }
-
- @Override
- protected void update(AbstractXmlReferenceTable joinTable) {
- super.update(joinTable);
- this.updateSpecifiedInverseJoinColumns((XmlJoinTable) joinTable);
- this.updateDefaultInverseJoinColumn();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getRelationshipMapping().getPersistentAttribute();
- }
-
-
- // ********** AbstractOrmTable implementation **********
-
- @Override
- public OrmJoinTableJoiningStrategy getParent() {
- return (OrmJoinTableJoiningStrategy) super.getParent();
- }
-
- @Override
- protected String buildDefaultName() {
- return this.getParent().getJoinTableDefaultName();
- }
-
- @Override
- protected XmlJoinTable getResourceTable() {
- return this.getParent().getResourceJoinTable();
- }
-
- @Override
- protected XmlJoinTable addResourceTable() {
- return getParent().addResourceJoinTable();
- }
-
- @Override
- protected void removeResourceTable() {
- getParent().removeResourceJoinTable();
- }
-
-
- // ********** inverse join columns **********
-
- public ListIterator<OrmJoinColumn> inverseJoinColumns() {
- return this.hasSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumns() : this.defaultInverseJoinColumns();
- }
-
- public int inverseJoinColumnsSize() {
- return this.hasSpecifiedInverseJoinColumns() ? this.specifiedInverseJoinColumnsSize() : this.defaultInverseJoinColumnsSize();
- }
-
- public void convertDefaultToSpecifiedInverseJoinColumn() {
- MappingTools.convertJoinTableDefaultToSpecifiedInverseJoinColumn(this);
- }
-
-
- // ********** default inverse join column **********
-
- public OrmJoinColumn getDefaultInverseJoinColumn() {
- return this.defaultInverseJoinColumn;
- }
-
- protected void setDefaultInverseJoinColumn(OrmJoinColumn defaultInverseJoinColumn) {
- OrmJoinColumn old = this.defaultInverseJoinColumn;
- this.defaultInverseJoinColumn = defaultInverseJoinColumn;
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, old, defaultInverseJoinColumn);
- }
-
- protected ListIterator<OrmJoinColumn> defaultInverseJoinColumns() {
- if (this.defaultInverseJoinColumn != null) {
- return new SingleElementListIterator<OrmJoinColumn>(this.defaultInverseJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultInverseJoinColumnsSize() {
- return (this.defaultInverseJoinColumn == null) ? 0 : 1;
- }
-
- protected void initializeDefaultInverseJoinColumn() {
- if (this.shouldBuildDefaultInverseJoinColumn()) {
- this.defaultInverseJoinColumn = this.buildInverseJoinColumn(null);
- }
- }
-
- protected void updateDefaultInverseJoinColumn() {
- if (this.shouldBuildDefaultInverseJoinColumn()) {
- if (this.defaultInverseJoinColumn == null) {
- this.setDefaultInverseJoinColumn(this.buildInverseJoinColumn(null));
- } else {
- this.defaultInverseJoinColumn.update(null);
- }
- } else {
- this.setDefaultInverseJoinColumn(null);
- }
- }
-
- protected boolean shouldBuildDefaultInverseJoinColumn() {
- return ! this.hasSpecifiedInverseJoinColumns();
- }
-
-
- // ********** specified inverse join columns **********
-
- public ListIterator<OrmJoinColumn> specifiedInverseJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedInverseJoinColumns);
- }
-
- public int specifiedInverseJoinColumnsSize() {
- return this.specifiedInverseJoinColumns.size();
- }
-
- public boolean hasSpecifiedInverseJoinColumns() {
- return !this.specifiedInverseJoinColumns.isEmpty();
- }
-
- protected void addSpecifiedInverseJoinColumnFrom(OrmJoinColumn oldJoinColumn) {
- OrmJoinColumn newJoinColumn = this.addSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.size());
- newJoinColumn.initializeFrom(oldJoinColumn);
- }
-
- public OrmJoinColumn addSpecifiedInverseJoinColumn(int index) {
- if (this.getResourceTable() == null) {
- this.addResourceTable();
- }
- XmlJoinColumn xmlJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumn();
- OrmJoinColumn joinColumn = this.buildInverseJoinColumn(xmlJoinColumn);
- this.specifiedInverseJoinColumns.add(index, joinColumn);
- this.getResourceTable().getInverseJoinColumns().add(index, xmlJoinColumn);
- this.fireItemAdded(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addSpecifiedInverseJoinColumn(int index, OrmJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.specifiedInverseJoinColumns, SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedInverseJoinColumn(OrmJoinColumn joinColumn) {
- this.addSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedInverseJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedInverseJoinColumn(this.specifiedInverseJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedInverseJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedInverseJoinColumns.remove(index);
- if ( ! this.hasSpecifiedInverseJoinColumns()) {
- //create the defaultInverseJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultInverseJoinColumn = this.buildInverseJoinColumn(null);
- }
- this.getResourceTable().getInverseJoinColumns().remove(index);
- this.fireItemRemoved(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultInverseJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
- }
-
- protected void removeSpecifiedInverseJoinColumn_(OrmJoinColumn joinColumn) {
- this.removeItemFromList(joinColumn, this.specifiedInverseJoinColumns, SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedInverseJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedInverseJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().getInverseJoinColumns().move(targetIndex, sourceIndex);
- this.fireItemMoved(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void clearSpecifiedInverseJoinColumns() {
- this.specifiedInverseJoinColumns.clear();
- this.defaultInverseJoinColumn = this.buildInverseJoinColumn(null);
- this.getResourceTable().getInverseJoinColumns().clear();
- this.fireListCleared(SPECIFIED_INVERSE_JOIN_COLUMNS_LIST);
- this.firePropertyChanged(DEFAULT_INVERSE_JOIN_COLUMN, null, this.defaultInverseJoinColumn);
- }
-
- protected OrmJoinColumn buildInverseJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return this.buildJoinColumn(resourceJoinColumn, this.inverseJoinColumnOwner);
- }
-
- protected void initializeSpecifiedInverseJoinColumns(XmlJoinTable xmlJoinTable) {
- if (xmlJoinTable != null) {
- for (XmlJoinColumn xmlJoinColumn : xmlJoinTable.getInverseJoinColumns()) {
- this.specifiedInverseJoinColumns.add(this.buildInverseJoinColumn(xmlJoinColumn));
- }
- }
- }
-
- protected void updateSpecifiedInverseJoinColumns(XmlJoinTable xmlJoinTable) {
- Iterator<XmlJoinColumn> xmlJoinColumns = this.xmlInverseJoinColumns(xmlJoinTable);
-
- for (ListIterator<OrmJoinColumn> contextJoinColumns = this.specifiedInverseJoinColumns(); contextJoinColumns.hasNext(); ) {
- OrmJoinColumn contextColumn = contextJoinColumns.next();
- if (xmlJoinColumns.hasNext()) {
- contextColumn.update(xmlJoinColumns.next());
- } else {
- this.removeSpecifiedInverseJoinColumn_(contextColumn);
- }
- }
-
- while (xmlJoinColumns.hasNext()) {
- this.addSpecifiedInverseJoinColumn(this.buildInverseJoinColumn(xmlJoinColumns.next()));
- }
- }
-
- protected Iterator<XmlJoinColumn> xmlInverseJoinColumns(XmlJoinTable xmlJoinTable) {
- // make a copy of the XML join columns (to prevent ConcurrentModificationException)
- return (xmlJoinTable == null) ? EmptyIterator.<XmlJoinColumn>instance()
- : new CloneIterator<XmlJoinColumn>(xmlJoinTable.getInverseJoinColumns());
- }
-
-
- // ********** validation **********
-
- @Override
- protected void validateJoinColumns(List<IMessage> messages, IReporter reporter) {
- super.validateJoinColumns(messages, reporter);
- this.validateJoinColumns(this.inverseJoinColumns(), messages, reporter);
- }
-
- @Override
- protected boolean shouldValidateAgainstDatabase() {
- return getParent().shouldValidateAgainstDatabase();
- }
-
- @Override
- protected String getUnresolvedCatalogMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getUnresolvedNameMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getUnresolvedSchemaMessageId() {
- return JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedCatalogMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedNameMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedSchemaMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA;
- }
-
- // ********** join column owner adapters **********
-
- /**
- * just a little common behavior
- */
- protected abstract class AbstractJoinColumnOwner
- implements OrmJoinColumn.Owner
- {
- protected AbstractJoinColumnOwner() {
- super();
- }
-
- public TypeMapping getTypeMapping() {
- return GenericOrmJoinTable.this.getParent().getRelationshipReference().getTypeMapping();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return GenericOrmJoinTable.this.getRelationshipMapping().getPersistentAttribute();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the join table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- /**
- * the join column can only be on the join table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- public Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- String joinTableName = GenericOrmJoinTable.this.getName();
- return (joinTableName == null) ? null : (joinTableName.equals(tableName)) ? GenericOrmJoinTable.this.getDbTable() : null;
- }
-
- /**
- * by default, the join column is, obviously, in the join table;
- * not sure whether it can be anywhere else...
- */
- public String getDefaultTableName() {
- return GenericOrmJoinTable.this.getName();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmJoinTable.this.getValidationTextRange();
- }
-
- protected boolean isPersistentAttributeVirtual() {
- return getPersistentAttribute().isVirtual();
- }
-
- protected String getPersistentAttributeName() {
- return getPersistentAttribute().getName();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isPersistentAttributeVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getTableNotValidMessage(),
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_JOIN_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getVirtualTableNotValidMessage(),
- new String[] {
- getName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_JOIN_TABLE},
- column,
- textRange
- );
- }
-
- protected abstract String getTableNotValidMessage();
-
- protected abstract String getVirtualTableNotValidMessage();
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedNameMessage(),
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getVirtualUnresolvedNameMessage(),
- new String[] {getPersistentAttributeName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnresolvedNameMessage();
-
- protected abstract String getVirtualUnresolvedNameMessage();
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- if (isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedReferencedColumnNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getUnresolvedReferencedColumnNameMessage(),
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getVirtualUnresolvedReferencedColumnNameMessage(),
- new String[] {this.getPersistentAttributeName(), column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnresolvedReferencedColumnNameMessage();
-
- protected abstract String getVirtualUnresolvedReferencedColumnNameMessage();
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getUnspecifiedNameMultipleJoinColumnsMessage(),
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getVirtualUnspecifiedNameMultipleJoinColumnsMessage(),
- new String[] {this.getPersistentAttributeName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnspecifiedNameMultipleJoinColumnsMessage();
-
- protected abstract String getVirtualUnspecifiedNameMultipleJoinColumnsMessage();
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(),
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(),
- new String[] {this.getPersistentAttributeName()},
- column,
- textRange
- );
- }
-
- protected abstract String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage();
-
- protected abstract String getVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage();
- }
-
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- protected class JoinColumnOwner
- extends AbstractJoinColumnOwner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- public Entity getRelationshipTarget() {
- return GenericOrmJoinTable.this.getParent().getRelationshipReference().getEntity();
- }
-
- public String getAttributeName() {
- RelationshipMapping relationshipMapping = GenericOrmJoinTable.this.getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- for (PersistentAttribute each : CollectionTools.iterable(targetEntity.getPersistentType().allAttributes())) {
- if (each.getMapping().isOwnedBy(relationshipMapping)) {
- return each.getName();
- }
- }
- return null;
- }
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- org.eclipse.jpt.db.Table dbTable = super.getDbTable(tableName);
- return (dbTable != null) ? dbTable : this.getTypeMapping().getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmJoinTable.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.joinColumnsSize();
- }
-
- @Override
- protected String getTableNotValidMessage() {
- return JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getVirtualTableNotValidMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getUnresolvedNameMessage() {
- return JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getVirtualUnresolvedNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- public String getUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- public String getVirtualUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- public String getUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getVirtualUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
- }
-
-
- /**
- * owner for "forward-pointer" JoinColumns;
- * these point at the target/inverse entity
- */
- protected class InverseJoinColumnOwner
- extends AbstractJoinColumnOwner
- {
- protected InverseJoinColumnOwner() {
- super();
- }
-
- public Entity getRelationshipTarget() {
- RelationshipMapping relationshipMapping = GenericOrmJoinTable.this.getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public String getAttributeName() {
- RelationshipMapping relationshipMapping = GenericOrmJoinTable.this.getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getName();
- }
-
- @Override
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- org.eclipse.jpt.db.Table dbTable = super.getDbTable(tableName);
- if (dbTable != null) {
- return dbTable;
- }
- Entity relationshipTarget = this.getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getDbTable(tableName);
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- Entity relationshipTarget = this.getRelationshipTarget();
- return (relationshipTarget == null) ? null : relationshipTarget.getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmJoinTable.this.defaultInverseJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmJoinTable.this.inverseJoinColumnsSize();
- }
-
- @Override
- protected String getTableNotValidMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getVirtualTableNotValidMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getUnresolvedNameMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- public String getVirtualUnresolvedNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- public String getUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- public String getVirtualUnresolvedReferencedColumnNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- }
-
- @Override
- public String getUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getVirtualUnspecifiedNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
-
- @Override
- public String getVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmLobConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmLobConverter.java
deleted file mode 100644
index 771057930f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmLobConverter.java
+++ /dev/null
@@ -1,58 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.LobConverter;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmLobConverter extends AbstractOrmXmlContextNode
- implements LobConverter, OrmConverter
-{
- protected XmlConvertibleMapping resourceConvertibleMapping;
-
- public GenericOrmLobConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- super(parent);
- this.initialize(resourceMapping);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.LOB_CONVERTER;
- }
-
- public void initialize(XmlConvertibleMapping resourceConvertibleMapping) {
- this.resourceConvertibleMapping = resourceConvertibleMapping;
- }
-
- public void update() {
- //do nothing
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceConvertibleMapping.getLobTextRange();
- }
-
- public void addToResourceModel() {
- this.resourceConvertibleMapping.setLob(true);
- }
-
- public void removeFromResourceModel() {
- this.resourceConvertibleMapping.setLob(false);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToManyMapping.java
deleted file mode 100644
index 517a92c340..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToManyMapping.java
+++ /dev/null
@@ -1,22 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-
-public class GenericOrmManyToManyMapping
- extends AbstractOrmManyToManyMapping<XmlManyToMany>
-{
- public GenericOrmManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany resourceMapping) {
- super(parent, resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToOneMapping.java
deleted file mode 100644
index be6988b905..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmManyToOneMapping.java
+++ /dev/null
@@ -1,29 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-public class GenericOrmManyToOneMapping
- extends AbstractOrmManyToOneMapping<XmlManyToOne>
-{
- public GenericOrmManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmManyToOneRelationshipReference(this, this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmMappedSuperclass.java
deleted file mode 100644
index bbb9ea11cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmMappedSuperclass.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmMappedSuperclass;
-import org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass;
-
-
-public class GenericOrmMappedSuperclass extends AbstractOrmMappedSuperclass
-{
-
- public GenericOrmMappedSuperclass(OrmPersistentType parent, XmlMappedSuperclass resourceMapping) {
- super(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedNativeQuery.java
deleted file mode 100644
index 43fa8e2a73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedNativeQuery.java
+++ /dev/null
@@ -1,73 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-
-
-public class GenericOrmNamedNativeQuery extends AbstractOrmQuery<XmlNamedNativeQuery>
- implements OrmNamedNativeQuery
-{
-
- protected String resultClass;
-
- protected String resultSetMapping;
-
-
- public GenericOrmNamedNativeQuery(XmlContextNode parent, XmlNamedNativeQuery resourceQuery) {
- super(parent, resourceQuery);
- }
-
- public char getResultClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String newResultClass) {
- String oldResultClass = this.resultClass;
- this.resultClass = newResultClass;
- getResourceQuery().setResultClass(newResultClass);
- firePropertyChanged(NamedNativeQuery.RESULT_CLASS_PROPERTY, oldResultClass, newResultClass);
- }
-
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String newResultSetMapping) {
- String oldResultSetMapping = this.resultSetMapping;
- this.resultSetMapping = newResultSetMapping;
- getResourceQuery().setResultSetMapping(newResultSetMapping);
- firePropertyChanged(NamedNativeQuery.RESULT_SET_MAPPING_PROPERTY, oldResultSetMapping, newResultSetMapping);
- }
-
-
- @Override
- protected void initialize(XmlNamedNativeQuery resourceQuery) {
- super.initialize(resourceQuery);
- this.resultClass = resourceQuery.getResultClass();
- this.resultSetMapping = resourceQuery.getResultSetMapping();
- }
-
- @Override
- public void update(XmlNamedNativeQuery resourceQuery) {
- super.update(resourceQuery);
- this.setResultClass(resourceQuery.getResultClass());
- this.setResultSetMapping(resourceQuery.getResultSetMapping());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedQuery.java
deleted file mode 100644
index 94c0693e57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNamedQuery.java
+++ /dev/null
@@ -1,25 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-
-
-public class GenericOrmNamedQuery extends AbstractOrmQuery<XmlNamedQuery> implements OrmNamedQuery
-{
-
- public GenericOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- super(parent, resourceNamedQuery);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullAttributeMapping.java
deleted file mode 100644
index 90fab75123..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullAttributeMapping.java
+++ /dev/null
@@ -1,55 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-
-public class GenericOrmNullAttributeMapping
- extends AbstractOrmAttributeMapping<XmlNullAttributeMapping>
-{
-
- public GenericOrmNullAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public int getXmlSequence() {
- return -1;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return null;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- throw new UnsupportedOperationException();
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- throw new UnsupportedOperationException();
- }
-
- // ********** metamodel **********
-
- @Override
- public MetamodelField getMetamodelField() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullConverter.java
deleted file mode 100644
index a69d79ac07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmNullConverter.java
+++ /dev/null
@@ -1,50 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmNullConverter extends AbstractOrmXmlContextNode
- implements OrmConverter
-{
-
- public GenericOrmNullConverter(OrmAttributeMapping parent) {
- super(parent);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.NO_CONVERTER;
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-
- public void update() {
- // do nothing, null implementation
- }
-
- public void addToResourceModel() {
- // do nothing, null implementation
- }
-
- public void removeFromResourceModel() {
- // do nothing, null implementation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyMapping.java
deleted file mode 100644
index facb180a33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyMapping.java
+++ /dev/null
@@ -1,30 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-
-public class GenericOrmOneToManyMapping extends AbstractOrmOneToManyMapping<XmlOneToMany>
-{
-
- public GenericOrmOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmRelationshipReference buildRelationshipReference() {
- return new GenericOrmOneToManyRelationshipReference(this, this.resourceAttributeMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyRelationshipReference.java
deleted file mode 100644
index 2dc8d15490..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,60 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-public class GenericOrmOneToManyRelationshipReference
- extends AbstractOrmOneToManyRelationshipReference
-{
-
- public GenericOrmOneToManyRelationshipReference(
- OrmOneToManyMapping parent, XmlOneToMany resource) {
-
- super(parent, resource);
- }
-
- @Override
- protected OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new NullOrmJoinColumnJoiningStrategy(this);
- }
-
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-
-
- // **************** join columns *******************************************
-
- @Override
- public boolean usesJoinColumnJoiningStrategy() {
- return false;
- }
-
- @Override
- public void setJoinColumnJoiningStrategy() {
- throw new UnsupportedOperationException("join column joining strategy not supported on a 1.0 1-m mapping"); //$NON-NLS-1$
- }
-
- @Override
- public void unsetJoinColumnJoiningStrategy() {
- throw new UnsupportedOperationException("join column joining strategy not supported on a 1.0 1-m mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToOneMapping.java
deleted file mode 100644
index 604573441f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOneToOneMapping.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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-
-public class GenericOrmOneToOneMapping
- extends AbstractOrmOneToOneMapping<XmlOneToOne>
-{
-
- // ********** constructor **********
- public GenericOrmOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmOneToOneRelationshipReference(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java
deleted file mode 100644
index ec57ce6b5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmOrderable.java
+++ /dev/null
@@ -1,336 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.resource.orm.XmlOrderable;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * ORM multi-relationship (m:m, 1:m) mapping
- */
-public class GenericOrmOrderable
- extends AbstractOrmXmlContextNode
- implements OrmOrderable2_0
-{
-
- protected String specifiedOrderBy;
- protected boolean noOrdering = false;
- protected boolean pkOrdering = false;
- protected boolean customOrdering = false;
-
- //JPA 2.0
- protected final Orderable.Owner owner; //the owner is only used for 2.0 projects
- protected boolean orderColumnOrdering = false;
- protected final OrmOrderColumn2_0 orderColumn;
-
- public GenericOrmOrderable(OrmAttributeMapping parent, Orderable.Owner owner) {
- super(parent);
- this.owner = owner;
- this.orderColumn = getXmlContextNodeFactory().buildOrmOrderColumn(this, new OrderColumnOwner());
- this.initializeOrdering();
- }
-
- public void update() {
- this.updateOrdering();
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmPersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- protected XmlOrderable getResourceOrderable() {
- return (XmlOrderable) getParent().getResourceAttributeMapping();
- }
-
- // **************** order by ***********************************************
-
- public String getSpecifiedOrderBy() {
- return this.specifiedOrderBy;
- }
-
- public void setSpecifiedOrderBy(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.getResourceOrderable().setOrderBy(orderBy);
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void setSpecifiedOrderBy_(String orderBy) {
- String old = this.specifiedOrderBy;
- this.specifiedOrderBy = orderBy;
- this.firePropertyChanged(SPECIFIED_ORDER_BY_PROPERTY, old, orderBy);
- }
-
- protected void initializeOrdering() {
- this.specifiedOrderBy = this.getXmlOrderBy();
- XmlOrderColumn resourceOrderColumn = getXmlOrderColumn();
- if (this.specifiedOrderBy == null && resourceOrderColumn == null) {
- this.noOrdering = true;
- } else if (this.specifiedOrderBy != null && this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
- this.pkOrdering = true;
- } else if (resourceOrderColumn == null) {
- this.customOrdering = true;
- } else {
- this.orderColumnOrdering = true;
- }
- }
-
- protected void updateOrdering() {
- this.setSpecifiedOrderBy_(this.getXmlOrderBy());
- XmlOrderColumn resourceOrderColumn = getXmlOrderColumn();
- if (this.specifiedOrderBy == null && resourceOrderColumn == null) {
- this.setNoOrdering_(true);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- this.setOrderColumnOrdering_(false);
- } else if (this.specifiedOrderBy != null && this.specifiedOrderBy.equals("")) { //$NON-NLS-1$
- this.setNoOrdering_(false);
- this.setPkOrdering_(true);
- this.setCustomOrdering_(false);
- this.setOrderColumnOrdering_(false);
- } else if (resourceOrderColumn == null){
- this.setNoOrdering_(false);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(true);
- this.setOrderColumnOrdering_(false);
- } else {
- this.setNoOrdering_(false);
- this.setPkOrdering_(false);
- this.setCustomOrdering_(false);
- this.setOrderColumnOrdering_(true);
- }
- this.orderColumn.update(this.getResourceOrderable());
- }
-
- protected String getXmlOrderBy() {
- return this.getResourceOrderable().getOrderBy();
- }
-
- protected XmlOrderColumn getXmlOrderColumn() {
- return ((XmlOrderable_2_0) this.getResourceOrderable()).getOrderColumn();
- }
-
- // **************** no ordering ***********************************************
-
- public boolean isNoOrdering() {
- return this.noOrdering;
- }
-
- public void setNoOrdering(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- if (noOrdering) {
- this.getResourceOrderable().setOrderBy(null);
- this.removeXmlOrderColumn();
- }
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
- protected void setNoOrdering_(boolean noOrdering) {
- boolean old = this.noOrdering;
- this.noOrdering = noOrdering;
- this.firePropertyChanged(NO_ORDERING_PROPERTY, old, noOrdering);
- }
-
-
- // **************** pk ordering ***********************************************
-
- public boolean isPkOrdering() {
- return this.pkOrdering;
- }
-
- public void setPkOrdering(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- if (pkOrdering) {
- this.getResourceOrderable().setOrderBy(""); //$NON-NLS-1$
- this.removeXmlOrderColumn();
- }
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
- protected void setPkOrdering_(boolean pkOrdering) {
- boolean old = this.pkOrdering;
- this.pkOrdering = pkOrdering;
- this.firePropertyChanged(PK_ORDERING_PROPERTY, old, pkOrdering);
- }
-
-
- // **************** custom ordering ***********************************************
-
- public boolean isCustomOrdering() {
- return this.customOrdering;
- }
-
- public void setCustomOrdering(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- if (customOrdering) {
- this.setSpecifiedOrderBy(""); //$NON-NLS-1$
- this.removeXmlOrderColumn();
- }
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
-
- protected void setCustomOrdering_(boolean customOrdering) {
- boolean old = this.customOrdering;
- this.customOrdering = customOrdering;
- this.firePropertyChanged(CUSTOM_ORDERING_PROPERTY, old, customOrdering);
- }
-
- // ********** Orderable2_0 implementation **********
- // **************** order column ordering ***********************************************
-
- public boolean isOrderColumnOrdering() {
- return this.orderColumnOrdering;
- }
-
- public void setOrderColumnOrdering(boolean orderColumnOrdering) {
- boolean old = this.orderColumnOrdering;
- this.orderColumnOrdering = orderColumnOrdering;
- if (orderColumnOrdering) {
- this.getResourceOrderable().setOrderBy(null);
- addXmlOrderColumn();
- }
- this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
- }
-
- protected void setOrderColumnOrdering_(boolean orderColumnOrdering) {
- boolean old = this.orderColumnOrdering;
- this.orderColumnOrdering = orderColumnOrdering;
- this.firePropertyChanged(ORDER_COLUMN_ORDERING_PROPERTY, old, orderColumnOrdering);
- }
-
- public OrmOrderColumn2_0 getOrderColumn() {
- return this.orderColumn;
- }
-
- protected void addXmlOrderColumn() {
- ((XmlOrderable_2_0) getResourceOrderable()).setOrderColumn(OrmFactory.eINSTANCE.createXmlOrderColumn());
- }
-
- protected void removeXmlOrderColumn() {
- ((XmlOrderable_2_0) getResourceOrderable()).setOrderColumn(null);
- }
-
- public String getDefaultTableName() {
- return getOwner().getTableName();
- }
-
- /**
- * Only call this for 2.0 projects
- */
- protected Orderable2_0.Owner getOwner() {
- return (Orderable2_0.Owner) this.owner;
- }
-
-
- // ********** Validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = getResourceOrderable().getValidationTextRange();
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- //order-column and order-by both specified is handled with schema validation
- if (isOrderColumnOrdering()) {
- //TODO validation message if type is not List
- this.getOrderColumn().validate(messages, reporter);
- }
- }
-
- public String getUnresolvedNameMessage() {
- return JpaValidationMessages.ORDER_COLUMN_UNRESOLVED_NAME;
- }
-
-
- // ********** OrmNamedColumn implementation **********
-
- protected class OrderColumnOwner implements OrmNamedColumn.Owner {
-
- public String getDefaultTableName() {
- return GenericOrmOrderable.this.getDefaultTableName();
- }
-
- public Table getDbTable(String tableName) {
- return getOwner().getDbTable(tableName);
- }
-
- public String getDefaultColumnName() {
- return getPersistentAttribute().getName() + "_ORDER"; //$NON-NLS-1$
- }
-
- public TypeMapping getTypeMapping() {
- return getPersistentAttribute().getOwningTypeMapping();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmOrderable.this.getValidationTextRange();
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ORDER_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME,
- new String[] {getPersistentAttributeName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected boolean isPersistentAttributeVirtual() {
- return getPersistentAttribute().isVirtual();
- }
-
- protected String getPersistentAttributeName() {
- return getPersistentAttribute().getName();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentAttribute.java
deleted file mode 100644
index 076d2c428c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentAttribute.java
+++ /dev/null
@@ -1,62 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-
-public class GenericOrmPersistentAttribute extends AbstractOrmPersistentAttribute
-{
-
- public GenericOrmPersistentAttribute(OrmPersistentType parent, Owner owner, XmlAttributeMapping resourceMapping) {
- super(parent, owner, resourceMapping);
- }
-
- //****************** AccessHolder implementation *******************
-
- /**
- * GenericOrmPersistentAttribute does not support specified access (no access element in 1.0), so we return null
- */
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- throw new UnsupportedOperationException("specifiedAccess is not supported for GenericOrmPersistentAttribute"); //$NON-NLS-1$
- }
-
- @Override
- protected void validateAttribute(List<IMessage> messages) {
- super.validateAttribute(messages);
- if (this.javaPersistentAttribute != null) {
- JavaPersistentType javaPersistentType = getOwningPersistentType().getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.getAttributeNamed(this.javaPersistentAttribute.getName()) == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED,
- new String[] {this.getName(), this.getOwningPersistentType().getMapping().getClass_()},
- this.attributeMapping,
- this.attributeMapping.getNameTextRange()
- )
- );
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentType.java
deleted file mode 100644
index cf52e6c52a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPersistentType.java
+++ /dev/null
@@ -1,1080 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmStructureNodes;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentType2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmPersistentType2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.core.utility.BodySourceWriter;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * ORM persistent type:<ul>
- * <li>mapping
- * <li>access
- * <li>attributes
- * <li>super persistent type
- * <li>Java persistent type
- * </ul>
- */
-public class GenericOrmPersistentType
- extends AbstractOrmXmlContextNode
- implements OrmPersistentType2_0
-{
- protected OrmTypeMapping mapping;
-
- protected AccessType defaultAccess;
-
- protected AccessType specifiedAccess;
-
- protected final Vector<OrmPersistentAttribute> specifiedAttributes = new Vector<OrmPersistentAttribute>();
-
- protected final Vector<OrmPersistentAttribute> virtualAttributes = new Vector<OrmPersistentAttribute>();
-
- protected PersistentType superPersistentType;
-
- protected String declaringTypeName;
-
- protected JavaPersistentType javaPersistentType;
-
- protected final MetamodelSourceType.Synchronizer metamodelSynchronizer;
-
-
- public GenericOrmPersistentType(EntityMappings parent, XmlTypeMapping resourceMapping) {
- super(parent);
- this.mapping = this.buildMapping(resourceMapping);
- this.specifiedAccess = this.buildSpecifiedAccess();
- this.defaultAccess = this.buildDefaultAccess();
- this.javaPersistentType = this.buildJavaPersistentType();
- this.superPersistentType = this.buildSuperPersistentType();
- this.declaringTypeName = this.buildDeclaringTypeName();
- this.initializeAttributes();
- this.metamodelSynchronizer = this.buildMetamodelSynchronizer();
- }
-
- protected MetamodelSourceType.Synchronizer buildMetamodelSynchronizer() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildMetamodelSynchronizer(this) :
- null;
- }
-
-
- // ********** update **********
-
- public void update() {
- this.setSpecifiedAccess(this.buildSpecifiedAccess());
- this.setDefaultAccess(this.buildDefaultAccess());
- this.mapping.update();
- this.updateJavaPersistentType();
- this.updateSuperPersistentType();
- this.setDeclaringTypeName(this.buildDeclaringTypeName());
- this.updateAttributes();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.javaPersistentType != null) {
- this.javaPersistentType.postUpdate();
- }
- this.mapping.postUpdate();
- for (PersistentAttribute attribute : this.getAttributes()) {
- attribute.postUpdate();
- }
- }
-
-
- // ********** name **********
-
- public String getName() {
- String name = this.mapping.getClass_();
- // nested class names are specified with a '$' in orm.xml
- return (name == null) ? null : name.replace('$', '.');
- }
-
- public String getShortName(){
- String className = this.getName();
- return StringTools.stringIsEmpty(className) ? null : ClassName.getSimpleName(className);
- }
-
-
- // ********** mapping **********
-
- public OrmTypeMapping getMapping() {
- return this.mapping;
- }
-
- public void setMappingKey(String newMappingKey) {
- if (this.valuesAreEqual(this.getMappingKey(), newMappingKey)) {
- return;
- }
- OrmTypeMapping oldMapping = this.mapping;
- OrmTypeMappingDefinition mappingDefinition = this.getMappingFileDefinition().getOrmTypeMappingDefinition(newMappingKey);
- XmlTypeMapping resourceTypeMapping = mappingDefinition.buildResourceMapping(this.getResourceNodeFactory());
- this.mapping = this.buildMapping(resourceTypeMapping);
- this.getEntityMappings().changeMapping(this, oldMapping, this.mapping);
- this.firePropertyChanged(MAPPING_PROPERTY, oldMapping, this.mapping);
- }
-
- protected OrmTypeMapping buildMapping(XmlTypeMapping resourceMapping) {
- OrmTypeMappingDefinition mappingDefintion = this.getMappingFileDefinition().getOrmTypeMappingDefinition(resourceMapping.getMappingKey());
- return mappingDefintion.buildContextMapping(this, resourceMapping, this.getXmlContextNodeFactory());
- }
-
-
- // ********** access **********
-
- public AccessType getAccess() {
- return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
- }
-
- public AccessType getDefaultAccess() {
- return this.defaultAccess;
- }
-
- protected void setDefaultAccess(AccessType defaultAccess) {
- AccessType old = this.defaultAccess;
- this.defaultAccess = defaultAccess;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, defaultAccess);
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.getResourceTypeMapping().setAccess(AccessType.toOrmResourceModel(specifiedAccess));
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- protected AccessType buildDefaultAccess() {
- if ( ! this.mapping.isMetadataComplete()) {
- if (this.javaPersistentType != null) {
- if (this.javaPersistentTypeHasSpecifiedAccess()) {
- return this.javaPersistentType.getAccess();
- }
- if (this.superPersistentType != null) {
- return this.superPersistentType.getAccess();
- }
- }
- }
- AccessType access = this.getMappingFileRoot().getAccess();
- return (access != null) ? access : AccessType.FIELD; //default to FIELD if no specified access found
- }
-
- protected boolean javaPersistentTypeHasSpecifiedAccess() {
- return (this.javaPersistentType.getSpecifiedAccess() != null) ||
- this.javaPersistentType.hasAnyAnnotatedAttributes();
- }
-
- public AccessType getOwnerOverrideAccess() {
- return this.getEntityMappings().getOverridePersistentTypeAccess();
- }
-
- public AccessType getOwnerDefaultAccess() {
- return this.getEntityMappings().getDefaultPersistentTypeAccess();
- }
-
- protected AccessType buildSpecifiedAccess() {
- return AccessType.fromOrmResourceModel(this.getResourceTypeMapping().getAccess());
- }
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public ListIterator<OrmPersistentAttribute> attributes() {
- return new CompositeListIterator<OrmPersistentAttribute>(this.specifiedAttributes(), this.virtualAttributes());
- }
-
- @SuppressWarnings("unchecked")
- protected Iterable<OrmPersistentAttribute> getAttributes() {
- return new CompositeIterable<OrmPersistentAttribute>(this.getSpecifiedAttributes(), this.getVirtualAttributes());
- }
-
- public int attributesSize() {
- return this.specifiedAttributesSize() + this.virtualAttributesSize();
- }
-
- public Iterator<String> allAttributeNames() {
- return this.attributeNames(this.allAttributes());
- }
-
- public Iterator<PersistentAttribute> allAttributes() {
- return new CompositeIterator<PersistentAttribute>(
- new TransformationIterator<PersistentType, Iterator<PersistentAttribute>>(this.inheritanceHierarchy()) {
- @Override
- protected Iterator<PersistentAttribute> transform(PersistentType pt) {
- return pt.attributes();
- }
- }
- );
- }
-
- protected Iterator<OrmPersistentAttribute> attributesNamed(final String attributeName) {
- return new FilteringIterator<OrmPersistentAttribute>(this.attributes()) {
- @Override
- protected boolean accept(OrmPersistentAttribute o) {
- return Tools.valuesAreEqual(attributeName, o.getName());
- }
- };
- }
-
- public OrmPersistentAttribute getAttributeNamed(String attributeName) {
- Iterator<OrmPersistentAttribute> stream = this.attributesNamed(attributeName);
- return (stream.hasNext()) ? stream.next() : null;
- }
-
- public PersistentAttribute resolveAttribute(String attributeName) {
- Iterator<OrmPersistentAttribute> attributes = this.attributesNamed(attributeName);
- if (attributes.hasNext()) {
- OrmPersistentAttribute attribute = attributes.next();
- return attributes.hasNext() ? null /* more than one */: attribute;
- }
- return (this.superPersistentType == null) ? null : this.superPersistentType.resolveAttribute(attributeName);
- }
-
- public Iterator<String> attributeNames() {
- return this.attributeNames(this.attributes());
- }
-
- protected Iterator<String> attributeNames(Iterator<? extends PersistentAttribute> attrs) {
- return new TransformationIterator<PersistentAttribute, String>(attrs) {
- @Override
- protected String transform(PersistentAttribute attribute) {
- return attribute.getName();
- }
- };
- }
-
- protected void initializeAttributes() {
- this.initializeSpecifiedAttributes();
- this.initializeVirtualAttributes();
- }
-
- protected void updateAttributes() {
- this.updateSpecifiedAttributes();
- this.updateVirtualAttributes();
- }
-
- protected Iterator<JavaResourcePersistentAttribute> javaPersistentAttributes() {
- return (this.javaPersistentType == null) ?
- EmptyListIterator.<JavaResourcePersistentAttribute>instance() :
- this.javaPersistentAttributes(this.javaPersistentType.getResourcePersistentType());
- }
-
- protected Iterator<JavaResourcePersistentAttribute> javaPersistentAttributes(JavaResourcePersistentType resourcePersistentType) {
- AccessType access = this.specifiedAccess;
- if (access == null && ! this.mapping.isMetadataComplete()) {
- access = this.getJavaPersistentType().getSpecifiedAccess();
- }
- if (access == null) {
- access = this.defaultAccess;
- }
- return resourcePersistentType.persistableAttributes(AccessType.toJavaResourceModel(access));
- }
-
-
- // ********** specified attributes **********
-
- public ListIterator<OrmPersistentAttribute> specifiedAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.specifiedAttributes);
- }
-
- protected Iterable<OrmPersistentAttribute> getSpecifiedAttributes() {
- return new LiveCloneIterable<OrmPersistentAttribute>(this.specifiedAttributes);
- }
-
- public int specifiedAttributesSize() {
- return this.specifiedAttributes.size();
- }
-
- protected OrmPersistentAttribute getSpecifiedAttributeFor(final JavaResourcePersistentAttribute jrpa) {
- for (OrmPersistentAttribute attribute : this.getSpecifiedAttributes()) {
- JavaPersistentAttribute javaAttribute = attribute.getJavaPersistentAttribute();
- if ((javaAttribute != null) && (javaAttribute.getResourcePersistentAttribute() == jrpa)) {
- return attribute;
- }
- }
- return null;
- }
-
- public OrmPersistentAttribute addSpecifiedAttribute(String mappingKey, String attributeName) {
- Attributes resourceAttributes = this.getResourceAttributes();
- if (resourceAttributes == null) {
- resourceAttributes = this.createResourceAttributes();
- this.mapping.getResourceTypeMapping().setAttributes(resourceAttributes);
- }
-
- OrmAttributeMappingDefinition mappingDefintion = this.getMappingFileDefinition().getOrmAttributeMappingDefinition(mappingKey);
- XmlAttributeMapping resourceMapping = mappingDefintion.buildResourceMapping(getResourceNodeFactory());
- OrmPersistentAttribute persistentAttribute = this.buildSpecifiedAttribute(resourceMapping);
- int index = this.getSpecifiedAttributeInsertionIndex(persistentAttribute);
- this.specifiedAttributes.add(index, persistentAttribute);
- persistentAttribute.getMapping().addToResourceModel(resourceAttributes);
-
- persistentAttribute.getSpecifiedMapping().setName(attributeName);
- this.fireItemAdded(ATTRIBUTES_LIST, index, persistentAttribute);
- return persistentAttribute;
- }
-
- public void changeMapping(OrmPersistentAttribute ormPersistentAttribute, OrmAttributeMapping oldMapping, OrmAttributeMapping newMapping) {
- int sourceIndex = this.specifiedAttributes.indexOf(ormPersistentAttribute);
- this.specifiedAttributes.remove(sourceIndex);
- oldMapping.removeFromResourceModel(this.getResourceAttributes());
- int targetIndex = getSpecifiedAttributeInsertionIndex(ormPersistentAttribute);
- this.specifiedAttributes.add(targetIndex, ormPersistentAttribute);
- newMapping.addToResourceModel(this.getResourceAttributes());
- oldMapping.initializeOn(newMapping);
- this.fireItemMoved(ATTRIBUTES_LIST, targetIndex, sourceIndex);
- }
-
- public void makeAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute) {
- this.makeAttributeSpecified(ormPersistentAttribute, ormPersistentAttribute.getMappingKey());
- }
-
- public void makeAttributeSpecified(OrmPersistentAttribute ormPersistentAttribute, String mappingKey) {
- if ( ! ormPersistentAttribute.isVirtual()) {
- throw new IllegalStateException("Attribute is already specified"); //$NON-NLS-1$
- }
- if (this.valuesAreEqual(mappingKey, MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY)) {
- throw new IllegalStateException("Use makePersistentAttributeSpecified(OrmPersistentAttribute, String) instead and specify a mapping type"); //$NON-NLS-1$
- }
-
- Attributes resourceAttributes = this.getResourceAttributes();
- if (resourceAttributes == null) {
- resourceAttributes = this.createResourceAttributes();
- this.mapping.getResourceTypeMapping().setAttributes(resourceAttributes);
- }
-
- OrmAttributeMappingDefinition mappingDefintion = this.getMappingFileDefinition().getOrmAttributeMappingDefinition(mappingKey);
- XmlAttributeMapping resourceMapping = mappingDefintion.buildResourceMapping(getResourceNodeFactory());
-
- OrmPersistentAttribute newAttribute = this.buildSpecifiedAttribute(resourceMapping);
- int insertionIndex = this.getSpecifiedAttributeInsertionIndex(newAttribute);
- this.specifiedAttributes.add(insertionIndex, newAttribute);
- newAttribute.getMapping().addToResourceModel(resourceAttributes);
-
- int removalIndex = this.virtualAttributes.indexOf(ormPersistentAttribute);
- this.virtualAttributes.remove(ormPersistentAttribute);
- newAttribute.getSpecifiedMapping().setName(ormPersistentAttribute.getName());
- if (ormPersistentAttribute.getJavaPersistentAttribute().getSpecifiedAccess() != null) {
- newAttribute.setSpecifiedAccess(ormPersistentAttribute.getJavaPersistentAttribute().getSpecifiedAccess());
- }
-
- this.fireItemAdded(ATTRIBUTES_LIST, insertionIndex, newAttribute);
- this.fireItemRemoved(VIRTUAL_ATTRIBUTES_LIST, removalIndex, ormPersistentAttribute);
- }
-
- protected int getSpecifiedAttributeInsertionIndex(OrmPersistentAttribute specifiedAttribute) {
- return CollectionTools.insertionIndexOf(this.specifiedAttributes, specifiedAttribute, this.getAttributeComparator());
- }
-
- protected Comparator<OrmPersistentAttribute> getAttributeComparator() {
- return ATTRIBUTE_COMPARATOR;
- }
-
- protected static final Comparator<OrmPersistentAttribute> ATTRIBUTE_COMPARATOR =
- new Comparator<OrmPersistentAttribute>() {
- public int compare(OrmPersistentAttribute o1, OrmPersistentAttribute o2) {
- int o1Sequence = o1.getMapping().getXmlSequence();
- int o2Sequence = o2.getMapping().getXmlSequence();
- return (o1Sequence == o2Sequence) ? 0 : (o1Sequence < o2Sequence) ? -1 : 1;
- }
- };
-
- protected Attributes getResourceAttributes() {
- return this.getResourceTypeMapping().getAttributes();
- }
-
- protected Attributes createResourceAttributes() {
- return EmfTools.create(this.getResourceNodeFactory(), OrmPackage.eINSTANCE.getAttributes(), Attributes.class);
- }
-
- protected void initializeSpecifiedAttributes() {
- Attributes attributes = this.getResourceAttributes();
- if (attributes == null) {
- return;
- }
- for (XmlAttributeMapping resourceMapping : attributes.getAttributeMappings()) {
- this.addSpecifiedAttribute(resourceMapping);
- }
- }
-
- protected void updateSpecifiedAttributes() {
- Attributes attributes = this.getResourceAttributes();
- Collection<OrmPersistentAttribute> contextAttributesToRemove = CollectionTools.collection(this.specifiedAttributes());
- Collection<OrmPersistentAttribute> contextAttributesToUpdate = new ArrayList<OrmPersistentAttribute>();
- int resourceIndex = 0;
-
- if (attributes != null) {
- for (XmlAttributeMapping resourceMapping : attributes.getAttributeMappings()) {
- boolean contextAttributeFound = false;
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- if (contextAttribute.getMapping().getResourceAttributeMapping() == resourceMapping) {
- this.moveSpecifiedAttribute_(resourceIndex, contextAttribute);
- contextAttributesToRemove.remove(contextAttribute);
- contextAttributesToUpdate.add(contextAttribute);
- contextAttributeFound = true;
- break;
- }
- }
- if ( ! contextAttributeFound) {
- OrmPersistentAttribute ormPersistentAttribute = this.addSpecifiedAttribute(resourceMapping);
- this.fireItemAdded(ATTRIBUTES_LIST, specifiedAttributesSize(), ormPersistentAttribute);
- }
- resourceIndex++;
- }
- }
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- this.removeSpecifiedAttribute_(contextAttribute);
- }
- //first handle adding/removing of the persistent attributes, then update the others last,
- //this causes less churn in the update process
- for (OrmPersistentAttribute contextAttribute : contextAttributesToUpdate) {
- contextAttribute.update();
- }
- }
-
- protected void removeSpecifiedAttribute_(OrmPersistentAttribute ormPersistentAttribute) {
- this.removeItemFromList(ormPersistentAttribute, this.specifiedAttributes, ATTRIBUTES_LIST);
- }
-
- //not firing change notification so this can be reused in initialize and update
- protected OrmPersistentAttribute addSpecifiedAttribute(XmlAttributeMapping resourceMapping) {
- OrmPersistentAttribute ormPersistentAttribute = this.buildSpecifiedAttribute(resourceMapping);
- this.specifiedAttributes.add(ormPersistentAttribute);
- return ormPersistentAttribute;
- }
-
- protected void moveSpecifiedAttribute_(int index, OrmPersistentAttribute attribute) {
- this.moveItemInList(index, this.specifiedAttributes.indexOf(attribute), this.specifiedAttributes, ATTRIBUTES_LIST);
- }
-
- public void removeSpecifiedAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- int index = this.specifiedAttributes.indexOf(ormPersistentAttribute);
- this.specifiedAttributes.remove(ormPersistentAttribute);
- ormPersistentAttribute.getMapping().removeFromResourceModel(this.getResourceAttributes());
- if (this.getResourceAttributes().isUnset()) {
- this.mapping.getResourceTypeMapping().setAttributes(null);
- }
- this.fireItemRemoved(ATTRIBUTES_LIST, index, ormPersistentAttribute);
- }
-
- protected OrmPersistentAttribute buildSpecifiedAttribute(XmlAttributeMapping resourceMapping) {
- return this.buildOrmPersistentAttribute(this.buildSpecifiedAttributeOwner(), resourceMapping);
- }
-
- protected OrmPersistentAttribute.Owner buildSpecifiedAttributeOwner() {
- return new SpecifiedAttributeOwner();
- }
-
- protected JavaPersistentAttribute buildJavaPersistentAttribute(JavaResourcePersistentAttribute jrpa) {
- return this.getJpaFactory().buildJavaPersistentAttribute(this, jrpa);
- }
-
-
- // ********** virtual attributes **********
-
- public ListIterator<OrmPersistentAttribute> virtualAttributes() {
- return new CloneListIterator<OrmPersistentAttribute>(this.virtualAttributes);
- }
-
- protected Iterable<OrmPersistentAttribute> getVirtualAttributes() {
- return new LiveCloneIterable<OrmPersistentAttribute>(this.virtualAttributes);
- }
-
- public int virtualAttributesSize() {
- return this.virtualAttributes.size();
- }
-
- protected void addVirtualAttribute(OrmPersistentAttribute virtualAttribute) {
- this.addItemToList(virtualAttribute, this.virtualAttributes, VIRTUAL_ATTRIBUTES_LIST);
- }
-
- protected void removeVirtualAttribute(OrmPersistentAttribute virtualAttribute) {
- this.removeItemFromList(virtualAttribute, this.virtualAttributes, VIRTUAL_ATTRIBUTES_LIST);
- }
-
- public boolean containsVirtualAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- return this.virtualAttributes.contains(ormPersistentAttribute);
- }
-
- public void makeAttributeVirtual(OrmPersistentAttribute ormPersistentAttribute) {
- if (ormPersistentAttribute.isVirtual()) {
- throw new IllegalStateException("Attribute is already virtual"); //$NON-NLS-1$
- }
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- OrmPersistentAttribute virtualAttribute = null;
- if (javaPersistentAttribute != null) {
- virtualAttribute = this.addVirtualAttribute(javaPersistentAttribute.getResourcePersistentAttribute());
- }
- this.removeSpecifiedAttribute(ormPersistentAttribute);
- if (virtualAttribute != null) {
- this.fireItemAdded(VIRTUAL_ATTRIBUTES_LIST, virtualAttributesSize() - 1, virtualAttribute);
- }
- }
-
- protected void initializeVirtualAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.javaPersistentAttributes(); stream.hasNext(); ) {
- JavaResourcePersistentAttribute javaResourceAttribute = stream.next();
- if (this.getSpecifiedAttributeFor(javaResourceAttribute) == null) {
- this.addVirtualAttribute(javaResourceAttribute);
- }
- }
- }
-
- protected void updateVirtualAttributes() {
- Collection<OrmPersistentAttribute> contextAttributesToRemove = CollectionTools.collection(this.virtualAttributes());
- Collection<OrmPersistentAttribute> contextAttributesToUpdate = new ArrayList<OrmPersistentAttribute>();
- int resourceIndex = 0;
-
- for (Iterator<JavaResourcePersistentAttribute> stream = this.javaPersistentAttributes(); stream.hasNext(); ) {
- JavaResourcePersistentAttribute javaResourceAttribute = stream.next();
- OrmPersistentAttribute specifiedAttribute = this.getSpecifiedAttributeFor(javaResourceAttribute);
- if (specifiedAttribute == null) {
- JavaPersistentAttribute javaAttribute = this.getJpaFactory().buildJavaPersistentAttribute(this, javaResourceAttribute);
- JavaAttributeMapping javaAttributeMapping = javaAttribute.getMapping();
- if (this.mapping.isMetadataComplete()) {
- javaAttributeMapping = javaAttribute.getDefaultMapping();
- }
- boolean contextAttributeFound = false;
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- JavaPersistentAttribute javaPersistentAttribute = contextAttribute.getJavaPersistentAttribute();
- if (javaPersistentAttribute.getResourcePersistentAttribute() == javaResourceAttribute) {
- if (this.valuesAreEqual(contextAttribute.getMappingKey(), javaAttributeMapping.getKey())) {
- //the mapping key would change if metaDataComplete flag changes, rebuild the orm attribute
- contextAttributesToRemove.remove(contextAttribute);
- contextAttributesToUpdate.add(contextAttribute);
- contextAttributeFound = true;
- break;
- }
- }
- }
- if ( ! contextAttributeFound) {
- OrmPersistentAttribute virtualAttribute = this.addVirtualAttribute(javaAttributeMapping);
- this.fireItemAdded(VIRTUAL_ATTRIBUTES_LIST, virtualAttributesSize() - 1, virtualAttribute);
- }
- resourceIndex++;
- }
- }
-
- for (OrmPersistentAttribute contextAttribute : contextAttributesToRemove) {
- this.removeVirtualAttribute(contextAttribute);
- }
- //first handle adding/removing of the persistent attributes, then update the others last,
- //this causes less churn in the update process
- for (OrmPersistentAttribute contextAttribute : contextAttributesToUpdate) {
- contextAttribute.update();
- }
- }
-
- protected OrmPersistentAttribute addVirtualAttribute(JavaResourcePersistentAttribute resourceAttribute) {
- JavaPersistentAttribute javaAttribute = this.getJpaFactory().buildJavaPersistentAttribute(this, resourceAttribute);
- JavaAttributeMapping javaAttributeMapping = javaAttribute.getMapping();
- if (this.mapping.isMetadataComplete()) {
- javaAttributeMapping = javaAttribute.getDefaultMapping();
- }
- return this.addVirtualAttribute(javaAttributeMapping);
- }
-
- //not firing change notification so this can be reused in initialize and update
- protected OrmPersistentAttribute addVirtualAttribute(JavaAttributeMapping javaAttributeMapping) {
- OrmAttributeMappingDefinition mappingDefintion = this.getMappingFileDefinition().getOrmAttributeMappingDefinition(javaAttributeMapping.getKey());
- XmlAttributeMapping resourceMapping = mappingDefintion.buildVirtualResourceMapping(this.mapping, javaAttributeMapping, this.getXmlContextNodeFactory());
- OrmPersistentAttribute virtualAttribute = this.buildVirtualOrmPersistentAttribute(javaAttributeMapping, resourceMapping);
- this.virtualAttributes.add(virtualAttribute);
- return virtualAttribute;
- }
-
- protected OrmPersistentAttribute buildVirtualOrmPersistentAttribute(JavaAttributeMapping javaAttributeMapping, XmlAttributeMapping resourceMapping) {
- return this.buildOrmPersistentAttribute(this.buildVirtualAttributeOwner(javaAttributeMapping.getPersistentAttribute()), resourceMapping);
- }
-
- protected OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentAttribute.Owner owner, XmlAttributeMapping resourceMapping) {
- return this.getXmlContextNodeFactory().buildOrmPersistentAttribute(this, owner, resourceMapping);
- }
-
- protected OrmPersistentAttribute.Owner buildVirtualAttributeOwner(final JavaPersistentAttribute javaPersistentAttribute) {
- return new OrmPersistentAttribute.Owner() {
- public JavaPersistentAttribute findJavaPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- return javaPersistentAttribute;
- }
-
- public void updateJavaPersistentAttribute() {
- //update the attribute, since we own it and it will not get updated otherwise
- javaPersistentAttribute.update();
- }
- };
- }
-
-
- // ********** Java persistent type **********
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType javaPersistentType) {
- JavaPersistentType old = this.javaPersistentType;
- this.javaPersistentType = javaPersistentType;
- this.firePropertyChanged(JAVA_PERSISTENT_TYPE_PROPERTY, old, javaPersistentType);
- }
-
- protected JavaPersistentType buildJavaPersistentType() {
- JavaResourcePersistentType jrpt = this.getJavaResourcePersistentType();
- return (jrpt == null) ? null : this.buildJavaPersistentType(jrpt);
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType() {
- return this.getEntityMappings().resolveJavaResourcePersistentType(this.getName());
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType(String className) {
- return this.getJpaProject().getJavaResourcePersistentType(className);
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType jrpt) {
- return getJpaFactory().buildJavaPersistentType(this, jrpt);
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType jrpt = this.getJavaResourcePersistentType();
- if (jrpt == null) {
- this.setJavaPersistentType(null);
- } else {
- if (this.javaPersistentType == null) {
- this.setJavaPersistentType(this.buildJavaPersistentType(jrpt));
- } else {
- this.javaPersistentType.update(jrpt);
- }
- }
- }
-
-
- // ********** super persistent type **********
-
- public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType superPersistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = superPersistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, superPersistentType);
- }
-
- protected void updateSuperPersistentType() {
- PersistentType spt = this.buildSuperPersistentType();
- // check for circular inheritance
- if ((spt == null) || CollectionTools.contains(spt.inheritanceHierarchy(), this)) {
- this.setSuperPersistentType(null);
- } else {
- this.setSuperPersistentType(spt);
- }
- }
-
- protected PersistentType buildSuperPersistentType() {
- return (this.javaPersistentType == null) ? null : this.javaPersistentType.getSuperPersistentType();
- }
-
-
- // ********** inheritance **********
-
- public Iterator<PersistentType> inheritanceHierarchy() {
- return this.inheritanceHierarchyOf(this);
- }
-
- public Iterator<PersistentType> ancestors() {
- return this.inheritanceHierarchyOf(this.superPersistentType);
- }
-
- protected Iterator<PersistentType> inheritanceHierarchyOf(PersistentType start) {
- // using a chain iterator to traverse up the inheritance tree
- return new ChainIterator<PersistentType>(start) {
- @Override
- protected PersistentType nextLink(PersistentType persistentType) {
- return persistentType.getSuperPersistentType();
- }
- };
- }
-
-
- // ********** declaring type name **********
-
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- protected void setDeclaringTypeName(String declaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = declaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, declaringTypeName);
- }
-
- protected String buildDeclaringTypeName() {
- return this.isJpa2_0Compatible() ? buildDeclaringTypeName_() : null;
- }
-
- protected String buildDeclaringTypeName_() {
- return (this.javaPersistentType == null) ?
- null : ((JavaPersistentType2_0) this.javaPersistentType).getDeclaringTypeName();
- }
-
-
- // ********** metamodel **********
-
- public IFile getMetamodelFile() {
- return (this.javaPersistentType == null) ? null : this.metamodelSynchronizer.getFile();
- }
-
- public void initializeMetamodel() {
- // do nothing - probably shouldn't be called...
- }
-
- public boolean isManaged() {
- return true;
- }
-
- /**
- * All orm.xml persistent types must be able to generate a static metamodel
- * because 1.0 orm.xml files can be referenced from 2.0 persistence.xml files.
- */
- public void synchronizeMetamodel(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- if (this.javaPersistentType != null) {
- this.metamodelSynchronizer.synchronize(memberTypeTree);
- }
- }
-
- public void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- if (this.javaPersistentType != null) {
- this.metamodelSynchronizer.printBodySourceOn(pw, memberTypeTree);
- }
- }
-
- public void disposeMetamodel() {
- // do nothing - probably shouldn't be called...
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return OrmStructureNodes.PERSISTENT_TYPE_ID;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (OrmPersistentAttribute attribute : this.getSpecifiedAttributes()) {
- if (attribute.contains(textOffset)) {
- return attribute;
- }
- }
- return this;
- }
-
- public TextRange getSelectionTextRange() {
- return this.mapping.getSelectionTextRange();
- }
-
- public void dispose() {
- if (this.javaPersistentType != null) {
- this.javaPersistentType.dispose();
- }
- }
-
-
- // ********** PersistentType.Owner implementation **********
-
- public AccessType getOverridePersistentTypeAccess() {
- if (this.specifiedAccess != null) {
- return this.specifiedAccess;
- }
-
- if (this.superPersistentType instanceof OrmPersistentType) {
- AccessType accessType = ((OrmPersistentType) this.superPersistentType).getSpecifiedAccess();
- if (accessType != null) {
- return accessType;
- }
- }
-
- if (this.mapping.isMetadataComplete()) {
- AccessType accessType = this.getOwnerDefaultAccess();
- if (accessType != null) {
- return accessType;
- }
- }
-
- // no override access type
- return null;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- if (this.superPersistentType instanceof OrmPersistentType) {
- AccessType accessType = ((OrmPersistentType) this.superPersistentType).getDefaultAccess();
- if (accessType != null) {
- return accessType;
- }
- }
-
- return this.getOwnerDefaultAccess();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateClass(messages);
- this.validateMapping(messages, reporter);
- this.validateAttributes(messages, reporter);
- }
-
- protected void validateClass(List<IMessage> messages) {
- if (this.javaPersistentType == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS,
- new String[] {this.getName()},
- this,
- this.mapping.getClassTextRange()
- )
- );
- }
- }
-
- protected void validateMapping(List<IMessage> messages, IReporter reporter) {
- try {
- this.mapping.validate(messages, reporter);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- protected void validateAttributes(List<IMessage> messages, IReporter reporter) {
- for (Iterator<OrmPersistentAttribute> stream = this.attributes(); stream.hasNext(); ) {
- this.validateAttribute(stream.next(), messages, reporter);
- }
- }
-
- protected void validateAttribute(OrmPersistentAttribute attribute, List<IMessage> messages, IReporter reporter) {
- try {
- attribute.validate(messages, reporter);
- } catch(Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
- public TextRange getValidationTextRange() {
- return this.mapping.getValidationTextRange();
- }
-
-
- // ********** misc **********
-
- @Override
- public EntityMappings getParent() {
- return (EntityMappings) super.getParent();
- }
-
- public String getDefaultPackage() {
- return this.getEntityMappings().getPackage();
- }
-
- public boolean isDefaultMetadataComplete() {
- return this.getEntityMappings().isDefaultPersistentTypeMetadataComplete();
- }
-
- public boolean isFor(String typeName) {
- String className = this.getName();
- if (className == null) {
- return false;
- }
- if (className.equals(typeName)) {
- return true;
- }
- String defaultPackage = this.getDefaultPackage();
- if (defaultPackage == null) {
- return false;
- }
- return (defaultPackage + '.' + className).equals(typeName);
- }
-
- public boolean contains(int textOffset) {
- return this.mapping.containsOffset(textOffset);
- }
-
- public void classChanged(String oldClass, String newClass) {
- this.firePropertyChanged(NAME_PROPERTY, oldClass, newClass);
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- protected EntityMappings getEntityMappings() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getResourceTypeMapping() {
- return this.mapping.getResourceTypeMapping();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** specified persistent attribute owner **********
-
- protected class SpecifiedAttributeOwner
- implements OrmPersistentAttribute.Owner
- {
- private JavaPersistentAttribute cachedJavaPersistentAttribute;
-
- public SpecifiedAttributeOwner() {
- super();
- }
-
- public JavaPersistentAttribute findJavaPersistentAttribute(OrmPersistentAttribute ormPersistentAttribute) {
- if (GenericOrmPersistentType.this.javaPersistentType == null) {
- return null;
- }
- String ormName = ormPersistentAttribute.getName();
- if (ormName == null) {
- return null;
- }
- AccessType ormAccess = ormPersistentAttribute.getAccess();
-
- JavaPersistentAttribute javaPersistentAttribute = this.findExistingJavaPersistentAttribute(ormName);
- if ((javaPersistentAttribute != null) && (javaPersistentAttribute.getAccess() == ormAccess)) {
- this.cachedJavaPersistentAttribute = null; // we only want to cache the persistent attribute if we build it
- return javaPersistentAttribute;
- }
-
- // if 'javaPersistentAttribute' is null, it might exist in a superclass that is not persistent, we need to build it ourselves.
- // if access is different, we won't be able to find the corresponding java persistent attribute, it won't exist so we build it ourselves
- return this.buildJavaPersistentAttribute(ormName, ormAccess);
- }
-
- protected JavaPersistentAttribute findExistingJavaPersistentAttribute(String attributeName) {
- return GenericOrmPersistentType.this.javaPersistentType.getAttributeNamed(attributeName);
- }
-
- protected JavaPersistentAttribute buildJavaPersistentAttribute(String ormName, AccessType ormAccess) {
- JavaResourcePersistentAttribute jrpa = this.getJavaResourcePersistentAttribute(this.getJavaResourcePersistentType(), ormName, ormAccess);
- if (this.cachedJavaPersistentAttribute != null &&
- this.cachedJavaPersistentAttribute.getResourcePersistentAttribute() == jrpa) {
- return this.cachedJavaPersistentAttribute;
- }
- return this.cachedJavaPersistentAttribute = (jrpa == null) ? null : GenericOrmPersistentType.this.buildJavaPersistentAttribute(jrpa);
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType() {
- return GenericOrmPersistentType.this.javaPersistentType.getResourcePersistentType();
- }
-
- protected JavaResourcePersistentAttribute getJavaResourcePersistentAttribute(JavaResourcePersistentType javaResourcePersistentType, String ormName, AccessType ormAccess) {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.attributes(javaResourcePersistentType, ormAccess); stream.hasNext(); ) {
- JavaResourcePersistentAttribute jrpa = stream.next();
- if (jrpa.getName().equals(ormName)) {
- return jrpa;
- }
- }
- // climb up inheritance hierarchy
- String superclassName = javaResourcePersistentType.getSuperclassQualifiedName();
- if (superclassName == null) {
- return null;
- }
- JavaResourcePersistentType superclass = GenericOrmPersistentType.this.getJavaResourcePersistentType(superclassName);
- if (superclass == null) {
- return null;
- }
- // recurse
- return this.getJavaResourcePersistentAttribute(superclass, ormName, ormAccess);
- }
-
- protected Iterator<JavaResourcePersistentAttribute> attributes(JavaResourcePersistentType javaResourcePersistentType, AccessType ormAccess) {
- return (ormAccess == AccessType.PROPERTY) ? javaResourcePersistentType.persistableProperties() : javaResourcePersistentType.persistableFields();
- }
-
- public void updateJavaPersistentAttribute() {
- if (this.cachedJavaPersistentAttribute != null) {
- this.cachedJavaPersistentAttribute.update();
- }
- //else {
- //don't update, we don't own the java persistent attribute,
- //it will be updated through the java context model
- //}
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.java
deleted file mode 100644
index 4e4f893c5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmPrimaryKeyJoinColumn.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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmBaseJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmNamedColumn;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class GenericOrmPrimaryKeyJoinColumn extends AbstractOrmNamedColumn<XmlPrimaryKeyJoinColumn>
- implements OrmPrimaryKeyJoinColumn
-{
- protected String specifiedReferencedColumnName;
-
- protected String defaultReferencedColumnName;
-
- protected XmlPrimaryKeyJoinColumn resourcePkJoinColumn;
-
- public GenericOrmPrimaryKeyJoinColumn(XmlContextNode parent, OrmBaseJoinColumn.Owner owner, XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- super(parent, owner);
- this.initialize(resourcePkJoinColumn);
- }
-
- public void initializeFrom(PrimaryKeyJoinColumn oldPkJoinColumn) {
- super.initializeFrom(oldPkJoinColumn);
- setSpecifiedReferencedColumnName(oldPkJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- @Override
- protected XmlPrimaryKeyJoinColumn getResourceColumn() {
- return this.resourcePkJoinColumn;
- }
-
- @Override
- protected void addResourceColumn() {
- //primaryKeyJoinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlPrimaryKeyJoinColumn is removed/added to the XmlEntity collection
- }
-
- @Override
- protected void removeResourceColumn() {
- //primaryKeyJoinColumns are part of a collection, the pk-join-column element will be removed/added
- //when the XmlPrimaryKeyJoinColumn is removed/added to the XmlEntity collection
- }
-
- public String getReferencedColumnName() {
- return (this.getSpecifiedReferencedColumnName() == null) ? getDefaultReferencedColumnName() : this.getSpecifiedReferencedColumnName();
- }
-
- public String getSpecifiedReferencedColumnName() {
- return this.specifiedReferencedColumnName;
- }
-
- public void setSpecifiedReferencedColumnName(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- getResourceColumn().setReferencedColumnName(newSpecifiedReferencedColumnName);
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- protected void setSpecifiedReferencedColumnName_(String newSpecifiedReferencedColumnName) {
- String oldSpecifiedReferencedColumnName = this.specifiedReferencedColumnName;
- this.specifiedReferencedColumnName = newSpecifiedReferencedColumnName;
- firePropertyChanged(SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY, oldSpecifiedReferencedColumnName, newSpecifiedReferencedColumnName);
- }
-
- public String getDefaultReferencedColumnName() {
- return this.defaultReferencedColumnName;
- }
-
- protected void setDefaultReferencedColumnName(String newDefaultReferencedColumnName) {
- String oldDefaultReferencedColumnName = this.defaultReferencedColumnName;
- this.defaultReferencedColumnName = newDefaultReferencedColumnName;
- firePropertyChanged(DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY, oldDefaultReferencedColumnName, newDefaultReferencedColumnName);
- }
-
- @Override
- public OrmBaseJoinColumn.Owner getOwner() {
- return (OrmBaseJoinColumn.Owner) this.owner;
- }
-
- public Column getReferencedDbColumn() {
- Table table = this.getReferencedColumnDbTable();
- return (table == null) ? null : table.getColumnForIdentifier(this.getReferencedColumnName());
- }
-
- public Table getReferencedColumnDbTable() {
- return getOwner().getReferencedColumnDbTable();
- }
-
- public boolean isReferencedColumnResolved() {
- return getReferencedDbColumn() != null;
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- if (getResourceColumn() != null) {
- TextRange textRange = getResourceColumn().getReferencedColumnNameTextRange();
- if (textRange != null) {
- return textRange;
- }
- }
- return getOwner().getValidationTextRange();
- }
-
-
- public boolean isVirtual() {
- return getOwner().isVirtual(this);
- }
-
- @Override
- public String getTable() {
- return getOwner().getDefaultTableName();
- }
-
- @Override
- protected void initialize(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- this.resourcePkJoinColumn = resourcePkJoinColumn;
- super.initialize(resourcePkJoinColumn);
- this.specifiedReferencedColumnName = getResourceReferencedColumnName();
- this.defaultReferencedColumnName = buildDefaultReferencedColumnName();
- }
-
- @Override
- public void update(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- this.resourcePkJoinColumn = resourcePkJoinColumn;
- super.update(resourcePkJoinColumn);
- this.setSpecifiedReferencedColumnName_(getResourceReferencedColumnName());
- this.setDefaultReferencedColumnName(buildDefaultReferencedColumnName());
- }
-
- protected String getResourceReferencedColumnName() {
- return this.resourcePkJoinColumn == null ? null : this.resourcePkJoinColumn.getReferencedColumnName();
- }
-
- //TODO not correct when we start supporting primaryKeyJoinColumns in 1-1 mappings
- protected String buildDefaultReferencedColumnName() {
- return buildDefaultName();
- }
-
-
- //******************* validation ***********************
-
- @Override
- //this method will only be called if the table validates correctly
- protected void validateName(List<IMessage> messages) {
- //do not call super here, first need to check for multiple join columns errors
- this.validateJoinColumnName(messages);
- this.validateReferencedColumnName(messages);
- }
-
- protected void validateJoinColumnName(List<IMessage> messages) {
- if (this.getSpecifiedName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedNameMultipleJoinColumnsMessage());
- }
- else if (this.getName() != null){
- super.validateName(messages);
- }
- //If the name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected void validateReferencedColumnName(List<IMessage> messages) {
- if (this.getSpecifiedReferencedColumnName() == null && this.getOwner().joinColumnsSize() > 1) {
- messages.add(this.buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage());
- }
- else if (this.getReferencedColumnName() != null) {
- Table refColumnDbTable = this.getReferencedColumnDbTable();
- if (refColumnDbTable != null && ! this.isReferencedColumnResolved()) {
- messages.add(getOwner().buildUnresolvedReferencedColumnNameMessage(this, this.getReferencedColumnNameTextRange()));
- }
- }
- //If the referenced column name is null and there is only one join-column, one of these validation messages will apply
- // 1. target entity does not have a primary key
- // 2. target entity is not specified
- // 3. target entity is not an entity
- }
-
- protected IMessage buildUnspecifiedNameMultipleJoinColumnsMessage() {
- return getOwner().buildUnspecifiedNameMultipleJoinColumnsMessage(this, getNameTextRange());
- }
-
- protected IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage() {
- return getOwner().buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(this, getReferencedColumnNameTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryContainer.java
deleted file mode 100644
index 0fdb1b918a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryContainer.java
+++ /dev/null
@@ -1,253 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.NamedNativeQuery;
-import org.eclipse.jpt.core.context.NamedQuery;
-import org.eclipse.jpt.core.context.Query;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmQueryContainer extends AbstractOrmXmlContextNode
- implements OrmQueryContainer
-{
- protected final XmlQueryContainer resourceQueryContainer;
-
- protected final List<OrmNamedQuery> namedQueries;
-
- protected final List<OrmNamedNativeQuery> namedNativeQueries;
-
-
- public GenericOrmQueryContainer(XmlContextNode parent, XmlQueryContainer resourceQueryContainer) {
- super(parent);
- this.resourceQueryContainer = resourceQueryContainer;
- this.namedQueries = new ArrayList<OrmNamedQuery>();
- this.namedNativeQueries = new ArrayList<OrmNamedNativeQuery>();
- this.initializeNamedQueries();
- this.initializeNamedNativeQueries();
- }
-
- public ListIterator<OrmNamedQuery> namedQueries() {
- return new CloneListIterator<OrmNamedQuery>(this.namedQueries);
- }
-
- public int namedQueriesSize() {
- return this.namedQueries.size();
- }
-
- public OrmNamedQuery addNamedQuery(int index) {
- XmlNamedQuery resourceNamedQuery = OrmFactory.eINSTANCE.createXmlNamedQuery();
- OrmNamedQuery contextNamedQuery = buildNamedQuery(resourceNamedQuery);
- this.namedQueries.add(index, contextNamedQuery);
- this.resourceQueryContainer.getNamedQueries().add(index, resourceNamedQuery);
- this.fireItemAdded(NAMED_QUERIES_LIST, index, contextNamedQuery);
- return contextNamedQuery;
- }
-
- protected void addNamedQuery(int index, OrmNamedQuery namedQuery) {
- addItemToList(index, namedQuery, this.namedQueries, NAMED_QUERIES_LIST);
- }
-
- protected void addNamedQuery(OrmNamedQuery namedQuery) {
- this.addNamedQuery(this.namedQueries.size(), namedQuery);
- }
-
- public void removeNamedQuery(NamedQuery namedQuery) {
- removeNamedQuery(this.namedQueries.indexOf(namedQuery));
- }
-
- public void removeNamedQuery(int index) {
- OrmNamedQuery namedQuery = this.namedQueries.remove(index);
- this.resourceQueryContainer.getNamedQueries().remove(index);
- fireItemRemoved(NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected void removeNamedQuery_(OrmNamedQuery namedQuery) {
- removeItemFromList(namedQuery, this.namedQueries, NAMED_QUERIES_LIST);
- }
-
- public void moveNamedQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedQueries, targetIndex, sourceIndex);
- this.resourceQueryContainer.getNamedQueries().move(targetIndex, sourceIndex);
- fireItemMoved(NAMED_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<OrmNamedNativeQuery> namedNativeQueries() {
- return new CloneListIterator<OrmNamedNativeQuery>(this.namedNativeQueries);
- }
-
- public int namedNativeQueriesSize() {
- return this.namedNativeQueries.size();
- }
-
- public OrmNamedNativeQuery addNamedNativeQuery(int index) {
- XmlNamedNativeQuery resourceNamedNativeQuery = OrmFactory.eINSTANCE.createXmlNamedNativeQuery();
- OrmNamedNativeQuery contextNamedNativeQuery = buildNamedNativeQuery(resourceNamedNativeQuery);
- this.namedNativeQueries.add(index, contextNamedNativeQuery);
- this.resourceQueryContainer.getNamedNativeQueries().add(index, resourceNamedNativeQuery);
- this.fireItemAdded(NAMED_NATIVE_QUERIES_LIST, index, contextNamedNativeQuery);
- return contextNamedNativeQuery;
- }
-
- protected void addNamedNativeQuery(int index, OrmNamedNativeQuery namedNativeQuery) {
- addItemToList(index, namedNativeQuery, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- protected void addNamedNativeQuery(OrmNamedNativeQuery namedNativeQuery) {
- this.addNamedNativeQuery(this.namedNativeQueries.size(), namedNativeQuery);
- }
-
- public void removeNamedNativeQuery(NamedNativeQuery namedNativeQuery) {
- this.removeNamedNativeQuery(this.namedNativeQueries.indexOf(namedNativeQuery));
- }
-
- public void removeNamedNativeQuery(int index) {
- OrmNamedNativeQuery namedNativeQuery = this.namedNativeQueries.remove(index);
- this.resourceQueryContainer.getNamedNativeQueries().remove(index);
- fireItemRemoved(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- protected void removeNamedNativeQuery_(OrmNamedNativeQuery namedNativeQuery) {
- removeItemFromList(namedNativeQuery, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
- public void moveNamedNativeQuery(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex);
- this.resourceQueryContainer.getNamedNativeQueries().move(targetIndex, sourceIndex);
- fireItemMoved(NAMED_NATIVE_QUERIES_LIST, targetIndex, sourceIndex);
- }
-
-
- protected void initializeNamedQueries() {
- for (XmlNamedQuery namedQuery : this.resourceQueryContainer.getNamedQueries()) {
- this.namedQueries.add(buildNamedQuery(namedQuery));
- }
- }
-
- protected void initializeNamedNativeQueries() {
- for (XmlNamedNativeQuery namedNativeQuery : this.resourceQueryContainer.getNamedNativeQueries()) {
- this.namedNativeQueries.add(buildNamedNativeQuery(namedNativeQuery));
- }
- }
-
- public void update() {
- this.updateNamedQueries();
- this.updateNamedNativeQueries();
- }
-
- protected void updateNamedQueries() {
- // make a copy of the XML queries (to prevent ConcurrentModificationException)
- Iterator<XmlNamedQuery> xmlQueries = new CloneIterator<XmlNamedQuery>(this.resourceQueryContainer.getNamedQueries());
-
- for (Iterator<OrmNamedQuery> contextQueries = this.namedQueries(); contextQueries.hasNext(); ) {
- OrmNamedQuery contextQuery = contextQueries.next();
- if (xmlQueries.hasNext()) {
- contextQuery.update(xmlQueries.next());
- }
- else {
- removeNamedQuery_(contextQuery);
- }
- }
-
- while (xmlQueries.hasNext()) {
- addNamedQuery(buildNamedQuery(xmlQueries.next()));
- }
- }
-
- protected OrmNamedQuery buildNamedQuery(XmlNamedQuery resourceNamedQuery) {
- return getXmlContextNodeFactory().buildOrmNamedQuery(this, resourceNamedQuery);
- }
-
- protected void updateNamedNativeQueries() {
- // make a copy of the XML queries (to prevent ConcurrentModificationException)
- Iterator<XmlNamedNativeQuery> xmlQueries = new CloneIterator<XmlNamedNativeQuery>(this.resourceQueryContainer.getNamedNativeQueries());
-
- for (Iterator<OrmNamedNativeQuery> contextQueries = this.namedNativeQueries(); contextQueries.hasNext(); ) {
- OrmNamedNativeQuery contextQuery = contextQueries.next();
- if (xmlQueries.hasNext()) {
- contextQuery.update(xmlQueries.next());
- }
- else {
- removeNamedNativeQuery_(contextQuery);
- }
- }
-
- while (xmlQueries.hasNext()) {
- addNamedNativeQuery(buildNamedNativeQuery(xmlQueries.next()));
- }
- }
-
- protected OrmNamedNativeQuery buildNamedNativeQuery(XmlNamedNativeQuery resourceNamedNativeQuery) {
- return getXmlContextNodeFactory().buildOrmNamedNativeQuery(this, resourceNamedNativeQuery);
- }
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateQueries(messages);
- }
-
- protected void validateQueries(List<IMessage> messages) {
- for (Iterator<OrmQuery> localQueries = this.queries(); localQueries.hasNext(); ) {
- OrmQuery localQuery = localQueries.next();
- for (Iterator<Query> globalQueries = this.getPersistenceUnit().queries(); globalQueries.hasNext(); ) {
- if (localQuery.duplicates(globalQueries.next())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.QUERY_DUPLICATE_NAME,
- new String[] {localQuery.getName()},
- localQuery,
- localQuery.getNameTextRange())
- );
- }
- }
- }
- }
-
- /**
- * Return all the queries, named and named native.
- */
- @SuppressWarnings("unchecked")
- protected Iterator<OrmQuery> queries() {
- return new CompositeIterator<OrmQuery>(
- namedQueries(),
- namedNativeQueries()
- );
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceQueryContainer.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryHint.java
deleted file mode 100644
index ff733e3dd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmQueryHint.java
+++ /dev/null
@@ -1,77 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.QueryHint;
-import org.eclipse.jpt.core.context.orm.OrmQuery;
-import org.eclipse.jpt.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class GenericOrmQueryHint extends AbstractOrmXmlContextNode implements OrmQueryHint
-{
-
- protected String name;
-
- protected String value;
-
- protected XmlQueryHint resourceQueryHint;
-
- public GenericOrmQueryHint(OrmQuery parent, XmlQueryHint resourceQueryHint) {
- super(parent);
- this.initialize(resourceQueryHint);
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceQueryHint.setName(newName);
- firePropertyChanged(QueryHint.NAME_PROPERTY, oldName, newName);
- }
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.resourceQueryHint.setValue(newValue);
- firePropertyChanged(QueryHint.VALUE_PROPERTY, oldValue, newValue);
- }
-
- protected void initialize(XmlQueryHint resourceQueryHint) {
- this.resourceQueryHint = resourceQueryHint;
- this.name = resourceQueryHint.getName();
- this.value = resourceQueryHint.getValue();
- }
-
- public void update(XmlQueryHint resourceQueryHint) {
- this.resourceQueryHint = resourceQueryHint;
- this.setName(resourceQueryHint.getName());
- this.setValue(resourceQueryHint.getValue());
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceQueryHint.getValidationTextRange();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmReferenceTable.java
deleted file mode 100644
index 03a982521d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmReferenceTable.java
+++ /dev/null
@@ -1,400 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.ReferenceTable;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmReferenceTable;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class GenericOrmReferenceTable
- extends AbstractOrmTable
- implements OrmReferenceTable
-{
- protected OrmJoinColumn defaultJoinColumn;
-
- protected final Vector<OrmJoinColumn> specifiedJoinColumns = new Vector<OrmJoinColumn>();
- protected final OrmJoinColumn.Owner joinColumnOwner;
-
-
- protected GenericOrmReferenceTable(XmlContextNode parent) {
- super(parent);
- this.joinColumnOwner = this.buildJoinColumnOwner();
- }
-
- protected abstract OrmJoinColumn.Owner buildJoinColumnOwner();
-
- public void initializeFrom(ReferenceTable oldReferenceTable) {
- super.initializeFrom(oldReferenceTable);
- for (Iterator<OrmJoinColumn> stream = oldReferenceTable.specifiedJoinColumns(); stream.hasNext(); ) {
- this.addSpecifiedJoinColumnFrom(stream.next());
- }
- }
-
- protected void initialize(AbstractXmlReferenceTable xmlReferenceTable) {
- super.initialize(xmlReferenceTable);
- this.initializeSpecifiedJoinColumns(xmlReferenceTable);
- this.initializeDefaultJoinColumn();
- }
-
- public void update() {
- this.update(this.getResourceTable());
- }
-
- protected void update(AbstractXmlReferenceTable xmlReferenceTable) {
- super.update(xmlReferenceTable);
- this.updateSpecifiedJoinColumns(xmlReferenceTable);
- this.updateDefaultJoinColumn();
- }
-
-
- // ********** AbstractOrmTable implementation **********
-
- /**
- * if the join table is on the "mappedBy" side, it's bogus;
- * so don't give it a default schema
- */
- @Override
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- @Override
- protected abstract AbstractXmlReferenceTable getResourceTable();
-
-
- // ********** join columns **********
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- return this.hasSpecifiedJoinColumns() ? this.specifiedJoinColumns() : this.defaultJoinColumns();
- }
-
- public int joinColumnsSize() {
- return this.hasSpecifiedJoinColumns() ? this.specifiedJoinColumnsSize() : this.defaultJoinColumnsSize();
- }
-
- public void convertDefaultToSpecifiedJoinColumn() {
- MappingTools.convertReferenceTableDefaultToSpecifiedJoinColumn(this);
- }
-
-
- // ********** default join column **********
-
- public OrmJoinColumn getDefaultJoinColumn() {
- return this.defaultJoinColumn;
- }
-
- protected void setDefaultJoinColumn(OrmJoinColumn defaultJoinColumn) {
- OrmJoinColumn old = this.defaultJoinColumn;
- this.defaultJoinColumn = defaultJoinColumn;
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, old, defaultJoinColumn);
- }
-
- protected ListIterator<OrmJoinColumn> defaultJoinColumns() {
- if (this.defaultJoinColumn != null) {
- return new SingleElementListIterator<OrmJoinColumn>(this.defaultJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultJoinColumnsSize() {
- return (this.defaultJoinColumn == null) ? 0 : 1;
- }
-
- protected void initializeDefaultJoinColumn() {
- if (this.shouldBuildDefaultJoinColumn()) {
- this.defaultJoinColumn = this.buildJoinColumn(null);
- }
- }
-
- protected void updateDefaultJoinColumn() {
- if (this.shouldBuildDefaultJoinColumn()) {
- if (this.defaultJoinColumn == null) {
- this.setDefaultJoinColumn(this.buildJoinColumn(null));
- } else {
- this.defaultJoinColumn.update(null);
- }
- } else {
- this.setDefaultJoinColumn(null);
- }
- }
-
- protected boolean shouldBuildDefaultJoinColumn() {
- return ! this.hasSpecifiedJoinColumns();
- }
-
-
- // ********** specified join columns **********
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- return new CloneListIterator<OrmJoinColumn>(this.specifiedJoinColumns);
- }
-
- public int specifiedJoinColumnsSize() {
- return this.specifiedJoinColumns.size();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return this.specifiedJoinColumns.size() != 0;
- }
-
- protected void addSpecifiedJoinColumnFrom(OrmJoinColumn oldJoinColumn) {
- OrmJoinColumn newJoinColumn = this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size());
- newJoinColumn.initializeFrom(oldJoinColumn);
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- if (this.getResourceTable() == null) {
- this.addResourceTable();
- }
- XmlJoinColumn xmlJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumn();
- OrmJoinColumn joinColumn = this.buildJoinColumn(xmlJoinColumn);
- this.specifiedJoinColumns.add(index, joinColumn);
- this.getResourceTable().getJoinColumns().add(index, xmlJoinColumn);
- this.fireItemAdded(SPECIFIED_JOIN_COLUMNS_LIST, index, joinColumn);
- return joinColumn;
- }
-
- protected void addSpecifiedJoinColumn(int index, OrmJoinColumn joinColumn) {
- this.addItemToList(index, joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedJoinColumn(OrmJoinColumn joinColumn) {
- this.addSpecifiedJoinColumn(this.specifiedJoinColumns.size(), joinColumn);
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- this.removeSpecifiedJoinColumn(this.specifiedJoinColumns.indexOf(joinColumn));
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- OrmJoinColumn removedJoinColumn = this.specifiedJoinColumns.remove(index);
- if ( ! this.hasSpecifiedJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultJoinColumn = this.buildJoinColumn(null);
- }
- this.getResourceTable().getJoinColumns().remove(index);
- this.fireItemRemoved(SPECIFIED_JOIN_COLUMNS_LIST, index, removedJoinColumn);
- if (this.defaultJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
- }
-
- protected void removeSpecifiedJoinColumn_(OrmJoinColumn joinColumn) {
- this.removeItemFromList(joinColumn, this.specifiedJoinColumns, SPECIFIED_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedJoinColumns, targetIndex, sourceIndex);
- this.getResourceTable().getJoinColumns().move(targetIndex, sourceIndex);
- this.fireItemMoved(SPECIFIED_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void clearSpecifiedJoinColumns() {
- this.specifiedJoinColumns.clear();
- this.defaultJoinColumn = this.buildJoinColumn(null);
- this.getResourceTable().getJoinColumns().clear();
- this.fireListCleared(SPECIFIED_JOIN_COLUMNS_LIST);
- this.firePropertyChanged(DEFAULT_JOIN_COLUMN, null, this.defaultJoinColumn);
- }
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn) {
- return this.buildJoinColumn(resourceJoinColumn, this.joinColumnOwner);
- }
-
- protected void initializeSpecifiedJoinColumns(AbstractXmlReferenceTable xmlReferenceTable) {
- if (xmlReferenceTable != null) {
- for (XmlJoinColumn xmlJoinColumn : xmlReferenceTable.getJoinColumns()) {
- this.specifiedJoinColumns.add(this.buildJoinColumn(xmlJoinColumn));
- }
- }
- }
-
- protected void updateSpecifiedJoinColumns(AbstractXmlReferenceTable xmlReferenceTable) {
- Iterator<XmlJoinColumn> xmlJoinColumns = this.xmlJoinColumns(xmlReferenceTable);
-
- for (Iterator<OrmJoinColumn> contextJoinColumns = this.specifiedJoinColumns(); contextJoinColumns.hasNext(); ) {
- OrmJoinColumn contextJoinColumn = contextJoinColumns.next();
- if (xmlJoinColumns.hasNext()) {
- contextJoinColumn.update(xmlJoinColumns.next());
- } else {
- this.removeSpecifiedJoinColumn_(contextJoinColumn);
- }
- }
-
- while (xmlJoinColumns.hasNext()) {
- this.addSpecifiedJoinColumn(this.buildJoinColumn(xmlJoinColumns.next()));
- }
- }
-
- protected Iterator<XmlJoinColumn> xmlJoinColumns(AbstractXmlReferenceTable xmlReferenceTable) {
- // make a copy of the XML join columns (to prevent ConcurrentModificationException)
- return (xmlReferenceTable == null) ? EmptyIterator.<XmlJoinColumn>instance()
- : new CloneIterator<XmlJoinColumn>(xmlReferenceTable.getJoinColumns());
- }
-
-
- // ********** misc **********
-
- protected OrmJoinColumn buildJoinColumn(XmlJoinColumn resourceJoinColumn, OrmJoinColumn.Owner owner) {
- return this.getXmlContextNodeFactory().buildOrmJoinColumn(this, owner, resourceJoinColumn);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- boolean continueValidating = true;
- if (this.shouldValidateAgainstDatabase()) {
- continueValidating = this.validateAgainstDatabase(messages, reporter);
- }
- //join column validation will handle the check for whether to validate against the database
- //some validation messages are not database specific. If the database validation for the
- //table fails we will stop there and not validate the join columns at all
- if (continueValidating) {
- this.validateJoinColumns(messages, reporter);
- }
- }
- protected abstract boolean shouldValidateAgainstDatabase();
-
- protected boolean validateAgainstDatabase(List<IMessage> messages, IReporter reporter) {
- PersistentAttribute persistentAttribute = this.getPersistentAttribute();
- if ( ! this.hasResolvedCatalog()) {
- if (persistentAttribute.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getVirtualAttributeUnresolvedCatalogMessageId(),
- new String[] {persistentAttribute.getName(), this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getUnresolvedCatalogMessageId(),
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
- }
- return false;
- }
-
- if ( ! this.hasResolvedSchema()) {
- if (persistentAttribute.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getVirtualAttributeUnresolvedSchemaMessageId(),
- new String[] {persistentAttribute.getName(), this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- } else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getUnresolvedSchemaMessageId(),
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- }
- return false;
- }
- if ( ! this.isResolved()) {
- if (getName() != null) { //if name is null, the validation will be handled elsewhere, such as the target entity is not defined
- if (persistentAttribute.isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getVirtualAttributeUnresolvedNameMessageId(),
- new String[] {persistentAttribute.getName(), this.getName()},
- this,
- this.getNameTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getUnresolvedNameMessageId(),
- new String[] {this.getName()},
- this,
- this.getNameTextRange())
- );
- }
- }
- return false;
- }
- return true;
- }
-
- protected void validateJoinColumns(List<IMessage> messages, IReporter reporter) {
- this.validateJoinColumns(this.joinColumns(), messages, reporter);
- }
-
- protected void validateJoinColumns(Iterator<OrmJoinColumn> joinColumns, List<IMessage> messages, IReporter reporter) {
- while (joinColumns.hasNext()) {
- joinColumns.next().validate(messages, reporter);
- }
- }
-
- protected abstract String getUnresolvedCatalogMessageId();
-
- protected abstract String getUnresolvedSchemaMessageId();
-
- protected abstract String getUnresolvedNameMessageId();
-
- protected abstract String getVirtualAttributeUnresolvedCatalogMessageId();
-
- protected abstract String getVirtualAttributeUnresolvedSchemaMessageId();
-
- protected abstract String getVirtualAttributeUnresolvedNameMessageId();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSecondaryTable.java
deleted file mode 100644
index ad7faba7f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSecondaryTable.java
+++ /dev/null
@@ -1,509 +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.core.internal.jpa1.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.SecondaryTable;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmBaseJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * orm.xml secondary table
- */
-public class GenericOrmSecondaryTable
- extends AbstractOrmTable
- implements OrmSecondaryTable
-{
- protected XmlSecondaryTable secondaryTable;
-
- protected final Vector<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns = new Vector<OrmPrimaryKeyJoinColumn>();
-
- protected OrmPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn;
-
- protected final OrmBaseJoinColumn.Owner joinColumnOwner;
-
-
- public GenericOrmSecondaryTable(OrmEntity parent, XmlSecondaryTable xmlSecondaryTable) {
- super(parent);
- this.joinColumnOwner = this.buildJoinColumnOwner();
- this.initialize(xmlSecondaryTable);
- }
-
- protected OrmBaseJoinColumn.Owner buildJoinColumnOwner() {
- return new PrimaryKeyJoinColumnOwner();
- }
-
- public void initializeFrom(SecondaryTable oldSecondaryTable) {
- super.initializeFrom(oldSecondaryTable);
- for (PrimaryKeyJoinColumn oldPkJoinColumn : CollectionTools.iterable(oldSecondaryTable.specifiedPrimaryKeyJoinColumns())) {
- OrmPrimaryKeyJoinColumn newPkJoinColumn = addSpecifiedPrimaryKeyJoinColumn(specifiedPrimaryKeyJoinColumnsSize());
- newPkJoinColumn.initializeFrom(oldPkJoinColumn);
- }
- }
-
- @Override
- public OrmEntity getParent() {
- return (OrmEntity) super.getParent();
- }
-
- public OrmEntity getOrmEntity() {
- return getParent();
- }
-
- public OrmPrimaryKeyJoinColumn getDefaultPrimaryKeyJoinColumn() {
- return this.defaultPrimaryKeyJoinColumn;
- }
-
- protected void setDefaultPrimaryKeyJoinColumn(OrmPrimaryKeyJoinColumn newPkJoinColumn) {
- OrmPrimaryKeyJoinColumn oldPkJoinColumn = this.defaultPrimaryKeyJoinColumn;
- this.defaultPrimaryKeyJoinColumn = newPkJoinColumn;
- firePropertyChanged(SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldPkJoinColumn, newPkJoinColumn);
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumns() : this.defaultPrimaryKeyJoinColumns();
- }
-
- public int primaryKeyJoinColumnsSize() {
- return this.containsSpecifiedPrimaryKeyJoinColumns() ? this.specifiedPrimaryKeyJoinColumnsSize() : this.defaultPrimaryKeyJoinColumnsSize();
- }
-
- public ListIterator<OrmPrimaryKeyJoinColumn> specifiedPrimaryKeyJoinColumns() {
- return new CloneListIterator<OrmPrimaryKeyJoinColumn>(this.specifiedPrimaryKeyJoinColumns);
- }
-
- public int specifiedPrimaryKeyJoinColumnsSize() {
- return this.specifiedPrimaryKeyJoinColumns.size();
- }
-
- protected ListIterator<OrmPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns() {
- if (this.defaultPrimaryKeyJoinColumn != null) {
- return new SingleElementListIterator<OrmPrimaryKeyJoinColumn>(this.defaultPrimaryKeyJoinColumn);
- }
- return EmptyListIterator.instance();
- }
-
- protected int defaultPrimaryKeyJoinColumnsSize() {
- return (this.defaultPrimaryKeyJoinColumn == null) ? 0 : 1;
- }
-
- public boolean containsSpecifiedPrimaryKeyJoinColumns() {
- return !this.specifiedPrimaryKeyJoinColumns.isEmpty();
- }
-
- public OrmPrimaryKeyJoinColumn addSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn oldDefaultPkJoinColumn = this.getDefaultPrimaryKeyJoinColumn();
- if (oldDefaultPkJoinColumn != null) {
- //null the default join column now if one already exists.
- //if one does not exist, there is already a specified join column.
- //Remove it now so that it doesn't get removed during an update and
- //cause change notifications to be sent to the UI in the wrong order
- this.defaultPrimaryKeyJoinColumn = null;
- }
- XmlPrimaryKeyJoinColumn resourcePkJoinColumn = OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn();
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = buildPrimaryKeyJoinColumn(resourcePkJoinColumn);
- this.specifiedPrimaryKeyJoinColumns.add(index, contextPkJoinColumn);
- this.secondaryTable.getPrimaryKeyJoinColumns().add(index, resourcePkJoinColumn);
-
- this.fireItemAdded(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, contextPkJoinColumn);
- if (oldDefaultPkJoinColumn != null) {
- this.firePropertyChanged(SecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, oldDefaultPkJoinColumn, null);
- }
- return contextPkJoinColumn;
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(int index, OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- addItemToList(index, primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- protected void addSpecifiedPrimaryKeyJoinColumn(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- this.addSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.size(), primaryKeyJoinColumn);
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(PrimaryKeyJoinColumn pkJoinColumn) {
- this.removeSpecifiedPrimaryKeyJoinColumn(this.specifiedPrimaryKeyJoinColumns.indexOf(pkJoinColumn));
- }
-
- public void removeSpecifiedPrimaryKeyJoinColumn(int index) {
- OrmPrimaryKeyJoinColumn removedPrimaryKeyJoinColumn = this.specifiedPrimaryKeyJoinColumns.remove(index);
- if (!containsSpecifiedPrimaryKeyJoinColumns()) {
- //create the defaultJoinColumn now or this will happen during project update
- //after removing the join column from the resource model. That causes problems
- //in the UI because the change notifications end up in the wrong order.
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(null);
- }
- this.secondaryTable.getPrimaryKeyJoinColumns().remove(index);
- fireItemRemoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, index, removedPrimaryKeyJoinColumn);
- if (this.defaultPrimaryKeyJoinColumn != null) {
- //fire change notification if a defaultJoinColumn was created above
- this.firePropertyChanged(Entity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN, null, this.defaultPrimaryKeyJoinColumn);
- }
- }
-
- protected void removeSpecifiedPrimaryKeyJoinColumn_(OrmPrimaryKeyJoinColumn primaryKeyJoinColumn) {
- removeItemFromList(primaryKeyJoinColumn, this.specifiedPrimaryKeyJoinColumns, SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST);
- }
-
- public void moveSpecifiedPrimaryKeyJoinColumn(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.specifiedPrimaryKeyJoinColumns, targetIndex, sourceIndex);
- this.secondaryTable.getPrimaryKeyJoinColumns().move(targetIndex, sourceIndex);
- fireItemMoved(SecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
-
- public boolean isVirtual() {
- return getOrmEntity().containsVirtualSecondaryTable(this);
- }
-
- @Override
- protected XmlSecondaryTable getResourceTable() {
- return this.secondaryTable;
- }
-
- @Override
- protected XmlSecondaryTable addResourceTable() {
- //secondaryTables are part of a collection, the secondary-table element will be removed/added
- //when the XmlSecondaryTable is removed/added to the XmlEntity collection
- throw new IllegalStateException("resource table is missing"); //$NON-NLS-1$
- }
-
- @Override
- protected void removeResourceTable() {
- //secondaryTables are part of a collection, the secondary-table element will be removed/added
- //when the XmlSecondaryTable is removed/added to the XmlEntity collection
- }
-
- protected void initialize(XmlSecondaryTable xst) {
- this.secondaryTable = xst;
- super.initialize(xst);
- this.initializeSpecifiedPrimaryKeyJoinColumns();
- this.initializeDefaultPrimaryKeyJoinColumn();
- }
-
- protected void initializeSpecifiedPrimaryKeyJoinColumns() {
- for (XmlPrimaryKeyJoinColumn resourcePkJoinColumn : this.secondaryTable.getPrimaryKeyJoinColumns()) {
- this.specifiedPrimaryKeyJoinColumns.add(buildPrimaryKeyJoinColumn(resourcePkJoinColumn));
- }
- }
-
- protected boolean shouldBuildDefaultPrimaryKeyJoinColumn() {
- return !containsSpecifiedPrimaryKeyJoinColumns();
- }
-
- protected void initializeDefaultPrimaryKeyJoinColumn() {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- return;
- }
- this.defaultPrimaryKeyJoinColumn = buildPrimaryKeyJoinColumn(null);
- }
-
- public void update(XmlSecondaryTable xst) {
- this.secondaryTable = xst;
- super.update(xst);
- this.updateSpecifiedPrimaryKeyJoinColumns();
- this.updateDefaultPrimaryKeyJoinColumn();
- }
-
- protected void updateSpecifiedPrimaryKeyJoinColumns() {
- // make a copy of the XML PK join columns (to prevent ConcurrentModificationException)
- Iterator<XmlPrimaryKeyJoinColumn> xmlPkJoinColumns = new CloneIterator<XmlPrimaryKeyJoinColumn>(this.secondaryTable.getPrimaryKeyJoinColumns());
-
- for (Iterator<OrmPrimaryKeyJoinColumn> contextPkJoinColumns = this.specifiedPrimaryKeyJoinColumns(); contextPkJoinColumns.hasNext(); ) {
- OrmPrimaryKeyJoinColumn contextPkJoinColumn = contextPkJoinColumns.next();
- if (xmlPkJoinColumns.hasNext()) {
- contextPkJoinColumn.update(xmlPkJoinColumns.next());
- }
- else {
- removeSpecifiedPrimaryKeyJoinColumn_(contextPkJoinColumn);
- }
- }
-
- while (xmlPkJoinColumns.hasNext()) {
- addSpecifiedPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(xmlPkJoinColumns.next()));
- }
- }
-
- protected void updateDefaultPrimaryKeyJoinColumn() {
- if (!shouldBuildDefaultPrimaryKeyJoinColumn()) {
- setDefaultPrimaryKeyJoinColumn(null);
- return;
- }
- if (getDefaultPrimaryKeyJoinColumn() == null) {
- this.setDefaultPrimaryKeyJoinColumn(buildPrimaryKeyJoinColumn(null));
- }
- else {
- this.defaultPrimaryKeyJoinColumn.update(null);
- }
- }
-
- protected OrmPrimaryKeyJoinColumn buildPrimaryKeyJoinColumn(XmlPrimaryKeyJoinColumn resourcePkJoinColumn) {
- return getXmlContextNodeFactory().buildOrmPrimaryKeyJoinColumn(this, this.joinColumnOwner, resourcePkJoinColumn);
- }
-
- /**
- * a secondary table doesn't have a default name
- */
- @Override
- protected String buildDefaultName() {
- return null;
- }
-
- @Override
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages);
- }
- for (Iterator<OrmPrimaryKeyJoinColumn> stream = this.primaryKeyJoinColumns(); stream.hasNext(); ) {
- stream.next().validate(messages, reporter);
- }
- }
-
- protected void validateAgainstDatabase(List<IMessage> messages) {
- if ( ! this.hasResolvedCatalog()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_CATALOG,
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
- return;
- }
-
- if ( ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- return;
- }
-
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange()
- )
- );
- return;
- }
- }
-
-
- // ********** pk join column owner adapter **********
-
- protected class PrimaryKeyJoinColumnOwner
- implements OrmBaseJoinColumn.Owner
- {
- public TypeMapping getTypeMapping() {
- return GenericOrmSecondaryTable.this.getOrmEntity();
- }
-
- public String getDefaultTableName() {
- return GenericOrmSecondaryTable.this.getName();
- }
-
- public Table getDbTable(String tableName) {
- return GenericOrmSecondaryTable.this.getDbTable();
- }
-
- public Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public int joinColumnsSize() {
- return GenericOrmSecondaryTable.this.primaryKeyJoinColumnsSize();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmSecondaryTable.this.defaultPrimaryKeyJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- if (joinColumnsSize() != 1) {
- return null;
- }
- Entity parentEntity = getOrmEntity().getParentEntity();
- return (parentEntity == null) ? getOrmEntity().getPrimaryKeyColumnName() : parentEntity.getPrimaryKeyColumnName();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmSecondaryTable.this.getValidationTextRange();
- }
-
- protected boolean isSecondaryTableVirtual() {
- return GenericOrmSecondaryTable.this.isVirtual();
- }
-
- protected String getSecondaryTableName() {
- return GenericOrmSecondaryTable.this.getName();
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isSecondaryTableVirtual()) {
- return buildVirtualUnresolvedNameMessage(column, textRange);
- }
- if (((BaseJoinColumn) column).isVirtual()) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getTable()},
- column,
- textRange
- );
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getTable()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getSecondaryTableName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- if (isSecondaryTableVirtual()) {
- return buildVirtualUnresolvedReferencedColumnNameMessage(column, textRange);
- }
- if (column.isVirtual()) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {this.getSecondaryTableName(), column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isSecondaryTableVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getSecondaryTableName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isSecondaryTableVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getSecondaryTableName()},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSequenceGenerator.java
deleted file mode 100644
index a7805c1564..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmSequenceGenerator.java
+++ /dev/null
@@ -1,45 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- *
- */
-public class GenericOrmSequenceGenerator
- extends AbstractOrmSequenceGenerator
-{
-
- public GenericOrmSequenceGenerator(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- super(parent, resourceSequenceGenerator);
- }
-
- // ********** database stuff **********
-
- /**
- * The JPA spec does not allow a sequence to have a schema.
- */
- @Override
- protected String getSchema() {
- return this.getContextDefaultSchema();
- }
-
- /**
- * The JPA spec does not allow a sequence to have a catalog.
- */
- @Override
- protected String getCatalog() {
- return this.getContextDefaultCatalog();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTable.java
deleted file mode 100644
index 63fcf35496..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTable.java
+++ /dev/null
@@ -1,134 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmTable;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlTable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- */
-public class GenericOrmTable
- extends AbstractOrmTable
- implements OrmTable
-{
- protected XmlEntity resourceEntity;
-
- public GenericOrmTable(OrmEntity parent) {
- super(parent);
- }
-
- public OrmEntity getOrmEntity() {
- return (OrmEntity) super.getParent();
- }
-
- @Override
- protected XmlTable getResourceTable() {
- return this.resourceEntity.getTable();
- }
-
- @Override
- protected XmlTable addResourceTable() {
- XmlTable resourceTable = OrmFactory.eINSTANCE.createXmlTable();
- this.resourceEntity.setTable(resourceTable);
- return resourceTable;
- }
-
- @Override
- protected void removeResourceTable() {
- this.resourceEntity.setTable(null);
- }
-
- public void initialize(XmlEntity xmlEntity) {
- this.resourceEntity = xmlEntity;
- this.initialize(this.getResourceTable());
- }
-
- public void update(XmlEntity xmlEntity) {
- this.resourceEntity = xmlEntity;
- this.update(this.getResourceTable());
- }
-
- @Override
- protected String buildDefaultName() {
- return this.getOrmEntity().getDefaultTableName();
- }
-
- @Override
- protected String buildDefaultSchema() {
- return this.getOrmEntity().getDefaultSchema();
- }
-
- @Override
- protected String buildDefaultCatalog() {
- return this.getOrmEntity().getDefaultCatalog();
- }
-
- //*********** Validation *******************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (this.connectionProfileIsActive()) {
- this.validateAgainstDatabase(messages);
- }
- }
-
- protected void validateAgainstDatabase(List<IMessage> messages) {
- if ( ! this.hasResolvedCatalog()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_CATALOG,
- new String[] {this.getCatalog(), this.getName()},
- this,
- this.getCatalogTextRange()
- )
- );
- return;
- }
-
- if ( ! this.hasResolvedSchema()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_SCHEMA,
- new String[] {this.getSchema(), this.getName()},
- this,
- this.getSchemaTextRange()
- )
- );
- return;
- }
-
- if ( ! this.isResolved()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TABLE_UNRESOLVED_NAME,
- new String[] {this.getName()},
- this,
- this.getNameTextRange()
- )
- );
- return;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java
deleted file mode 100644
index f9910b4661..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java
+++ /dev/null
@@ -1,420 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.TableGenerator;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmGenerator;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- *
- */
-public class GenericOrmTableGenerator
- extends AbstractOrmGenerator<XmlTableGenerator>
- implements OrmTableGenerator, UniqueConstraint.Owner
-{
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected String specifiedPkColumnName;
- protected String defaultPkColumnName;
-
- protected String specifiedValueColumnName;
- protected String defaultValueColumnName;
-
- protected String specifiedPkColumnValue;
- protected String defaultPkColumnValue;
-
- protected final List<OrmUniqueConstraint> uniqueConstraints;
-
-
- // ********** constructor **********
-
- public GenericOrmTableGenerator(XmlContextNode parent, XmlTableGenerator resourceTableGenerator) {
- super(parent);
- this.uniqueConstraints = new ArrayList<OrmUniqueConstraint>();
- this.initialize(resourceTableGenerator);
- }
-
- @Override
- public int getDefaultInitialValue() {
- return TableGenerator.DEFAULT_INITIAL_VALUE;
- }
-
- // ********** table **********
-
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.getResourceGenerator().setTable(table);
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- 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);
- }
-
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.getResourceGenerator().setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.getResourceGenerator().setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
-
- // ********** primary key column name **********
-
- public String getPkColumnName() {
- return (this.specifiedPkColumnName != null) ? this.specifiedPkColumnName : this.defaultPkColumnName;
- }
-
- public String getSpecifiedPkColumnName() {
- return this.specifiedPkColumnName;
- }
-
- public void setSpecifiedPkColumnName(String name) {
- String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.getResourceGenerator().setPkColumnName(name);
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
- }
-
- protected void setSpecifiedPkColumnName_(String name) {
- String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultPkColumnName() {
- return this.defaultPkColumnName;
- }
-
- protected void setDefaultPkColumnName(String name) {
- String old = this.defaultPkColumnName;
- this.defaultPkColumnName = name;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, old, name);
- }
-
-
- // ********** value column name **********
-
- public String getValueColumnName() {
- return (this.specifiedValueColumnName != null) ? this.specifiedValueColumnName : this.defaultValueColumnName;
- }
-
- public String getSpecifiedValueColumnName() {
- return this.specifiedValueColumnName;
- }
-
- public void setSpecifiedValueColumnName(String name) {
- String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.getResourceGenerator().setValueColumnName(name);
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
- }
-
- protected void setSpecifiedValueColumnName_(String name) {
- String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultValueColumnName() {
- return this.defaultValueColumnName;
- }
-
- protected void setDefaultValueColumnName(String name) {
- String old = this.defaultValueColumnName;
- this.defaultValueColumnName = name;
- this.firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, old, name);
- }
-
-
- // ********** primary key column value **********
-
- public String getPkColumnValue() {
- return (this.specifiedPkColumnValue != null) ? this.specifiedPkColumnValue : this.defaultPkColumnValue;
- }
-
- public String getSpecifiedPkColumnValue() {
- return this.specifiedPkColumnValue;
- }
-
- public void setSpecifiedPkColumnValue(String value) {
- String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.getResourceGenerator().setPkColumnValue(value);
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
- }
-
- protected void setSpecifiedPkColumnValue_(String value) {
- String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
- }
-
- public String getDefaultPkColumnValue() {
- return this.defaultPkColumnValue;
- }
-
- public void setDefaultPkColumnValue(String value) {
- String old = this.defaultPkColumnValue;
- this.defaultPkColumnValue = value;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** unique constraints **********
-
- public ListIterator<OrmUniqueConstraint> uniqueConstraints() {
- return new CloneListIterator<OrmUniqueConstraint>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public OrmUniqueConstraint addUniqueConstraint(int index) {
- XmlUniqueConstraint resourceUC = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- OrmUniqueConstraint contextUC = this.buildUniqueConstraint(resourceUC);
- this.uniqueConstraints.add(index, contextUC);
- this.getResourceGenerator().getUniqueConstraints().add(index, resourceUC);
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, contextUC);
- return contextUC;
- }
-
- protected void addUniqueConstraint(int index, OrmUniqueConstraint uniqueConstraint) {
- this.addItemToList(index, uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- protected void addUniqueConstraint(OrmUniqueConstraint uniqueConstraint) {
- this.addUniqueConstraint(this.uniqueConstraints.size(), uniqueConstraint);
- }
-
- public void removeUniqueConstraint(UniqueConstraint uniqueConstraint) {
- this.removeUniqueConstraint(this.uniqueConstraints.indexOf(uniqueConstraint));
- }
-
- public void removeUniqueConstraint(int index) {
- OrmUniqueConstraint uniqueConstraint = this.uniqueConstraints.remove(index);
- this.getResourceGenerator().getUniqueConstraints().remove(index);
- this.fireItemRemoved(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- protected void removeUniqueConstraint_(OrmUniqueConstraint uniqueConstraint) {
- this.removeItemFromList(uniqueConstraint, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex);
- this.getResourceGenerator().getUniqueConstraints().move(targetIndex, sourceIndex);
- this.fireItemMoved(UNIQUE_CONSTRAINTS_LIST, targetIndex, sourceIndex);
- }
-
-
- //******************* UniqueConstraint.Owner implementation ******************
-
- public Iterator<String> candidateUniqueConstraintColumnNames() {
- org.eclipse.jpt.db.Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers().iterator() : EmptyIterator.<String>instance();
- }
-
-
- // ********** resource => context **********
-
- @Override
- protected void initialize(XmlTableGenerator xmlTableGenerator) {
- super.initialize(xmlTableGenerator);
- this.specifiedTable = xmlTableGenerator.getTable();
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = xmlTableGenerator.getSchema();
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = xmlTableGenerator.getCatalog();
- this.specifiedPkColumnName = xmlTableGenerator.getPkColumnName();
- this.specifiedValueColumnName = xmlTableGenerator.getValueColumnName();
- this.specifiedPkColumnValue = xmlTableGenerator.getPkColumnValue();
- this.initializeUniqueContraints();
- }
-
- protected void initializeUniqueContraints() {
- if (this.resourceGenerator == null) {
- return;
- }
- for (XmlUniqueConstraint uniqueConstraint : this.resourceGenerator.getUniqueConstraints()) {
- this.uniqueConstraints.add(this.buildUniqueConstraint(uniqueConstraint));
- }
- }
-
- @Override
- public void update(XmlTableGenerator xmlTableGenerator) {
- super.update(xmlTableGenerator);
- this.setSpecifiedTable_(xmlTableGenerator.getTable());
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(xmlTableGenerator.getSchema());
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(xmlTableGenerator.getCatalog());
- this.setSpecifiedPkColumnName_(xmlTableGenerator.getPkColumnName());
- this.setSpecifiedValueColumnName_(xmlTableGenerator.getValueColumnName());
- this.setSpecifiedPkColumnValue_(xmlTableGenerator.getPkColumnValue());
- // TODO defaults
- this.updateUniqueConstraints();
- }
-
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- protected void updateUniqueConstraints() {
- Iterator<XmlUniqueConstraint> xmlConstraints = this.xmlUniqueConstraints();
-
- for (Iterator<OrmUniqueConstraint> contextConstraints = this.uniqueConstraints(); contextConstraints.hasNext(); ) {
- OrmUniqueConstraint contextConstraint = contextConstraints.next();
- if (xmlConstraints.hasNext()) {
- contextConstraint.update(xmlConstraints.next());
- }
- else {
- this.removeUniqueConstraint_(contextConstraint);
- }
- }
-
- while (xmlConstraints.hasNext()) {
- this.addUniqueConstraint(this.buildUniqueConstraint(xmlConstraints.next()));
- }
- }
-
- protected Iterator<XmlUniqueConstraint> xmlUniqueConstraints() {
- // make a copy of the XML constraints (to prevent ConcurrentModificationException)
- return (this.resourceGenerator == null) ? EmptyIterator.<XmlUniqueConstraint>instance()
- : new CloneIterator<XmlUniqueConstraint>(this.resourceGenerator.getUniqueConstraints());
- }
-
- protected OrmUniqueConstraint buildUniqueConstraint(XmlUniqueConstraint resourceUniqueConstraint) {
- return this.getXmlContextNodeFactory().buildOrmUniqueConstraint(this, this, resourceUniqueConstraint);
- }
-
-
- // ********** database stuff **********
-
- public Table getDbTable() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema == null) ? null : dbSchema.getTableForIdentifier(this.getTable());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTemporalConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTemporalConverter.java
deleted file mode 100644
index 8adc7a5953..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTemporalConverter.java
+++ /dev/null
@@ -1,86 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmTemporalConverter extends AbstractOrmXmlContextNode
- implements TemporalConverter, OrmConverter
-{
- protected TemporalType temporalType;
-
- protected XmlConvertibleMapping resourceConvertibleMapping;
-
- public GenericOrmTemporalConverter(OrmAttributeMapping parent, XmlConvertibleMapping resourceConvertableMapping) {
- super(parent);
- this.initialize(resourceConvertableMapping);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return Converter.TEMPORAL_CONVERTER;
- }
-
- public TemporalType getTemporalType() {
- return this.temporalType;
- }
-
- public void setTemporalType(TemporalType newTemporalType) {
- TemporalType oldTemporalType = this.temporalType;
- this.temporalType = newTemporalType;
- this.resourceConvertibleMapping.setTemporal(TemporalType.toOrmResourceModel(newTemporalType));
- firePropertyChanged(TEMPORAL_TYPE_PROPERTY, oldTemporalType, newTemporalType);
- }
-
- protected void setTemporalType_(TemporalType newTemporalType) {
- TemporalType oldTemporalType = this.temporalType;
- this.temporalType = newTemporalType;
- firePropertyChanged(TEMPORAL_TYPE_PROPERTY, oldTemporalType, newTemporalType);
- }
-
-
- protected void initialize(XmlConvertibleMapping resourceConvertibleMapping) {
- this.resourceConvertibleMapping = resourceConvertibleMapping;
- this.temporalType = this.temporalType();
- }
-
- public void update() {
- this.setTemporalType_(this.temporalType());
- }
-
- protected TemporalType temporalType() {
- return TemporalType.fromOrmResourceModel(this.resourceConvertibleMapping.getTemporal());
- }
-
-
- public TextRange getValidationTextRange() {
- return this.resourceConvertibleMapping.getTemporalTextRange();
- }
-
- public void addToResourceModel() {
- this.resourceConvertibleMapping.setTemporal(org.eclipse.jpt.core.resource.orm.TemporalType.DATE);
- }
-
- public void removeFromResourceModel() {
- this.resourceConvertibleMapping.setTemporal(null);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTransientMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTransientMapping.java
deleted file mode 100644
index be02c1fa29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmTransientMapping.java
+++ /dev/null
@@ -1,58 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-
-
-public class GenericOrmTransientMapping
- extends AbstractOrmAttributeMapping<XmlTransient>
- implements OrmTransientMapping
-{
-
- public GenericOrmTransientMapping(OrmPersistentAttribute parent, XmlTransient resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmTransientMapping(this);
- }
-
- public int getXmlSequence() {
- return 90;
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getTransients().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getTransients().remove(this.resourceAttributeMapping);
- }
-
- // ********** metamodel **********
-
- @Override
- public MetamodelField getMetamodelField() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmUniqueConstraint.java
deleted file mode 100644
index 6eb27d552f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmUniqueConstraint.java
+++ /dev/null
@@ -1,126 +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.core.internal.jpa1.context.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-public class GenericOrmUniqueConstraint
- extends AbstractOrmXmlContextNode
- implements OrmUniqueConstraint
-{
-
- protected final List<String> columnNames;
-
- protected XmlUniqueConstraint resourceUniqueConstraint;
-
- protected Owner owner;
-
- public GenericOrmUniqueConstraint(XmlContextNode parent, Owner owner, XmlUniqueConstraint resourceUniqueConstraint) {
- super(parent);
- this.owner = owner;
- this.columnNames = new ArrayList<String>();
- this.initialize(resourceUniqueConstraint);
- }
-
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(int index, String columnName) {
- this.columnNames.add(index, columnName);
- this.resourceUniqueConstraint.getColumnNames().add(index, columnName);
- fireItemAdded(COLUMN_NAMES_LIST, index, columnName);
- }
-
- protected void addColumnName_(int index, String columnName) {
- this.addItemToList(index, columnName, this.columnNames, COLUMN_NAMES_LIST);
- }
-
- protected void addColumnName_(String columnName) {
- this.addItemToList(columnName, this.columnNames, COLUMN_NAMES_LIST);
- }
-
- protected void setColumnName_(int index, String columnName) {
- this.setItemInList(index, columnName, this.columnNames, COLUMN_NAMES_LIST);
- }
-
- public void removeColumnName(String columnName) {
- this.removeColumnName(this.columnNames.indexOf(columnName));
- }
-
- public void removeColumnName(int index) {
- String removedColumnName = this.columnNames.remove(index);
- this.resourceUniqueConstraint.getColumnNames().remove(index);
- fireItemRemoved(COLUMN_NAMES_LIST, index, removedColumnName);
- }
-
- protected void removeColumnName_(int index) {
- this.removeItemFromList(index, this.columnNames, COLUMN_NAMES_LIST);
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.columnNames, targetIndex, sourceIndex);
- this.resourceUniqueConstraint.getColumnNames().move(targetIndex, sourceIndex);
- fireItemMoved(COLUMN_NAMES_LIST, targetIndex, sourceIndex);
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceUniqueConstraint.getValidationTextRange();
- }
-
- protected void initialize(XmlUniqueConstraint xmlUniqueConstraint) {
- this.resourceUniqueConstraint = xmlUniqueConstraint;
- this.initializeColumnNames();
- }
-
- protected void initializeColumnNames() {
- for (String annotationColumnName : this.resourceUniqueConstraint.getColumnNames()) {
- this.columnNames.add(annotationColumnName);
- }
- }
-
- public void update(XmlUniqueConstraint xmlUniqueConstraint) {
- this.resourceUniqueConstraint = xmlUniqueConstraint;
- this.updateColumnNames();
- }
-
- protected void updateColumnNames() {
- int index = 0;
- for (String xmlColumnName : this.resourceUniqueConstraint.getColumnNames()) {
- if (this.columnNames.size() > index) {
- if ( ! this.columnNames.get(index).equals(xmlColumnName)) {
- this.setColumnName_(index, xmlColumnName);
- }
- }
- else {
- this.addColumnName_(xmlColumnName);
- }
- index++;
- }
-
- while (index < this.columnNames.size()) {
- this.removeColumnName_(index);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmVersionMapping.java
deleted file mode 100644
index 0d74de740f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmVersionMapping.java
+++ /dev/null
@@ -1,24 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmVersionMapping;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-
-
-public class GenericOrmVersionMapping extends AbstractOrmVersionMapping<XmlVersion>
-{
-
- public GenericOrmVersionMapping(OrmPersistentAttribute parent, XmlVersion resourceMapping) {
- super(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXml.java
deleted file mode 100644
index 9b39249296..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXml.java
+++ /dev/null
@@ -1,225 +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.core.internal.jpa1.context.orm;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.MappingFileRoot;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * JPA <code>orm.xml</code> file.
- */
-public class GenericOrmXml
- extends AbstractOrmXmlContextNode
- implements OrmXml
-{
- /**
- * If the XML resource's content type changes, the mapping file
- * ref will dispose its current mapping file and build a new one.
- */
- protected final JpaXmlResource xmlResource;
-
- /**
- * The resouce type will only change if the XML file's version changes
- * (since, if the content type changes, we get garbage-collected).
- */
- protected JpaResourceType resourceType;
-
- protected EntityMappings entityMappings;
-
-
- public GenericOrmXml(MappingFileRef parent, JpaXmlResource xmlResource) {
- super(parent);
- this.checkXmlResource(xmlResource);
- this.xmlResource = xmlResource;
- this.resourceType = xmlResource.getResourceType();
-
- XmlEntityMappings xmlEntityMappings = (XmlEntityMappings) xmlResource.getRootObject();
- if (xmlEntityMappings != null) {
- this.entityMappings = this.buildEntityMappings(xmlEntityMappings);
- }
- }
-
- protected void checkXmlResource(JpaXmlResource resource) {
- if (resource == null) {
- throw new NullPointerException();
- }
- if ( ! resource.getContentType().isKindOf(JptCorePlugin.MAPPING_FILE_CONTENT_TYPE)) {
- throw new IllegalArgumentException("Content type is not 'mapping file': " + resource); //$NON-NLS-1$
- }
- }
-
- // ********** overrides **********
-
- @Override
- public MappingFileRef getParent() {
- return (MappingFileRef) super.getParent();
- }
-
- @Override
- public IResource getResource() {
- return this.xmlResource.getFile();
- }
-
- @Override
- public JpaResourceType getResourceType() {
- return this.resourceType;
- }
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- if ((this.entityMappings != null) && this.entityMappings.containsOffset(textOffset)) {
- return this.entityMappings.getStructureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange getSelectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public void dispose() {
- if (this.entityMappings != null) {
- this.entityMappings.dispose();
- }
- JpaFile jpaFile = getJpaFile();
- if (jpaFile != null) {
- jpaFile.removeRootStructureNode(this.xmlResource);
- }
- }
-
- // ********** MappingFile implementation **********
-
- public JpaXmlResource getXmlResource() {
- return this.xmlResource;
- }
-
- public MappingFileRoot getRoot() {
- return this.entityMappings;
- }
-
- public OrmPersistentType getPersistentType(String name) {
- return (this.entityMappings == null) ? null : this.entityMappings.getPersistentType(name);
- }
-
- // ********** PersistentTypeContainer implementation **********
-
- /**
- * All orm.xml mapping files must be able to generate a static metamodel
- * because 1.0 orm.xml files can be referenced from 2.0 persistence.xml
- * files.
- */
- public Iterable<? extends PersistentType> getPersistentTypes() {
- return (this.entityMappings != null) ? this.entityMappings.getPersistentTypes() : EmptyIterable.<JavaPersistentType> instance();
- }
-
- // ********** entity mappings **********
-
- public EntityMappings getEntityMappings() {
- return this.entityMappings;
- }
-
- protected void setEntityMappings(EntityMappings entityMappings) {
- EntityMappings old = this.entityMappings;
- this.entityMappings = entityMappings;
- this.firePropertyChanged(ENTITY_MAPPINGS_PROPERTY, old, entityMappings);
- }
-
- protected EntityMappings buildEntityMappings(XmlEntityMappings xmlEntityMappings) {
- return this.getXmlContextNodeFactory().buildEntityMappings(this, xmlEntityMappings);
- }
-
- // ********** updating **********
-
- public void update() {
- XmlEntityMappings oldXmlEntityMappings = (this.entityMappings == null) ? null : this.entityMappings.getXmlEntityMappings();
- XmlEntityMappings newXmlEntityMappings = (XmlEntityMappings) this.xmlResource.getRootObject();
- JpaResourceType newResourceType = this.xmlResource.getResourceType();
-
- // If the old and new xml entity mappings are different instances,
- // we scrap the old context entity mappings and rebuild. This can
- // happen when the resource model drastically changes, such as
- // a cvs checkout or an edit reversion.
- if ((oldXmlEntityMappings != newXmlEntityMappings)
- || (newXmlEntityMappings == null)
- || this.valuesAreDifferent(this.resourceType, newResourceType)) {
-
- if (this.entityMappings != null) {
- getJpaFile().removeRootStructureNode(this.xmlResource);
- this.entityMappings.dispose();
- setEntityMappings(null);
- }
- }
-
- this.resourceType = newResourceType;
-
- if (newXmlEntityMappings != null) {
- if (this.entityMappings != null) {
- this.entityMappings.update();
- }
- else {
- setEntityMappings(buildEntityMappings(newXmlEntityMappings));
- }
-
- this.getJpaFile().addRootStructureNode(this.xmlResource, this.entityMappings);
- }
- }
-
- protected JpaFile getJpaFile() {
- return this.getJpaFile(this.xmlResource.getFile());
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.entityMappings != null) {
- this.entityMappings.postUpdate();
- }
- }
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- return TextRange.Empty.instance();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (this.entityMappings != null) {
- this.entityMappings.validate(messages, reporter);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXmlDefinition.java
deleted file mode 100644
index d6b52f3704..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmXmlDefinition.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.core.internal.jpa1.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-
-public class GenericOrmXmlDefinition
- extends AbstractOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE =
- new GenericOrmXmlDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private GenericOrmXmlDefinition() {
- super();
- }
-
-
- public EFactory getResourceNodeFactory() {
- return OrmFactory.eINSTANCE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new GenericOrmXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.ORM_XML_1_0_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 GenericJpaPlatformProvider})
- 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 GenericJpaPlatformProvider})
- return new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitDefaults.java
deleted file mode 100644
index 503f5aba6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,324 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmPersistenceUnitDefaults2_0;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-
-/**
- * <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-defaults</code> element
- */
-public class GenericPersistenceUnitDefaults
- extends AbstractOrmXmlContextNode
- implements OrmPersistenceUnitDefaults2_0
-{
- protected AccessType access;
-
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- protected boolean cascadePersist;
- protected boolean delimitedIdentifiers;
-
-
- // ********** constructor/initialization **********
-
- public GenericPersistenceUnitDefaults(PersistenceUnitMetadata parent) {
- super(parent);
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
- if (xmlDefaults != null) {
- this.access = AccessType.fromOrmResourceModel(xmlDefaults.getAccess());
- this.specifiedCatalog = xmlDefaults.getCatalog();
- this.specifiedSchema = xmlDefaults.getSchema();
- this.cascadePersist = xmlDefaults.isCascadePersist();
- this.delimitedIdentifiers = xmlDefaults.isDelimitedIdentifiers();
- }
- this.defaultCatalog = this.getJpaProject().getDefaultCatalog();
- this.defaultSchema = this.getJpaProject().getDefaultSchema();
- }
-
- public boolean resourceExists() {
- return this.getXmlDefaults() != null;
- }
-
- @Override
- public PersistenceUnitMetadata getParent() {
- return (PersistenceUnitMetadata) super.getParent();
- }
-
- protected XmlPersistenceUnitMetadata getXmlPersistenceUnitMetadata() {
- return this.getParent().getXmlPersistenceUnitMetadata();
- }
-
- protected XmlEntityMappings getXmlEntityMappings() {
- return this.getParent().getXmlEntityMappings();
- }
-
- // ********** access **********
-
- public AccessType getAccess() {
- return this.access;
- }
-
- public void setAccess(AccessType access) {
- AccessType old = this.access;
- this.access = access;
- if (access != old) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- xmlDefaults.setAccess(AccessType.toOrmResourceModel(access));
- this.checkXmlDefaults(xmlDefaults);
- this.firePropertyChanged(ACCESS_PROPERTY, old, access);
- }
- }
-
- protected void setAccess_(AccessType access) {
- AccessType old = this.access;
- this.access = access;
- this.firePropertyChanged(ACCESS_PROPERTY, old, access);
- }
-
-
- // ********** schema container **********
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em> catalog),
- * then the database probably does not support catalogs; and we need to
- * get the schema directly from the database.
- */
- public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.getDbCatalog(catalog) : this.getDatabase();
- }
-
-
- // ********** catalog **********
-
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- if (this.attributeValueHasChanged(old, catalog)) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- xmlDefaults.setCatalog(catalog);
- this.checkXmlDefaults(xmlDefaults);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
- }
-
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
- /**
- * If we don't have a catalog (i.e. we don't even have a <em>default</em>
- * catalog), then the database probably does not support catalogs.
- */
- public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.getDbCatalog(catalog);
- }
-
-
- // ********** schema **********
-
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- if (this.attributeValueHasChanged(old, schema)) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- xmlDefaults.setSchema(schema);
- this.checkXmlDefaults(xmlDefaults);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
-
- // ********** cascade persist **********
-
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- boolean old = this.cascadePersist;
- this.cascadePersist = cascadePersist;
- if (cascadePersist != old) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- xmlDefaults.setCascadePersist(cascadePersist);
- this.checkXmlDefaults(xmlDefaults);
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, cascadePersist);
- }
- }
-
- protected void setCascadePersist_(boolean cp) {
- boolean old = this.cascadePersist;
- this.cascadePersist = cp;
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, cp);
- }
-
-
- // ********** delimited identifiers **********
-
- public boolean isDelimitedIdentifiers() {
- return this.delimitedIdentifiers;
- }
-
- public void setDelimitedIdentifiers(boolean delimitedIdentifiers) {
- boolean old = this.delimitedIdentifiers;
- this.delimitedIdentifiers = delimitedIdentifiers;
- if (delimitedIdentifiers != old) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- xmlDefaults.setDelimitedIdentifiers(delimitedIdentifiers);
- this.checkXmlDefaults(xmlDefaults);
- this.firePropertyChanged(DELIMITED_IDENTIFIERS_PROPERTY, old, delimitedIdentifiers);
- }
- }
-
- protected void setDelimitedIdentifiers_(boolean di) {
- boolean old = this.delimitedIdentifiers;
- this.delimitedIdentifiers = di;
- this.firePropertyChanged(DELIMITED_IDENTIFIERS_PROPERTY, old, di);
- }
-
-
- // ********** behavior **********
-
- /**
- * If the XML does not exist, build it before returning it
- */
- protected XmlPersistenceUnitDefaults getXmlDefaultsForUpdate() {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
- return (xmlDefaults != null) ? xmlDefaults : this.buildXmlDefaults();
- }
-
- /**
- * build the XML defaults and the XML metadata if necessary
- */
- protected XmlPersistenceUnitDefaults buildXmlDefaults() {
- XmlPersistenceUnitMetadata resourceMetadata = this.getXmlPersistenceUnitMetadata();
- if (resourceMetadata == null) {
- resourceMetadata = this.buildXmlPersistenceUnitMetadata();
- this.getXmlEntityMappings().setPersistenceUnitMetadata(resourceMetadata);
- }
- XmlPersistenceUnitDefaults xmlDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- resourceMetadata.setPersistenceUnitDefaults(xmlDefaults);
- return xmlDefaults;
- }
-
- protected XmlPersistenceUnitMetadata buildXmlPersistenceUnitMetadata() {
- return this.getParent().buildXmlPersistenceUnitMetadata();
- }
-
- /**
- * clear the resource defaults and the resource metadata if appropriate
- */
- protected void checkXmlDefaults(XmlPersistenceUnitDefaults xmlDefaults) {
- if (xmlDefaults.isUnset()) {
- XmlPersistenceUnitMetadata metadata = this.getXmlEntityMappings().getPersistenceUnitMetadata();
- metadata.setPersistenceUnitDefaults(null);
- if (metadata.isUnset()) {
- this.getXmlEntityMappings().setPersistenceUnitMetadata(null);
- }
- }
- }
-
- public void update() {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
- if (xmlDefaults == null) {
- this.setAccess_(null);
- this.setSpecifiedCatalog_(null);
- this.setSpecifiedSchema_(null);
- this.setCascadePersist_(false);
- this.setDelimitedIdentifiers_(false);
- } else {
- this.setAccess_(AccessType.fromOrmResourceModel(xmlDefaults.getAccess()));
- this.setSpecifiedCatalog_(xmlDefaults.getCatalog());
- this.setSpecifiedSchema_(xmlDefaults.getSchema());
- this.setCascadePersist_(xmlDefaults.isCascadePersist());
- this.setDelimitedIdentifiers_(xmlDefaults.isDelimitedIdentifiers());
- }
- this.setDefaultCatalog(this.getJpaProject().getDefaultCatalog());
- this.setDefaultSchema(this.getJpaProject().getDefaultSchema());
- }
-
- public TextRange getValidationTextRange() {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
- return (xmlDefaults != null) ? xmlDefaults.getValidationTextRange() : this.getXmlEntityMappings().getValidationTextRange();
- }
-
- protected XmlPersistenceUnitDefaults getXmlDefaults() {
- XmlPersistenceUnitMetadata metadata = this.getXmlPersistenceUnitMetadata();
- return (metadata == null) ? null : metadata.getPersistenceUnitDefaults();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitMetadata.java
deleted file mode 100644
index 1d7f8d71a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,126 +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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-metadata</code> element
- */
-public class GenericPersistenceUnitMetadata
- extends AbstractOrmXmlContextNode
- implements PersistenceUnitMetadata
-{
- protected boolean xmlMappingMetadataComplete;
-
- protected final OrmPersistenceUnitDefaults persistenceUnitDefaults;
-
-
- public GenericPersistenceUnitMetadata(EntityMappings parent) {
- super(parent);
- this.xmlMappingMetadataComplete = this.getResourceXmlMappingMetadataComplete();
- this.persistenceUnitDefaults = this.getXmlContextNodeFactory().buildPersistenceUnitDefaults(this);
- }
-
- @Override
- public EntityMappings getParent() {
- return (EntityMappings) super.getParent();
- }
-
- public XmlEntityMappings getXmlEntityMappings() {
- return this.getParent().getXmlEntityMappings();
- }
-
-
- // ********** persistence unit metadata **********
-
- public XmlPersistenceUnitMetadata buildXmlPersistenceUnitMetadata() {
- return EmfTools.create(
- this.getResourceNodeFactory(),
- OrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata(),
- XmlPersistenceUnitMetadata.class
- );
- }
-
- public XmlPersistenceUnitMetadata getXmlPersistenceUnitMetadata() {
- return this.getXmlEntityMappings().getPersistenceUnitMetadata();
- }
-
-
- // ********** XML mapping metadata complete **********
-
- public boolean isXmlMappingMetadataComplete() {
- return this.xmlMappingMetadataComplete;
- }
-
- public void setXmlMappingMetadataComplete(boolean xmlMappingMetadataComplete) {
- boolean old = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = xmlMappingMetadataComplete;
- if (old != xmlMappingMetadataComplete) {
- XmlPersistenceUnitMetadata xmlMetadata = this.getXmlPersistenceUnitMetadata();
- if (xmlMetadata != null) {
- xmlMetadata.setXmlMappingMetadataComplete(xmlMappingMetadataComplete);
- if (xmlMetadata.isUnset()) {
- this.getXmlEntityMappings().setPersistenceUnitMetadata(null);
- }
- }
- else if (xmlMappingMetadataComplete) {
- xmlMetadata = this.buildXmlPersistenceUnitMetadata();
- this.getXmlEntityMappings().setPersistenceUnitMetadata(xmlMetadata);
- xmlMetadata.setXmlMappingMetadataComplete(xmlMappingMetadataComplete);
- }
- this.firePropertyChanged(XML_MAPPING_METADATA_COMPLETE_PROPERTY, old, xmlMappingMetadataComplete);
- }
- }
-
- protected void setXmlMappingMetadataComplete_(boolean xmlMappingMetadataComplete) {
- boolean old = this.xmlMappingMetadataComplete;
- this.xmlMappingMetadataComplete = xmlMappingMetadataComplete;
- this.firePropertyChanged(XML_MAPPING_METADATA_COMPLETE_PROPERTY, old, xmlMappingMetadataComplete);
- }
-
- protected boolean getResourceXmlMappingMetadataComplete() {
- XmlPersistenceUnitMetadata xmlMetadata = this.getXmlPersistenceUnitMetadata();
- return (xmlMetadata != null) ? xmlMetadata.isXmlMappingMetadataComplete() : false;
- }
-
-
- // ********** persistence unit defaults **********
-
- public OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return this.persistenceUnitDefaults;
- }
-
-
- // ********** miscellaneous **********
-
- public void update() {
- this.setXmlMappingMetadataComplete_(this.getResourceXmlMappingMetadataComplete());
- this.persistenceUnitDefaults.update();
- }
-
- public TextRange getValidationTextRange() {
- if (this.getXmlPersistenceUnitMetadata() != null) {
- return this.getXmlPersistenceUnitMetadata().getValidationTextRange();
- }
- return this.getXmlEntityMappings().getValidationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/NullOrmJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/NullOrmJoinColumnJoiningStrategy.java
deleted file mode 100644
index 96833ee6cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/NullOrmJoinColumnJoiningStrategy.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa1.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-
-public class NullOrmJoinColumnJoiningStrategy
- extends AbstractOrmXmlContextNode
- implements OrmJoinColumnJoiningStrategy
-{
-
- protected NullOrmJoinColumnJoiningStrategy(JoinColumnEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public void initializeFrom(JoinColumnJoiningStrategy oldStrategy) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public JoinColumnEnabledRelationshipReference getParent() {
- return (JoinColumnEnabledRelationshipReference) super.getParent();
- }
-
- public JoinColumnEnabledRelationshipReference getRelationshipReference() {
- return this.getParent();
- }
-
- public RelationshipMapping getRelationshipMapping() {
- return this.getRelationshipReference().getRelationshipMapping();
- }
-
- public void addStrategy() {
- throw new UnsupportedOperationException();
- }
-
- public void removeStrategy() {
- //do nothing, no join column to remove
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return false;
- }
-
- public TypeMapping getRelationshipTarget() {
- return null;
- }
-
- // **************** join columns *******************************************
-
- public ListIterator<OrmJoinColumn> joinColumns() {
- throw new UnsupportedOperationException();
- }
-
- public int joinColumnsSize() {
- throw new UnsupportedOperationException();
- }
-
-
- // **************** default join column ************************************
-
- public OrmJoinColumn getDefaultJoinColumn() {
- throw new UnsupportedOperationException();
- }
-
- // **************** specified join columns *********************************
-
- public ListIterator<OrmJoinColumn> specifiedJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
- public int specifiedJoinColumnsSize() {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasSpecifiedJoinColumns() {
- return false;
- }
-
- public OrmJoinColumn addSpecifiedJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void removeSpecifiedJoinColumn(JoinColumn joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public void removeSpecifiedJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveSpecifiedJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- // **************** resource => context ************************************
-
- public void update() {
- //no-op
- }
-
- public TextRange getValidationTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public String getColumnTableNotValidDescription() {
- throw new UnsupportedOperationException();
- }
-
- public Table getDbTable(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public Table getReferencedColumnDbTable() {
- throw new UnsupportedOperationException();
- }
-
- public String getTableName() {
- return null;
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- throw new UnsupportedOperationException();
- }
-
- public TypeMapping getRelationshipSource() {
- return getRelationshipMapping().getTypeMapping();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/UnsupportedOrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/UnsupportedOrmAttributeMapping.java
deleted file mode 100644
index cdc8829c0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/UnsupportedOrmAttributeMapping.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.core.internal.jpa1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-
-/**
- * This will be used in cases where the java support attribute mapping types
- * that are not supported by the particular version of the orm.xml file. For example,
- * EclipseLink supports variable 1-1 mappings, but the generic orm.xml file does not.
- */
-public class UnsupportedOrmAttributeMapping
- extends AbstractOrmAttributeMapping<XmlNullAttributeMapping>
-{
-
- public UnsupportedOrmAttributeMapping(OrmPersistentAttribute parent, XmlNullAttributeMapping resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public int getXmlSequence() {
- return -1;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- //this ends up returning the java attribute mapping key
- return this.resourceAttributeMapping.getMappingKey();
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- throw new UnsupportedOperationException();
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- throw new UnsupportedOperationException();
- }
-
- // ********** metamodel **********
-
- @Override
- public MetamodelField getMetamodelField() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericClassRef.java
deleted file mode 100644
index 7b679a02d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericClassRef.java
+++ /dev/null
@@ -1,307 +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.core.internal.jpa1.context.persistence;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * Context persistence.xml class reference
- */
-public class GenericClassRef
- extends AbstractPersistenceXmlContextNode
- implements ClassRef
-{
- // this is null for an "implied" class ref
- protected final XmlJavaClassRef xmlJavaClassRef;
-
- protected String className;
-
- protected JavaPersistentType javaPersistentType;
-
-
- // ********** construction/initialization **********
-
- /**
- * Construct an "specified" class ref; i.e. a class ref with
- * an explicit entry in the persistence.xml.
- */
- public GenericClassRef(PersistenceUnit parent, XmlJavaClassRef classRef) {
- this(parent, classRef, classRef.getJavaClass());
- }
-
- /**
- * Construct an "implied" class ref; i.e. a class ref without
- * an explicit entry in the persistence.xml.
- */
- public GenericClassRef(PersistenceUnit parent, String className) {
- this(parent, null, className);
- }
-
- protected GenericClassRef(PersistenceUnit parent, XmlJavaClassRef classRef, String className) {
- super(parent);
- this.xmlJavaClassRef = classRef;
- this.initialize(className);
- }
-
- protected void initialize(String typeName) {
- this.className = typeName;
- this.javaPersistentType = this.buildJavaPersistentType();
- }
-
- @Override
- public PersistenceUnit getParent() {
- return (PersistenceUnit) super.getParent();
- }
-
- public XmlJavaClassRef getResourceClassRef() {
- return this.xmlJavaClassRef;
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- return PersistenceStructureNodes.CLASS_REF_ID;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return this;
- }
-
- public TextRange getSelectionTextRange() {
- return this.isVirtual() ? null : this.xmlJavaClassRef.getSelectionTextRange();
- }
-
- public void dispose() {
- if (this.javaPersistentType != null) {
- this.javaPersistentType.dispose();
- }
- }
-
-
- // ********** PersistentType.Owner implementation **********
-
- public AccessType getOverridePersistentTypeAccess() {
- // no access type at this level overrides any local access type specification
- return null;
- }
-
- public AccessType getDefaultPersistentTypeAccess() {
- return this.getPersistenceUnit().getDefaultAccess();
- }
-
-
- // ********** queries **********
-
- public boolean isFor(String typeName) {
- return Tools.valuesAreEqual(typeName, this.getJavaClassName());
- }
-
- public boolean isVirtual() {
- return this.xmlJavaClassRef == null;
- }
-
- public boolean containsOffset(int textOffset) {
- return this.isNotVirtual() && this.xmlJavaClassRef.containsOffset(textOffset);
- }
-
- protected boolean isNotVirtual() {
- return ! this.isVirtual();
- }
-
-
- // ********** class name **********
-
- public String getClassName() {
- return this.className;
- }
-
- public void setClassName(String className) {
- String old = this.className;
- this.className = className;
- this.xmlJavaClassRef.setJavaClass(className);
- this.firePropertyChanged(CLASS_NAME_PROPERTY, old, className);
- }
-
- protected void setClassName_(String newClassName) {
- String old = this.className;
- this.className = newClassName;
- this.firePropertyChanged(CLASS_NAME_PROPERTY, old, newClassName);
- }
-
- /**
- * Nested classes will be qualified with a '$'; the Java name is qualified
- * with a '.'. Like <code>className</code>, this can be <code>null</code>.
- */
- protected String getJavaClassName() {
- return StringTools.stringIsEmpty(this.className) ? null : this.className.replace('$', '.');
- }
-
-
- // ********** java persistent type **********
-
- public JavaPersistentType getJavaPersistentType() {
- return this.javaPersistentType;
- }
-
- protected void setJavaPersistentType(JavaPersistentType javaPersistentType) {
- JavaPersistentType old = this.javaPersistentType;
- this.javaPersistentType = javaPersistentType;
- this.firePropertyChanged(JAVA_PERSISTENT_TYPE_PROPERTY, old, javaPersistentType);
- }
-
- protected JavaPersistentType buildJavaPersistentType() {
- JavaResourcePersistentType jrpt = this.getJavaResourcePersistentType();
- return (jrpt == null) ? null : this.buildJavaPersistentType(jrpt);
- }
-
- protected JavaPersistentType buildJavaPersistentType(JavaResourcePersistentType jrpt) {
- return this.getJpaFactory().buildJavaPersistentType(this, jrpt);
- }
-
- protected void updateJavaPersistentType() {
- JavaResourcePersistentType jrpt = this.getJavaResourcePersistentType();
- if (jrpt == null) {
- if (this.javaPersistentType != null) {
- this.javaPersistentType.dispose();
- this.setJavaPersistentType(null);
- }
- } else {
- if (this.javaPersistentType == null) {
- this.setJavaPersistentType(this.buildJavaPersistentType(jrpt));
- } else {
- this.javaPersistentType.update(jrpt);
- }
- }
- }
-
- protected JavaResourcePersistentType getJavaResourcePersistentType() {
- String javaClassName = this.getJavaClassName();
- return (javaClassName == null) ? null : this.getJpaProject().getJavaResourcePersistentType(javaClassName);
- }
-
-
- // ********** updating **********
-
- public void update() {
- this.update(this.xmlJavaClassRef.getJavaClass());
- }
-
- public void update(String typeName) {
- this.setClassName_(typeName);
- this.updateJavaPersistentType();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.javaPersistentType != null) {
- this.javaPersistentType.postUpdate();
- }
- }
-
- // ********** XmlContextNode implementation **********
-
- public TextRange getValidationTextRange() {
- return this.isVirtual() ? null : this.xmlJavaClassRef.getValidationTextRange();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- if (StringTools.stringIsEmpty(this.className)) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_CLASS,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- if (this.javaPersistentType == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_CLASS,
- new String[] {this.getJavaClassName()},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- // 190062 validate Java class only if this is the only reference to it;
- // i.e. the persistence.xml ref is the only ref - none of the mapping
- // files reference the same class
- boolean validateJavaPersistentType = true;
- for (Iterator<MappingFileRef> stream = this.getPersistenceUnit().mappingFileRefsContaining(this.getJavaClassName()); stream.hasNext(); ) {
- validateJavaPersistentType = false;
- MappingFileRef mappingFileRef = stream.next();
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS,
- new String[] {this.getJavaClassName(), mappingFileRef.getFileName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
-
- if (validateJavaPersistentType) {
- this.validateJavaPersistentType(messages, reporter);
- }
- }
-
- protected void validateJavaPersistentType(List<IMessage> messages, IReporter reporter) {
- try {
- this.javaPersistentType.validate(messages, reporter);
- } catch (Throwable t) {
- JptCorePlugin.log(t);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getJavaClassName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericJarFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericJarFileRef.java
deleted file mode 100644
index 80b33e73c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericJarFileRef.java
+++ /dev/null
@@ -1,26 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-
-/**
- * Context JAR file reference (from the persistence unit)
- */
-public class GenericJarFileRef
- extends AbstractJarFileRef
-{
- public GenericJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- super(parent, xmlJarFileRef);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericMappingFileRef.java
deleted file mode 100644
index 1b09a7f729..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericMappingFileRef.java
+++ /dev/null
@@ -1,81 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <code>persistence.xml</code> file
- * <br>
- * <code>mapping-file</code> element
- */
-public class GenericMappingFileRef
- extends AbstractMappingFileRef
-{
- protected XmlMappingFileRef xmlMappingFileRef;
-
-
- // ********** construction/initialization **********
-
- public GenericMappingFileRef(PersistenceUnit parent, XmlMappingFileRef xmlMappingFileRef) {
- super(parent, xmlMappingFileRef.getFileName());
- this.xmlMappingFileRef = xmlMappingFileRef;
- }
-
-
- // ********** file name **********
-
- public void setFileName(String fileName) {
- String old = this.fileName;
- this.fileName = fileName;
- this.xmlMappingFileRef.setFileName(fileName);
- this.firePropertyChanged(FILE_NAME_PROPERTY, old, fileName);
- }
-
- protected void setFileName_(String newFileName) {
- String old = this.fileName;
- this.fileName = newFileName;
- this.firePropertyChanged(FILE_NAME_PROPERTY, old, newFileName);
- }
-
-
- // ********** MappingFileRef implementation **********
-
- public void update(XmlMappingFileRef mappingFileRef) {
- this.xmlMappingFileRef = mappingFileRef;
- this.setFileName_(mappingFileRef.getFileName());
- this.update();
- }
-
- public boolean isImplied() {
- return false;
- }
-
- public boolean containsOffset(int textOffset) {
- return this.xmlMappingFileRef.containsOffset(textOffset);
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public TextRange getSelectionTextRange() {
- return this.xmlMappingFileRef.getSelectionTextRange();
- }
-
-
- // ********** XmlContextNode implementation **********
-
- public TextRange getValidationTextRange() {
- return this.xmlMappingFileRef.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistence.java
deleted file mode 100644
index 38b80c76f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistence.java
+++ /dev/null
@@ -1,284 +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.core.internal.jpa1.context.persistence;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceStructureNodes;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.persistence.Persistence2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericPersistence
- extends AbstractPersistenceXmlContextNode
- implements Persistence2_0
-{
- protected XmlPersistence xmlPersistence;
-
- // The implementation here is a single persistence unit, although the API
- // is for a list. We want to support multiple persistence units someday....
- protected PersistenceUnit persistenceUnit;
-
- public GenericPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
- super(parent);
- this.xmlPersistence = xmlPersistence;
- this.initializePersistenceUnits();
- }
-
- public String getId() {
- return PersistenceStructureNodes.PERSISTENCE_ID;
- }
-
- public XmlPersistence getXmlPersistence() {
- return this.xmlPersistence;
- }
-
- @Override
- public PersistenceXml getParent() {
- return (PersistenceXml) super.getParent();
- }
-
- // **************** persistence units **************************************
-
- public ListIterator<PersistenceUnit> persistenceUnits() {
- return (this.persistenceUnit == null) ? EmptyListIterator.<PersistenceUnit>instance() : this.persistenceUnits_();
- }
-
- protected ListIterator<PersistenceUnit> persistenceUnits_() {
- return new SingleElementListIterator<PersistenceUnit>(this.persistenceUnit);
- }
-
- protected Iterable<PersistenceUnit> getPersistenceUnits() {
- return (this.persistenceUnit == null) ? EmptyIterable.<PersistenceUnit>instance() : this.getPersistenceUnits_();
- }
-
- protected Iterable<PersistenceUnit> getPersistenceUnits_() {
- return new SingleElementIterable<PersistenceUnit>(this.persistenceUnit);
- }
-
- public int persistenceUnitsSize() {
- return (this.persistenceUnit == null) ? 0 : 1;
- }
-
- public PersistenceUnit addPersistenceUnit() {
- return addPersistenceUnit(persistenceUnitsSize());
- }
-
- public PersistenceUnit addPersistenceUnit(int index) {
- if (index > 0 || this.persistenceUnit != null) {
- throw new IllegalStateException("This implementation does not support multiple persistence units."); //$NON-NLS-1$
- }
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- this.persistenceUnit = buildPersistenceUnit(xmlPersistenceUnit);
- this.xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
- fireItemAdded(PERSISTENCE_UNITS_LIST, index, this.persistenceUnit);
- return this.persistenceUnit;
- }
-
- public void removePersistenceUnit(PersistenceUnit pu) {
- if (pu != this.persistenceUnit) {
- throw new IllegalArgumentException("Invalid persistence unit: " + pu); //$NON-NLS-1$
- }
- removePersistenceUnit(0);
- }
-
- public void removePersistenceUnit(int index) {
- if (index > 0 || this.persistenceUnit == null) {
- throw new IndexOutOfBoundsException("index: " + index); //$NON-NLS-1$
- }
- PersistenceUnit oldPersistenceUnit = this.persistenceUnit;
- this.persistenceUnit.dispose();
- this.persistenceUnit = null;
- this.xmlPersistence.getPersistenceUnits().remove(index);
- fireItemRemoved(PERSISTENCE_UNITS_LIST, index, oldPersistenceUnit);
- }
-
- protected void addPersistenceUnit_(PersistenceUnit newPersistenceUnit) {
- this.persistenceUnit = newPersistenceUnit;
- fireItemAdded(PERSISTENCE_UNITS_LIST, 0, this.persistenceUnit);
- }
-
- protected void removePersistenceUnit_(PersistenceUnit oldPersistenceUnit) {
- this.persistenceUnit.dispose();
- this.persistenceUnit = null;
- fireItemRemoved(PERSISTENCE_UNITS_LIST, 0, oldPersistenceUnit);
- }
-
-
- // **************** metamodel **********************************
-
- public void initializeMetamodel() {
- for (PersistenceUnit pu : this.getPersistenceUnits()) {
- ((PersistenceUnit2_0) pu).initializeMetamodel();
- }
- }
-
- public void synchronizeMetamodel() {
- for (PersistenceUnit pu : this.getPersistenceUnits()) {
- ((PersistenceUnit2_0) pu).synchronizeMetamodel();
- }
- }
-
- public void disposeMetamodel() {
- for (PersistenceUnit pu : this.getPersistenceUnits()) {
- ((PersistenceUnit2_0) pu).disposeMetamodel();
- }
- }
-
-
- // **************** updating ***********************************************
-
- protected void initializePersistenceUnits() {
- // only adding one here, until we support multiple persistence units
- if (this.xmlPersistence.getPersistenceUnits().size() > 0) {
- this.persistenceUnit = buildPersistenceUnit(this.xmlPersistence.getPersistenceUnits().get(0));
- }
- }
-
- public void update(XmlPersistence persistence) {
- this.xmlPersistence = persistence;
- XmlPersistenceUnit xmlPersistenceUnit = null;
- if (persistence.getPersistenceUnits().size() > 0) {
- xmlPersistenceUnit = persistence.getPersistenceUnits().get(0);
- }
-
- if (this.persistenceUnit != null) {
- if (xmlPersistenceUnit != null) {
- this.persistenceUnit.update(xmlPersistenceUnit);
- }
- else {
- removePersistenceUnit_(this.persistenceUnit);
- }
- }
- else {
- if (xmlPersistenceUnit != null) {
- addPersistenceUnit_(buildPersistenceUnit(xmlPersistenceUnit));
- }
- }
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.persistenceUnit != null) {
- this.persistenceUnit.postUpdate();
- }
- }
-
- protected PersistenceUnit buildPersistenceUnit(XmlPersistenceUnit xmlPersistenceUnit) {
- return this.getContextNodeFactory().buildPersistenceUnit(this, xmlPersistenceUnit);
- }
-
-
- // *************************************************************************
-
- public JpaStructureNode getStructureNode(int textOffset) {
- for (PersistenceUnit pu : this.getPersistenceUnits()) {
- if (pu.containsOffset(textOffset)) {
- return pu.getStructureNode(textOffset);
- }
- }
- return this;
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.xmlPersistence == null) ? false : this.xmlPersistence.containsOffset(textOffset);
- }
-
- public TextRange getSelectionTextRange() {
- return this.xmlPersistence.getSelectionTextRange();
- }
-
- public TextRange getValidationTextRange() {
- return this.xmlPersistence.getValidationTextRange();
- }
-
- public void dispose() {
- for (PersistenceUnit pu : this.getPersistenceUnits()) {
- pu.dispose();
- }
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateVersion(messages);
- this.checkForMultiplePersistenceUnits(messages);
- this.validatePersistenceUnit(messages, reporter);
- }
-
- protected void validateVersion(List<IMessage> messages) {
- if (! latestDocumentVersion().equals(this.xmlPersistence.getVersion())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- JpaValidationMessages.XML_VERSION_NOT_LATEST,
- this,
- this.xmlPersistence.getVersionTextRange()));
- }
- }
-
- protected String latestDocumentVersion() {
- return getJpaPlatform().getMostRecentSupportedResourceType(
- JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE).getVersion();
- }
-
- /**
- * extraneous persistence units can be
- * accessed through the XmlPersistence resource object
- */
- protected void checkForMultiplePersistenceUnits(List<IMessage> messages) {
- if (this.xmlPersistence.getPersistenceUnits().size() > 1) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- JpaValidationMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS,
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
-
- protected void validatePersistenceUnit(List<IMessage> messages, IReporter reporter) {
- if (this.persistenceUnit == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- this.persistenceUnit.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnit.java
deleted file mode 100644
index f64d46c892..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnit.java
+++ /dev/null
@@ -1,25 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-
-/**
- * generic persistence-unit
- */
-public class GenericPersistenceUnit
- extends AbstractPersistenceUnit
-{
- public GenericPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- super(parent, xmlPersistenceUnit);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnitProperty.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnitProperty.java
deleted file mode 100644
index b5f4aa822c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceUnitProperty.java
+++ /dev/null
@@ -1,104 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNode;
-import org.eclipse.jpt.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Straightforward implementation of the persistence unit property.
- * Notifies the persistence unit of any changes to the property.
- */
-public class GenericPersistenceUnitProperty
- extends AbstractPersistenceXmlContextNode
- implements PersistenceUnit.Property
-{
- protected final XmlProperty xmlProperty;
- protected String name;
- protected String value;
-
-
- public GenericPersistenceUnitProperty(PersistenceUnit parent, XmlProperty xmlProperty) {
- super(parent);
- this.xmlProperty = xmlProperty;
- this.name = xmlProperty.getName();
- this.value = xmlProperty.getValue();
- }
-
- @Override
- public PersistenceUnit getParent() {
- return (PersistenceUnit) super.getParent();
- }
-
- public XmlProperty getXmlProperty() {
- return this.xmlProperty;
- }
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- String old = this.name;
- this.name = name;
- if (attributeValueHasChanged(old, name)) {
- this.xmlProperty.setName(name);
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- getParent().propertyNameChanged(old, this.name, this.value);
- }
- }
-
-
- // ********** value **********
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- String old = this.value;
- this.value = value;
- if (attributeValueHasChanged(old, value)) {
- this.xmlProperty.setValue(value);
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- getParent().propertyValueChanged(this.name, value);
- }
- }
-
-
- // ********** updating **********
-
- public void update() {
- this.setName(this.xmlProperty.getName());
- this.setValue(this.xmlProperty.getValue());
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- return this.xmlProperty.getValidationTextRange();
- }
-
-
- // ********** misc **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- sb.append(" = "); //$NON-NLS-1$
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXml.java
deleted file mode 100644
index 80d40f7bcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXml.java
+++ /dev/null
@@ -1,228 +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.core.internal.jpa1.context.persistence;
-
-import java.util.List;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.persistence.Persistence2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceXml2_0;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * context model persistence.xml
- */
-public class GenericPersistenceXml
- extends AbstractPersistenceXmlContextNode
- implements PersistenceXml2_0
-{
- /**
- * If the XML resource's content type changes a new instance of this object will be built
- */
- protected JpaXmlResource xmlResource; // never null
-
- /**
- * The resouce type will only change if the XML file's version changes
- * (since, if the content type changes, we get garbage-collected).
- */
- protected JpaResourceType resourceType;
-
- protected Persistence persistence;
-
-
- public GenericPersistenceXml(JpaRootContextNode parent, JpaXmlResource resource) {
- super(parent);
- if ( ! resource.getContentType().isKindOf(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- throw new IllegalArgumentException("Resource " + resource + " must have persistence xml content type"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- this.xmlResource = resource;
- if (resource.getRootObject() != null) {
- this.persistence = this.buildPersistence((XmlPersistence) resource.getRootObject());
- this.resourceType = resource.getResourceType();
- }
- }
-
-
- // ********** XmlFile implementation **********
-
- public JpaXmlResource getXmlResource() {
- return this.xmlResource;
- }
-
-
- // ********** AbstractJpaNode overrides **********
-
- @Override
- public IResource getResource() {
- return this.xmlResource.getFile();
- }
-
-
- // ********** AbstractJpaContextNode overrides **********
-
- @Override
- public JpaResourceType getResourceType() {
- return this.xmlResource.getResourceType();
- }
-
-
- // ********** persistence **********
-
- public Persistence getPersistence() {
- return this.persistence;
- }
-
- protected void setPersistence(Persistence persistence) {
- Persistence old = this.persistence;
- this.persistence = persistence;
- this.firePropertyChanged(PERSISTENCE_PROPERTY, old, persistence);
- }
-
- protected Persistence buildPersistence(XmlPersistence xmlPersistence) {
- return this.getContextNodeFactory().buildPersistence(this, xmlPersistence);
- }
-
-
- // ********** metamodel **********
-
- public void initializeMetamodel() {
- if (this.persistence != null) {
- ((Persistence2_0) this.persistence).initializeMetamodel();
- }
- }
-
- public void synchronizeMetamodel() {
- if (this.persistence != null) {
- ((Persistence2_0) this.persistence).synchronizeMetamodel();
- }
- }
-
- public void disposeMetamodel() {
- if (this.persistence != null) {
- ((Persistence2_0) this.persistence).disposeMetamodel();
- }
- }
-
-
- // ********** updating **********
-
- public void update() {
- XmlPersistence oldXmlPersistence = (this.persistence == null) ? null : this.persistence.getXmlPersistence();
- XmlPersistence newXmlPersistence = (XmlPersistence) this.xmlResource.getRootObject();
- JpaResourceType newResourceType = this.xmlResource.getResourceType();
-
- // if the old and new xml persistences are different instances,
- // we scrap the old and rebuild. this can happen when the resource
- // model drastically changes, such as a cvs checkout or an edit reversion
- if ((oldXmlPersistence != newXmlPersistence)
- || (newXmlPersistence == null)
- || this.valuesAreDifferent(this.resourceType, newResourceType)) {
-
- if (this.persistence != null) {
- getJpaFile().removeRootStructureNode(this.xmlResource);
- this.persistence.dispose();
- setPersistence(null);
- }
- }
-
- this.resourceType = newResourceType;
-
- if (newXmlPersistence != null) {
- if (this.persistence != null) {
- this.persistence.update(newXmlPersistence);
- }
- else {
- setPersistence(buildPersistence(newXmlPersistence));
- }
-
- this.getJpaFile().addRootStructureNode(this.xmlResource, this.persistence);
- }
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.persistence != null) {
- this.persistence.postUpdate();
- }
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public String getId() {
- // isn't actually displayed, so needs no details page
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- if (this.persistence.containsOffset(textOffset)) {
- return this.persistence.getStructureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange getSelectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public void dispose() {
- if (this.persistence != null) {
- this.persistence.dispose();
- }
- JpaFile jpaFile = getJpaFile();
- if (jpaFile != null) {
- jpaFile.removeRootStructureNode(this.xmlResource);
- }
- }
-
- protected JpaFile getJpaFile() {
- return this.getJpaFile(this.xmlResource.getFile());
- }
-
-
- // ********** validation **********
-
- // never actually selected
- public TextRange getValidationTextRange() {
- return TextRange.Empty.instance();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-
- if (this.persistence == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT,
- this
- )
- );
- return;
- }
-
- this.persistence.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXmlDefinition.java
deleted file mode 100644
index 1a79b2c05e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/GenericPersistenceXmlDefinition.java
+++ /dev/null
@@ -1,57 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.persistence.GenericPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-
-public class GenericPersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE =
- new GenericPersistenceXmlDefinition();
-
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private GenericPersistenceXmlDefinition() {
- super();
- }
-
-
- public EFactory getResourceNodeFactory() {
- return PersistenceFactory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new GenericPersistenceXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/ImpliedMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/ImpliedMappingFileRef.java
deleted file mode 100644
index b7c93efffa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/persistence/ImpliedMappingFileRef.java
+++ /dev/null
@@ -1,68 +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.core.internal.jpa1.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Used by the persistence unit for the
- * <code>META-INF/orm.xml</code> file when it is not explicitly listed
- * in the <code>persistence.xml</code> file.
- */
-public class ImpliedMappingFileRef
- extends AbstractMappingFileRef
-{
-
- // ********** construction/initialization **********
-
- public ImpliedMappingFileRef(PersistenceUnit parent, String resourceFileName) {
- super(parent, resourceFileName);
- }
-
-
- // ********** MappingFileRef implementation **********
-
- public boolean isImplied() {
- return true;
- }
-
- public void setFileName(String fileName) {
- throw new UnsupportedOperationException("Cannot set an implied mapping file ref's 'fileName': " + fileName); //$NON-NLS-1$
- }
-
- public boolean containsOffset(int textOffset) {
- return false;
- }
-
- public void update(XmlMappingFileRef mappingFileRef) {
- if (mappingFileRef != null) {
- throw new IllegalArgumentException("an implied mapping file ref's xml mapping file ref must be null: " + mappingFileRef); //$NON-NLS-1$
- }
- this.update();
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public TextRange getSelectionTextRange() {
- return null;
- }
-
-
- // ********** XmlContextNode implementation **********
-
- public TextRange getValidationTextRange() {
- return this.getPersistenceUnit().getValidationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverride1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverride1_0Annotation.java
deleted file mode 100644
index 2837174908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverride1_0Annotation.java
+++ /dev/null
@@ -1,27 +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.core.internal.jpa1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class BinaryAssociationOverride1_0Annotation
- extends BinaryAssociationOverrideAnnotation
-{
-
- public BinaryAssociationOverride1_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverrides1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverrides1_0Annotation.java
deleted file mode 100644
index 6648edb213..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryAssociationOverrides1_0Annotation.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.core.internal.jpa1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class BinaryAssociationOverrides1_0Annotation
- extends BinaryAssociationOverridesAnnotation
-{
-
- public BinaryAssociationOverrides1_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- protected NestableAssociationOverrideAnnotation buildAssociationOverride(Object jdtAssociationOverride) {
- return new BinaryAssociationOverride1_0Annotation(this, (IAnnotation) jdtAssociationOverride);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQueries1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQueries1_0Annotation.java
deleted file mode 100644
index 5d6435121f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQueries1_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.jpa1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class BinaryNamedQueries1_0Annotation
- extends BinaryNamedQueriesAnnotation
-{
- public BinaryNamedQueries1_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- protected NamedQueryAnnotation buildNamedQuery(Object jdtQuery) {
- return new BinaryNamedQuery1_0Annotation(this, (IAnnotation) jdtQuery);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQuery1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQuery1_0Annotation.java
deleted file mode 100644
index 3ddb0353c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinaryNamedQuery1_0Annotation.java
+++ /dev/null
@@ -1,27 +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.core.internal.jpa1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.NamedQuery
- */
-public final class BinaryNamedQuery1_0Annotation
- extends BinaryNamedQueryAnnotation
-{
-
- public BinaryNamedQuery1_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinarySequenceGenerator1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinarySequenceGenerator1_0Annotation.java
deleted file mode 100644
index 573dfee8ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/binary/BinarySequenceGenerator1_0Annotation.java
+++ /dev/null
@@ -1,27 +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.core.internal.jpa1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinarySequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public final class BinarySequenceGenerator1_0Annotation
- extends BinarySequenceGeneratorAnnotation
-{
-
- public BinarySequenceGenerator1_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java
deleted file mode 100644
index 617747551f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverride1_0Annotation.java
+++ /dev/null
@@ -1,53 +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.core.internal.jpa1.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class SourceAssociationOverride1_0Annotation
- extends SourceAssociationOverrideAnnotation
-{
-
- // ********** construction/initialization **********
-
- public SourceAssociationOverride1_0Annotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- // ********** static methods **********
-
- public static SourceAssociationOverride1_0Annotation buildAssociationOverride(JavaResourceNode parent, Member member) {
- return new SourceAssociationOverride1_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceAssociationOverride1_0Annotation buildNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourceAssociationOverride1_0Annotation(parent, member, idaa, annotationAdapter);
- }
-
- protected static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ASSOCIATION_OVERRIDE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.java
deleted file mode 100644
index 44bf07b668..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceAssociationOverrides1_0Annotation.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.core.internal.jpa1.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class SourceAssociationOverrides1_0Annotation
- extends SourceAssociationOverridesAnnotation
-{
-
- public SourceAssociationOverrides1_0Annotation(JavaResourceNode parent, Member member) {
- super(parent, member);
- }
-
- @Override
- protected NestableAssociationOverrideAnnotation buildAssociationOverride(int index) {
- return SourceAssociationOverride1_0Annotation.buildNestedAssociationOverride(this, this.member, index, this.daa);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceNamedQuery1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceNamedQuery1_0Annotation.java
deleted file mode 100644
index 6e1de34158..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceNamedQuery1_0Annotation.java
+++ /dev/null
@@ -1,33 +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.core.internal.jpa1.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQuery
- */
-public final class SourceNamedQuery1_0Annotation
- extends SourceNamedQueryAnnotation
-{
-
- // ********** constructors **********
- public SourceNamedQuery1_0Annotation(JavaResourceNode parent, Type type) {
- super(parent, type);
- }
-
- public SourceNamedQuery1_0Annotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceSequenceGenerator1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceSequenceGenerator1_0Annotation.java
deleted file mode 100644
index 27ac7f42a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/resource/java/source/SourceSequenceGenerator1_0Annotation.java
+++ /dev/null
@@ -1,27 +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.core.internal.jpa1.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceSequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public final class SourceSequenceGenerator1_0Annotation
- extends SourceSequenceGeneratorAnnotation
-{
-
- public SourceSequenceGenerator1_0Annotation(JavaResourceNode parent, Member member) {
- super(parent, member);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 69240f1d5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,176 +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.core.internal.jpa2;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.AbstractJpaAnnotationDefintionProvider;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.Access2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.AssociationOverride2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.AssociationOverrides2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.Cacheable2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.CollectionTable2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.ElementCollection2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyClass2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyColumn2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyEnumerated2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyJoinColumn2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyJoinColumns2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapKeyTemporal2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.MapsId2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.NamedQueries2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.NamedQuery2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.OrderColumn2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.SequenceGenerator2_0AnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverrideAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.AttributeOverridesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.BasicAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.DiscriminatorValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EmbeddedIdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EntityAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.EnumeratedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.GeneratedValueAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.IdClassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.InheritanceAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.JoinTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.LobAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.ManyToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MapKeyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.MappedSuperclassAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueriesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.NamedNativeQueryAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToManyAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OneToOneAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.OrderByAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.PrimaryKeyJoinColumnsAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.SecondaryTablesAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TableGeneratorAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TemporalAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.TransientAnnotationDefinition;
-import org.eclipse.jpt.core.internal.resource.java.VersionAnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-
-/**
- * Support for existing JPA 1.0 annotations, new JPA 2.0 annotations, and
- * augmented support for annotations changed from 1.0 to 2.0
- */
-public class Generic2_0JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE =
- new Generic2_0JpaAnnotationDefinitionProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private Generic2_0JpaAnnotationDefinitionProvider() {
- super();
- }
-
-
- @Override
- protected void addTypeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(Access2_0AnnotationDefinition.instance());
- definitions.add(AssociationOverride2_0AnnotationDefinition.instance());
- definitions.add(AssociationOverrides2_0AnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(Cacheable2_0AnnotationDefinition.instance());
- definitions.add(DiscriminatorColumnAnnotationDefinition.instance());
- definitions.add(DiscriminatorValueAnnotationDefinition.instance());
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(IdClassAnnotationDefinition.instance());
- definitions.add(InheritanceAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- definitions.add(NamedQuery2_0AnnotationDefinition.instance());
- definitions.add(NamedQueries2_0AnnotationDefinition.instance());
- definitions.add(NamedNativeQueryAnnotationDefinition.instance());
- definitions.add(NamedNativeQueriesAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SecondaryTableAnnotationDefinition.instance());
- definitions.add(SecondaryTablesAnnotationDefinition.instance());
- definitions.add(SequenceGenerator2_0AnnotationDefinition.instance());
- definitions.add(TableAnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- }
-
- @Override
- protected void addTypeMappingAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EmbeddableAnnotationDefinition.instance());
- definitions.add(EntityAnnotationDefinition.instance());
- definitions.add(MappedSuperclassAnnotationDefinition.instance());
- }
-
- @Override
- protected void addAttributeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(Access2_0AnnotationDefinition.instance());
- definitions.add(AssociationOverride2_0AnnotationDefinition.instance());
- definitions.add(AssociationOverrides2_0AnnotationDefinition.instance());
- definitions.add(AttributeOverrideAnnotationDefinition.instance());
- definitions.add(AttributeOverridesAnnotationDefinition.instance());
- definitions.add(BasicAnnotationDefinition.instance());
- definitions.add(CollectionTable2_0AnnotationDefinition.instance());
- definitions.add(ColumnAnnotationDefinition.instance());
- definitions.add(ElementCollection2_0AnnotationDefinition.instance());
- definitions.add(EmbeddedAnnotationDefinition.instance());
- definitions.add(EmbeddedIdAnnotationDefinition.instance());
- definitions.add(EnumeratedAnnotationDefinition.instance());
- definitions.add(GeneratedValueAnnotationDefinition.instance());
- definitions.add(IdAnnotationDefinition.instance());
- definitions.add(JoinColumnAnnotationDefinition.instance());
- definitions.add(JoinColumnsAnnotationDefinition.instance());
- definitions.add(JoinTableAnnotationDefinition.instance());
- definitions.add(LobAnnotationDefinition.instance());
- definitions.add(ManyToManyAnnotationDefinition.instance());
- definitions.add(ManyToOneAnnotationDefinition.instance());
- definitions.add(MapsId2_0AnnotationDefinition.instance());
- definitions.add(MapKeyAnnotationDefinition.instance());
- definitions.add(MapKeyClass2_0AnnotationDefinition.instance());
- definitions.add(MapKeyColumn2_0AnnotationDefinition.instance());
- definitions.add(MapKeyEnumerated2_0AnnotationDefinition.instance());
- definitions.add(MapKeyJoinColumn2_0AnnotationDefinition.instance());
- definitions.add(MapKeyJoinColumns2_0AnnotationDefinition.instance());
- definitions.add(MapKeyTemporal2_0AnnotationDefinition.instance());
- definitions.add(OneToManyAnnotationDefinition.instance());
- definitions.add(OneToOneAnnotationDefinition.instance());
- definitions.add(OrderByAnnotationDefinition.instance());
- definitions.add(OrderColumn2_0AnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnAnnotationDefinition.instance());
- definitions.add(PrimaryKeyJoinColumnsAnnotationDefinition.instance());
- definitions.add(SequenceGenerator2_0AnnotationDefinition.instance());
- definitions.add(TableGeneratorAnnotationDefinition.instance());
- definitions.add(TemporalAnnotationDefinition.instance());
- definitions.add(TransientAnnotationDefinition.instance());
- definitions.add(VersionAnnotationDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformFactory.java
deleted file mode 100644
index ac34884075..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformFactory.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.core.internal.jpa2;
-
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class Generic2_0JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public Generic2_0JpaPlatformFactory() {
- super();
- }
-
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- this.buildJpaVersion(),
- new GenericJpaFactory2_0(),
- new GenericJpaAnnotationProvider(Generic2_0JpaAnnotationDefinitionProvider.instance()),
- Generic2_0JpaPlatformProvider.instance(),
- this.buildJpaPlatformVariation());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new SimpleVersion(JptCorePlugin.JPA_FACET_VERSION_2_0);
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- //table_per_class inheritance support is optional in the 2.0 spec
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.MAYBE;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformProvider.java
deleted file mode 100644
index 6247e02782..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/Generic2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,156 +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.core.internal.jpa2;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.JavaIdMappingDefinition2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
-import org.eclipse.jpt.core.internal.jpa2.context.persistence.Generic2_0PersistenceXmlDefinition;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class Generic2_0JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "generic2_0"; //$NON-NLS-1$
-
-
- // singleton
- private static final JpaPlatformProvider INSTANCE =
- new Generic2_0JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private Generic2_0JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_2_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()};
- }
-
-
- // ********** Java type mappings **********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (eclipselink) uses
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********** Java attribute mappings **********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (eclipselink) uses
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (eclipselink) uses
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaElementCollectionMappingDefinition2_0.instance(),
- JavaIdMappingDefinition2_0.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaOneToManyMappingDefinition.instance(),
- JavaOneToOneMappingDefinition.instance()};
- }
-
-
- // ********** Mapping Files **********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- return new ResourceDefinition[] {
- GenericPersistenceXmlDefinition.instance(),
- Generic2_0PersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- GenericOrmXml2_0Definition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java
deleted file mode 100644
index 726704938b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java
+++ /dev/null
@@ -1,80 +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.core.internal.jpa2;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-
-/**
- * Conversions are determined by the <code>delimited-identifiers</code>
- * flag in <code>orm.xml</code>.
- * <p>
- * Assume we are in a JPA 2.0-compatible project.
- */
-public class GenericJpaDatabaseIdentifierAdapter
- implements DatabaseIdentifierAdapter
-{
- private final JpaDataSource dataSource;
-
- public GenericJpaDatabaseIdentifierAdapter(JpaDataSource dataSource) {
- super();
- this.dataSource = dataSource;
- }
-
- /**
- * If the flag is set, "identifiers" are treated as "names".
- */
- public String convertIdentifierToName(String identifier, DefaultCallback defaultCallback) {
- return this.getDefaultDelimitedIdentifiers() ? identifier : defaultCallback.convertIdentifierToName(identifier);
- }
-
- /**
- * If the flag is set, "names" are treated as "identifiers".
- */
- public String convertNameToIdentifier(String name, DefaultCallback defaultCallback) {
- return this.getDefaultDelimitedIdentifiers() ? name : defaultCallback.convertNameToIdentifier(name);
- }
-
- protected boolean getDefaultDelimitedIdentifiers() {
- PersistenceUnit2_0 pu = this.getPersistenceUnit();
- return (pu != null) && pu.getDefaultDelimitedIdentifiers();
- }
-
- protected PersistenceUnit2_0 getPersistenceUnit() {
- Persistence p = this.getPersistence();
- if (p == null) {
- return null;
- }
- Iterator<PersistenceUnit> units = this.getPersistence().persistenceUnits();
- return (PersistenceUnit2_0) (units.hasNext() ? units.next() : null);
- }
-
- protected Persistence getPersistence() {
- PersistenceXml pxml = this.getPersistenceXml();
- return (pxml == null) ? null : pxml.getPersistence();
- }
-
- protected PersistenceXml getPersistenceXml() {
- // TODO this null check can be removed if the data source is moved to the persistence unit;
- // the root context node can be null during construction;
- // this shouldn't be a problem since the default-delimiters flag
- // is recalculated during the initial, post-project construction, "update"
- JpaRootContextNode rcn = this.dataSource.getJpaProject().getRootContextNode();
- return (rcn == null) ? null : rcn.getPersistenceXml();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java
deleted file mode 100644
index 32c814c96c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaFactory2_0.java
+++ /dev/null
@@ -1,190 +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.core.internal.jpa2;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaProject.Config;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn.Owner;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaColumn;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaCacheable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaCollectionTable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaEmbeddable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.VirtualAssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-
-/**
- * Central class that allows extenders to easily replace implementations of
- * various Dali interfaces.
- */
-public class GenericJpaFactory2_0
- extends AbstractJpaFactory
-{
-
- public GenericJpaFactory2_0() {
- super();
- }
-
- // ********** Core Model **********
-
- @Override
- public JpaProject 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);
- }
-
- @Override
- public MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType) {
- return new GenericMetamodelSynchronizer(sourceType);
- }
-
-
- // ********** Java Context Model **********
-
- @Override
- public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourcePersistentType jrpt) {
- return new GenericJavaPersistentType2_0(owner, jrpt);
- }
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
- return new GenericJavaPersistentAttribute2_0(parent, jrpa);
- }
-
- @Override
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
- return new GenericJavaEmbeddable2_0(parent);
- }
-
- @Override
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
- return new GenericJavaSequenceGenerator2_0(parent);
- }
-
- //The 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- @Override
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner) {
- return new GenericJavaAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public JavaAssociationOverrideRelationshipReference buildJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent) {
- return new GenericJavaAssociationOverrideRelationshipReference2_0(parent);
- }
-
- @Override
- public AssociationOverrideAnnotation buildJavaVirtualAssociationOverrideAnnotation(JavaResourcePersistentMember jrpm, String name, JoiningStrategy joiningStrategy) {
- return new VirtualAssociationOverride2_0Annotation(jrpm, name, joiningStrategy);
- }
-
- @Override
- public JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent) {
- return new GenericJavaDerivedIdentity2_0(parent);
- }
-
- @Override
- public JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- return new GenericJavaElementCollectionMapping2_0(parent);
- }
-
- @Override
- public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
- return new GenericJavaCacheable2_0(parent);
- }
-
- @Override
- public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
- return new GenericJavaOrphanRemoval2_0(parent);
- }
-
- @Override
- public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedQuery2_0(parent);
- }
-
- @Override
- public JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent) {
- return new GenericJavaCollectionTable2_0(parent);
- }
-
- @Override
- public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
- return new GenericJavaOrderColumn2_0(parent, owner);
- }
-
- @Override
- public JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- @Override
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaManyToOneMapping2_0(parent);
- }
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToManyMapping2_0(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new GenericJavaOneToOneMapping2_0(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericMetamodelSynchronizer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericMetamodelSynchronizer.java
deleted file mode 100644
index 8dc8d64205..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericMetamodelSynchronizer.java
+++ /dev/null
@@ -1,432 +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.core.internal.jpa2;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.core.jpa2.context.AttributeMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.core.utility.BodySourceWriter;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-import com.ibm.icu.text.DateFormat;
-import com.ibm.icu.text.SimpleDateFormat;
-
-/**
- * For now, the "synchronization" is simple brute-force: we generate the source
- * code and then compare it with what is already present in the file.
- * If the new source is different, we replace the file contents; otherwise, we
- * leave the file unchanged.
- */
-@SuppressWarnings("nls")
-public class GenericMetamodelSynchronizer
- implements MetamodelSourceType.Synchronizer
-{
- protected final MetamodelSourceType sourceType;
-
-
- public GenericMetamodelSynchronizer(MetamodelSourceType sourceType) {
- super();
- this.sourceType = sourceType;
- }
-
- public IFile getFile() {
- return (IFile) this.getPackageFragment().getCompilationUnit(this.getFileName()).getResource();
- }
-
-
- // ********** synchronize **********
-
- public void synchronize(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- try {
- this.synchronize_(memberTypeTree);
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- }
- }
-
- protected void synchronize_(Map<String, Collection<MetamodelSourceType>> memberTypeTree) throws JavaModelException {
- IPackageFragment pkg = this.getPackageFragment();
- String fileName = this.getFileName();
-
- ICompilationUnit compilationUnit = pkg.getCompilationUnit(fileName);
- if (compilationUnit.exists()) {
- // overwrite existing file if it has changed (ignoring the timestamp)
- String newSource = this.buildSource(compilationUnit, memberTypeTree);
- if (newSource != null) {
- pkg.createCompilationUnit(fileName, newSource, true, null); // true=force
- }
- } else {
- // write a new file, creating the package folders if necessary
- if ( ! pkg.exists()) {
- this.getSourceFolder().createPackageFragment(pkg.getElementName(), true, null); // true=force
- }
- pkg.createCompilationUnit(fileName, this.buildSource(memberTypeTree), false, null); // false=no force
- }
- }
-
- /**
- * pre-condition: the compilation unit exists
- *
- * return null if the old source is not to be replaced
- */
- protected String buildSource(ICompilationUnit compilationUnit, Map<String, Collection<MetamodelSourceType>> memberTypeTree) throws JavaModelException {
- IFile file = (IFile) compilationUnit.getResource();
- JavaResourcePersistentType2_0 genType = this.getJpaProject().getGeneratedMetamodelTopLevelType(file);
- if (genType == null) {
- return null; // the file exists, but its source is not a generated metamodel top-level class
- }
-
- String oldSource = compilationUnit.getSource();
- int oldLength = oldSource.length();
-
- String newSource = this.buildSource(memberTypeTree);
- int newLength = newSource.length();
- if (newLength != oldLength) {
- return newSource;
- }
-
- String date = genType.getGeneratedAnnotation().getDate(); // if we get here, this will be non-empty
- int dateBegin = oldSource.indexOf(date);
- if (dateBegin == -1) {
- return null; // hmmm...
- }
- int dateEnd = dateBegin + date.length();
- if (dateEnd > oldLength) {
- return null; // hmmm...
- }
-
- if (newSource.regionMatches(0, oldSource, 0, dateBegin) &&
- newSource.regionMatches(dateEnd, oldSource, dateEnd, oldLength - dateEnd)) {
- return null;
- }
- return newSource;
- }
-
-
- // ********** package/file **********
-
- protected IPackageFragment getPackageFragment() {
- return this.getSourceFolder().getPackageFragment(this.getPackageName());
- }
-
- protected IPackageFragmentRoot getSourceFolder() {
- return this.getJpaProject().getMetamodelPackageFragmentRoot();
- }
-
- protected JpaProject2_0 getJpaProject() {
- return (JpaProject2_0) this.sourceType.getJpaProject();
- }
-
- protected String getPackageName() {
- return this.buildPackageName(this.sourceType.getName());
- }
-
- protected String buildPackageName(String topLevelSourceTypeName) {
- return this.buildPackageName_(ClassName.getPackageName(topLevelSourceTypeName));
- }
-
- // TODO
- protected String buildPackageName_(String sourcePackageName) {
- // the default is to store the metamodel class in the same package as the source type
- return sourcePackageName;
- }
-
- protected String getFileName() {
- return ClassName.getSimpleName(this.getClassName()) + ".java";
- }
-
- protected String getClassName() {
- return this.buildClassName(this.sourceType.getName());
- }
-
- protected String buildClassName(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- return this.buildClassName(this.sourceType.getName(), memberTypeTree);
- }
-
- protected String buildClassName(String sourceTypeName, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- String current = sourceTypeName;
- SimpleStack<String> stack = new SimpleStack<String>();
-
- while (true) {
- stack.push(ClassName.getSimpleName(current));
- String declaringTypeName = this.getDeclaringTypeName(current, memberTypeTree);
- if (declaringTypeName == null) {
- break;
- }
- current = declaringTypeName;
- }
-
- StringBuilder sb = new StringBuilder(sourceTypeName.length() + 10);
- sb.append(this.buildPackageName(current));
- while ( ! stack.isEmpty()) {
- sb.append('.');
- sb.append(this.buildSimpleClassName(stack.pop()));
- }
- return sb.toString();
- }
-
- protected String buildClassName(String topLevelSourceTypeName) {
- return this.buildPackageName(topLevelSourceTypeName) + '.' + this.buildSimpleClassName(ClassName.getSimpleName(topLevelSourceTypeName));
- }
-
- protected String getSimpleClassName() {
- return this.buildSimpleClassName(ClassName.getSimpleName(this.sourceType.getName()));
- }
-
- // TODO
- protected String buildSimpleClassName(String simpleSourceTypeName) {
- // the default is to simply append an underscore to the source type name
- return simpleSourceTypeName + '_';
- }
-
-
- // ********** source code **********
-
- /**
- * build the "body" source first; then build the "package" and "imports" source
- * and concatenate the "body" source to it
- */
- protected String buildSource(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- // build the body source first so we can gather up the import statements
- BodySourceWriter bodySourceWriter = this.buildBodySourceWriter(memberTypeTree);
-
- StringWriter sw = new StringWriter(bodySourceWriter.getLength() + 2000);
- PrintWriter pw = new PrintWriter(sw);
- this.printPackageAndImportsOn(pw, bodySourceWriter);
- pw.print(bodySourceWriter.getSource());
- return sw.toString();
- }
-
- protected BodySourceWriter buildBodySourceWriter(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- BodySourceWriter pw = new BodySourceWriter(this.getPackageName(), this.getClassName());
- this.printBodySourceOn(pw, memberTypeTree);
- return pw;
- }
-
- public void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- this.printClassDeclarationOn(pw, memberTypeTree);
- pw.print(" {");
- pw.println();
-
- pw.indent();
- boolean attributesPrinted = this.printAttributesOn(pw);
- this.printMemberTypesOn(pw, memberTypeTree, attributesPrinted);
- pw.undent();
-
- pw.print('}');
- pw.println(); // EOF
- }
-
-
- // ********** class declaration **********
-
- protected void printClassDeclarationOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- boolean topLevel = this.sourceTypeIsTopLevel(memberTypeTree);
- if (topLevel) {
- this.printGeneratedAnnotationOn(pw);
- }
- if (this.sourceType.isManaged()) {
- this.printStaticMetamodelAnnotationOn(pw);
- }
-
- pw.print("public ");
- if ( ! topLevel) {
- pw.print("static ");
- }
- pw.print("class ");
- pw.print(this.getSimpleClassName()); // this is always the simple name
- PersistentType superPersistentType = this.sourceType.getSuperPersistentType();
- if (superPersistentType != null) {
- pw.print(" extends ");
- pw.printTypeDeclaration(this.buildClassName(superPersistentType.getName(), memberTypeTree));
- }
- }
-
- /**
- * Return whether the source type is a top level type.
- * This can be inferred from the specified member type tree.
- */
- protected boolean sourceTypeIsTopLevel(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- return this.sourceTypeIsTopLevel(this.sourceType.getName(), memberTypeTree);
- }
-
- /**
- * Return whether the specified source type is a top level type.
- * This can be inferred from the specified member type tree.
- */
- protected boolean sourceTypeIsTopLevel(String sourceTypeName, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- return this.getDeclaringTypeName(sourceTypeName, memberTypeTree) == null;
- }
-
- /**
- * Return the name of the specified source type's declaring type, as
- * implied by the specified member type tree. Return null if the source
- * type is a top-level type.
- */
- protected String getDeclaringTypeName(String sourceTypeName, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- int lastPeriod = sourceTypeName.lastIndexOf('.');
- if (lastPeriod == -1) {
- return null; // default package top-level type
- }
- String declaringTypeName = sourceTypeName.substring(0, lastPeriod);
- return (memberTypeTree.get(declaringTypeName) == null) ? null : declaringTypeName;
- }
-
- protected void printGeneratedAnnotationOn(BodySourceWriter pw) {
- pw.printAnnotation("javax.annotation.Generated");
- pw.print('(');
- pw.print("value=");
- pw.printStringLiteral(JavaResourcePersistentType2_0.METAMODEL_GENERATED_ANNOTATION_VALUE);
- pw.print(", ");
- pw.print("date=");
- pw.printStringLiteral(format(new Date()));
- pw.print(')');
- pw.println();
- }
-
- protected void printStaticMetamodelAnnotationOn(BodySourceWriter pw) {
- pw.printAnnotation(JPA2_0.STATIC_METAMODEL);
- pw.print('(');
- pw.printTypeDeclaration(this.sourceType.getName());
- pw.print(".class");
- pw.print(')');
- pw.println();
- }
-
- /**
- * {@link SimpleDateFormat} is not thread-safe.
- */
- protected static synchronized String format(Date date) {
- return DATE_FORMAT.format(date);
- }
- /**
- * Recommended date format is ISO 8601.
- * @see javax.annotation.Generated
- */
- private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
-
-
- // ********** attributes **********
-
- /**
- * Return whether any attributes were printed.
- */
- protected boolean printAttributesOn(BodySourceWriter pw) {
- boolean printed = false;
- for (Iterator<PersistentAttribute> stream = this.sourceType.attributes(); stream.hasNext(); ) {
- this.printAttributeOn(stream.next(), pw);
- printed = true;
- }
- return printed;
- }
-
- protected void printAttributeOn(PersistentAttribute persistentAttribute, BodySourceWriter pw) {
- AttributeMapping attributeMapping = persistentAttribute.getMapping();
- if (attributeMapping != null) { // probably shouldn't be null?
- this.printAttributeMappingOn(attributeMapping, pw);
- }
- }
-
- protected void printAttributeMappingOn(AttributeMapping attributeMapping, BodySourceWriter pw) {
- MetamodelField field = ((AttributeMapping2_0) attributeMapping).getMetamodelField();
- if (field != null) {
- this.printFieldOn(field, pw);
- }
- }
-
- protected void printFieldOn(MetamodelField field, BodySourceWriter pw) {
- for (String modifier : field.getModifiers()) {
- pw.print(modifier);
- pw.print(' ');
- }
- pw.printTypeDeclaration(field.getTypeName());
- pw.print('<');
- for (Iterator<String> stream = field.getTypeArgumentNames().iterator(); stream.hasNext(); ) {
- pw.printTypeDeclaration(stream.next());
- if (stream.hasNext()) {
- pw.print(", ");
- }
- }
- pw.print('>');
- pw.print(' ');
- pw.print(field.getName());
- pw.print(';');
- pw.println();
- }
-
-
- // ********** member types **********
-
- protected void printMemberTypesOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree, boolean attributesPrinted) {
- Collection<MetamodelSourceType> memberTypes = memberTypeTree.get(this.sourceType.getName());
- if (memberTypes != null) {
- if (attributesPrinted) {
- pw.println();
- }
- for (Iterator<MetamodelSourceType> stream = memberTypes.iterator(); stream.hasNext(); ) {
- stream.next().printBodySourceOn(pw, memberTypeTree);
- if (stream.hasNext()) {
- pw.println();
- }
- }
- }
- }
-
-
- // ********** package and imports **********
-
- protected void printPackageAndImportsOn(PrintWriter pw, BodySourceWriter bodySourceWriter) {
- if (this.getPackageName().length() != 0) {
- pw.print("package ");
- pw.print(this.getPackageName());
- pw.print(';');
- pw.println();
- pw.println();
- }
-
- for (String import_ : bodySourceWriter.getImports()) {
- pw.print("import ");
- pw.print(import_);
- pw.print(';');
- pw.println();
- }
- pw.println();
- }
-
-
- // ********** misc **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.sourceType.getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/SimpleMetamodelField.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/SimpleMetamodelField.java
deleted file mode 100644
index 4615c38895..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/SimpleMetamodelField.java
+++ /dev/null
@@ -1,107 +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.core.internal.jpa2.context;
-
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * Straightforward implementation.
- */
-public class SimpleMetamodelField
- implements MetamodelField
-{
- protected final Iterable<String> modifiers;
- protected final String typeName;
- protected final Iterable<String> typeArgumentNames;
- protected final String name;
-
- public SimpleMetamodelField(
- Iterable<String> modifiers,
- String typeName,
- Iterable<String> typeArgumentNames,
- String name
- ) {
- super();
- if (modifiers == null) {
- throw new NullPointerException();
- }
- if (typeName == null) {
- throw new NullPointerException();
- }
- if (typeArgumentNames == null) {
- throw new NullPointerException();
- }
- if (name == null) {
- throw new NullPointerException();
- }
- this.modifiers = modifiers;
- this.typeName = typeName;
- this.typeArgumentNames = typeArgumentNames;
- this.name = name;
- }
-
- public Iterable<String> getModifiers() {
- return this.modifiers;
- }
-
- public String getTypeName() {
- return this.typeName;
- }
-
- public Iterable<String> getTypeArgumentNames() {
- return this.typeArgumentNames;
- }
-
- public String getName() {
- return this.name;
- }
-
- @Override
- public int hashCode() {
- return CollectionTools.hashCode(this.modifiers) ^
- this.typeName.hashCode() ^
- CollectionTools.hashCode(this.typeArgumentNames) ^
- this.name.hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof MetamodelField)) {
- return false;
- }
- MetamodelField other = (MetamodelField) o;
- return CollectionTools.elementsAreEqual(this.getModifiers(), other.getModifiers()) &&
- this.getTypeName().equals(other.getTypeName()) &&
- CollectionTools.elementsAreEqual(this.getTypeArgumentNames(), other.getTypeArgumentNames()) &&
- this.getName().equals(other.getName());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- for (String modifier : this.modifiers) {
- sb.append(modifier);
- sb.append(' ');
- }
- sb.append(this.typeName);
- sb.append('<');
- for (String typeArgumentName : this.typeArgumentNames) {
- sb.append(typeArgumentName);
- sb.append(", "); //$NON-NLS-1$
- }
- sb.setLength(sb.length() - 2);
- sb.append('>');
- sb.append(' ');
- sb.append(this.name);
- return sb.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java
deleted file mode 100644
index 8736b45a3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,1684 +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.core.internal.jpa2.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractJavaElementCollectionMapping2_0
- extends AbstractJavaAttributeMapping<ElementCollection2_0Annotation>
- implements JavaElementCollectionMapping2_0
-{
- protected String specifiedTargetClass;
- protected String defaultTargetClass;
- protected String fullyQualifiedTargetClass;
- protected PersistentType resolvedTargetType;
- protected Embeddable resolvedTargetEmbeddable;
- protected Entity resolvedTargetEntity;
-
- protected FetchType specifiedFetch;
-
- protected final JavaOrderable2_0 orderable;
-
- protected final JavaCollectionTable2_0 collectionTable;
-
- protected Type valueType;
-
- protected final JavaColumn valueColumn;
-
- protected JavaConverter valueConverter;
-
- protected final JavaConverter nullConverter;
-
- protected final JavaAttributeOverrideContainer valueAttributeOverrideContainer;
-
- protected final JavaAssociationOverrideContainer valueAssociationOverrideContainer;
-
- protected Type keyType;
-
- //MapKey is not supported by the spec, so this is only for EclipseLink
- //In the generic case we can handle this with validation and not showing the UI widgets
- protected String specifiedMapKey;
- protected boolean noMapKey = false;
- protected boolean pkMapKey = false;
- protected boolean customMapKey = false;
-
- protected String specifiedMapKeyClass;
- protected String defaultMapKeyClass;
- protected String fullyQualifiedMapKeyClass;
- protected PersistentType resolvedMapKeyType;
- protected Embeddable resolvedMapKeyEmbeddable;
- protected Entity resolvedMapKeyEntity;
-
- protected final JavaColumn mapKeyColumn;
-
- protected final JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer;
-
- protected AbstractJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- this.orderable = getJpaFactory().buildJavaOrderable(this, buildOrderableOwner());
- this.collectionTable = getJpaFactory().buildJavaCollectionTable(this);
- this.valueColumn = getJpaFactory().buildJavaColumn(parent, new ValueColumnOwner());
- this.nullConverter = getJpaFactory().buildJavaNullConverter(this);
- this.valueConverter = this.nullConverter;
- this.valueAttributeOverrideContainer = this.getJpaFactory().buildJavaAttributeOverrideContainer(this, new ValueAttributeOverrideContainerOwner());
- this.valueAssociationOverrideContainer = this.getJpaFactory().buildJavaAssociationOverrideContainer(this, new ValueAssociationOverrideContainerOwner());
- this.mapKeyColumn = getJpaFactory().buildJavaMapKeyColumn(parent, new MapKeyColumnOwner());
- this.mapKeyAttributeOverrideContainer = this.getJpaFactory().buildJavaAttributeOverrideContainer(this, new MapKeyAttributeOverrideContainerOwner());
- }
-
- @Override
- protected JpaFactory2_0 getJpaFactory() {
- return (JpaFactory2_0) super.getJpaFactory();
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.specifiedFetch = this.getResourceFetch();
- this.orderable.initialize();
- this.defaultTargetClass = this.buildDefaultTargetClass();
- this.specifiedTargetClass = this.getResourceTargetClass();
- this.fullyQualifiedTargetClass = this.buildFullyQualifiedTargetClass();
- this.resolvedTargetType = this.buildResolvedTargetType();
- this.resolvedTargetEmbeddable = this.buildResolvedTargetEmbeddable();
- this.resolvedTargetEntity = this.buildResolvedTargetEntity();
- this.initializeCollectionTable();
- this.initializeValueType();
- this.initializeValueColumn();
- this.initializeValueConverter();
- this.valueAttributeOverrideContainer.initialize(getResourcePersistentAttribute());
- this.valueAssociationOverrideContainer.initialize(getResourcePersistentAttribute());
- this.defaultMapKeyClass = this.buildDefaultMapKeyClass();
- this.specifiedMapKeyClass = this.getResourceMapKeyClass();
- this.fullyQualifiedMapKeyClass = this.buildFullyQualifiedMapKeyClass();
- this.resolvedMapKeyType = this.buildResolvedMapKeyType();
- this.resolvedMapKeyEmbeddable = this.buildResolvedMapKeyEmbeddable();
- this.resolvedMapKeyEntity = this.buildResolvedMapKeyEntity();
- this.initializeKeyType();
- this.initializeMapKey();
- this.initializeMapKeyColumn();
- this.mapKeyAttributeOverrideContainer.initialize(getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.setSpecifiedFetch_(this.getResourceFetch());
- this.orderable.update();
- this.setDefaultTargetClass(this.buildDefaultTargetClass());
- this.setSpecifiedTargetClass_(this.getResourceTargetClass());
- this.setFullyQualifiedTargetClass(this.buildFullyQualifiedTargetClass());
- this.resolvedTargetType = this.buildResolvedTargetType();//no need for change notification, use resolved target embeddable change notification instead?
- this.setResolvedTargetEmbeddable(this.buildResolvedTargetEmbeddable());
- this.updateCollectionTable();
- this.updateValueType();
- this.updateValueColumn();
- this.updateValueConverter();
- this.valueAttributeOverrideContainer.update(getResourcePersistentAttribute());
- this.valueAssociationOverrideContainer.update(getResourcePersistentAttribute());
- this.setDefaultMapKeyClass(this.buildDefaultMapKeyClass());
- this.setSpecifiedMapKeyClass_(this.getResourceMapKeyClass());
- this.setFullyQualifiedMapKeyClass(this.buildFullyQualifiedMapKeyClass());
- this.resolvedMapKeyType = this.buildResolvedMapKeyType();//no need for change notification, use resolved target embeddable change notification instead?
- this.setResolvedMapKeyEmbeddable(this.buildResolvedMapKeyEmbeddable());
- this.setResolvedMapKeyEntity(this.buildResolvedMapKeyEntity());
- this.updateKeyType();
- this.updateMapKey();
- this.updateMapKeyColumn();
- this.mapKeyAttributeOverrideContainer.update(getResourcePersistentAttribute());
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- this.valueAssociationOverrideContainer.postUpdate();
- }
-
- public Entity getEntity() {
- return getTypeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY ? (Entity) getTypeMapping() : null;
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ElementCollection2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(JPA.ASSOCIATION_OVERRIDE);
- names.add(JPA.ASSOCIATION_OVERRIDES);
- names.add(JPA.ATTRIBUTE_OVERRIDE);
- names.add(JPA.ATTRIBUTE_OVERRIDES);
- names.add(JPA2_0.COLLECTION_TABLE);
- names.add(JPA.COLUMN);
- names.add(JPA.ENUMERATED);
- names.add(JPA.LOB);
- names.add(JPA.MAP_KEY);
- names.add(JPA2_0.MAP_KEY_CLASS);
- names.add(JPA2_0.MAP_KEY_COLUMN);
- names.add(JPA2_0.MAP_KEY_ENUMERATED);
- names.add(JPA2_0.MAP_KEY_JOIN_COLUMN);
- names.add(JPA2_0.MAP_KEY_JOIN_COLUMNS);
- names.add(JPA2_0.MAP_KEY_TEMPORAL);
- names.add(JPA.ORDER_BY);
- names.add(JPA2_0.ORDER_COLUMN);
- names.add(JPA.TEMPORAL);
- }
-
- // ********** target class **********
-
- public String getTargetClass() {
- return (this.specifiedTargetClass != null) ? this.specifiedTargetClass : this.defaultTargetClass;
- }
-
- public String getSpecifiedTargetClass() {
- return this.specifiedTargetClass;
- }
-
- public void setSpecifiedTargetClass(String targetClass) {
- String old = this.specifiedTargetClass;
- this.specifiedTargetClass = targetClass;
- this.mappingAnnotation.setTargetClass(targetClass);
- this.firePropertyChanged(SPECIFIED_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- protected void setSpecifiedTargetClass_(String targetClass) {
- String old = this.specifiedTargetClass;
- this.specifiedTargetClass = targetClass;
- this.firePropertyChanged(SPECIFIED_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- protected String getResourceTargetClass() {
- return this.mappingAnnotation.getTargetClass();
- }
-
- public String getDefaultTargetClass() {
- return this.defaultTargetClass;
- }
-
- protected void setDefaultTargetClass(String targetClass) {
- String old = this.defaultTargetClass;
- this.defaultTargetClass = targetClass;
- this.firePropertyChanged(DEFAULT_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- protected String buildDefaultTargetClass() {
- return this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- }
-
- public String getFullyQualifiedTargetClass() {
- return this.fullyQualifiedTargetClass;
- }
-
- protected void setFullyQualifiedTargetClass(String targetClass) {
- String old = this.fullyQualifiedTargetClass;
- this.fullyQualifiedTargetClass = targetClass;
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- protected String buildFullyQualifiedTargetClass() {
- return (this.specifiedTargetClass == null) ?
- this.defaultTargetClass :
- this.mappingAnnotation.getFullyQualifiedTargetClassName();
- }
-
- public Embeddable getResolvedTargetEmbeddable() {
- return this.resolvedTargetEmbeddable;
- }
-
- protected void setResolvedTargetEmbeddable(Embeddable embeddable) {
- Embeddable old = this.resolvedTargetEmbeddable;
- this.resolvedTargetEmbeddable = embeddable;
- this.firePropertyChanged(RESOLVED_TARGET_EMBEDDABLE_PROPERTY, old, embeddable);
- }
-
- public PersistentType getResolvedTargetType() {
- return this.resolvedTargetType;
- }
-
- protected PersistentType buildResolvedTargetType() {
- return (this.fullyQualifiedTargetClass == null) ? null : this.getPersistenceUnit().getPersistentType(this.fullyQualifiedTargetClass);
- }
-
- protected Embeddable buildResolvedTargetEmbeddable() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- protected Entity buildResolvedTargetEntity() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
-
- public char getTargetClassEnclosingTypeSeparator() {
- return '.';
- }
-
- // *************** Fetch ***************
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.mappingAnnotation.setFetch(FetchType.toJavaResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected FetchType getResourceFetch() {
- return FetchType.fromJavaResourceModel(this.mappingAnnotation.getFetch());
- }
-
- // ********** collection table **********
-
- public JavaCollectionTable2_0 getCollectionTable() {
- return this.collectionTable;
- }
-
- protected void initializeCollectionTable() {
- this.collectionTable.initialize(getCollectionTableAnnotation());
- }
-
- protected void updateCollectionTable() {
- this.collectionTable.update(getCollectionTableAnnotation());
- }
-
- public CollectionTable2_0Annotation getCollectionTableAnnotation() {
- return (CollectionTable2_0Annotation) this.getResourcePersistentAttribute().
- getNonNullAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- }
-
- // ***************** value column **************
-
- public JavaColumn getValueColumn() {
- return this.valueColumn;
- }
-
- protected void initializeValueColumn() {
- this.valueColumn.initialize(getColumnAnnotation());
- }
-
- protected void updateValueColumn() {
- getValueColumn().update(getColumnAnnotation());
- }
-
- public ColumnAnnotation getColumnAnnotation() {
- return (ColumnAnnotation) this.getResourcePersistentAttribute().getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
-
- // ************ value converter ************
-
- public JavaConverter getConverter() {
- return this.valueConverter;
- }
-
- protected String getValueConverterType() {
- return this.valueConverter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getValueConverterType(), converterType)) {
- return;
- }
- JavaConverter oldConverter = this.valueConverter;
- JavaConverter newConverter = buildConverter(converterType);
- this.valueConverter = this.nullConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.valueConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(JavaConverter newConverter) {
- JavaConverter oldConverter = this.valueConverter;
- this.valueConverter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
-
- protected void initializeValueConverter() {
- this.valueConverter = this.buildConverter(this.getResourceConverterType());
- }
-
- protected void updateValueConverter() {
- if (this.valuesAreEqual(getResourceConverterType(), getValueConverterType())) {
- getConverter().update(this.getResourcePersistentAttribute());
- }
- else {
- JavaConverter javaConverter = buildConverter(getResourceConverterType());
- setConverter(javaConverter);
- }
- }
-
- protected JavaConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.ENUMERATED_CONVERTER)) {
- return getJpaFactory().buildJavaEnumeratedConverter(this, this.getResourcePersistentAttribute());
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getJpaFactory().buildJavaTemporalConverter(this, this.getResourcePersistentAttribute());
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.getResourcePersistentAttribute().getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME) != null) {
- return Converter.ENUMERATED_CONVERTER;
- }
- if (this.getResourcePersistentAttribute().getAnnotation(TemporalAnnotation.ANNOTATION_NAME) != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- return Converter.NO_CONVERTER;
- }
-
-
- // ********** overrides **********
-
- public JavaAttributeOverrideContainer getValueAttributeOverrideContainer() {
- return this.valueAttributeOverrideContainer;
- }
-
- public JavaAssociationOverrideContainer getValueAssociationOverrideContainer() {
- return this.valueAssociationOverrideContainer;
- }
-
-
- // ***************** map key column **************
-
- public JavaColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- protected void initializeMapKeyColumn() {
- this.mapKeyColumn.initialize(getMapKeyColumnAnnotation());
- }
-
- protected void updateMapKeyColumn() {
- getMapKeyColumn().update(getMapKeyColumnAnnotation());
- }
-
- public MapKeyColumn2_0Annotation getMapKeyColumnAnnotation() {
- return (MapKeyColumn2_0Annotation) this.getResourcePersistentAttribute().getNonNullAnnotation(MapKeyColumn2_0Annotation.ANNOTATION_NAME);
- }
-
- public JavaAttributeOverrideContainer getMapKeyAttributeOverrideContainer() {
- return this.mapKeyAttributeOverrideContainer;
- }
-
- // ********** ordering **********
-
- public JavaOrderable2_0 getOrderable() {
- return this.orderable;
- }
-
- protected Orderable2_0.Owner buildOrderableOwner() {
- return new Orderable2_0.Owner() {
- public String getTableName() {
- return getCollectionTable().getName();
- }
- public Table getDbTable(String tableName) {
- return getCollectionTable().getDbTable();
- }
- };
- }
-
-
- public Type getValueType() {
- return this.valueType;
- }
-
- protected void setValueType(Type newValueType) {
- Type old = this.valueType;
- this.valueType = newValueType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, old, newValueType);
- }
-
- protected void initializeValueType() {
- this.valueType = this.buildValueType();
- }
-
- protected void updateValueType() {
- this.setValueType(this.buildValueType());
- }
-
- protected Type buildValueType() {
- if (getResolvedTargetEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- else if (this.resolvedTargetEntity != null) {
- return Type.ENTITY_TYPE;
- }
- else if (getTargetClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- public Type getKeyType() {
- return this.keyType;
- }
-
- protected void setKeyType(Type newKeyType) {
- Type old = this.keyType;
- this.keyType = newKeyType;
- firePropertyChanged(KEY_TYPE_PROPERTY, old, newKeyType);
- }
-
- protected void initializeKeyType() {
- this.keyType = this.buildKeyType();
- }
-
- protected void updateKeyType() {
- this.setKeyType(this.buildKeyType());
- }
-
- protected Type buildKeyType() {
- if (getResolvedMapKeyEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- if (getResolvedMapKeyEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (getMapKeyClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- // ********** map key **********
-
- public String getMapKey() {
- if (this.noMapKey) {
- return null;
- }
- if (this.pkMapKey) {
- return null;//the target is either embeddable or basic, so a key will have to be specified
- }
- if (this.customMapKey) {
- return this.specifiedMapKey;
- }
- throw new IllegalStateException("unknown map key"); //$NON-NLS-1$
- }
-
- public String getSpecifiedMapKey() {
- return this.specifiedMapKey;
- }
-
- public void setSpecifiedMapKey(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKey == null) {
- if (mapKeyAnnotation != null) {
- this.removeMapKeyAnnotation();
- }
- } else {
- if (mapKeyAnnotation == null) {
- mapKeyAnnotation = this.addMapKeyAnnotation();
- }
- mapKeyAnnotation.setName(mapKey);
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void setSpecifiedMapKey_(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void initializeMapKey() {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKeyAnnotation == null) {
- this.noMapKey = true;
- } else {
- this.specifiedMapKey = mapKeyAnnotation.getName();
- if (this.specifiedMapKey == null) {
- this.pkMapKey = true;
- } else {
- this.customMapKey = true;
- }
- }
- }
-
- protected void updateMapKey() {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (mapKeyAnnotation == null) {
- this.setSpecifiedMapKey_(null);
- this.setNoMapKey_(true);
- this.setPkMapKey_(false);
- this.setCustomMapKey_(false);
- } else {
- String mk = mapKeyAnnotation.getName();
- this.setSpecifiedMapKey_(mk);
- this.setNoMapKey_(false);
- this.setPkMapKey_(mk == null);
- this.setCustomMapKey_(mk != null);
- }
- }
-
- protected MapKeyAnnotation getMapKeyAnnotation() {
- return (MapKeyAnnotation) this.getResourcePersistentAttribute().getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected MapKeyAnnotation addMapKeyAnnotation() {
- return (MapKeyAnnotation) this.getResourcePersistentAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected void removeMapKeyAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- }
-
- protected boolean mapKeyNameTouches(int pos, CompilationUnit astRoot) {
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- return (mapKeyAnnotation != null) && mapKeyAnnotation.nameTouches(pos, astRoot);
- }
-
-
- // ********** no map key **********
-
- public boolean isNoMapKey() {
- return this.noMapKey;
- }
-
- public void setNoMapKey(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- if (noMapKey) {
- if (this.getMapKeyAnnotation() != null) {
- this.removeMapKeyAnnotation();
- }
- } else {
- // the 'noMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setNoMapKey_(boolean)
- }
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
- protected void setNoMapKey_(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
-
- // ********** pk map key **********
-
- public boolean isPkMapKey() {
- return this.pkMapKey;
- }
-
- public void setPkMapKey(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- MapKeyAnnotation mapKeyAnnotation = this.getMapKeyAnnotation();
- if (pkMapKey) {
- if (mapKeyAnnotation == null) {
- this.addMapKeyAnnotation();
- } else {
- mapKeyAnnotation.setName(null);
- }
- } else {
- // the 'pkMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setPkMapKey_(boolean)
- }
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
- protected void setPkMapKey_(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
-
- // ********** custom map key **********
-
- public boolean isCustomMapKey() {
- return this.customMapKey;
- }
-
- public void setCustomMapKey(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- if (customMapKey) {
- this.setSpecifiedMapKey(""); //$NON-NLS-1$
- } else {
- // the 'customMapKey' flag is cleared as a
- // side-effect of setting the other flags,
- // via a call to #setCustomMapKey_(boolean)
- }
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- protected void setCustomMapKey_(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- // *************** map key class *************
-
- public String getMapKeyClass() {
- return (this.specifiedMapKeyClass != null) ? this.specifiedMapKeyClass : this.defaultMapKeyClass;
- }
-
- public String getSpecifiedMapKeyClass() {
- return this.specifiedMapKeyClass;
- }
-
- public void setSpecifiedMapKeyClass(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- MapKeyClass2_0Annotation mapKeyClassAnnotation = this.getMapKeyClassAnnotation();
- if (mapKeyClass == null) {
- if (mapKeyClassAnnotation != null) {
- this.removeMapKeyClassAnnotation();
- }
- } else {
- if (mapKeyClassAnnotation == null) {
- mapKeyClassAnnotation = this.addMapKeyClassAnnotation();
- }
- mapKeyClassAnnotation.setValue(mapKeyClass);
- }
-
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected void setSpecifiedMapKeyClass_(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String getResourceMapKeyClass() {
- MapKeyClass2_0Annotation annotation = getMapKeyClassAnnotation();
- return annotation == null ? null : annotation.getValue();
- }
-
- public String getDefaultMapKeyClass() {
- return this.defaultMapKeyClass;
- }
-
- protected void setDefaultMapKeyClass(String mapKeyClass) {
- String old = this.defaultMapKeyClass;
- this.defaultMapKeyClass = mapKeyClass;
- this.firePropertyChanged(DEFAULT_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String buildDefaultMapKeyClass() {
- return this.getPersistentAttribute().getMultiReferenceMapKeyTypeName();
- }
-
- public String getFullyQualifiedMapKeyClass() {
- return this.fullyQualifiedMapKeyClass;
- }
-
- protected void setFullyQualifiedMapKeyClass(String mapKeyClass) {
- String old = this.fullyQualifiedMapKeyClass;
- this.fullyQualifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(FULLY_QUALIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String buildFullyQualifiedMapKeyClass() {
- return (this.specifiedMapKeyClass == null) ?
- this.defaultMapKeyClass :
- this.getMapKeyClassAnnotation().getFullyQualifiedClassName();
- }
-
- public char getMapKeyClassEnclosingTypeSeparator() {
- return '.';
- }
-
- protected MapKeyClass2_0Annotation getMapKeyClassAnnotation() {
- return (MapKeyClass2_0Annotation) this.getResourcePersistentAttribute().getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- protected MapKeyClass2_0Annotation addMapKeyClassAnnotation() {
- return (MapKeyClass2_0Annotation) this.getResourcePersistentAttribute().addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- protected void removeMapKeyClassAnnotation() {
- this.getResourcePersistentAttribute().removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- }
-
- public Embeddable getResolvedMapKeyEmbeddable() {
- return this.resolvedMapKeyEmbeddable;
- }
-
- protected void setResolvedMapKeyEmbeddable(Embeddable embeddable) {
- Embeddable old = this.resolvedMapKeyEmbeddable;
- this.resolvedMapKeyEmbeddable = embeddable;
- this.firePropertyChanged(RESOLVED_MAP_KEY_EMBEDDABLE_PROPERTY, old, embeddable);
- }
-
- public Entity getResolvedMapKeyEntity() {
- return this.resolvedMapKeyEntity;
- }
-
- protected void setResolvedMapKeyEntity(Entity entity) {
- Entity old = this.resolvedMapKeyEntity;
- this.resolvedMapKeyEntity = entity;
- this.firePropertyChanged(RESOLVED_MAP_KEY_ENTITY_PROPERTY, old, entity);
- }
-
- public PersistentType getResolvedMapKeyType() {
- return getResolvedMapKeyEmbeddable() == null ? null : getResolvedMapKeyEmbeddable().getPersistentType();
- }
-
- protected PersistentType buildResolvedMapKeyType() {
- return (this.fullyQualifiedMapKeyClass == null) ? null : this.getPersistenceUnit().getPersistentType(this.fullyQualifiedMapKeyClass);
- }
-
- protected Embeddable buildResolvedMapKeyEmbeddable() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- protected Entity buildResolvedMapKeyEntity() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getCollectionTable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getValueColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = getConverter().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getOrderable().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getValueAttributeOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getValueAssociationOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.mapKeyNameTouches(pos, astRoot)) {
- return this.javaCandidateMapKeyNames(filter);
- }
- result = this.getMapKeyColumn().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.getMapKeyAttributeOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
-// result = this.getMapKeyAssociationOverrideContainer().javaCompletionProposals(pos, filter, astRoot);
-// if (result != null) {
-// return result;
-// }
- return null;
- }
-
- protected Iterator<String> javaCandidateMapKeyNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.candidateMapKeyNames(filter));
- }
-
- protected Iterator<String> candidateMapKeyNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.candidateMapKeyNames(), filter);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEmbeddableAttributeNames();
- }
-
- public Iterator<String> allTargetEmbeddableAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.allTargetEmbeddableAttributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- });
- }
-
- @Override
- public Iterator<String> allMappingNames() {
- return new CompositeIterator<String>(this.getName(), this.allEmbeddableAttributeMappingNames());
- }
-
- protected Iterator<String> allEmbeddableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- }
- );
- }
-
- protected Iterator<AttributeMapping> allTargetEmbeddableAttributeMappings() {
- return (this.resolvedTargetEmbeddable != null) ?
- this.resolvedTargetEmbeddable.allAttributeMappings() :
- EmptyIterator.<AttributeMapping> instance();
- }
-
- protected Iterator<AttributeMapping> embeddableAttributeMappings() {
- Embeddable targetEmbeddable = getResolvedTargetEmbeddable();
- if (targetEmbeddable != null && targetEmbeddable != getPersistentAttribute().getOwningTypeMapping()) {
- return targetEmbeddable.attributeMappings();
- }
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> allOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableAttributeMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- }
- );
- }
-
- @Override
- public Iterator<String> allOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableAssociationMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- }
- );
- }
-
- protected Iterator<String> embeddableOverrideableMappingNames(Transformer<AttributeMapping, Iterator<String>> transformer) {
- return new TransformationIterator<String, String>(
- new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.embeddableAttributeMappings(), transformer)))
- {
- @Override
- protected String transform(String next) {
- return getName() + '.' + next;
- }
- };
- }
-
- @Override
- public AttributeMapping resolveAttributeMapping(String name) {
- AttributeMapping resolvedMapping = super.resolveAttributeMapping(name);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- int dotIndex = name.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(name.substring(0, dotIndex))) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(embeddableAttributeMappings())) {
- resolvedMapping = attributeMapping.resolveAttributeMapping(name.substring(dotIndex + 1));
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AttributeOverride override = getValueAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- if (this.getResolvedTargetEmbeddable() == null) {
- return null;
- }
- return this.getResolvedTargetEmbeddable().resolveOverriddenColumn(attributeName);
- }
- }
- return null;
- }
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- return (this.fullyQualifiedTargetClass != null) ? this.fullyQualifiedTargetClass : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String keyTypeName = ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldMapKeyTypeName();
- if (keyTypeName != null) {
- typeArgumentNames.add(keyTypeName);
- }
- }
-
- public String getMetamodelFieldMapKeyTypeName() {
- return MappingTools.getMetamodelFieldMapKeyTypeName(this);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateTargetClass(messages, astRoot);
- this.validateMapKeyClass(messages, astRoot);
- this.getOrderable().validate(messages, reporter, astRoot);
- this.getCollectionTable().validate(messages, reporter, astRoot);
- this.validateValue(messages, reporter, astRoot);
- this.validateMapKey(messages, reporter, astRoot);
- }
-
- protected void validateValue(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- //TODO should we handle validation when the type is embeddable, but a value column is specified, or things like that if that is invalid?
- if (getValueType() == Type.BASIC_TYPE) {
- this.getValueColumn().validate(messages, reporter, astRoot);
- this.getConverter().validate(messages, reporter, astRoot);
- }
- else if (getValueType() == Type.EMBEDDABLE_TYPE) {
- this.getValueAttributeOverrideContainer().validate(messages, reporter, astRoot);
- this.getValueAssociationOverrideContainer().validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateMapKey(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- if (getMapKey() != null) {
- //TODO validate that the map key refers to an existing attribute
- return;
- }
- if (getKeyType() == Type.BASIC_TYPE) {
- this.getMapKeyColumn().validate(messages, reporter, astRoot);
- //validate map key converter
- }
- else if (getKeyType() == Type.ENTITY_TYPE) {
- //validate map key join columns
- }
- else if (getKeyType() == Type.EMBEDDABLE_TYPE) {
- getMapKeyAttributeOverrideContainer().validate(messages, reporter, astRoot);
- //getMapKeyAssociationOverrideContainer().validate(messages, reporter, astRoot);
- }
- }
-
- protected void validateTargetClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.getTargetClass() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED,
- new String[0],
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- //TODO this does not give an error for unmapped, unlisted types that aren't basic - bug 310464
- if (this.resolvedTargetType != null) {
- if (getResolvedTargetEmbeddable() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE,
- new String[] {this.getTargetClass()},
- this,
- this.getTargetClassTextRange(astRoot)
- )
- );
- }
- }
- }
-
- protected void validateMapKeyClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (!getPersistentAttribute().getJpaContainer().isMap()) {
- return;
- }
- if (this.getMapKeyClass() == null) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED,
- new String[0],
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- protected TextRange getTargetClassTextRange(CompilationUnit astRoot) {
- return this.getTextRange(this.mappingAnnotation.getTargetClassTextRange(astRoot), astRoot);
- }
-
- protected TextRange getTextRange(TextRange textRange, CompilationUnit astRoot) {
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
-
- protected abstract class ColumnOwner implements JavaBaseColumn.Owner {
- public String getDefaultTableName() {
- return getCollectionTable().getName();
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractJavaElementCollectionMapping2_0.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- if (getCollectionTable().getName() != null && getCollectionTable().getName().equals(tableName)) {
- return AbstractJavaElementCollectionMapping2_0.this.getCollectionTable().getDbTable();
- }
- return null;
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaElementCollectionMapping2_0.this.getValidationTextRange(astRoot);
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getColumnTableNotValidMessage(),
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected abstract String getColumnTableNotValidMessage();
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getColumnUnresolvedNameMessage(),
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected abstract String getColumnUnresolvedNameMessage();
- }
-
- protected class ValueColumnOwner extends ColumnOwner {
- public String getDefaultColumnName() {
- return AbstractJavaElementCollectionMapping2_0.this.getName();
- }
-
- @Override
- protected String getColumnTableNotValidMessage() {
- return JpaValidationMessages.COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getColumnUnresolvedNameMessage() {
- return JpaValidationMessages.COLUMN_UNRESOLVED_NAME;
- }
- }
-
- protected class MapKeyColumnOwner extends ColumnOwner {
- public String getDefaultColumnName() {
- return AbstractJavaElementCollectionMapping2_0.this.getName() + "_KEY"; //$NON-NLS-1$
- }
-
- @Override
- protected String getColumnTableNotValidMessage() {
- return JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getColumnUnresolvedNameMessage() {
- return JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME;
- }
- }
-
- // ********** override container owners **********
-
- protected abstract class OverrideContainerOwner
- implements JavaOverrideContainer.Owner
- {
- public TypeMapping getTypeMapping() {
- return AbstractJavaElementCollectionMapping2_0.this.getTypeMapping();
- }
-
- public String getDefaultTableName() {
- return AbstractJavaElementCollectionMapping2_0.this.getCollectionTable().getName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractJavaElementCollectionMapping2_0.this.getCollectionTable().getDbTable();
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return AbstractJavaElementCollectionMapping2_0.this.getValidationTextRange(astRoot);
- }
- }
-
- protected class ValueAssociationOverrideContainerOwner
- extends OverrideContainerOwner
- implements JavaAssociationOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaElementCollectionMapping2_0.this.getResolvedTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public String getPossiblePrefix() {
- return "value."; //$NON-NLS-1$
- }
-
- public String getWritePrefix() {
- return getPersistentAttribute().getJpaContainer().isMap() ? this.getPossiblePrefix() : null;
- }
-
- //return false if the override is prefixed with "key.", these will be part of the MapKeyAttributeOverrideContainer.
- //a prefix of "value." or no prefix at all is relevant. If the type is not a Map then return true since all attribute overrides
- //need to apply to the value.
- public boolean isRelevant(String overrideName) {
- if (getKeyType() != Type.EMBEDDABLE_TYPE) {
- return true;
- }
- return !overrideName.startsWith("key."); //$NON-NLS-1$
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {overrideName, column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
- }
-
- //********** AttributeOverrideContainer.Owner implementation *********
-
- protected class ValueAttributeOverrideContainerOwner
- extends OverrideContainerOwner
- implements JavaAttributeOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaElementCollectionMapping2_0.this.getResolvedTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public String getPossiblePrefix() {
- return "value."; //$NON-NLS-1$
- }
-
- public String getWritePrefix() {
- return getPersistentAttribute().getJpaContainer().isMap() ? this.getPossiblePrefix() : null;
- }
-
- //return false if the override is prefixed with "key.", these will be part of the MapKeyAttributeOverrideContainer.
- //a prefix of "value." or no prefix at all is relevant. If the type is not a Map then return true since all attribute overrides
- //need to apply to the value.
- public boolean isRelevant(String overrideName) {
- if (getKeyType() != Type.EMBEDDABLE_TYPE) {
- return true;
- }
- return !overrideName.startsWith("key."); //$NON-NLS-1$
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
- }
-
-
- protected class MapKeyAttributeOverrideContainerOwner
- extends OverrideContainerOwner
- implements JavaAttributeOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaElementCollectionMapping2_0.this.getResolvedMapKeyEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- public String getPossiblePrefix() {
- return "key."; //$NON-NLS-1$
- }
-
- public String getWritePrefix() {
- return this.getPossiblePrefix();
- }
-
- //the only relevant overrides are those that start with "key.", no prefix will be a value attribute override
- public boolean isRelevant(String overrideName) {
- if (getValueType() != Type.EMBEDDABLE_TYPE) {
- return true;
- }
- return overrideName.startsWith("key."); //$NON-NLS-1$
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {overrideName, column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (override.isVirtual()) {
- return this.buildVirtualColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE },
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaIdMappingDefinition2_0.java
deleted file mode 100644
index 6ae03e083d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaIdMappingDefinition2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaIdMappingDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-public abstract class AbstractJavaIdMappingDefinition2_0
- extends AbstractJavaIdMappingDefinition
-{
- protected AbstractJavaIdMappingDefinition2_0() {
- super();
- }
-
-
- @Override
- public boolean testSpecified(JavaPersistentAttribute persistentAttribute) {
- return super.testSpecified(persistentAttribute) && ! testDerivedId(persistentAttribute);
- }
-
- /**
- * Return whether the Id annotation, if present, is used as a supporting annotation for
- * 1-1 or M-1 mapping, rather than as a primary mapping annotation
- */
- protected boolean testDerivedId(JavaPersistentAttribute persistentAttribute) {
- JavaResourcePersistentAttribute resourceAttribute =
- persistentAttribute.getResourcePersistentAttribute();
- return resourceAttribute.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME) != null
- || resourceAttribute.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME) != null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaAssociationOverrideRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaAssociationOverrideRelationshipReference2_0.java
deleted file mode 100644
index 357b69d918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaAssociationOverrideRelationshipReference2_0.java
+++ /dev/null
@@ -1,127 +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.core.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.AssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaJoinTableInAssociationOverrideJoiningStrategy2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaAssociationOverrideRelationshipReference2_0 extends AbstractJavaAssociationOverrideRelationshipReference
- implements JavaAssociationOverrideRelationshipReference2_0
-{
-
- protected final JavaJoinTableInAssociationOverrideJoiningStrategy2_0 joinTableJoiningStrategy;
-
- public GenericJavaAssociationOverrideRelationshipReference2_0(JavaAssociationOverride parent) {
- super(parent);
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy();
- }
-
- public void initializeFrom(AssociationOverrideRelationshipReference oldAssociationOverride) {
- if (oldAssociationOverride.getJoinColumnJoiningStrategy().hasSpecifiedJoinColumns()) {
- getJoinColumnJoiningStrategy().initializeFrom(oldAssociationOverride.getJoinColumnJoiningStrategy());
- }
- else {
- getJoinTableJoiningStrategy().initializeFrom(((AssociationOverrideRelationshipReference2_0) oldAssociationOverride).getJoinTableJoiningStrategy());
- }
- }
-
- protected JavaJoinTableInAssociationOverrideJoiningStrategy2_0 buildJoinTableJoiningStrategy() {
- return new GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0(this);
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.joinTableJoiningStrategy.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- @Override
- protected void initializeJoiningStrategies(AssociationOverrideAnnotation associationOverride) {
- super.initializeJoiningStrategies(associationOverride);
- this.joinTableJoiningStrategy.initialize((AssociationOverride2_0Annotation) associationOverride);
- }
-
- @Override
- protected void updateJoiningStrategies(AssociationOverrideAnnotation associationOverride) {
- super.updateJoiningStrategies(associationOverride);
- this.joinTableJoiningStrategy.update((AssociationOverride2_0Annotation) associationOverride);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- //this is not yet correctly supported so I am going to comment it out
- //I end up with join-table validation when the association is for join-columns.
- //bug 190319 covers the use case for validation of join tables in association overrides
- //this.joinTableJoiningStrategy.validate(messages, reporter, astRoot);
- }
-
-
-
- // **************** join columns *******************************************
-
-
- public JavaJoinTableInAssociationOverrideJoiningStrategy2_0 getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public void unsetJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return getAssociationOverride().isVirtual();
- }
-
- @Override
- public void setJoinColumnJoiningStrategy() {
- super.setJoinColumnJoiningStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCacheable2_0.java
deleted file mode 100644
index e21fb8be65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCacheable2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaCacheable2_0
- extends AbstractJavaJpaContextNode
- implements JavaCacheable2_0
-{
- protected boolean defaultCacheable;
- protected Boolean specifiedCacheable;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
- public GenericJavaCacheable2_0(JavaCacheableHolder2_0 parent) {
- super(parent);
- }
-
- @Override
- public JavaCacheableHolder2_0 getParent() {
- return (JavaCacheableHolder2_0) super.getParent();
- }
-
- protected String getCacheableAnnotationName() {
- return Cacheable2_0Annotation.ANNOTATION_NAME;
- }
-
- protected Cacheable2_0Annotation getResourceCacheable() {
- return (Cacheable2_0Annotation) this.resourcePersistentType.getAnnotation(getCacheableAnnotationName());
- }
-
- protected void addResourceCacheable() {
- this.resourcePersistentType.addAnnotation(getCacheableAnnotationName());
- }
-
- protected void removeResourceCacheable() {
- this.resourcePersistentType.removeAnnotation(getCacheableAnnotationName());
- }
-
- protected boolean calculateDefaultCacheable() {
- return getParent().calculateDefaultCacheable();
- }
-
- public boolean isCacheable() {
- return this.specifiedCacheable != null ? this.specifiedCacheable.booleanValue() : this.defaultCacheable;
- }
-
- public boolean isDefaultCacheable() {
- return this.defaultCacheable;
- }
-
- protected void setDefaultCacheable(boolean newDefaultCacheable) {
- boolean oldDefaultCacheable = this.defaultCacheable;
- this.defaultCacheable = newDefaultCacheable;
- firePropertyChanged(DEFAULT_CACHEABLE_PROPERTY, oldDefaultCacheable, newDefaultCacheable);
- }
-
- public Boolean getSpecifiedCacheable() {
- return this.specifiedCacheable;
- }
-
- public void setSpecifiedCacheable(Boolean newSpecifiedCacheable) {
- if (this.specifiedCacheable == newSpecifiedCacheable) {
- return;
- }
- Boolean oldSpecifiedCacheable = this.specifiedCacheable;
- this.specifiedCacheable = newSpecifiedCacheable;
-
- if (newSpecifiedCacheable != null) {
- if (getResourceCacheable() == null) {
- addResourceCacheable();
- }
- if (newSpecifiedCacheable.booleanValue()) {
- if (getResourceCacheable().getValue() == Boolean.FALSE) {
- getResourceCacheable().setValue(null);
- }
- }
- else {
- getResourceCacheable().setValue(Boolean.FALSE);
- }
- }
- else {
- removeResourceCacheable();
- }
- firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
- }
-
- protected void setSpecifiedCacheable_(Boolean newSpecifiedCacheable) {
- Boolean oldSpecifiedCacheable = this.specifiedCacheable;
- this.specifiedCacheable = newSpecifiedCacheable;
- firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
- }
-
- public void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- Cacheable2_0Annotation resourceCacheable = this.getResourceCacheable();
- this.specifiedCacheable = this.specifiedCacheable(resourceCacheable);
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- Cacheable2_0Annotation resourceCacheable = this.getResourceCacheable();
- this.setSpecifiedCacheable_(this.specifiedCacheable(resourceCacheable));
- this.setDefaultCacheable(this.calculateDefaultCacheable());
- }
-
- private Boolean specifiedCacheable(Cacheable2_0Annotation resourceCacheable) {
- if (resourceCacheable == null) {
- return null;
- }
- if (resourceCacheable.getValue() == null) { //@Cacheable is equivalent to @Cacheable(true)
- return Boolean.TRUE;
- }
- return resourceCacheable.getValue();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- Cacheable2_0Annotation resourceCacheable = this.getResourceCacheable();
- return resourceCacheable == null ? null : resourceCacheable.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCollectionTable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCollectionTable2_0.java
deleted file mode 100644
index 41dcc0cfb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaCollectionTable2_0.java
+++ /dev/null
@@ -1,246 +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.core.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaReferenceTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Java collection table
- */
-public class GenericJavaCollectionTable2_0
- extends GenericJavaReferenceTable
- implements JavaCollectionTable2_0
-{
-
- public GenericJavaCollectionTable2_0(JavaElementCollectionMapping2_0 parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- @Override
- public JavaElementCollectionMapping2_0 getParent() {
- return (JavaElementCollectionMapping2_0) super.getParent();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- public void initialize(CollectionTable2_0Annotation collectionTable) {
- super.initialize(collectionTable);
- }
-
- public void update(CollectionTable2_0Annotation collectionTable) {
- super.update(collectionTable);
- }
-
- // ********** AbstractJavaTable implementation **********
-
- @Override
- protected String getAnnotationName() {
- return CollectionTable2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String buildDefaultName() {
- return MappingTools.buildCollectionTableDefaultName(getParent());
- }
-
- @Override
- protected CollectionTable2_0Annotation getAnnotation() {
- return this.getParent().getCollectionTableAnnotation();
- }
-
-
-
- // ********** validation **********
-
- @Override
- protected boolean shouldValidateAgainstDatabase() {
- return getParent().shouldValidateAgainstDatabase();
- }
-
- @Override
- protected String getUnresolvedCatalogMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getUnresolvedSchemaMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_SCHEMA;
- }
-
- @Override
- protected String getUnresolvedNameMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_NAME;
- }
-
-
- // ********** join column owner adapter **********
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- protected class JoinColumnOwner
- implements JavaJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
-
- //***** NamedColumn.Owner implementation *******
- public TypeMapping getTypeMapping() {
- return GenericJavaCollectionTable2_0.this.getParent().getTypeMapping();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- String collectionTableName = GenericJavaCollectionTable2_0.this.getName();
- return (collectionTableName == null) ? null : (collectionTableName.equals(tableName)) ? GenericJavaCollectionTable2_0.this.getDbTable() : null;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- //***** JavaNamedColumn.Owner implementation *******
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return GenericJavaCollectionTable2_0.this.getValidationTextRange(astRoot);
- }
-
- //***** BaseColumn.Owner implementation *******
- /**
- * by default, the join column is, obviously, in the collection table
- */
- public String getDefaultTableName() {
- return GenericJavaCollectionTable2_0.this.getName();
- }
-
-
- //***** BaseJoinColumn.Owner implementation *******
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericJavaCollectionTable2_0.this.defaultJoinColumn == joinColumn;
- }
-
- //***** JoinColumn.Owner implementation *******
- /**
- * the default table name is always valid and a specified table name
- * is prohibited (which will be handled elsewhere)
- */
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * the join column can only be on the collection table itself
- */
- public Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public Entity getRelationshipTarget() {
- return GenericJavaCollectionTable2_0.this.getParent().getEntity();
- }
-
- public String getAttributeName() {
- return null; //I *think* this is correct
- //return GenericJavaCollectionTable2_0.this.getParent().getName();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return GenericJavaCollectionTable2_0.this.getParent().getPersistentAttribute();
- }
-
- public int joinColumnsSize() {
- return GenericJavaCollectionTable2_0.this.joinColumnsSize();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedIdentity2_0.java
deleted file mode 100644
index 67f5312ad3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaDerivedIdentity2_0.java
+++ /dev/null
@@ -1,191 +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.core.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaMapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaDerivedIdentity2_0 extends AbstractJavaJpaContextNode
- implements JavaDerivedIdentity2_0
-{
- // cache the strategy for property change notification
- protected DerivedIdentityStrategy2_0 cachedPredominantDerivedIdentityStrategy;
-
- protected JavaIdDerivedIdentityStrategy2_0 idDerivedIdentityStrategy;
-
- protected JavaMapsIdDerivedIdentityStrategy2_0 mapsIdDerivedIdentityStrategy;
-
-
- public GenericJavaDerivedIdentity2_0(JavaSingleRelationshipMapping2_0 parent) {
- super(parent);
- this.idDerivedIdentityStrategy = buildIdDerivedIdentityStrategy();
- this.mapsIdDerivedIdentityStrategy = buildMapsIdDerivedIdentityStrategy();
- }
-
-
- protected JavaIdDerivedIdentityStrategy2_0 buildIdDerivedIdentityStrategy() {
- return new GenericJavaIdDerivedIdentityStrategy2_0(this);
- }
-
- protected JavaMapsIdDerivedIdentityStrategy2_0 buildMapsIdDerivedIdentityStrategy() {
- return new GenericJavaMapsIdDerivedIdentityStrategy2_0(this);
- }
-
- @Override
- public JavaSingleRelationshipMapping2_0 getParent() {
- return (JavaSingleRelationshipMapping2_0) super.getParent();
- }
-
- public JavaSingleRelationshipMapping2_0 getMapping() {
- return getParent();
- }
-
-
- // **************** predominant joining strategy ***************************
-
- public DerivedIdentityStrategy2_0 getPredominantDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy;
- }
-
- protected void setPredominantJoiningStrategy() {
- setPredominantJoiningStrategy(calculatePredominantDerivedIdentityStrategy());
- }
-
- protected void setPredominantJoiningStrategy(DerivedIdentityStrategy2_0 newStrategy) {
- DerivedIdentityStrategy2_0 oldStrategy = this.cachedPredominantDerivedIdentityStrategy;
- this.cachedPredominantDerivedIdentityStrategy = newStrategy;
- firePropertyChanged(PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
-
- // **************** resource -> context ************************************
-
- public void initialize() {
- this.idDerivedIdentityStrategy.initialize();
- this.mapsIdDerivedIdentityStrategy.initialize();
- this.cachedPredominantDerivedIdentityStrategy = calculatePredominantDerivedIdentityStrategy();
- }
-
- public void update() {
- this.idDerivedIdentityStrategy.update();
- this.mapsIdDerivedIdentityStrategy.update();
- setPredominantJoiningStrategy(calculatePredominantDerivedIdentityStrategy());
- }
-
- protected DerivedIdentityStrategy2_0 calculatePredominantDerivedIdentityStrategy() {
- if (this.mapsIdDerivedIdentityStrategy.isSpecified()) {
- return this.mapsIdDerivedIdentityStrategy;
- }
- else if (this.idDerivedIdentityStrategy.isSpecified()) {
- return this.idDerivedIdentityStrategy;
- }
- else {
- return null;
- }
- }
-
-
- // **************** no strategy *******************************************
-
- public void setNullDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesNullDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == null;
- }
-
-
- // **************** maps id strategy **************************************
-
- public JavaMapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy() {
- return this.mapsIdDerivedIdentityStrategy;
- }
-
- public void setMapsIdDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.addStrategy();
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMapsIdDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesMapsIdDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == this.mapsIdDerivedIdentityStrategy;
- }
-
-
- // **************** id strategy *******************************************
-
- public JavaIdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy() {
- return this.idDerivedIdentityStrategy;
- }
-
- public void setIdDerivedIdentityStrategy() {
- this.idDerivedIdentityStrategy.addStrategy();
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetIdDerivedIdentityStrategy() {
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesIdDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == this.idDerivedIdentityStrategy;
- }
-
-
- // **************** java completion ***************************************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result == null) {
- result = this.mapsIdDerivedIdentityStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- if (result == null) {
- result = this.idDerivedIdentityStrategy.javaCompletionProposals(pos, filter, astRoot);
- }
- return result;
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getMapping().getValidationTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.idDerivedIdentityStrategy.validate(messages, reporter, astRoot);
- this.mapsIdDerivedIdentityStrategy.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0.java
deleted file mode 100644
index 43cfc4038d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,22 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-
-
-public class GenericJavaElementCollectionMapping2_0
- extends AbstractJavaElementCollectionMapping2_0
-{
- public GenericJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaEmbeddable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaEmbeddable2_0.java
deleted file mode 100644
index 4e9bd8353c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaEmbeddable2_0.java
+++ /dev/null
@@ -1,43 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEmbeddable;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-
-public class GenericJavaEmbeddable2_0
- extends AbstractJavaEmbeddable
-{
- public GenericJavaEmbeddable2_0(JavaPersistentType parent) {
- super(parent);
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return ArrayTools.contains(ALLOWED_ATTRIBUTE_MAPPING_KEYS, attributeMappingKey);
- }
-
- public static final String[] ALLOWED_ATTRIBUTE_MAPPING_KEYS =
- new String[] {
- MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY,
- MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index a53f2f67c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaIdDerivedIdentityStrategy2_0.java
+++ /dev/null
@@ -1,126 +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.core.internal.jpa2.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericJavaIdDerivedIdentityStrategy2_0
- extends AbstractJavaJpaContextNode
- implements JavaIdDerivedIdentityStrategy2_0
-{
- protected boolean value;
-
-
- public GenericJavaIdDerivedIdentityStrategy2_0(JavaDerivedIdentity2_0 parent) {
- super(parent);
- }
-
-
- public JavaDerivedIdentity2_0 getDerivedIdentity() {
- return (JavaDerivedIdentity2_0) super.getParent();
- }
-
- public JavaSingleRelationshipMapping2_0 getMapping() {
- return getDerivedIdentity().getMapping();
- }
-
- protected JavaResourcePersistentAttribute getResourceAttribute() {
- return getMapping().getPersistentAttribute().getResourcePersistentAttribute();
- }
-
- protected IdAnnotation getAnnotation() {
- return (IdAnnotation) getResourceAttribute().getAnnotation(JPA.ID);
- }
-
- protected boolean getResourceValue() {
- return getAnnotation() != null;
- }
-
- protected void addAnnotation() {
- getResourceAttribute().addAnnotation(JPA.ID);
- }
-
- protected void removeAnnotation() {
- getResourceAttribute().removeAnnotation(JPA.ID);
- }
-
- public boolean getValue() {
- return this.value;
- }
-
- public void setValue(boolean newValue) {
- if (this.value == newValue) {
- return;
- }
- boolean oldValue = this.value;
- this.value = newValue;
-
- if (newValue) {
- addAnnotation();
- }
- else {
- removeAnnotation();
- }
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- protected void setValue_(boolean newValue) {
- boolean oldValue = this.value;
- this.value = newValue;
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public boolean isSpecified() {
- return getAnnotation() != null;
- }
-
- public void addStrategy() {
- if (getAnnotation() == null) {
- addAnnotation();
- }
- }
-
- public void removeStrategy() {
- if (getAnnotation() != null) {
- removeAnnotation();
- }
- }
-
- public void initialize() {
- this.value = getResourceValue();
- }
-
- public void update() {
- this.setValue_(getResourceValue());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- IdAnnotation annotation = this.getAnnotation();
- return annotation == null ? null : annotation.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- // no validation rules
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0.java
deleted file mode 100644
index 2dc037ada4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0.java
+++ /dev/null
@@ -1,73 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.jpa2.context.java.JavaAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaJoinTableInAssociationOverrideJoiningStrategy2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0
- extends AbstractJavaJoinTableJoiningStrategy
- implements JavaJoinTableInAssociationOverrideJoiningStrategy2_0
-{
- protected transient AssociationOverride2_0Annotation associationOverrideAnnotation;
-
- public GenericJavaJoinTableInAssociationOverrideJoiningStrategy2_0(JavaAssociationOverrideRelationshipReference2_0 parent) {
- super(parent);
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- @Override
- public JavaAssociationOverrideRelationshipReference2_0 getRelationshipReference() {
- return (JavaAssociationOverrideRelationshipReference2_0) super.getRelationshipReference();
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return getRelationshipReference().getTypeMapping().shouldValidateAgainstDatabase();
- }
-
- // **************** join table *********************************************
-
- public JoinTableAnnotation getAnnotation() {
- return this.associationOverrideAnnotation.getNonNullJoinTable();
- }
- @Override
- protected JoinTableAnnotation addAnnotation() {
- return this.associationOverrideAnnotation.addJoinTable();
- }
-
- @Override
- protected void removeAnnotation() {
- this.associationOverrideAnnotation.removeJoinTable();
- }
-
-
- public void initialize(AssociationOverride2_0Annotation associationOverride) {
- this.associationOverrideAnnotation = associationOverride;
- super.initialize();
- }
-
- public void update(AssociationOverride2_0Annotation associationOverride) {
- this.associationOverrideAnnotation = associationOverride;
- super.update();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getRelationshipReference().getValidationTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.java
deleted file mode 100644
index 48057b5bd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-
-
-public class GenericJavaManyToOneMapping2_0
- extends AbstractJavaManyToOneMapping
-{
- public GenericJavaManyToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaManyToOneRelationshipReference2_0(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneRelationshipReference2_0.java
deleted file mode 100644
index cbc931c043..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaManyToOneRelationshipReference2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToOneRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-
-public class GenericJavaManyToOneRelationshipReference2_0
- extends AbstractJavaManyToOneRelationshipReference
-{
-
- public GenericJavaManyToOneRelationshipReference2_0(JavaManyToOneMapping2_0 parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericJavaJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.joinTableJoiningStrategy.getJoinTable() != null) {
- return this.joinTableJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index 3ec591b63c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java
+++ /dev/null
@@ -1,299 +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.core.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaMapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-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 GenericJavaMapsIdDerivedIdentityStrategy2_0
- extends AbstractJavaJpaContextNode
- implements JavaMapsIdDerivedIdentityStrategy2_0
-{
- protected String specifiedValue;
-
- protected String defaultValue;
-
-
- public GenericJavaMapsIdDerivedIdentityStrategy2_0(JavaDerivedIdentity2_0 parent) {
- super(parent);
- }
-
-
- public JavaDerivedIdentity2_0 getDerivedIdentity() {
- return (JavaDerivedIdentity2_0) super.getParent();
- }
-
- public JavaSingleRelationshipMapping2_0 getMapping() {
- return getDerivedIdentity().getMapping();
- }
-
- protected JavaResourcePersistentAttribute getResourceAttribute() {
- return getMapping().getPersistentAttribute().getResourcePersistentAttribute();
- }
-
- protected MapsId2_0Annotation getAnnotation() {
- return (MapsId2_0Annotation) getResourceAttribute().getNonNullAnnotation(JPA2_0.MAPS_ID);
- }
-
- protected MapsId2_0Annotation getAnnotationOrNull() {
- return (MapsId2_0Annotation) getResourceAttribute().getAnnotation(JPA2_0.MAPS_ID);
- }
-
- protected String getResourceValue() {
- return getAnnotation().getValue();
- }
-
- protected String calculateDefaultValue() {
- Iterable<AttributeMapping> validAttributeMappings =
- new FilteringIterable<AttributeMapping>(
- CollectionTools.collection(getMapping().getPersistentAttribute().getOwningTypeMapping().allAttributeMappings())) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(o.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- }
- };
- if (CollectionTools.size(validAttributeMappings) == 1) {
- return validAttributeMappings.iterator().next().getName();
- }
- return null;
- }
-
- protected void addAnnotation() {
- getResourceAttribute().addAnnotation(JPA2_0.MAPS_ID);
- }
-
- protected void removeAnnotation() {
- getResourceAttribute().removeAnnotation(JPA2_0.MAPS_ID);
- }
-
- public String getSpecifiedValue() {
- return this.specifiedValue;
- }
-
- public void setSpecifiedValue(String newValue) {
- if (StringTools.stringsAreEqual(this.specifiedValue, newValue)) {
- return;
- }
- String oldValue = this.specifiedValue;
- this.specifiedValue = newValue;
- getAnnotation().setValue(newValue);
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, oldValue, newValue);
- }
-
- protected void setSpecifiedValue_(String newValue) {
- String oldValue = this.specifiedValue;
- this.specifiedValue = newValue;
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, oldValue, newValue);
- }
-
- public boolean usesDefaultValue() {
- return true;
- }
-
- public String getDefaultValue() {
- return this.defaultValue;
- }
-
- protected void setDefaultValue_(String newValue) {
- if (StringTools.stringsAreEqual(this.defaultValue, newValue)) {
- return;
- }
- String oldValue = this.defaultValue;
- this.defaultValue = newValue;
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, oldValue, newValue);
- }
-
- public String getValue() {
- return (this.specifiedValue != null) ? this.specifiedValue : this.defaultValue;
- }
-
- public Iterable<String> getSortedValueChoices() {
- return CollectionTools.sort(
- new TransformationIterable<AttributeMapping, String>(getAllAttributeMappingChoices()) {
- @Override
- protected String transform(AttributeMapping o) {
- return o.getName();
- }
- });
- }
-
- public Iterable<AttributeMapping> getAllAttributeMappingChoices() {
- return new CompositeIterable<AttributeMapping>(
- getAttributeMappingChoiceIterables(
- CollectionTools.collection(getMapping().getPersistentAttribute().getOwningTypeMapping().allAttributeMappings())));
- }
-
- protected Iterable<Iterable<AttributeMapping>> getAttributeMappingChoiceIterables(Iterable<AttributeMapping> availableMappings) {
- return new TransformationIterable<AttributeMapping, Iterable<AttributeMapping>>(availableMappings) {
- @Override
- protected Iterable<AttributeMapping> transform(AttributeMapping o) {
- if (StringTools.stringsAreEqual(o.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) {
- return getEmbeddedIdMappingChoiceIterable((EmbeddedIdMapping) o);
- }
- return new SingleElementIterable<AttributeMapping>(o);
- }
- };
- }
-
- protected Iterable<AttributeMapping> getEmbeddedIdMappingChoiceIterable(EmbeddedIdMapping mapping) {
- Embeddable embeddable = mapping.getTargetEmbeddable();
- if (embeddable == null) {
- return new SingleElementIterable<AttributeMapping>(mapping);
- }
- return new CompositeIterable<AttributeMapping>(
- mapping,
- CollectionTools.collection(embeddable.allAttributeMappings()));
- }
-
- public AttributeMapping getResolvedAttributeMappingValue() {
- if (getValue() != null) {
- for (AttributeMapping each : getAllAttributeMappingChoices()) {
- if (each.getName().equals(getValue())) {
- return each;
- }
- }
- }
- return null;
- }
-
- public boolean isSpecified() {
- return getAnnotationOrNull() != null;
- }
-
- public void addStrategy() {
- if (getAnnotationOrNull() == null) {
- addAnnotation();
- }
- }
-
- public void removeStrategy() {
- if (getAnnotationOrNull() != null) {
- removeAnnotation();
- }
- }
-
- public void initialize() {
- this.specifiedValue = getResourceValue();
- this.defaultValue = calculateDefaultValue();
- }
-
- public void update() {
- this.setSpecifiedValue_(getResourceValue());
- this.setDefaultValue_(calculateDefaultValue());
- }
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (getAnnotation().valueTouches(pos, astRoot)) {
- result = sortedJavaValueChoices(filter);
- }
- return result;
- }
-
- protected Iterator<String> sortedJavaValueChoices(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(
- new FilteringIterator<String>(getSortedValueChoices(), filter));
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.getAnnotation().getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateMapsId(messages, reporter, astRoot);
- }
-
- protected void validateMapsId(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- // shortcut out if maps id is not even used
- if (! getDerivedIdentity().usesMapsIdDerivedIdentityStrategy()) {
- return;
- }
-
- // test whether value can be resolved
- AttributeMapping attributeMappingValue = getResolvedAttributeMappingValue();
- if (attributeMappingValue == null) {
- // if value is not specified, use that message
- if (getSpecifiedValue() == null) {
- messages.add(buildMessage(JpaValidationMessages.MAPS_ID_VALUE_NOT_SPECIFIED, null, astRoot));
- }
- else {
- messages.add(buildMessage(JpaValidationMessages.MAPS_ID_VALUE_NOT_RESOLVED, new String[] {getValue()}, astRoot));
- }
- }
-
- // test whether attribute mapping is allowable
- if (attributeMappingValue != null) {
- if (! CollectionTools.contains(getValidAttributeMappingChoices(), attributeMappingValue)) {
- messages.add(buildMessage(JpaValidationMessages.MAPS_ID_VALUE_INVALID, new String[] {getValue()}, astRoot));
- }
- }
- }
-
- protected Iterable<AttributeMapping> getValidAttributeMappingChoices() {
- return new CompositeIterable<AttributeMapping>(
- getAttributeMappingChoiceIterables(
- new FilteringIterable<AttributeMapping>(
- CollectionTools.collection(getMapping().getPersistentAttribute().getOwningTypeMapping().allAttributeMappings())) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(o.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- }
- }));
- }
-
- protected IMessage buildMessage(String msgID, String[] params, CompilationUnit astRoot) {
- PersistentAttribute attribute = getDerivedIdentity().getMapping().getPersistentAttribute();
- String attributeDesc = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
-
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- ArrayTools.add(params, 0, attributeDesc),
- this,
- this.getValidationTextRange(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaNamedQuery2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaNamedQuery2_0.java
deleted file mode 100644
index dfb4303377..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaNamedQuery2_0.java
+++ /dev/null
@@ -1,92 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaQuery;
-import org.eclipse.jpt.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaNamedQuery2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-/**
- * GenericJavaNamedQuery2_0
- */
-public class GenericJavaNamedQuery2_0 extends AbstractJavaQuery
- implements JavaNamedQuery2_0
-{
- protected LockModeType2_0 specifiedLockMode;
- protected LockModeType2_0 defaultLockMode;
-
- public GenericJavaNamedQuery2_0(JavaJpaContextNode parent) {
- super(parent);
- }
-
- // ********** NamedQuery2_0 implementation **********
-
- public LockModeType2_0 getLockMode() {
- return (this.specifiedLockMode != null) ? this.specifiedLockMode : this.defaultLockMode;
- }
-
- public LockModeType2_0 getSpecifiedLockMode() {
- return this.specifiedLockMode;
- }
-
- public void setSpecifiedLockMode(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.specifiedLockMode;
- this.specifiedLockMode = lockMode;
- this.getResourceQuery().setLockMode(LockModeType2_0.toJavaResourceModel(lockMode));
- this.firePropertyChanged(SPECIFIED_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- protected void setSpecifiedLockMode_(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.specifiedLockMode;
- this.specifiedLockMode = lockMode;
- this.firePropertyChanged(SPECIFIED_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- public LockModeType2_0 getDefaultLockMode() {
- return this.defaultLockMode;
- }
-
- protected void setDefaultLockMode(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.defaultLockMode;
- this.defaultLockMode = lockMode;
- firePropertyChanged(DEFAULT_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- protected LockModeType2_0 buildDefaultLockMode() {
- return LockModeType2_0.NONE;
- }
-
- // ********** resource => context **********
-
- public void initialize(NamedQueryAnnotation resourceQuery) {
- super.initialize(resourceQuery);
- this.defaultLockMode = this.buildDefaultLockMode();
- this.specifiedLockMode = this.getResourceQueryLockMode(resourceQuery);
- }
-
- public void update(NamedQueryAnnotation resourceQuery) {
- super.update(resourceQuery);
- this.setSpecifiedLockMode_(this.getResourceQueryLockMode(resourceQuery));
- }
-
- @Override
- protected NamedQuery2_0Annotation getResourceQuery() {
- return (NamedQuery2_0Annotation) super.getResourceQuery();
- }
-
- protected LockModeType2_0 getResourceQueryLockMode(NamedQueryAnnotation resourceQuery) {
- return LockModeType2_0.fromJavaResourceModel(
- ((NamedQuery2_0Annotation)resourceQuery).getLockMode());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.java
deleted file mode 100644
index 075d3b4d7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-
-
-public class GenericJavaOneToManyMapping2_0
- extends AbstractJavaOneToManyMapping<OneToMany2_0Annotation>
-{
- public GenericJavaOneToManyMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-
- @Override
- protected JavaRelationshipReference buildRelationshipReference() {
- return new GenericJavaOneToManyRelationshipReference2_0(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyRelationshipReference2_0.java
deleted file mode 100644
index 66a2234118..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToManyRelationshipReference2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyRelationshipReference;
-
-public class GenericJavaOneToManyRelationshipReference2_0
- extends AbstractJavaOneToManyRelationshipReference
-{
-
- public GenericJavaOneToManyRelationshipReference2_0(JavaOneToManyMapping parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy(this);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.java
deleted file mode 100644
index de4b0059c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-
-
-public class GenericJavaOneToOneMapping2_0
- extends AbstractJavaOneToOneMapping
-{
- public GenericJavaOneToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaOneToOneRelationshipReference2_0(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneRelationshipReference2_0.java
deleted file mode 100644
index 60878540a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOneToOneRelationshipReference2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToOneRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaJoinTableJoiningStrategy;
-
-public class GenericJavaOneToOneRelationshipReference2_0
- extends AbstractJavaOneToOneRelationshipReference
-{
-
- public GenericJavaOneToOneRelationshipReference2_0(JavaOneToOneMapping parent) {
- super(parent);
- }
-
- @Override
- protected JavaJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericJavaJoinTableJoiningStrategy(this);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.primaryKeyJoinColumnJoiningStrategy.primaryKeyJoinColumnsSize() > 0) {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
- else if (this.joinTableJoiningStrategy.getJoinTable() != null) {
- return this.joinTableJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java
deleted file mode 100644
index b80807365c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrderColumn2_0.java
+++ /dev/null
@@ -1,178 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-
-public class GenericJavaOrderColumn2_0
- extends AbstractJavaNamedColumn<OrderColumn2_0Annotation>
- implements JavaOrderColumn2_0
-{
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
-
- public GenericJavaOrderColumn2_0(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- protected OrderColumn2_0Annotation getNonNullOrderColumnAnnotation(JavaResourcePersistentAttribute resource) {
- return (OrderColumn2_0Annotation) resource.getNonNullAnnotation(OrderColumn2_0Annotation.ANNOTATION_NAME);
- }
-
- public void initialize(JavaResourcePersistentAttribute resource) {
- this.initialize(getNonNullOrderColumnAnnotation(resource));
- }
-
- @Override
- public void initialize(OrderColumn2_0Annotation column) {
- super.initialize(column);
- this.specifiedNullable = this.getResourceNullable(column);
- this.specifiedInsertable = this.getResourceInsertable(column);
- this.specifiedUpdatable = this.getResourceUpdatable(column);
- }
-
- public void update(JavaResourcePersistentAttribute resource) {
- this.update(getNonNullOrderColumnAnnotation(resource));
- }
-
- @Override
- public void update(OrderColumn2_0Annotation column) {
- super.update(column);
- this.setSpecifiedNullable_(this.getResourceNullable(column));
- this.setSpecifiedInsertable_(this.getResourceInsertable(column));
- this.setSpecifiedUpdatable_(this.getResourceUpdatable(column));
- }
-
- @Override
- public JavaOrderable2_0 getParent() {
- return (JavaOrderable2_0) super.getParent();
- }
-
- @Override
- public String getTable() {
- return getParent().getDefaultTableName();
- }
-
- public boolean isNullable() {
- return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
- }
-
- public boolean isDefaultNullable() {
- return BaseColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- this.getResourceColumn().setNullable(newSpecifiedNullable);
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- protected Boolean getResourceNullable(OrderColumn2_0Annotation column) {
- return column.getNullable();
- }
-
- public boolean isInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
- }
-
- public boolean isDefaultInsertable() {
- return BaseColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- protected Boolean getResourceInsertable(OrderColumn2_0Annotation column) {
- return column.getInsertable();
- }
-
- public boolean isUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
- }
-
- public boolean isDefaultUpdatable() {
- return BaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- protected Boolean getResourceUpdatable(OrderColumn2_0Annotation column) {
- return column.getUpdatable();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrphanRemoval2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrphanRemoval2_0.java
deleted file mode 100644
index 8587f04505..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaOrphanRemoval2_0.java
+++ /dev/null
@@ -1,109 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OrphanRemovable2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * GenericJavaOrphanRemoval2_0
- */
-public class GenericJavaOrphanRemoval2_0
- extends AbstractJavaJpaContextNode
- implements JavaOrphanRemovable2_0
-{
- protected boolean defaultOrphanRemoval;
- protected Boolean specifiedOrphanRemoval;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public GenericJavaOrphanRemoval2_0(JavaOrphanRemovalHolder2_0 parent) {
- super(parent);
- }
-
- @Override
- public JavaOrphanRemovalHolder2_0 getParent() {
- return (JavaOrphanRemovalHolder2_0) super.getParent();
- }
-
- protected String getAnnotationName() {
- return ((JavaAttributeMapping)getParent()).getAnnotationName();
- }
-
- protected OrphanRemovable2_0Annotation getResourceOrphanRemovable() {
- return (OrphanRemovable2_0Annotation) this.resourcePersistentAttribute.getAnnotation(this.getAnnotationName());
- }
-
- // ********** OrphanRemovable2_0 implementation **********
-
- public boolean isOrphanRemoval() {
- return this.specifiedOrphanRemoval != null ? this.specifiedOrphanRemoval.booleanValue() : this.defaultOrphanRemoval;
- }
-
- public Boolean getSpecifiedOrphanRemoval() {
- return this.specifiedOrphanRemoval;
- }
-
- public boolean isDefaultOrphanRemoval() {
- return this.defaultOrphanRemoval;
- }
-
- protected void setDefaultOrphanRemoval(boolean newDefaultOrphanRemoval) {
- boolean old = this.defaultOrphanRemoval;
- this.defaultOrphanRemoval = newDefaultOrphanRemoval;
- this.firePropertyChanged(DEFAULT_ORPHAN_REMOVAL_PROPERTY, old, newDefaultOrphanRemoval);
- }
-
- public void setSpecifiedOrphanRemoval(Boolean newOrphanRemoval) {
- Boolean old = this.specifiedOrphanRemoval;
- this.specifiedOrphanRemoval = newOrphanRemoval;
- this.getResourceOrphanRemovable().setOrphanRemoval(newOrphanRemoval);
- this.firePropertyChanged(SPECIFIED_ORPHAN_REMOVAL_PROPERTY, old, newOrphanRemoval);
- }
-
- protected void setSpecifiedOrphanRemoval_(Boolean newSpecifiedOrphanRemoval) {
- Boolean old = this.specifiedOrphanRemoval;
- this.specifiedOrphanRemoval = newSpecifiedOrphanRemoval;
- this.firePropertyChanged(SPECIFIED_ORPHAN_REMOVAL_PROPERTY, old, newSpecifiedOrphanRemoval);
- }
-
- // ********** initialize/update **********
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- OrphanRemovable2_0Annotation resource = this.getResourceOrphanRemovable();
- this.specifiedOrphanRemoval = this.getSpecifiedOrphanRemovalFrom(resource);
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- OrphanRemovable2_0Annotation resource = this.getResourceOrphanRemovable();
- this.setSpecifiedOrphanRemoval_(this.getSpecifiedOrphanRemovalFrom(resource));
- }
-
- private Boolean getSpecifiedOrphanRemovalFrom(OrphanRemovable2_0Annotation resource) {
- return (resource == null) ? null : resource.getOrphanRemoval();
- }
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- // TODO
- return null;
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0.java
deleted file mode 100644
index 9b979f879f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * JPA 2.0 Java persistent attribute
- */
-public class GenericJavaPersistentAttribute2_0
- extends AbstractJavaPersistentAttribute
- implements JavaPersistentAttribute2_0
-{
- protected AccessType specifiedAccess;
-
-
- public GenericJavaPersistentAttribute2_0(PersistentType parent, JavaResourcePersistentAttribute resourcePersistentAttribute) {
- super(parent, resourcePersistentAttribute);
- this.specifiedAccess = this.buildSpecifiedAccess();
- }
-
-
- // ********** AccessHolder implementation **********
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- /**
- * Don't support changing to specified access on a java persistent attribute, this
- * involves a larger process of moving the annotations to the corresponding field/property
- * which may or may not exist or might need to be created.
- */
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- throw new UnsupportedOperationException();
- }
-
- protected void setSpecifiedAccess_(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- protected AccessType buildSpecifiedAccess() {
- Access2_0Annotation accessAnnotation =
- (Access2_0Annotation) this.resourcePersistentAttribute.
- getAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- return accessAnnotation == null ? null : AccessType.fromJavaResourceModel(accessAnnotation.getValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedAccess_(this.buildSpecifiedAccess());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentType2_0.java
deleted file mode 100644
index 46939ff675..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaPersistentType2_0.java
+++ /dev/null
@@ -1,148 +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.core.internal.jpa2.context.java;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentType;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentType2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.BodySourceWriter;
-
-/**
- * JPA 2.0 Java persistent type.
- * Support for specified access and metamodel generation.
- */
-public class GenericJavaPersistentType2_0
- extends AbstractJavaPersistentType
- implements JavaPersistentType2_0
-{
- protected String declaringTypeName;
-
- protected final MetamodelSourceType.Synchronizer metamodelSynchronizer;
-
-
- public GenericJavaPersistentType2_0(PersistentType.Owner parent, JavaResourcePersistentType jrpt) {
- super(parent, jrpt);
- this.metamodelSynchronizer = this.buildMetamodelSynchronizer();
- }
-
- @Override
- protected void initialize(JavaResourcePersistentType jrpt) {
- super.initialize(jrpt);
- this.declaringTypeName = this.buildDeclaringTypeName();
- }
-
- protected MetamodelSourceType.Synchronizer buildMetamodelSynchronizer() {
- return ((JpaFactory2_0) this.getJpaFactory()).buildMetamodelSynchronizer(this);
- }
-
- @Override
- public void update() {
- super.update();
- this.setDeclaringTypeName(this.buildDeclaringTypeName());
- }
-
-
- // ********** access **********
-
- protected Access2_0Annotation getAccessAnnotation() {
- return (Access2_0Annotation) this.resourcePersistentType.getNonNullAnnotation(this.getAccessAnnotationName());
- }
-
- protected String getAccessAnnotationName() {
- return Access2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected AccessType buildSpecifiedAccess() {
- return AccessType.fromJavaResourceModel(this.getAccessAnnotation().getValue());
- }
-
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.getAccessAnnotation().setValue(AccessType.toJavaResourceModel(specifiedAccess));
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- protected void setSpecifiedAccess_(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- @Override
- protected Iterator<JavaResourcePersistentAttribute> resourceAttributes() {
- return (this.specifiedAccess == null) ?
- super.resourceAttributes() :
- this.resourcePersistentType.persistableAttributes(AccessType.toJavaResourceModel(this.specifiedAccess));
- }
-
- @Override
- public void updateAccess() {
- super.updateAccess();
- this.setSpecifiedAccess_(this.buildSpecifiedAccess());
- }
-
-
- // ********** declaring type name **********
-
- public String getDeclaringTypeName() {
- return this.declaringTypeName;
- }
-
- protected void setDeclaringTypeName(String declaringTypeName) {
- String old = this.declaringTypeName;
- this.declaringTypeName = declaringTypeName;
- this.firePropertyChanged(DECLARING_TYPE_NAME_PROPERTY, old, declaringTypeName);
- }
-
- protected String buildDeclaringTypeName() {
- return this.resourcePersistentType.getDeclaringTypeName();
- }
-
-
- // ********** metamodel **********
-
- public IFile getMetamodelFile() {
- return this.metamodelSynchronizer.getFile();
- }
-
- public void initializeMetamodel() {
- // do nothing - probably shouldn't be called...
- }
-
- public boolean isManaged() {
- return true;
- }
-
- public void synchronizeMetamodel(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- this.metamodelSynchronizer.synchronize(memberTypeTree);
- }
-
- public void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- this.metamodelSynchronizer.printBodySourceOn(pw, memberTypeTree);
- }
-
- public void disposeMetamodel() {
- // do nothing - probably shouldn't be called...
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java
deleted file mode 100644
index 242ab12a17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java
+++ /dev/null
@@ -1,139 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaSequenceGenerator;
-import org.eclipse.jpt.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-
-/**
- * Generic2_0JavaSequenceGenerator
- */
-public class GenericJavaSequenceGenerator2_0 extends AbstractJavaSequenceGenerator
- implements SequenceGenerator2_0
-{
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- public GenericJavaSequenceGenerator2_0(JavaJpaContextNode parent) {
- super(parent);
- }
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.getResourceGenerator().setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.getResourceGenerator().setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- // ********** resource => context **********
-
- @Override
- public void initialize(SequenceGeneratorAnnotation resourceSequenceGenerator) {
- super.initialize(resourceSequenceGenerator);
- SequenceGenerator2_0Annotation resource = (SequenceGenerator2_0Annotation) resourceSequenceGenerator;
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = resource.getCatalog();
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = resource.getSchema();
- }
-
- @Override
- public void update(SequenceGeneratorAnnotation resourceSequenceGenerator) {
- super.update(resourceSequenceGenerator);
- SequenceGenerator2_0Annotation resource = (SequenceGenerator2_0Annotation) resourceSequenceGenerator;
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(resource.getCatalog());
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(resource.getSchema());
- }
-
- @Override
- protected SequenceGenerator2_0Annotation getResourceGenerator() {
- return (SequenceGenerator2_0Annotation) super.getResourceGenerator();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index 1241c2ab88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy.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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy;
-
-public class GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy
- extends AbstractJavaJoinColumnInRelationshipMappingJoiningStrategy
-{
-
- public GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy(JavaJoinColumnEnabledRelationshipReference parent) {
- super(parent);
- }
-
- public TypeMapping getRelationshipSource() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public TypeMapping getRelationshipTarget() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- @Override
- protected Entity getRelationshipTargetEntity() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return relationshipTarget.getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY ? (Entity) relationshipTarget : null;
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaElementCollectionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaElementCollectionMappingDefinition2_0.java
deleted file mode 100644
index 3a276373a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaElementCollectionMappingDefinition2_0.java
+++ /dev/null
@@ -1,57 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-
-public class JavaElementCollectionMappingDefinition2_0
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaElementCollectionMappingDefinition2_0 INSTANCE =
- new JavaElementCollectionMappingDefinition2_0();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaElementCollectionMappingDefinition2_0() {
- super();
- }
-
- public String getKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return ElementCollection2_0Annotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((JpaFactory2_0) factory).buildJavaElementCollectionMapping2_0(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaIdMappingDefinition2_0.java
deleted file mode 100644
index d8948bc5ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/JavaIdMappingDefinition2_0.java
+++ /dev/null
@@ -1,37 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-
-public class JavaIdMappingDefinition2_0
- extends AbstractJavaIdMappingDefinition2_0
-{
- // singleton
- private static final JavaIdMappingDefinition2_0 INSTANCE =
- new JavaIdMappingDefinition2_0();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaIdMappingDefinition2_0() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaCacheable2_0.java
deleted file mode 100644
index 7110530551..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaCacheable2_0.java
+++ /dev/null
@@ -1,56 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class NullJavaCacheable2_0
- extends AbstractJavaJpaContextNode
- implements JavaCacheable2_0
-{
- public NullJavaCacheable2_0(JavaCacheableHolder2_0 parent) {
- super(parent);
- }
-
- public Boolean getSpecifiedCacheable() {
- return null;
- }
-
- public void setSpecifiedCacheable(Boolean newSpecifiedCacheable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isCacheable() {
- return false;
- }
-
- public boolean isDefaultCacheable() {
- return false;
- }
-
- public void initialize(JavaResourcePersistentType jrpt) {
- //no-op
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- //no-op
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaDerivedIdentity2_0.java
deleted file mode 100644
index 96e0f78fea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaDerivedIdentity2_0.java
+++ /dev/null
@@ -1,90 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.IdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.MapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class NullJavaDerivedIdentity2_0
- extends AbstractJavaJpaContextNode
- implements JavaDerivedIdentity2_0
-{
- public NullJavaDerivedIdentity2_0(JavaSingleRelationshipMapping2_0 parent) {
- super(parent);
- }
-
-
- public JavaSingleRelationshipMapping2_0 getMapping() {
- return (JavaSingleRelationshipMapping2_0) getParent();
- }
-
- public void initialize() {
- // no op
- }
-
- public void update() {
- // no op
- }
-
- public DerivedIdentityStrategy2_0 getPredominantDerivedIdentityStrategy() {
- return null;
- }
-
- public MapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy() {
- return null;
- }
-
- public boolean usesMapsIdDerivedIdentityStrategy() {
- return false;
- }
-
- public void setMapsIdDerivedIdentityStrategy() {
- // no op
- }
-
- public void unsetMapsIdDerivedIdentityStrategy() {
- // no op
- }
-
- public IdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy() {
- return null;
- }
-
- public boolean usesIdDerivedIdentityStrategy() {
- return false;
- }
-
- public void setIdDerivedIdentityStrategy() {
- // no op
- }
-
- public void unsetIdDerivedIdentityStrategy() {
- // no op
- }
-
- public boolean usesNullDerivedIdentityStrategy() {
- return true;
- }
-
- public void setNullDerivedIdentityStrategy() {
- // no op
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaMapKeyColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaMapKeyColumn2_0.java
deleted file mode 100644
index 9be228255c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaMapKeyColumn2_0.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.core.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-
-public class NullJavaMapKeyColumn2_0
- extends AbstractJavaJpaContextNode
- implements JavaColumn
-{
-
- public NullJavaMapKeyColumn2_0(JavaJpaContextNode parent) {
- super(parent);
- }
-
- public void initialize(JavaResourcePersistentAttribute resource) {
- //no-op
- }
-
- public void update(JavaResourcePersistentAttribute resource) {
- //no-op
- }
-
- public void initialize(ColumnAnnotation resourceColumn) {
- //no-op
- }
-
- public void update(ColumnAnnotation resourceColumn) {
- //no-op
- }
-
- public String getName() {
- return null;
- }
-
- public String getSpecifiedName() {
- return null;
- }
-
- public void setSpecifiedName(String newSpecifiedName) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultName() {
- return null;
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean isNullable() {
- return false;
- }
-
- public boolean isDefaultNullable() {
- return false;
- }
-
- public Boolean getSpecifiedNullable() {
- return null;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isInsertable() {
- return false;
- }
-
- public boolean isDefaultInsertable() {
- return false;
- }
-
- public Boolean getSpecifiedInsertable() {
- return null;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isUpdatable() {
- return false;
- }
-
- public boolean isDefaultUpdatable() {
- return false;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return null;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public int getDefaultLength() {
- return 0;
- }
-
- public int getDefaultPrecision() {
- return 0;
- }
-
- public int getDefaultScale() {
- return 0;
- }
-
- public int getLength() {
- return 0;
- }
-
- public int getPrecision() {
- return 0;
- }
-
- public int getScale() {
- return 0;
- }
-
- public Integer getSpecifiedLength() {
- return null;
- }
-
- public Integer getSpecifiedPrecision() {
- return null;
- }
-
- public Integer getSpecifiedScale() {
- return null;
- }
-
- public void setSpecifiedLength(Integer newSpecifiedLength) {
- throw new UnsupportedOperationException();
- }
-
- public void setSpecifiedPrecision(Integer newSpecifiedPrecision) {
- throw new UnsupportedOperationException();
- }
-
- public void setSpecifiedScale(Integer newSpecifiedScale) {
- throw new UnsupportedOperationException();
- }
-
- public Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- public String getDefaultTable() {
- return null;
- }
-
- public String getSpecifiedTable() {
- return null;
- }
-
- public String getTable() {
- return null;
- }
-
- public void setSpecifiedTable(String value) {
- throw new UnsupportedOperationException();
- }
-
- public Boolean getSpecifiedUnique() {
- return null;
- }
-
- public void setSpecifiedUnique(Boolean newSpecifiedUnique) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isDefaultUnique() {
- return false;
- }
-
- public boolean isUnique() {
- return false;
- }
-
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String value) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableNameIsInvalid() {
- return false;
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public Column getDbColumn() {
- return null;
- }
-
- public Table getDbTable() {
- return null;
- }
-
- public boolean isResolved() {
- return false;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrderColumn2_0.java
deleted file mode 100644
index b46cca3ba4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrderColumn2_0.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-public class NullJavaOrderColumn2_0
- extends AbstractJavaNamedColumn<OrderColumn2_0Annotation>
- implements JavaOrderColumn2_0
-{
-
- public NullJavaOrderColumn2_0(JavaJpaContextNode parent, JavaNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- public void initialize(JavaResourcePersistentAttribute resource) {
- //no-op
- }
-
- public void update(JavaResourcePersistentAttribute resource) {
- //no-op
- }
-
- public boolean isNullable() {
- return false;
- }
-
- public boolean isDefaultNullable() {
- return false;
- }
-
- public Boolean getSpecifiedNullable() {
- return null;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isInsertable() {
- return false;
- }
-
- public boolean isDefaultInsertable() {
- return false;
- }
-
- public Boolean getSpecifiedInsertable() {
- return null;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isUpdatable() {
- return false;
- }
-
- public boolean isDefaultUpdatable() {
- return false;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return null;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrphanRemoval2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrphanRemoval2_0.java
deleted file mode 100644
index 03633a8565..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/NullJavaOrphanRemoval2_0.java
+++ /dev/null
@@ -1,64 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * NullJavaOrphanRemoval2_0
- */
-public class NullJavaOrphanRemoval2_0
- extends AbstractJavaJpaContextNode
- implements JavaOrphanRemovable2_0
-{
- // ********** constructor **********
- public NullJavaOrphanRemoval2_0(JavaOrphanRemovalHolder2_0 parent) {
- super(parent);
- }
-
- // ********** OrphanRemovable2_0 implementation **********
-
- public boolean isOrphanRemoval() {
- return false;
- }
-
- public Boolean getSpecifiedOrphanRemoval() {
- return null;
- }
-
- public boolean isDefaultOrphanRemoval() {
- return false;
- }
-
- public void setSpecifiedOrphanRemoval(Boolean newSpecifiedOrphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- // ********** JavaOrphanRemovable2_0 implementation **********
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- // do nothing
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- // do nothing
- }
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverride2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverride2_0Annotation.java
deleted file mode 100644
index 122c3f6bc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverride2_0Annotation.java
+++ /dev/null
@@ -1,60 +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.core.internal.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.VirtualAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinTableAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class VirtualAssociationOverride2_0Annotation
- extends VirtualAssociationOverrideAnnotation
- implements AssociationOverride2_0Annotation
-{
-
- private final JoinTableAnnotation joinTable;
-
- public VirtualAssociationOverride2_0Annotation(JavaResourcePersistentMember parent, String name, JoiningStrategy joiningStrategy) {
- super(parent, name, joiningStrategy);
- this.joinTable = this.buildJoinTable();
- }
-
- protected JoinTableAnnotation buildJoinTable() {
- if (this.joiningStrategy instanceof JoinTableJoiningStrategy) {
- return new VirtualAssociationOverrideJoinTableAnnotation(this, ((JoinTableJoiningStrategy)this.joiningStrategy).getJoinTable());
- }
- return new NullJoinTableAnnotation(this);
- }
-
- // ***** join table
-
- public JoinTableAnnotation getJoinTable() {
- return this.joinTable;
- }
-
- public JoinTableAnnotation getNonNullJoinTable() {
- return this.joinTable;
- }
-
- public JoinTableAnnotation addJoinTable() {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinTable() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverrideJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverrideJoinTableAnnotation.java
deleted file mode 100644
index 62b0475fd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/VirtualAssociationOverrideJoinTableAnnotation.java
+++ /dev/null
@@ -1,133 +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.core.internal.jpa2.context.java;
-
-import java.util.ListIterator;
-import java.util.Vector;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.internal.context.java.VirtualAssociationOverrideJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinTableAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public final class VirtualAssociationOverrideJoinTableAnnotation extends NullJoinTableAnnotation
- implements JoinTableAnnotation
-{
- private JoinTable joinTable; //TODO uniqueConstraints
-
- private final Vector<JoinColumnAnnotation> joinColumns;
-
- private final Vector<JoinColumnAnnotation> inverseJoinColumns;
-
- public VirtualAssociationOverrideJoinTableAnnotation(AssociationOverride2_0Annotation parent, JoinTable joinTable) {
- super(parent);
- this.joinTable = joinTable;
- this.joinColumns = this.buildJoinColumns();
- this.inverseJoinColumns = this.buildInverseJoinColumns();
- }
-
- @Override
- protected JoinTableAnnotation addAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(this.joinTable.joinColumnsSize());
- for (JoinColumn joinColumn : CollectionTools.iterable(this.joinTable.joinColumns())) {
- result.add(new VirtualAssociationOverrideJoinColumnAnnotation(this, joinColumn));
- }
- return result;
- }
-
- private Vector<JoinColumnAnnotation> buildInverseJoinColumns() {
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(this.joinTable.inverseJoinColumnsSize());
- for (JoinColumn joinColumn : CollectionTools.iterable(this.joinTable.inverseJoinColumns())) {
- result.add(new VirtualAssociationOverrideJoinColumnAnnotation(this, joinColumn));
- }
- return result;
- }
-
- @Override
- public String getName() {
- return this.joinTable.getSpecifiedName();
- }
-
- @Override
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getCatalog() {
- return this.joinTable.getCatalog();
- }
-
- @Override
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getSchema() {
- return this.joinTable.getSchema();
- }
-
- @Override
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- // ***** join columns
- @Override
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return this.joinColumns.listIterator();
- }
-
- @Override
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.elementAt(index);
- }
-
- @Override
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- @Override
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- // ***** inverse join columns
- @Override
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return this.inverseJoinColumns.listIterator();
- }
-
- @Override
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.elementAt(index);
- }
-
- @Override
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- @Override
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
deleted file mode 100644
index 00b1d5be03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,1876 +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.core.internal.jpa2.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.BaseOverride;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.Fetchable;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverrideColumn;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.Attributes;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public abstract class AbstractOrmElementCollectionMapping2_0<T extends XmlElementCollection>
- extends AbstractOrmAttributeMapping<T>
- implements OrmElementCollectionMapping2_0
-{
-
- protected String specifiedTargetClass;
- protected String defaultTargetClass;
- protected PersistentType resolvedTargetType;
- protected Embeddable resolvedTargetEmbeddable;
-
- protected FetchType specifiedFetch;
-
- protected final OrmOrderable2_0 orderable;
-
- protected final OrmCollectionTable2_0 collectionTable;
-
- protected Type valueType;
-
- protected final OrmColumn valueColumn;
-
- protected OrmConverter valueConverter;
-
- protected final OrmConverter nullValueConverter;
-
- protected final OrmAttributeOverrideContainer valueAttributeOverrideContainer;
-
- protected final OrmAssociationOverrideContainer valueAssociationOverrideContainer;
-
- protected Type keyType;
-
- protected String specifiedMapKey;
- protected boolean noMapKey = false;
- protected boolean pkMapKey = false;
- protected boolean customMapKey = false;
-
- protected String specifiedMapKeyClass;
- protected String defaultMapKeyClass;
- protected PersistentType resolvedMapKeyType;
- protected Embeddable resolvedMapKeyEmbeddable;
- protected Entity resolvedMapKeyEntity;
-
- protected final OrmColumn mapKeyColumn;
-
- protected final OrmAttributeOverrideContainer mapKeyAttributeOverrideContainer;
-
- protected AbstractOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, T resourceMapping) {
- super(parent, resourceMapping);
- this.specifiedFetch = this.getResourceFetch();
- this.orderable = getXmlContextNodeFactory().buildOrmOrderable(this, buildOrderableOwner());
- this.specifiedTargetClass = getResourceTargetClass();
- this.defaultTargetClass = buildDefaultTargetClass();
- this.resolvedTargetType = this.resolveTargetType();
- this.resolvedTargetEmbeddable = resolveTargetEmbeddable();
- this.collectionTable = getXmlContextNodeFactory().buildOrmCollectionTable(this, getResourceCollectionTable());
- this.valueType = this.buildValueType();
- this.valueColumn = getXmlContextNodeFactory().buildOrmColumn(this, new ValueColumnOwner());
- this.nullValueConverter = this.getXmlContextNodeFactory().buildOrmNullConverter(this);
- this.valueConverter = this.buildConverter(this.getResourceConverterType());
- this.valueAssociationOverrideContainer = buildValueAssociationOverrideContainer();
- this.valueAttributeOverrideContainer = buildValueAttributeOverrideContainer();
- this.resolvedMapKeyType = this.resolveMapKeyType();
- this.resolvedMapKeyEmbeddable = this.resolveMapKeyEmbeddable();
- this.resolvedMapKeyEntity = this.resolveMapKeyEntity();
- this.initializeMapKey();
- this.defaultMapKeyClass = this.buildDefaultMapKeyClass();
- this.specifiedMapKeyClass = this.getResourceMapKeyClass();
- this.mapKeyColumn = getXmlContextNodeFactory().buildOrmColumn(this, new MapKeyColumnOwner());
- this.mapKeyAttributeOverrideContainer = this.buildMapKeyAttributeOverrideContainer();
- }
-
- @Override
- public void update() {
- super.update();
- this.setSpecifiedTargetClass_(this.getResourceTargetClass());
- this.setDefaultTargetClass(this.buildDefaultTargetClass());
- this.resolvedTargetType = this.resolveTargetType();
- this.setResolvedTargetEmbeddable(this.resolveTargetEmbeddable());
- this.setSpecifiedFetch_(this.getResourceFetch());
- this.orderable.update();
- this.collectionTable.update();
- this.setValueType(buildValueType());
- this.valueColumn.update(getResourceColumn());
- this.valueAttributeOverrideContainer.update();
- this.valueAssociationOverrideContainer.update();
- this.updateValueConverter();
- this.resolvedMapKeyType = this.resolveMapKeyType();//no need for change notification, use resolved target embeddable change notification instead?
- this.setResolvedMapKeyEmbeddable(this.resolveMapKeyEmbeddable());
- this.setResolvedMapKeyEntity(this.resolveMapKeyEntity());
- this.setKeyType(buildKeyType());
- this.updateMapKey();
- this.setDefaultMapKeyClass(this.buildDefaultMapKeyClass());
- this.setSpecifiedMapKeyClass_(this.getResourceMapKeyClass());
- this.mapKeyColumn.update(getResourceMapKeyColumn());
- this.mapKeyAttributeOverrideContainer.update();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- this.valueAssociationOverrideContainer.postUpdate();
- }
-
- @Override
- protected OrmXml2_0ContextNodeFactory getXmlContextNodeFactory() {
- return super.getXmlContextNodeFactory();
- }
-
- public Entity getEntity() {
- return getTypeMapping().getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY ? (Entity) getTypeMapping() : null;
- }
-
-
- //************* AttributeMapping implementation ***************
-
- public String getKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- //************* OrmAttributeMapping implementation ***************
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public int getXmlSequence() {
- return 75;
- }
-
- public void addToResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getElementCollections().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(Attributes resourceAttributes) {
- resourceAttributes.getElementCollections().remove(this.resourceAttributeMapping);
- }
-
-
- // **************** target class ******************************************
-
- public char getTargetClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getTargetClass() {
- return (this.specifiedTargetClass != null) ? this.specifiedTargetClass : this.defaultTargetClass;
- }
-
- public String getSpecifiedTargetClass() {
- return this.specifiedTargetClass;
- }
-
- public void setSpecifiedTargetClass(String targetClass) {
- String old = this.specifiedTargetClass;
- this.specifiedTargetClass = targetClass;
- this.resourceAttributeMapping.setTargetClass(targetClass);
- this.firePropertyChanged(SPECIFIED_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- protected void setSpecifiedTargetClass_(String targetClass) {
- String old = this.specifiedTargetClass;
- this.specifiedTargetClass = targetClass;
- this.firePropertyChanged(SPECIFIED_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- public String getDefaultTargetClass() {
- return this.defaultTargetClass;
- }
-
- protected void setDefaultTargetClass(String targetClass) {
- String old = this.defaultTargetClass;
- this.defaultTargetClass = targetClass;
- this.firePropertyChanged(DEFAULT_TARGET_CLASS_PROPERTY, old, targetClass);
- }
-
- public Embeddable getResolvedTargetEmbeddable() {
- return this.resolvedTargetEmbeddable;
- }
-
- protected void setResolvedTargetEmbeddable(Embeddable targetEmbeddable) {
- Embeddable old = this.resolvedTargetEmbeddable;
- this.resolvedTargetEmbeddable = targetEmbeddable;
- this.firePropertyChanged(RESOLVED_TARGET_EMBEDDABLE_PROPERTY, old, targetEmbeddable);
- }
-
- public PersistentType getResolvedTargetType() {
- return this.resolvedTargetType;
- }
-
- protected String getResourceTargetClass() {
- return this.resourceAttributeMapping.getTargetClass();
- }
-
- protected String buildDefaultTargetClass() {
- if (this.getJavaPersistentAttribute() != null) {
- return this.getJavaPersistentAttribute().getMultiReferenceTargetTypeName();
- }
- return null;
- }
-
- protected PersistentType resolveTargetType() {
- return this.resolvePersistentType(this.getTargetClass());
- }
-
- protected Embeddable resolveTargetEmbeddable() {
- if (this.resolvedTargetType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedTargetType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- //************* Fetchable *************
-
- public FetchType getFetch() {
- return (this.getSpecifiedFetch() == null) ? this.getDefaultFetch() : this.getSpecifiedFetch();
- }
-
- public FetchType getDefaultFetch() {
- return DEFAULT_FETCH_TYPE;
- }
-
- public FetchType getSpecifiedFetch() {
- return this.specifiedFetch;
- }
-
- public void setSpecifiedFetch(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- this.resourceAttributeMapping.setFetch(FetchType.toOrmResourceModel(newSpecifiedFetch));
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected void setSpecifiedFetch_(FetchType newSpecifiedFetch) {
- FetchType oldFetch = this.specifiedFetch;
- this.specifiedFetch = newSpecifiedFetch;
- firePropertyChanged(Fetchable.SPECIFIED_FETCH_PROPERTY, oldFetch, newSpecifiedFetch);
- }
-
- protected FetchType getResourceFetch() {
- return FetchType.fromOrmResourceModel(this.resourceAttributeMapping.getFetch());
- }
-
- // **************** collection table ***********************************************
-
- public OrmCollectionTable2_0 getCollectionTable() {
- return this.collectionTable;
- }
-
- public XmlCollectionTable getResourceCollectionTable() {
- return this.resourceAttributeMapping.getCollectionTable();
- }
-
-
- // ************** value column ********************************************
-
- public OrmColumn getValueColumn() {
- return this.valueColumn;
- }
-
- protected XmlColumn getResourceColumn() {
- return this.resourceAttributeMapping.getColumn();
- }
-
-
- // *********** value converter *************
-
- public OrmConverter getConverter() {
- return this.valueConverter;
- }
-
- protected String getConverterType() {
- return this.valueConverter.getType();
- }
-
- public void setConverter(String converterType) {
- if (this.valuesAreEqual(getConverterType(), converterType)) {
- return;
- }
- OrmConverter oldConverter = this.valueConverter;
- OrmConverter newConverter = buildConverter(converterType);
- this.valueConverter = this.nullValueConverter;
- if (oldConverter != null) {
- oldConverter.removeFromResourceModel();
- }
- this.valueConverter = newConverter;
- if (newConverter != null) {
- newConverter.addToResourceModel();
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(OrmConverter newConverter) {
- OrmConverter oldConverter = this.valueConverter;
- this.valueConverter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected OrmConverter buildConverter(String converterType) {
- if (this.valuesAreEqual(converterType, Converter.NO_CONVERTER)) {
- return this.nullValueConverter;
- }
- if (this.valuesAreEqual(converterType, Converter.ENUMERATED_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmEnumeratedConverter(this, this.resourceAttributeMapping);
- }
- if (this.valuesAreEqual(converterType, Converter.TEMPORAL_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmTemporalConverter(this, this.resourceAttributeMapping);
- }
- if (this.valuesAreEqual(converterType, Converter.LOB_CONVERTER)) {
- return getXmlContextNodeFactory().buildOrmLobConverter(this, this.resourceAttributeMapping);
- }
- return null;
- }
-
- protected String getResourceConverterType() {
- if (this.resourceAttributeMapping.getEnumerated() != null) {
- return Converter.ENUMERATED_CONVERTER;
- }
- else if (this.resourceAttributeMapping.getTemporal() != null) {
- return Converter.TEMPORAL_CONVERTER;
- }
- else if (this.resourceAttributeMapping.isLob()) {
- return Converter.LOB_CONVERTER;
- }
-
- return Converter.NO_CONVERTER;
- }
-
- protected void updateValueConverter() {
- if (this.valuesAreEqual(getResourceConverterType(), getConverterType())) {
- getConverter().update();
- }
- else {
- setConverter(buildConverter(getResourceConverterType()));
- }
- }
-
-
- public Type getValueType() {
- return this.valueType;
- }
-
- protected void setValueType(Type newValueType) {
- Type old = this.valueType;
- this.valueType = newValueType;
- firePropertyChanged(VALUE_TYPE_PROPERTY, old, newValueType);
- }
-
- protected Type buildValueType() {
- if (getResolvedTargetEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- else if (getTargetClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- public Type getKeyType() {
- return this.keyType;
- }
-
- protected void setKeyType(Type newKeyType) {
- Type old = this.keyType;
- this.keyType = newKeyType;
- firePropertyChanged(KEY_TYPE_PROPERTY, old, newKeyType);
- }
-
- protected Type buildKeyType() {
- if (getResolvedMapKeyEmbeddable() != null) {
- return Type.EMBEDDABLE_TYPE;
- }
- if (getResolvedMapKeyEntity() != null) {
- return Type.ENTITY_TYPE;
- }
- else if (getMapKeyClass() == null) {
- return Type.NO_TYPE;
- }
- return Type.BASIC_TYPE;
- }
-
- // ************** value column ********************************************
-
- public OrmColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- protected XmlColumn getResourceMapKeyColumn() {
- return this.resourceAttributeMapping.getMapKeyColumn();
- }
-
- // **************** ordering ***********************************************
-
- public OrmOrderable2_0 getOrderable() {
- return this.orderable;
- }
-
- protected Orderable2_0.Owner buildOrderableOwner() {
- return new Orderable2_0.Owner() {
- public String getTableName() {
- return getCollectionTable().getName();
- }
- public Table getDbTable(String tableName) {
- return getCollectionTable().getDbTable();
- }
- };
- }
-
-
- // **************** overrides ***********************************************
-
- public OrmAttributeOverrideContainer getValueAttributeOverrideContainer() {
- return this.valueAttributeOverrideContainer;
- }
-
- protected OrmAttributeOverrideContainer buildValueAttributeOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAttributeOverrideContainer(this, new ValueAttributeOverrideContainerOwner());
- }
-
- protected JavaAttributeOverride getJavaValueAttributeOverrideNamed(String attributeName) {
- if (getJavaElementCollectionMapping() != null) {
- return getJavaElementCollectionMapping().getValueAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- }
- return null;
- }
-
- public OrmAssociationOverrideContainer getValueAssociationOverrideContainer() {
- return this.valueAssociationOverrideContainer;
- }
-
- protected OrmAssociationOverrideContainer buildValueAssociationOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAssociationOverrideContainer(this, new AssociationOverrideContainerOwner());
- }
-
- protected JavaAssociationOverride getJavaValueAssociationOverrideNamed(String attributeName) {
- if (getJavaElementCollectionMapping() != null) {
- return getJavaElementCollectionMapping().getValueAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- }
- return null;
- }
-
- protected JavaElementCollectionMapping2_0 getJavaElementCollectionMapping() {
- if (this.getJavaPersistentAttribute() == null) {
- return null;
- }
- AttributeMapping javaAttributeMapping = this.getJavaPersistentAttribute().getMapping();
- if (javaAttributeMapping.getKey() == MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY) {
- return ((JavaElementCollectionMapping2_0) javaAttributeMapping);
- }
- return null;
- }
-
- public OrmAttributeOverrideContainer getMapKeyAttributeOverrideContainer() {
- return this.mapKeyAttributeOverrideContainer;
- }
-
- protected OrmAttributeOverrideContainer buildMapKeyAttributeOverrideContainer() {
- return getXmlContextNodeFactory().buildOrmAttributeOverrideContainer(this, new MapKeyAttributeOverrideContainerOwner());
- }
-
- protected JavaAttributeOverride getJavaMapKeyAttributeOverrideNamed(String attributeName) {
- if (getJavaElementCollectionMapping() != null) {
- return getJavaElementCollectionMapping().getMapKeyAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- }
- return null;
- }
-
- // **************** map key ************************************************
-
- public String getMapKey() {
- if (this.noMapKey) {
- return null;
- }
- if (this.pkMapKey) {
- return null;//the target is either embeddable or basic, so a key will have to be specified
- }
- if (this.customMapKey) {
- return this.specifiedMapKey;
- }
- throw new IllegalStateException("unknown map key"); //$NON-NLS-1$
- }
-
- public String getSpecifiedMapKey() {
- return this.specifiedMapKey;
- }
-
- public void setSpecifiedMapKey(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- if (this.attributeValueHasChanged(old, mapKey)) {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (mapKey == null) {
- if (xmlMapKey != null) {
- this.removeXmlMapKey();
- }
- } else {
- if (xmlMapKey == null) {
- xmlMapKey = this.addXmlMapKey();
- }
- xmlMapKey.setName(mapKey);
- }
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void setSpecifiedMapKey_(String mapKey) {
- String old = this.specifiedMapKey;
- this.specifiedMapKey = mapKey;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_PROPERTY, old, mapKey);
- }
-
- protected void initializeMapKey() {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (xmlMapKey == null) {
- this.noMapKey = true;
- } else {
- this.specifiedMapKey = xmlMapKey.getName();
- if (this.specifiedMapKey == null) {
- this.pkMapKey = true;
- } else {
- this.customMapKey = true;
- }
- }
- }
-
- protected void updateMapKey() {
- MapKey xmlMapKey = this.getXmlMapKey();
- if (xmlMapKey == null) {
- this.setSpecifiedMapKey_(null);
- this.setNoMapKey_(true);
- this.setPkMapKey_(false);
- this.setCustomMapKey_(false);
- } else {
- String mk = xmlMapKey.getName();
- this.setSpecifiedMapKey_(mk);
- this.setNoMapKey_(false);
- this.setPkMapKey_(mk == null);
- this.setCustomMapKey_(mk != null);
- }
- }
-
- protected MapKey getXmlMapKey() {
- return this.resourceAttributeMapping.getMapKey();
- }
-
- protected MapKey addXmlMapKey() {
- MapKey mapKey = OrmFactory.eINSTANCE.createMapKey();
- this.resourceAttributeMapping.setMapKey(mapKey);
- return mapKey;
- }
-
- protected void removeXmlMapKey() {
- this.resourceAttributeMapping.setMapKey(null);
- }
-
- public Iterator<String> candidateMapKeyNames() {
- return this.allTargetEmbeddableAttributeNames();
- }
-
- public Iterator<String> allTargetEmbeddableAttributeNames() {
- return new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.allTargetEmbeddableAttributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- });
- }
-
- protected Iterator<String> allEmbeddableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- }
- );
- }
-
- @Override
- public Iterator<String> allMappingNames() {
- return new CompositeIterator<String>(this.getName(), this.allEmbeddableAttributeMappingNames());
- }
-
- protected Iterator<AttributeMapping> allTargetEmbeddableAttributeMappings() {
- return (this.resolvedTargetEmbeddable != null) ?
- this.resolvedTargetEmbeddable.allAttributeMappings() :
- EmptyIterator.<AttributeMapping> instance();
- }
-
- protected Iterator<AttributeMapping> embeddableAttributeMappings() {
- Embeddable targetEmbeddable = getResolvedTargetEmbeddable();
- if (targetEmbeddable != null && targetEmbeddable != getPersistentAttribute().getOwningTypeMapping()) {
- return targetEmbeddable.attributeMappings();
- }
- return EmptyIterator.instance();
- }
-
- @Override
- public Iterator<String> allOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableAttributeMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAttributeMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAttributeMappingNames();
- }
- }
- );
- }
-
- @Override
- public Iterator<String> allOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableAssociationMappingNames();
- }
-
- protected Iterator<String> embeddableOverrideableAssociationMappingNames() {
- return this.embeddableOverrideableMappingNames(
- new Transformer<AttributeMapping, Iterator<String>>() {
- public Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allOverrideableAssociationMappingNames();
- }
- }
- );
- }
-
- protected Iterator<String> embeddableOverrideableMappingNames(Transformer<AttributeMapping, Iterator<String>> transformer) {
- return new TransformationIterator<String, String>(
- new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.embeddableAttributeMappings(), transformer)))
- {
- @Override
- protected String transform(String next) {
- return getName() + '.' + next;
- }
- };
- }
-
-
- @Override
- public Column resolveOverriddenColumn(String attributeName) {
- if (getName() == null) {
- return null;
- }
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AttributeOverride override = getValueAttributeOverrideContainer().getAttributeOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getColumn();
- }
- if (this.getResolvedTargetEmbeddable() == null) {
- return null;
- }
- return this.getResolvedTargetEmbeddable().resolveOverriddenColumn(attributeName);
- }
- }
- return null;
- }
-
- protected Iterator<String> embeddableAttributeMappingNames() {
- return new TransformationIterator<String, String>(
- new CompositeIterator<String>(
- new TransformationIterator<AttributeMapping, Iterator<String>>(this.embeddableAttributeMappings()) {
- @Override
- protected Iterator<String> transform(AttributeMapping mapping) {
- return mapping.allMappingNames();
- }
- }
- )
- ) {
- @Override
- protected String transform(String next) {
- return getName() + '.' + next;
- }
- };
- }
-
- @Override
- public AttributeMapping resolveAttributeMapping(String attributeName) {
- if (getName() == null) {
- return null;
- }
- AttributeMapping resolvedMapping = super.resolveAttributeMapping(attributeName);
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- for (AttributeMapping attributeMapping : CollectionTools.iterable(embeddableAttributeMappings())) {
- resolvedMapping = attributeMapping.resolveAttributeMapping(attributeName.substring(dotIndex + 1));
- if (resolvedMapping != null) {
- return resolvedMapping;
- }
- }
- }
- }
- return null;
- }
-
- @Override
- public RelationshipReference resolveRelationshipReference(String attributeName) {
- if (getName() == null) {
- return null;
- }
- int dotIndex = attributeName.indexOf('.');
- if (dotIndex != -1) {
- if (getName().equals(attributeName.substring(0, dotIndex))) {
- attributeName = attributeName.substring(dotIndex + 1);
- AssociationOverride override = getValueAssociationOverrideContainer().getAssociationOverrideNamed(attributeName);
- if (override != null && !override.isVirtual()) {
- return override.getRelationshipReference();
- }
- if (this.getResolvedTargetEmbeddable() == null) {
- return null;
- }
- return this.getResolvedTargetEmbeddable().resolveRelationshipReference(attributeName);
- }
- }
- return null;
- }
-
- // **************** no map key ***********************************************
-
- public boolean isNoMapKey() {
- return this.noMapKey;
- }
-
- public void setNoMapKey(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- if (noMapKey) {
- if (this.getXmlMapKey() != null) {
- this.removeXmlMapKey();
- }
- }
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
- protected void setNoMapKey_(boolean noMapKey) {
- boolean old = this.noMapKey;
- this.noMapKey = noMapKey;
- this.firePropertyChanged(NO_MAP_KEY_PROPERTY, old, noMapKey);
- }
-
-
- // **************** pk map key ***********************************************
-
- public boolean isPkMapKey() {
- return this.pkMapKey;
- }
-
- public void setPkMapKey(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- MapKey xmlMapKey = this.getXmlMapKey();
- if (pkMapKey) {
- if (xmlMapKey == null) {
- this.addXmlMapKey();
- } else {
- xmlMapKey.setName(null);
- }
- }
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
- protected void setPkMapKey_(boolean pkMapKey) {
- boolean old = this.pkMapKey;
- this.pkMapKey = pkMapKey;
- this.firePropertyChanged(PK_MAP_KEY_PROPERTY, old, pkMapKey);
- }
-
-
- // **************** custom map key ***********************************************
-
- public boolean isCustomMapKey() {
- return this.customMapKey;
- }
-
- public void setCustomMapKey(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- if (customMapKey) {
- this.setSpecifiedMapKey(""); //$NON-NLS-1$
- }
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- protected void setCustomMapKey_(boolean customMapKey) {
- boolean old = this.customMapKey;
- this.customMapKey = customMapKey;
- this.firePropertyChanged(CUSTOM_MAP_KEY_PROPERTY, old, customMapKey);
- }
-
- // **************** map key class ******************************************
-
- public char getMapKeyClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getMapKeyClass() {
- return (this.specifiedMapKeyClass != null) ? this.specifiedMapKeyClass : this.defaultMapKeyClass;
- }
-
- public String getSpecifiedMapKeyClass() {
- return this.specifiedMapKeyClass;
- }
-
- public void setSpecifiedMapKeyClass(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- if (this.attributeValueHasChanged(old, mapKeyClass)) {
- XmlClassReference xmlMapKeyClass = this.getXmlMapKeyClass();
- if (mapKeyClass == null) {
- if (xmlMapKeyClass != null) {
- this.removeXmlMapKeyClass();
- }
- } else {
- if (xmlMapKeyClass == null) {
- xmlMapKeyClass = this.addXmlMapKeyClass();
- }
- xmlMapKeyClass.setClassName(mapKeyClass);
- }
- }
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected void setSpecifiedMapKeyClass_(String mapKeyClass) {
- String old = this.specifiedMapKeyClass;
- this.specifiedMapKeyClass = mapKeyClass;
- this.firePropertyChanged(SPECIFIED_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected XmlClassReference getXmlMapKeyClass() {
- return this.resourceAttributeMapping.getMapKeyClass();
- }
-
- protected XmlClassReference addXmlMapKeyClass() {
- XmlClassReference mapKeyClass = OrmFactory.eINSTANCE.createXmlClassReference();
- this.resourceAttributeMapping.setMapKeyClass(mapKeyClass);
- return mapKeyClass;
- }
-
- protected void removeXmlMapKeyClass() {
- this.resourceAttributeMapping.setMapKeyClass(null);
- }
-
- public String getDefaultMapKeyClass() {
- return this.defaultMapKeyClass;
- }
-
- protected void setDefaultMapKeyClass(String mapKeyClass) {
- String old = this.defaultMapKeyClass;
- this.defaultMapKeyClass = mapKeyClass;
- this.firePropertyChanged(DEFAULT_MAP_KEY_CLASS_PROPERTY, old, mapKeyClass);
- }
-
- protected String getResourceMapKeyClass() {
- XmlClassReference mapKeyClass = this.resourceAttributeMapping.getMapKeyClass();
- return mapKeyClass == null ? null : mapKeyClass.getClassName();
- }
-
- protected String buildDefaultMapKeyClass() {
- if (this.getJavaPersistentAttribute() != null) {
- return this.getJavaPersistentAttribute().getMultiReferenceMapKeyTypeName();
- }
- return null;
- }
-
-
- public Embeddable getResolvedMapKeyEmbeddable() {
- return this.resolvedMapKeyEmbeddable;
- }
-
- protected void setResolvedMapKeyEmbeddable(Embeddable embeddable) {
- Embeddable old = this.resolvedMapKeyEmbeddable;
- this.resolvedMapKeyEmbeddable = embeddable;
- this.firePropertyChanged(RESOLVED_MAP_KEY_EMBEDDABLE_PROPERTY, old, embeddable);
- }
-
- public Entity getResolvedMapKeyEntity() {
- return this.resolvedMapKeyEntity;
- }
-
- protected void setResolvedMapKeyEntity(Entity entity) {
- Entity old = this.resolvedMapKeyEntity;
- this.resolvedMapKeyEntity = entity;
- this.firePropertyChanged(RESOLVED_MAP_KEY_ENTITY_PROPERTY, old, entity);
- }
-
- public PersistentType getResolvedMapKeyType() {
- return getResolvedMapKeyEmbeddable() == null ? null : getResolvedMapKeyEmbeddable().getPersistentType();
- }
-
- protected PersistentType resolveMapKeyType() {
- return this.resolvePersistentType(this.getMapKeyClass());
- }
-
- protected Embeddable resolveMapKeyEmbeddable() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
- }
-
- protected Entity resolveMapKeyEntity() {
- if (this.resolvedMapKeyType == null) {
- return null;
- }
- TypeMapping typeMapping = this.resolvedMapKeyType.getMapping();
- return (typeMapping instanceof Entity) ? (Entity) typeMapping : null;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((PersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- if (this.valueType == Type.BASIC_TYPE) {
- return getTargetClass();
- }
- if (this.resolvedTargetType == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- String targetTypeName = this.resolvedTargetType.getName();
- 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 keyTypeName = ((PersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldMapKeyTypeName();
- if (keyTypeName != null) {
- typeArgumentNames.add(keyTypeName);
- }
- }
-
- public String getMetamodelFieldMapKeyTypeName() {
- return MappingTools.getMetamodelFieldMapKeyTypeName(this);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateTargetClass(messages);
- this.validateMapKeyClass(messages);
- this.getOrderable().validate(messages, reporter);
- this.getCollectionTable().validate(messages, reporter);
- this.validateValue(messages, reporter);
- this.validateMapKey(messages, reporter);
- }
-
- public void validateValue(List<IMessage> messages, IReporter reporter) {
- //TODO should we handle validation when the type is embeddable, but a value column is specified, or things like that if that is invalid?
- if (getValueType() == Type.BASIC_TYPE) {
- this.getValueColumn().validate(messages, reporter);
- this.getConverter().validate(messages, reporter);
- }
- if (getValueType() == Type.EMBEDDABLE_TYPE) {
- this.getValueAttributeOverrideContainer().validate(messages, reporter);
- this.getValueAssociationOverrideContainer().validate(messages, reporter);
- }
- }
-
- public void validateMapKey(List<IMessage> messages, IReporter reporter) {
- if (getMapKey() != null) {
- //TODO validate that the map key refers to an existing attribute
- return;
- }
- if (getKeyType() == Type.BASIC_TYPE) {
- this.getMapKeyColumn().validate(messages, reporter);
- //validate map key converter
- }
- else if (getKeyType() == Type.ENTITY_TYPE) {
- //validate map key join columns
- }
- else if (getKeyType() == Type.EMBEDDABLE_TYPE) {
- this.getMapKeyAttributeOverrideContainer().validate(messages, reporter);
- //validate map key association overrides
- }
- }
-
- protected void validateTargetClass(List<IMessage> messages) {
- if (getTargetClass() == null) {
- if (getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED,
- new String[0],
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- //TODO this does not give an error for unmapped, unlisted types that aren't basic - bug 310464
- if (this.resolvedTargetType != null) {
- if (getResolvedTargetEmbeddable() == null) {
- if (getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE,
- new String[] {this.getName(), this.getTargetClass()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE,
- new String[] {this.getTargetClass(), this.getName()},
- this,
- this.getTargetClassTextRange()
- )
- );
- }
- }
- }
- }
-
- protected void validateMapKeyClass(List<IMessage> messages) {
- if (getJavaPersistentAttribute() != null && !getJavaPersistentAttribute().getJpaContainer().isMap()) {
- return;
- }
- if (getMapKeyClass() == null) {
- if (getPersistentAttribute().isVirtual()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- else {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED,
- new String[0],
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getTargetClassTextRange() {
- return this.resourceAttributeMapping.getTargetClassTextRange();
- }
-
- protected abstract class ColumnOwner implements OrmColumn.Owner {
- public String getDefaultTableName() {
- return getCollectionTable().getName();
- }
-
- public TypeMapping getTypeMapping() {
- return AbstractOrmElementCollectionMapping2_0.this.getTypeMapping();
- }
-
- public Table getDbTable(String tableName) {
- if (getCollectionTable().getName().equals(tableName)) {
- return AbstractOrmElementCollectionMapping2_0.this.getCollectionTable().getDbTable();
- }
- return null;
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmElementCollectionMapping2_0.this.getValidationTextRange();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- getColumnTableNotValidMessage(),
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getVirtualAttributeColumnTableNotValidMessage(),
- new String[] {
- getName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getColumnUnresolvedNameMessage(),
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getVirtualAttributeColumnUnresolvedNameMessage(),
- new String[] {getName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
- protected abstract String getColumnTableNotValidMessage();
-
- protected abstract String getVirtualAttributeColumnTableNotValidMessage();
-
- protected abstract String getColumnUnresolvedNameMessage();
-
- protected abstract String getVirtualAttributeColumnUnresolvedNameMessage();
- }
-
- protected class ValueColumnOwner extends ColumnOwner {
-
- public XmlColumn getResourceColumn() {
- return AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.getColumn();
- }
-
- public void addResourceColumn() {
- AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.setColumn(null);
- }
-
- public String getDefaultColumnName() {
- return AbstractOrmElementCollectionMapping2_0.this.getName();
- }
-
- @Override
- public String getColumnTableNotValidMessage() {
- return JpaValidationMessages.COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getVirtualAttributeColumnTableNotValidMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getColumnUnresolvedNameMessage() {
- return JpaValidationMessages.COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- public String getVirtualAttributeColumnUnresolvedNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME;
- }
- }
-
- protected class MapKeyColumnOwner extends ColumnOwner {
-
- public XmlColumn getResourceColumn() {
- return AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.getMapKeyColumn();
- }
-
- public void addResourceColumn() {
- AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.setMapKeyColumn(OrmFactory.eINSTANCE.createXmlColumn());
- }
-
- public void removeResourceColumn() {
- AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.setMapKeyColumn(null);
- }
-
- public String getDefaultColumnName() {
- return AbstractOrmElementCollectionMapping2_0.this.getName() + "_KEY"; //$NON-NLS-1$
- }
-
- @Override
- protected String getColumnTableNotValidMessage() {
- return JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getVirtualAttributeColumnTableNotValidMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- public String getColumnUnresolvedNameMessage() {
- return JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- public String getVirtualAttributeColumnUnresolvedNameMessage() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME;
- }
-
- }
-
- protected abstract class OverrideContainerOwner implements OrmOverrideContainer.Owner {
- public OrmTypeMapping getTypeMapping() {
- return AbstractOrmElementCollectionMapping2_0.this.getTypeMapping();
- }
-
- public String getDefaultTableName() {
- return AbstractOrmElementCollectionMapping2_0.this.getCollectionTable().getName();
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- return AbstractOrmElementCollectionMapping2_0.this.getCollectionTable().getDbTable();
- }
-
- public java.util.Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * If there is a specified table name it needs to be the same
- * the default table name. the table is always the collection table
- */
- public boolean tableNameIsInvalid(String tableName) {
- return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
- }
- }
-
- protected class AssociationOverrideContainerOwner
- extends OverrideContainerOwner
- implements OrmAssociationOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmElementCollectionMapping2_0.this.getResolvedTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAssociationNames();
- }
-
- public EList<XmlAssociationOverride> getResourceAssociationOverrides() {
- return AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.getAssociationOverrides();
- }
-
- public RelationshipReference resolveRelationshipReference(String associationOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAssociationOverride javaAssociationOverride = getJavaValueAssociationOverrideNamed(associationOverrideName);
- if (javaAssociationOverride != null && !javaAssociationOverride.isVirtual()) {
- return javaAssociationOverride.getRelationshipReference();
- }
- }
- return MappingTools.resolveRelationshipReference(getOverridableTypeMapping(), associationOverrideName);
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnUnresolvedReferencedColumnNameMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedReferencedColumnNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedReferencedColumnNameMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {
- overrideName,
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideUnspecifiedNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {AbstractOrmElementCollectionMapping2_0.this.getName(), overrideName},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideUnspecifiedNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(AssociationOverride override, BaseJoinColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {
- column.getReferencedColumnName(),
- column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {AbstractOrmElementCollectionMapping2_0.this.getName(), overrideName},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(String overrideName, BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {overrideName},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmElementCollectionMapping2_0.this.getValidationTextRange();
- }
- }
-
-
- //********** OrmAttributeOverrideContainer.Owner implementation *********
-
- protected class ValueAttributeOverrideContainerOwner
- extends OverrideContainerOwner
- implements OrmAttributeOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmElementCollectionMapping2_0.this.getResolvedTargetEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- public EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.getAttributeOverrides();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAttributeOverride javaAttributeOverride = getJavaValueAttributeOverrideNamed(attributeOverrideName);
- if (javaAttributeOverride != null && !javaAttributeOverride.isVirtual()) {
- return javaAttributeOverride.getColumn();
- }
- }
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
- return new VirtualXmlAttributeOverrideColumn(overridableColumn);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmElementCollectionMapping2_0.this.getValidationTextRange();
- }
- }
-
-
- protected class MapKeyAttributeOverrideContainerOwner
- extends OverrideContainerOwner
- implements OrmAttributeOverrideContainer.Owner
- {
- public TypeMapping getOverridableTypeMapping() {
- return AbstractOrmElementCollectionMapping2_0.this.getResolvedMapKeyEmbeddable();
- }
-
- public Iterator<String> allOverridableNames() {
- TypeMapping typeMapping = getOverridableTypeMapping();
- return (typeMapping == null) ?
- EmptyIterator.<String>instance()
- : typeMapping.allOverridableAttributeNames();
- }
-
- public EList<XmlAttributeOverride> getResourceAttributeOverrides() {
- return AbstractOrmElementCollectionMapping2_0.this.resourceAttributeMapping.getMapKeyAttributeOverrides();
- }
-
- public Column resolveOverriddenColumn(String attributeOverrideName) {
- if (getPersistentAttribute().isVirtual() && !getTypeMapping().isMetadataComplete()) {
- JavaAttributeOverride javaAttributeOverride = getJavaMapKeyAttributeOverrideNamed(attributeOverrideName);
- if (javaAttributeOverride != null && !javaAttributeOverride.isVirtual()) {
- return javaAttributeOverride.getColumn();
- }
- }
- return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
- }
-
- public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
- return new VirtualXmlAttributeOverrideColumn(overridableColumn);
- }
-
- public IMessage buildColumnUnresolvedNameMessage(BaseOverride override, NamedColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnUnresolvedNameMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_UNRESOLVED_NAME,
- new String[] {
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnUnresolvedNameMessage(String overrideName, NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME,
- new String[] {
- overrideName,
- column.getName(),
- column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildColumnTableNotValidMessage(BaseOverride override, BaseColumn column, TextRange textRange) {
- if (isVirtual()) {
- return this.buildVirtualAttributeColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- if (override.isVirtual()) {
- return this.buildVirtualOverrideColumnTableNotValidMessage(override.getName(), column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualAttributeColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- AbstractOrmElementCollectionMapping2_0.this.getName(),
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualOverrideColumnTableNotValidMessage(String overrideName, BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID,
- new String[] {
- overrideName,
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public TextRange getValidationTextRange() {
- return AbstractOrmElementCollectionMapping2_0.this.getValidationTextRange();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmAssociationOverrideRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmAssociationOverrideRelationshipReference2_0.java
deleted file mode 100644
index ed4ef78560..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmAssociationOverrideRelationshipReference2_0.java
+++ /dev/null
@@ -1,112 +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.core.internal.jpa2.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.AssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmJoinTableInAssociationOverrideJoiningStrategy2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmAssociationOverrideRelationshipReference2_0 extends AbstractOrmAssociationOverrideRelationshipReference
- implements OrmAssociationOverrideRelationshipReference2_0
-{
-
- protected OrmJoinTableInAssociationOverrideJoiningStrategy2_0 joinTableJoiningStrategy;
-
- // cache the strategy for property change notification
- protected JoiningStrategy cachedPredominantJoiningStrategy;
-
- public GenericOrmAssociationOverrideRelationshipReference2_0(OrmAssociationOverride parent, XmlAssociationOverride xao) {
- super(parent, xao);
- }
-
- protected OrmJoinTableInAssociationOverrideJoiningStrategy2_0 buildJoinTableJoiningStrategy(XmlAssociationOverride xao) {
- return new GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0(this, xao);
- }
-
- @Override
- public void initializeFrom(AssociationOverrideRelationshipReference oldAssociationOverride) {
- if (oldAssociationOverride.getJoinColumnJoiningStrategy().hasSpecifiedJoinColumns()) {
- getJoinColumnJoiningStrategy().initializeFrom(oldAssociationOverride.getJoinColumnJoiningStrategy());
- }
- else {
- getJoinTableJoiningStrategy().initializeFrom(((AssociationOverrideRelationshipReference2_0) oldAssociationOverride).getJoinTableJoiningStrategy());
- }
- }
-
- @Override
- protected void initializeJoiningStrategies(org.eclipse.jpt.core.resource.orm.XmlAssociationOverride xao) {
- super.initializeJoiningStrategies(xao);
- this.joinTableJoiningStrategy = buildJoinTableJoiningStrategy(xao);
- }
-
- @Override
- protected void updateJoiningStrategies(org.eclipse.jpt.core.resource.orm.XmlAssociationOverride xao) {
- super.updateJoiningStrategies(xao);
- this.joinTableJoiningStrategy.update(xao);
- }
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- return this.joinTableJoiningStrategy;
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
-// if (this.connectionProfileIsActive()) {
-// this.validateJoinTable(messages, astRoot);
-// }
- }
-
-
-
- // **************** join table *******************************************
-
-
- public OrmJoinTableInAssociationOverrideJoiningStrategy2_0 getJoinTableJoiningStrategy() {
- return this.joinTableJoiningStrategy;
- }
-
- public boolean usesJoinTableJoiningStrategy() {
- return getPredominantJoiningStrategy() == this.joinTableJoiningStrategy;
- }
-
- public void setJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.addStrategy();
- this.joinColumnJoiningStrategy.removeStrategy();
- }
-
- public void unsetJoinTableJoiningStrategy() {
- this.joinTableJoiningStrategy.removeStrategy();
- }
-
- public boolean mayHaveDefaultJoinTable() {
- return getAssociationOverride().isVirtual();
- }
-
- @Override
- public void setJoinColumnJoiningStrategy() {
- super.setJoinColumnJoiningStrategy();
- this.joinTableJoiningStrategy.removeStrategy();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.java
deleted file mode 100644
index da3d2fcb2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCacheable2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmCacheable2_0 extends AbstractOrmXmlContextNode
- implements OrmCacheable2_0
-{
- protected final XmlCacheable_2_0 resource;
-
- protected boolean defaultCacheable;
-
- protected Boolean specifiedCacheable;
-
-
- public GenericOrmCacheable2_0(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource) {
- super(parent);
- this.resource = resource;
- this.specifiedCacheable = this.getResourceCacheable();
- }
-
- @Override
- public OrmCacheableHolder2_0 getParent() {
- return (OrmCacheableHolder2_0) super.getParent();
- }
-
- public boolean isCacheable() {
- return (this.specifiedCacheable != null) ? this.specifiedCacheable.booleanValue() : this.defaultCacheable;
- }
-
- public boolean isDefaultCacheable() {
- return this.defaultCacheable;
- }
-
- protected void setDefaultCacheable(boolean newDefaultCacheable) {
- boolean oldDefaultCacheable = this.defaultCacheable;
- this.defaultCacheable = newDefaultCacheable;
- firePropertyChanged(DEFAULT_CACHEABLE_PROPERTY, oldDefaultCacheable, newDefaultCacheable);
- }
-
- public Boolean getSpecifiedCacheable() {
- return this.specifiedCacheable;
- }
-
- public void setSpecifiedCacheable(Boolean newSpecifiedCacheable) {
- Boolean oldSpecifiedCacheable = this.specifiedCacheable;
- this.specifiedCacheable = newSpecifiedCacheable;
- this.resource.setCacheable(newSpecifiedCacheable);
- firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
- }
-
- protected void setSpecifiedCacheable_(Boolean newSpecifiedCacheable) {
- Boolean oldSpecifiedCacheable = this.specifiedCacheable;
- this.specifiedCacheable = newSpecifiedCacheable;
- firePropertyChanged(SPECIFIED_CACHEABLE_PROPERTY, oldSpecifiedCacheable, newSpecifiedCacheable);
- }
-
-
- // **************** initialize/update **************************************
-
- public void update() {
- setSpecifiedCacheable_(this.getResourceCacheable());
- setDefaultCacheable(this.calculateDefaultCacheable());
- }
-
- protected Boolean getResourceCacheable() {
- return this.resource.getCacheable();
- }
-
- protected boolean calculateDefaultCacheable() {
- return getParent().calculateDefaultCacheable();
- }
-
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getCacheableTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCollectionTable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCollectionTable2_0.java
deleted file mode 100644
index 31db53cffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmCollectionTable2_0.java
+++ /dev/null
@@ -1,350 +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.core.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.BaseJoinColumn;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.NamedColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.internal.context.MappingTools;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmReferenceTable;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * orm.xml collection table
- */
-public class GenericOrmCollectionTable2_0
- extends GenericOrmReferenceTable
- implements OrmCollectionTable2_0
-{
-
- public GenericOrmCollectionTable2_0(OrmElementCollectionMapping2_0 parent, XmlCollectionTable xmlCollectionTable) {
- super(parent);
- this.initialize(xmlCollectionTable);
- }
-
- @Override
- protected OrmJoinColumn.Owner buildJoinColumnOwner() {
- return new JoinColumnOwner();
- }
-
- public void initializeFrom(CollectionTable2_0 oldCollectionTable) {
- super.initializeFrom(oldCollectionTable);
- }
-
- // ********** AbstractOrmTable implementation **********
-
- public PersistentAttribute getPersistentAttribute() {
- return getParent().getPersistentAttribute();
- }
-
- @Override
- public OrmElementCollectionMapping2_0 getParent() {
- return (OrmElementCollectionMapping2_0) super.getParent();
- }
-
- @Override
- protected String buildDefaultName() {
- return MappingTools.buildCollectionTableDefaultName(getParent());
- }
-
- @Override
- protected XmlCollectionTable getResourceTable() {
- return this.getParent().getResourceAttributeMapping().getCollectionTable();
- }
-
- @Override
- protected XmlCollectionTable addResourceTable() {
- XmlCollectionTable xmlCollectionTable = OrmFactory.eINSTANCE.createXmlCollectionTable();
- getParent().getResourceAttributeMapping().setCollectionTable(xmlCollectionTable);
- return xmlCollectionTable;
- }
-
- @Override
- protected void removeResourceTable() {
- getParent().getResourceAttributeMapping().setCollectionTable(null);
- }
-
-
- // ********** validation **********
-
- @Override
- protected boolean shouldValidateAgainstDatabase() {
- return getParent().shouldValidateAgainstDatabase();
- }
-
- @Override
- protected String getUnresolvedCatalogMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getUnresolvedNameMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getUnresolvedSchemaMessageId() {
- return JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_SCHEMA;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedCatalogMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedNameMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedSchemaMessageId() {
- return JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA;
- }
-
-
- // ********** join column owner adapters **********
-
- /**
- * owner for "back-pointer" JoinColumns;
- * these point at the source/owning entity
- */
- protected class JoinColumnOwner
- implements OrmJoinColumn.Owner
- {
- protected JoinColumnOwner() {
- super();
- }
- public TypeMapping getTypeMapping() {
- return GenericOrmCollectionTable2_0.this.getParent().getTypeMapping();
- }
-
- public PersistentAttribute getPersistentAttribute() {
- return GenericOrmCollectionTable2_0.this.getParent().getPersistentAttribute();
- }
-
- /**
- * the default table name is always valid and a specified table name
- * is prohibited (which will be handled elsewhere)
- */
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterator<String> candidateTableNames() {
- return EmptyIterator.instance();
- }
-
- /**
- * the join column can only be on the collection table itself
- */
- public boolean tableIsAllowed() {
- return false;
- }
-
- public org.eclipse.jpt.db.Table getDbTable(String tableName) {
- String collectionTableName = GenericOrmCollectionTable2_0.this.getName();
- return (collectionTableName == null) ? null : (collectionTableName.equals(tableName)) ? GenericOrmCollectionTable2_0.this.getDbTable() : null;
- }
-
- /**
- * by default, the join column is, obviously, in the collection table;
- * not sure whether it can be anywhere else...
- */
- public String getDefaultTableName() {
- return GenericOrmCollectionTable2_0.this.getName();
- }
-
- public TextRange getValidationTextRange() {
- return GenericOrmCollectionTable2_0.this.getValidationTextRange();
- }
-
- public Entity getRelationshipTarget() {
- return GenericOrmCollectionTable2_0.this.getParent().getEntity();
- }
-
- public String getAttributeName() {
- //TODO
- return null; //I *think* this is correct
-// //return GenericJavaCollectionTable2_0.this.getParent().getName();
-// Entity targetEntity = GenericOrmCollectionTable2_0.this.getRelationshipMapping().getResolvedTargetEntity();
-// if (targetEntity == null) {
-// return null;
-// }
-// for (PersistentAttribute each : CollectionTools.iterable(targetEntity.getPersistentType().allAttributes())) {
-// if (each.getMapping().isOwnedBy(getRelationshipMapping())) {
-// return each.getName();
-// }
-// }
-// return null;
- }
-
- public org.eclipse.jpt.db.Table getReferencedColumnDbTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- public boolean isVirtual(BaseJoinColumn joinColumn) {
- return GenericOrmCollectionTable2_0.this.defaultJoinColumn == joinColumn;
- }
-
- public String getDefaultColumnName() {
- //built in MappingTools.buildJoinColumnDefaultName()
- return null;
- }
-
- public int joinColumnsSize() {
- return GenericOrmCollectionTable2_0.this.joinColumnsSize();
- }
-
- protected boolean isPersistentAttributeVirtual() {
- return getPersistentAttribute().isVirtual();
- }
-
- protected String getPersistentAttributeName() {
- return getPersistentAttribute().getName();
- }
-
- public IMessage buildTableNotValidMessage(BaseColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualTableNotValidMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualTableNotValidMessage(BaseColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID,
- new String[] {
- this.getPersistentAttributeName(),
- column.getTable(),
- column.getName(),
- JpaValidationDescriptionMessages.DOES_NOT_MATCH_COLLECTION_TABLE},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedNameMessage(NamedColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME,
- new String[] {this.getPersistentAttributeName(), column.getName(), column.getDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnresolvedReferencedColumnNameMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnresolvedReferencedColumnNameMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME,
- new String[] {this.getPersistentAttributeName(), column.getReferencedColumnName(), column.getReferencedColumnDbTable().getName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
-
- protected IMessage buildVirtualUnspecifiedNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getPersistentAttributeName()},
- column,
- textRange
- );
- }
-
- public IMessage buildUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- if (this.isPersistentAttributeVirtual()) {
- return this.buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(column, textRange);
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[0],
- column,
- textRange
- );
- }
- protected IMessage buildVirtualUnspecifiedReferencedColumnNameMultipleJoinColumnsMessage(BaseJoinColumn column, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS,
- new String[] {this.getPersistentAttributeName()},
- column,
- textRange
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmDerivedIdentity2_0.java
deleted file mode 100644
index 61647b4f06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmDerivedIdentity2_0.java
+++ /dev/null
@@ -1,178 +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.core.internal.jpa2.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmMapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmDerivedIdentity2_0
- extends AbstractOrmXmlContextNode
- implements OrmDerivedIdentity2_0
-{
- protected XmlSingleRelationshipMapping_2_0 resource;
-
- // cache the strategy for property change notification
- protected DerivedIdentityStrategy2_0 cachedPredominantDerivedIdentityStrategy;
-
- protected OrmIdDerivedIdentityStrategy2_0 idDerivedIdentityStrategy;
-
- protected OrmMapsIdDerivedIdentityStrategy2_0 mapsIdDerivedIdentityStrategy;
-
-
- public GenericOrmDerivedIdentity2_0(
- OrmSingleRelationshipMapping2_0 parent, XmlSingleRelationshipMapping_2_0 resource) {
- super(parent);
- this.resource = resource;
- this.idDerivedIdentityStrategy = buildIdDerivedIdentityStrategy();
- this.mapsIdDerivedIdentityStrategy = buildMapsIdDerivedIdentityStrategy();
- this.cachedPredominantDerivedIdentityStrategy = calculatePredominantDerivedIdentityStrategy();
- }
-
-
- protected OrmIdDerivedIdentityStrategy2_0 buildIdDerivedIdentityStrategy() {
- return new GenericOrmIdDerivedIdentityStrategy2_0(this, resource);
- }
-
- protected OrmMapsIdDerivedIdentityStrategy2_0 buildMapsIdDerivedIdentityStrategy() {
- return new GenericOrmMapsIdDerivedIdentityStrategy2_0(this, resource);
- }
-
- public OrmSingleRelationshipMapping2_0 getMapping() {
- return (OrmSingleRelationshipMapping2_0) getParent();
- }
-
-
- // **************** predominant joining strategy ***************************
-
- public DerivedIdentityStrategy2_0 getPredominantDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy;
- }
-
- protected void setPredominantJoiningStrategy() {
- setPredominantJoiningStrategy(calculatePredominantDerivedIdentityStrategy());
- }
-
- protected void setPredominantJoiningStrategy(DerivedIdentityStrategy2_0 newStrategy) {
- DerivedIdentityStrategy2_0 oldStrategy = this.cachedPredominantDerivedIdentityStrategy;
- this.cachedPredominantDerivedIdentityStrategy = newStrategy;
- firePropertyChanged(PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY, oldStrategy, newStrategy);
- }
-
-
- // **************** resource -> context ************************************
-
- public void update() {
- this.idDerivedIdentityStrategy.update();
- this.mapsIdDerivedIdentityStrategy.update();
- setPredominantJoiningStrategy(calculatePredominantDerivedIdentityStrategy());
- }
-
- protected DerivedIdentityStrategy2_0 calculatePredominantDerivedIdentityStrategy() {
- if (this.mapsIdDerivedIdentityStrategy.isSpecified()) {
- return this.mapsIdDerivedIdentityStrategy;
- }
- else if (this.idDerivedIdentityStrategy.isSpecified()) {
- return this.idDerivedIdentityStrategy;
- }
- else {
- return null;
- }
- }
-
-
- // **************** no strategy *******************************************
-
- public void setNullDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesNullDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == null;
- }
-
-
- // **************** maps id strategy **************************************
-
- public OrmMapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy() {
- return this.mapsIdDerivedIdentityStrategy;
- }
-
- public void setMapsIdDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.addStrategy();
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetMapsIdDerivedIdentityStrategy() {
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesMapsIdDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == this.mapsIdDerivedIdentityStrategy;
- }
-
-
- // **************** id strategy *******************************************
-
- public OrmIdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy() {
- return this.idDerivedIdentityStrategy;
- }
-
- public void setIdDerivedIdentityStrategy() {
- this.idDerivedIdentityStrategy.addStrategy();
- this.mapsIdDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public void unsetIdDerivedIdentityStrategy() {
- this.idDerivedIdentityStrategy.removeStrategy();
- setPredominantJoiningStrategy();
- }
-
- public boolean usesIdDerivedIdentityStrategy() {
- return this.cachedPredominantDerivedIdentityStrategy == this.idDerivedIdentityStrategy;
- }
-
-
- // **************** morphing **********************************************
-
- public void initializeFrom(OrmDerivedIdentity2_0 oldDerivedIdentity) {
- this.mapsIdDerivedIdentityStrategy.initializeFrom(oldDerivedIdentity.getMapsIdDerivedIdentityStrategy());
- this.idDerivedIdentityStrategy.initializeFrom(oldDerivedIdentity.getIdDerivedIdentityStrategy());
- this.cachedPredominantDerivedIdentityStrategy = calculatePredominantDerivedIdentityStrategy();
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getValidationTextRange() {
- return getMapping().getValidationTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.idDerivedIdentityStrategy.validate(messages, reporter);
- this.mapsIdDerivedIdentityStrategy.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0.java
deleted file mode 100644
index bb61f67178..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,24 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-
-
-public class GenericOrmElementCollectionMapping2_0
- extends AbstractOrmElementCollectionMapping2_0<XmlElementCollection>
-{
-
- public GenericOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
- super(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmEmbeddable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmEmbeddable2_0.java
deleted file mode 100644
index 0c73b1073a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmEmbeddable2_0.java
+++ /dev/null
@@ -1,31 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmEmbeddable;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaEmbeddable2_0;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-
-public class GenericOrmEmbeddable2_0
- extends AbstractOrmEmbeddable
-{
- public GenericOrmEmbeddable2_0(OrmPersistentType parent, XmlEmbeddable resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
- return ArrayTools.contains(GenericJavaEmbeddable2_0.ALLOWED_ATTRIBUTE_MAPPING_KEYS, attributeMappingKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index 63943de42a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmIdDerivedIdentityStrategy2_0.java
+++ /dev/null
@@ -1,102 +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.core.internal.jpa2.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class GenericOrmIdDerivedIdentityStrategy2_0
- extends AbstractOrmXmlContextNode
- implements OrmIdDerivedIdentityStrategy2_0
-{
- protected XmlDerivedId_2_0 resource;
-
- protected boolean value;
-
-
- public GenericOrmIdDerivedIdentityStrategy2_0(
- OrmDerivedIdentity2_0 parent, XmlDerivedId_2_0 resource) {
- super(parent);
- this.resource = resource;
- this.value = getResourceToContextValue();
- }
-
-
- public OrmDerivedIdentity2_0 getDerivedIdentity() {
- return (OrmDerivedIdentity2_0) getParent();
- }
-
- public OrmSingleRelationshipMapping2_0 getMapping() {
- return getDerivedIdentity().getMapping();
- }
-
- public boolean getValue() {
- return this.value;
- }
-
- public void setValue(boolean newValue) {
- boolean oldValue = this.value;
- this.value = newValue;
- this.resource.setId(getContextToResourceValue());
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- protected void setValue_(boolean newValue) {
- boolean oldValue = this.value;
- this.value = newValue;
- firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- public void update() {
- setValue_(getResourceToContextValue());
- }
-
- protected boolean getResourceToContextValue() {
- return (resource.getId() == null) ? false : resource.getId().booleanValue();
- }
-
- protected Boolean getContextToResourceValue() {
- return (this.value) ? Boolean.TRUE : null;
- }
-
- public boolean isSpecified() {
- return Boolean.TRUE.equals(this.resource.getId());
- }
-
- public void addStrategy() {
- this.resource.setId(true);
- }
-
- public void removeStrategy() {
- this.resource.setId(null);
- }
-
- public void initializeFrom(OrmIdDerivedIdentityStrategy2_0 oldStrategy) {
- setValue(oldStrategy.getValue());
- }
-
- public TextRange getValidationTextRange() {
- return this.resource.getIdTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // no validation rules
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0.java
deleted file mode 100644
index b1971ce41b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmJoinTableInAssociationOverrideJoiningStrategy2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0
- extends AbstractOrmJoinTableJoiningStrategy
- implements OrmJoinTableInAssociationOverrideJoiningStrategy2_0
-{
- protected transient XmlAssociationOverride resourceAssociationOverride;
-
- public GenericOrmJoinTableInAssociationOverrideJoiningStrategy2_0(OrmAssociationOverrideRelationshipReference2_0 parent, XmlAssociationOverride xao) {
- super(parent);
- this.resourceAssociationOverride = xao;
- this.initialize();
- }
-
- public boolean isOverridableAssociation() {
- return false;
- }
-
- @Override
- public OrmAssociationOverrideRelationshipReference2_0 getRelationshipReference() {
- return (OrmAssociationOverrideRelationshipReference2_0) super.getRelationshipReference();
- }
-
- public boolean shouldValidateAgainstDatabase() {
- return getRelationshipReference().getTypeMapping().shouldValidateAgainstDatabase();
- }
-
- // **************** join table *********************************************
-
- @Override
- protected void setResourceJoinTable(XmlJoinTable resourceJoinTable) {
- this.resourceAssociationOverride.setJoinTable(resourceJoinTable);
- }
-
- public XmlJoinTable getResourceJoinTable() {
- return this.resourceAssociationOverride.getJoinTable();
- }
-
- public void removeResourceJoinTable() {
- this.resourceAssociationOverride.setJoinTable(null);
- }
-
- public void update(XmlAssociationOverride resourceAssociationOverride) {
- this.resourceAssociationOverride = resourceAssociationOverride;
- super.update();
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceAssociationOverride.getValidationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0.java
deleted file mode 100644
index 93265e500c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-public class GenericOrmManyToOneMapping2_0
- extends AbstractOrmManyToOneMapping<XmlManyToOne>
-{
- public GenericOrmManyToOneMapping2_0(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmManyToOneRelationshipReference2_0(this, this.resourceAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneRelationshipReference2_0.java
deleted file mode 100644
index 72ee3ac0cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmManyToOneRelationshipReference2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToOneRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-
-public class GenericOrmManyToOneRelationshipReference2_0
- extends AbstractOrmManyToOneRelationshipReference
-{
-
- public GenericOrmManyToOneRelationshipReference2_0(
- OrmManyToOneMapping parent, XmlManyToOne resource) {
- super(parent, resource);
- }
-
- @Override
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericOrmJoinTableJoiningStrategy(this, getResourceMapping());
- }
-
- @Override
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- super.initializeOn(newRelationshipReference);
- newRelationshipReference.initializeFromJoinTableEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinTableEnabledRelationshipReference(oldRelationshipReference);
- OrmJoinTable oldTable =
- oldRelationshipReference.getJoinTableJoiningStrategy().getJoinTable();
- if (oldTable != null) {
- this.joinTableJoiningStrategy.addJoinTable().initializeFrom(oldTable);
- }
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.joinTableJoiningStrategy.getJoinTable() != null){
- return this.joinTableJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index fa2dd6e7c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_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.core.internal.jpa2.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmMapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-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 GenericOrmMapsIdDerivedIdentityStrategy2_0
- extends AbstractOrmXmlContextNode
- implements OrmMapsIdDerivedIdentityStrategy2_0
-{
- protected XmlMapsId_2_0 resource;
-
- protected String value;
-
-
- public GenericOrmMapsIdDerivedIdentityStrategy2_0(
- OrmDerivedIdentity2_0 parent, XmlMapsId_2_0 resource) {
- super(parent);
- this.resource = resource;
- this.value = this.resource.getMapsId();
- }
-
-
- public OrmDerivedIdentity2_0 getDerivedIdentity() {
- return (OrmDerivedIdentity2_0) getParent();
- }
-
- public OrmSingleRelationshipMapping2_0 getMapping() {
- return getDerivedIdentity().getMapping();
- }
-
- public String getSpecifiedValue() {
- return this.value;
- }
-
- public void setSpecifiedValue(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.resource.setMapsId(this.value);
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, oldValue, newValue);
- }
-
- protected void setSpecifiedValue_(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- firePropertyChanged(SPECIFIED_VALUE_PROPERTY, oldValue, newValue);
- }
-
- public boolean usesDefaultValue() {
- return false;
- }
-
- public String getDefaultValue() {
- // there is no way to have default values in xml
- return null;
- }
-
- public String getValue() {
- // there is never a default value
- return this.value;
- }
-
- public Iterable<String> getSortedValueChoices() {
- return CollectionTools.sort(
- new TransformationIterable<AttributeMapping, String>(getAllAttributeMappingChoices()) {
- @Override
- protected String transform(AttributeMapping o) {
- return o.getName();
- }
- });
- }
-
- public Iterable<AttributeMapping> getAllAttributeMappingChoices() {
- return new CompositeIterable<AttributeMapping>(
- getAttributeMappingChoiceIterables(
- CollectionTools.collection(getMapping().getPersistentAttribute().getOwningTypeMapping().allAttributeMappings())));
- }
-
- protected Iterable<Iterable<AttributeMapping>> getAttributeMappingChoiceIterables(Iterable<AttributeMapping> availableMappings) {
- return new TransformationIterable<AttributeMapping, Iterable<AttributeMapping>>(availableMappings) {
- @Override
- protected Iterable<AttributeMapping> transform(AttributeMapping o) {
- if (StringTools.stringsAreEqual(o.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) {
- return getEmbeddedIdMappingChoiceIterable((EmbeddedIdMapping) o);
- }
- else {
- return new SingleElementIterable(o);
- }
- }
- };
- }
-
- protected Iterable<AttributeMapping> getEmbeddedIdMappingChoiceIterable(EmbeddedIdMapping mapping) {
- Embeddable embeddable = mapping.getTargetEmbeddable();
- if (embeddable == null) {
- return new SingleElementIterable(mapping);
- }
- else {
- return new CompositeIterable<AttributeMapping>(
- mapping,
- CollectionTools.collection(embeddable.allAttributeMappings()));
- }
- }
-
- public AttributeMapping getResolvedAttributeMappingValue() {
- if (getValue() != null) {
- for (AttributeMapping each : getAllAttributeMappingChoices()) {
- if (Tools.valuesAreEqual(each.getName(), getValue())) {
- return each;
- }
- }
- }
- return null;
- }
-
- public boolean isSpecified() {
- return this.resource.getMapsId() != null;
- }
-
- public void addStrategy() {
- this.resource.setMapsId("");
- }
-
- public void removeStrategy() {
- this.resource.setMapsId(null);
- }
-
- public void update() {
- setSpecifiedValue_(this.resource.getMapsId());
- }
-
- public void initializeFrom(OrmMapsIdDerivedIdentityStrategy2_0 oldStrategy) {
- setSpecifiedValue(oldStrategy.getSpecifiedValue());
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.resource.getMapsIdTextRange();
- return (textRange == null) ? getDerivedIdentity().getValidationTextRange() : textRange;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateMapsId(messages, reporter);
- }
-
- protected void validateMapsId(List<IMessage> messages, IReporter reporter) {
- // shortcut out if maps id is not even used
- if (! getDerivedIdentity().usesMapsIdDerivedIdentityStrategy()) {
- return;
- }
-
- // test whether value can be resolved
- AttributeMapping attributeMappingValue = getResolvedAttributeMappingValue();
- if (attributeMappingValue == null) {
- // there is no defaulting, so only use the 'resolved' error, even if the value is empty string
- messages.add(buildMessage(JpaValidationMessages.MAPS_ID_VALUE_NOT_RESOLVED, new String[] {getValue()}));
- }
-
- // test whether attribute mapping is allowable
- if (attributeMappingValue != null) {
- if (! CollectionTools.contains(getValidAttributeMappingChoices(), attributeMappingValue)) {
- messages.add(buildMessage(JpaValidationMessages.MAPS_ID_VALUE_INVALID, new String[] {getValue()}));
- }
- }
- }
-
- protected Iterable<AttributeMapping> getValidAttributeMappingChoices() {
- return new CompositeIterable<AttributeMapping>(
- getAttributeMappingChoiceIterables(
- new FilteringIterable<AttributeMapping>(
- CollectionTools.collection(getMapping().getPersistentAttribute().getOwningTypeMapping().allAttributeMappings())) {
- @Override
- protected boolean accept(AttributeMapping o) {
- return StringTools.stringsAreEqual(o.getKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(o.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- }
- }));
- }
-
- protected IMessage buildMessage(String msgID, String[] params) {
- String attributeDescString;
- PersistentAttribute attribute = getDerivedIdentity().getMapping().getPersistentAttribute();
- if (attribute.isVirtual()) {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.VIRTUAL_ATTRIBUTE_DESC, attribute.getName());
- }
- else {
- attributeDescString = NLS.bind(JpaValidationDescriptionMessages.ATTRIBUTE_DESC, attribute.getName());
- }
- return DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY, msgID, ArrayTools.add(params, 0, attributeDescString), this, getValidationTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmNamedQuery2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmNamedQuery2_0.java
deleted file mode 100644
index 51f36abc89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmNamedQuery2_0.java
+++ /dev/null
@@ -1,88 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmQuery;
-import org.eclipse.jpt.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmNamedQuery2_0;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-
-/**
- * GenericOrmNamedQuery2_0
- */
-public class GenericOrmNamedQuery2_0 extends AbstractOrmQuery<XmlNamedQuery>
- implements OrmNamedQuery2_0
-{
- protected LockModeType2_0 specifiedLockMode;
- protected LockModeType2_0 defaultLockMode;
-
- // ********** constructor **********
- public GenericOrmNamedQuery2_0(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- super(parent, resourceNamedQuery);
- }
-
- // ********** NamedQuery2_0 implementation **********
-
- public LockModeType2_0 getLockMode() {
- return (this.specifiedLockMode != null) ? this.specifiedLockMode : this.defaultLockMode;
- }
-
- public LockModeType2_0 getSpecifiedLockMode() {
- return this.specifiedLockMode;
- }
-
- public void setSpecifiedLockMode(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.specifiedLockMode;
- this.specifiedLockMode = lockMode;
- this.getResourceQuery().setLockMode(LockModeType2_0.toOrmResourceModel(lockMode));
- this.firePropertyChanged(SPECIFIED_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- public void setSpecifiedLockMode_(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.specifiedLockMode;
- this.specifiedLockMode = lockMode;
- this.firePropertyChanged(SPECIFIED_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- public LockModeType2_0 getDefaultLockMode() {
- return this.defaultLockMode;
- }
-
- protected void setDefaultLockMode(LockModeType2_0 lockMode) {
- LockModeType2_0 old = this.defaultLockMode;
- this.defaultLockMode = lockMode;
- this.firePropertyChanged(DEFAULT_LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- protected LockModeType2_0 buildDefaultLockMode() {
- return LockModeType2_0.NONE;
- }
-
- // ********** resource => context **********
-
- @Override
- protected void initialize(XmlNamedQuery xmlQuery) {
- super.initialize(xmlQuery);
- this.defaultLockMode = this.buildDefaultLockMode();
- this.specifiedLockMode = this.getResourceLockModeOf(xmlQuery);
- }
-
- @Override
- public void update(XmlNamedQuery xmlQuery) {
- super.update(xmlQuery);
- this.setSpecifiedLockMode_(this.getResourceLockModeOf(xmlQuery));
- }
-
- private LockModeType2_0 getResourceLockModeOf(XmlNamedQuery xmlQuery) {
- return LockModeType2_0.fromOrmResourceModel(xmlQuery.getLockMode());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0.java
deleted file mode 100644
index 22e11bc0a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0.java
+++ /dev/null
@@ -1,30 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-
-
-public class GenericOrmOneToManyMapping2_0 extends AbstractOrmOneToManyMapping<XmlOneToMany>
-{
-
- public GenericOrmOneToManyMapping2_0(OrmPersistentAttribute parent, XmlOneToMany resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmRelationshipReference buildRelationshipReference() {
- return new GenericOrmOneToManyRelationshipReference2_0(this, this.resourceAttributeMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyRelationshipReference2_0.java
deleted file mode 100644
index 1ca049aad8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToManyRelationshipReference2_0.java
+++ /dev/null
@@ -1,80 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyRelationshipReference;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class GenericOrmOneToManyRelationshipReference2_0
- extends AbstractOrmOneToManyRelationshipReference
-{
- public GenericOrmOneToManyRelationshipReference2_0(
- OrmOneToManyMapping parent, XmlOneToMany resource) {
-
- super(parent, resource);
- }
-
- @Override
- protected OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy(this, getResourceMapping());
- }
-
- @Override
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- super.initializeOn(newRelationshipReference);
- newRelationshipReference.initializeFromJoinColumnEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinColumnEnabledRelationshipReference(oldRelationshipReference);
- int index = 0;
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- oldRelationshipReference.getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = this.joinColumnJoiningStrategy.addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- else {
- return this.joinTableJoiningStrategy;
- }
- }
-
-
- // **************** mapped by **********************************************
-
- @Override
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return super.mayBeMappedBy(mappedByMapping) ||
- mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0.java
deleted file mode 100644
index ea22084522..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-
-public class GenericOrmOneToOneMapping2_0
- extends AbstractOrmOneToOneMapping<XmlOneToOne>
-{
-
- // ********** constructor **********
- public GenericOrmOneToOneMapping2_0(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmOneToOneRelationshipReference2_0(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneRelationshipReference2_0.java
deleted file mode 100644
index 2a894d51fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOneToOneRelationshipReference2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToOneRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-
-public class GenericOrmOneToOneRelationshipReference2_0
- extends AbstractOrmOneToOneRelationshipReference
-{
-
-
- public GenericOrmOneToOneRelationshipReference2_0(
- OrmOneToOneMapping parent, XmlOneToOne resource) {
- super(parent, resource);
- }
-
-
- @Override
- protected OrmJoinTableJoiningStrategy buildJoinTableJoiningStrategy() {
- return new GenericOrmJoinTableJoiningStrategy(this, getResourceMapping());
- }
-
- @Override
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- super.initializeOn(newRelationshipReference);
- newRelationshipReference.initializeFromJoinTableEnabledRelationshipReference(this);
- // no other primary key reference as of yet, so no initialization based on pk join columns
- }
-
- @Override
- public void initializeFromJoinTableEnabledRelationshipReference(
- OrmJoinTableEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinTableEnabledRelationshipReference(oldRelationshipReference);
- OrmJoinTable oldTable =
- oldRelationshipReference.getJoinTableJoiningStrategy().getJoinTable();
- if (oldTable != null) {
- this.joinTableJoiningStrategy.addJoinTable().initializeFrom(oldTable);
- }
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.primaryKeyJoinColumnJoiningStrategy.primaryKeyJoinColumnsSize() > 0) {
- return this.primaryKeyJoinColumnJoiningStrategy;
- }
- else if (this.joinTableJoiningStrategy.getJoinTable() != null){
- return this.joinTableJoiningStrategy;
- }
- return this.joinColumnJoiningStrategy;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java
deleted file mode 100644
index d2aeb22eed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrderColumn2_0.java
+++ /dev/null
@@ -1,218 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.BaseColumn;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmNamedColumn;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
-
-
-public class GenericOrmOrderColumn2_0
- extends AbstractOrmNamedColumn<XmlOrderColumn>
- implements OrmOrderColumn2_0
-{
- protected Boolean specifiedNullable;
-
- protected Boolean specifiedInsertable;
-
- protected Boolean specifiedUpdatable;
-
- protected XmlOrderable_2_0 xmlOrderable;
-
- public GenericOrmOrderColumn2_0(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner) {
- super(parent, owner);
- }
-
- @Override
- public OrmOrderable2_0 getParent() {
- return (OrmOrderable2_0) super.getParent();
- }
-
- protected PersistentAttribute getPersistentAttribute() {
- return getParent().getParent().getPersistentAttribute();
- }
-
- @Override
- public String getTable() {
- return getParent().getDefaultTableName();
- }
-
- @Override
- public XmlOrderColumn getResourceColumn() {
- return this.xmlOrderable.getOrderColumn();
- }
-
- @Override
- protected void addResourceColumn() {
- this.xmlOrderable.setOrderColumn(OrmFactory.eINSTANCE.createXmlOrderColumn());
- }
-
- @Override
- protected void removeResourceColumn() {
- this.xmlOrderable.setOrderColumn(null);
- }
-
- public boolean isResourceSpecified() {
- return getResourceColumn() != null;
- }
-
- @Override
- protected void removeResourceColumnIfFeaturesUnset() {
- //override to do nothing
- //don't want to remove the order-column element if it's features are all set to null
- }
-
- public boolean isNullable() {
- return (this.getSpecifiedNullable() == null) ? this.isDefaultNullable() : this.getSpecifiedNullable().booleanValue();
- }
-
- public boolean isDefaultNullable() {
- return BaseColumn.DEFAULT_NULLABLE;
- }
-
- public Boolean getSpecifiedNullable() {
- return this.specifiedNullable;
- }
-
- public void setSpecifiedNullable(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- if (this.valuesAreDifferent(oldSpecifiedNullable, newSpecifiedNullable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setNullable(newSpecifiedNullable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedNullable != null) {
- addResourceColumn();
- getResourceColumn().setNullable(newSpecifiedNullable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- protected void setSpecifiedNullable_(Boolean newSpecifiedNullable) {
- Boolean oldSpecifiedNullable = this.specifiedNullable;
- this.specifiedNullable = newSpecifiedNullable;
- firePropertyChanged(BaseColumn.SPECIFIED_NULLABLE_PROPERTY, oldSpecifiedNullable, newSpecifiedNullable);
- }
-
- public boolean isInsertable() {
- return (this.getSpecifiedInsertable() == null) ? this.isDefaultInsertable() : this.getSpecifiedInsertable().booleanValue();
- }
-
- public boolean isDefaultInsertable() {
- return BaseColumn.DEFAULT_INSERTABLE;
- }
-
- public Boolean getSpecifiedInsertable() {
- return this.specifiedInsertable;
- }
-
- public void setSpecifiedInsertable(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- if (this.valuesAreDifferent(oldSpecifiedInsertable, newSpecifiedInsertable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setInsertable(newSpecifiedInsertable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedInsertable != null) {
- addResourceColumn();
- getResourceColumn().setInsertable(newSpecifiedInsertable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- protected void setSpecifiedInsertable_(Boolean newSpecifiedInsertable) {
- Boolean oldSpecifiedInsertable = this.specifiedInsertable;
- this.specifiedInsertable = newSpecifiedInsertable;
- firePropertyChanged(BaseColumn.SPECIFIED_INSERTABLE_PROPERTY, oldSpecifiedInsertable, newSpecifiedInsertable);
- }
-
- public boolean isUpdatable() {
- return (this.getSpecifiedUpdatable() == null) ? this.isDefaultUpdatable() : this.getSpecifiedUpdatable().booleanValue();
- }
-
- public boolean isDefaultUpdatable() {
- return BaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getSpecifiedUpdatable() {
- return this.specifiedUpdatable;
- }
-
- public void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- if (this.valuesAreDifferent(oldSpecifiedUpdatable, newSpecifiedUpdatable)) {
- if (this.getResourceColumn() != null) {
- this.getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- this.removeResourceColumnIfFeaturesUnset();
- }
- else if (newSpecifiedUpdatable != null) {
- addResourceColumn();
- getResourceColumn().setUpdatable(newSpecifiedUpdatable);
- }
- }
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- protected void setSpecifiedUpdatable_(Boolean newSpecifiedUpdatable) {
- Boolean oldSpecifiedUpdatable = this.specifiedUpdatable;
- this.specifiedUpdatable = newSpecifiedUpdatable;
- firePropertyChanged(BaseColumn.SPECIFIED_UPDATABLE_PROPERTY, oldSpecifiedUpdatable, newSpecifiedUpdatable);
- }
-
- public void initialize(XmlOrderable_2_0 xmlOrderable) {
- this.xmlOrderable = xmlOrderable;
- this.initialize(this.getResourceColumn());
- }
-
- public void update(XmlOrderable_2_0 xmlOrderable) {
- this.xmlOrderable = xmlOrderable;
- this.update(this.getResourceColumn());
- }
-
- @Override
- protected void initialize(XmlOrderColumn column) {
- super.initialize(column);
- this.specifiedNullable = this.getResourceNullable(column);
- this.specifiedUpdatable = this.getResourceUpdatable(column);
- this.specifiedInsertable = this.getResourceInsertable(column);
- }
-
- @Override
- protected void update(XmlOrderColumn column) {
- super.update(column);
- setSpecifiedNullable_(this.getResourceNullable(column));
- setSpecifiedUpdatable_(this.getResourceUpdatable(column));
- setSpecifiedInsertable_(this.getResourceInsertable(column));
- }
-
- protected Boolean getResourceNullable(XmlOrderColumn column) {
- return column == null ? null : column.getNullable();
- }
-
- protected Boolean getResourceUpdatable(XmlOrderColumn column) {
- return column == null ? null : column.getUpdatable();
- }
-
-
- protected Boolean getResourceInsertable(XmlOrderColumn column) {
- return column == null ? null : column.getInsertable();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrphanRemoval2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrphanRemoval2_0.java
deleted file mode 100644
index 2402b9381a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmOrphanRemoval2_0.java
+++ /dev/null
@@ -1,82 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * GenericOrmOrphanRemoval2_0
- */
-public class GenericOrmOrphanRemoval2_0 extends AbstractOrmXmlContextNode
- implements OrmOrphanRemovable2_0
-{
- protected final XmlOrphanRemovable_2_0 resource;
- protected boolean defaultOrphanRemoval;
- protected Boolean specifiedOrphanRemoval;
-
- // ********** constructor **********
- public GenericOrmOrphanRemoval2_0(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource) {
- super(parent);
- this.resource = resource;
- this.specifiedOrphanRemoval = this.getResourceOrphanRemoval();
- }
-
- @Override
- public OrmOrphanRemovalHolder2_0 getParent() {
- return (OrmOrphanRemovalHolder2_0) super.getParent();
- }
-
- // ********** OrphanRemovable2_0 implementation **********
-
- public boolean isOrphanRemoval() {
- return (this.specifiedOrphanRemoval != null) ? this.specifiedOrphanRemoval.booleanValue() : this.defaultOrphanRemoval;
- }
-
- public Boolean getSpecifiedOrphanRemoval() {
- return this.specifiedOrphanRemoval;
- }
-
- public boolean isDefaultOrphanRemoval() {
- return this.defaultOrphanRemoval;
- }
-
- public void setSpecifiedOrphanRemoval(Boolean newSpecifiedOrphanRemoval) {
- Boolean old = this.specifiedOrphanRemoval;
- this.specifiedOrphanRemoval = newSpecifiedOrphanRemoval;
- this.resource.setOrphanRemoval(newSpecifiedOrphanRemoval);
- this.firePropertyChanged(SPECIFIED_ORPHAN_REMOVAL_PROPERTY, old, newSpecifiedOrphanRemoval);
- }
-
- protected void setSpecifiedOrphanRemoval_(Boolean newSpecifiedOrphanRemoval) {
- Boolean old = this.specifiedOrphanRemoval;
- this.specifiedOrphanRemoval = newSpecifiedOrphanRemoval;
- this.firePropertyChanged(SPECIFIED_ORPHAN_REMOVAL_PROPERTY, old, newSpecifiedOrphanRemoval);
- }
-
- // ********** initialize/update **********
- public void update() {
- this.setSpecifiedOrphanRemoval_(this.getResourceOrphanRemoval());
- }
-
- // ********** validation **********
- public TextRange getValidationTextRange() {
- // TODO
- return null;
- }
-
- protected Boolean getResourceOrphanRemoval() {
- return this.resource.getOrphanRemoval();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0.java
deleted file mode 100644
index c4bfc6940a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0.java
+++ /dev/null
@@ -1,57 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlAccessHolder;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-
-public class GenericOrmPersistentAttribute2_0
- extends AbstractOrmPersistentAttribute
-{
-
- protected AccessType specifiedAccess;
-
- public GenericOrmPersistentAttribute2_0(OrmPersistentType parent, Owner owner, XmlAttributeMapping resourceMapping) {
- super(parent, owner, resourceMapping);
- this.specifiedAccess = getResourceAccess();
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- AccessType oldAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- ((XmlAccessHolder) this.getResourceAttributeMapping()).setAccess(AccessType.toOrmResourceModel(newSpecifiedAccess));
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldAccess, newSpecifiedAccess);
- }
-
- protected void setSpecifiedAccess_(AccessType newSpecifiedAccess) {
- AccessType oldAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldAccess, newSpecifiedAccess);
- }
-
- @Override
- public void update() {
- super.update();
- setSpecifiedAccess_(getResourceAccess());
- }
-
- protected AccessType getResourceAccess() {
- return AccessType.fromOrmResourceModel(((XmlAccessHolder) getResourceAttributeMapping()).getAccess());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java
deleted file mode 100644
index 25a055bc9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java
+++ /dev/null
@@ -1,138 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmSequenceGenerator;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSequenceGenerator2_0;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-
-/**
- * Generic2_0OrmSequenceGenerator
- */
-public class GenericOrmSequenceGenerator2_0 extends AbstractOrmSequenceGenerator
- implements OrmSequenceGenerator2_0
-{
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
- protected String specifiedSchema;
- protected String defaultSchema;
-
- public GenericOrmSequenceGenerator2_0(XmlContextNode parent, XmlSequenceGenerator resourceSequenceGenerator) {
- super(parent, resourceSequenceGenerator);
- }
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
-
- public void setSpecifiedCatalog(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.getResourceGenerator().setCatalog(catalog);
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
-
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
-
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
- }
-
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
- }
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
- return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.getResourceGenerator().setSchema(schema);
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
- }
-
- protected String buildDefaultSchema() {
- return this.getContextDefaultSchema();
- }
-
- // ********** resource => context **********
-
- @Override
- protected void initialize(org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator xmlResource) {
- super.initialize(xmlResource);
- XmlSequenceGenerator xmlResource2_0 = (XmlSequenceGenerator) xmlResource;
-
- this.defaultCatalog = this.buildDefaultCatalog();
- this.specifiedCatalog = xmlResource2_0.getCatalog();
- this.defaultSchema = this.buildDefaultSchema();
- this.specifiedSchema = xmlResource2_0.getSchema();
- }
-
- @Override
- public void update(org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator xmlResource) {
- super.update(xmlResource);
- XmlSequenceGenerator xmlResource2_0 = (XmlSequenceGenerator) xmlResource;
-
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setSpecifiedCatalog_(xmlResource2_0.getCatalog());
- this.setDefaultSchema(this.buildDefaultSchema());
- this.setSpecifiedSchema_(xmlResource2_0.getSchema());
- }
-
- @Override
- protected XmlSequenceGenerator getResourceGenerator() {
- return (XmlSequenceGenerator) super.getResourceGenerator();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy.java
deleted file mode 100644
index 9724c2b7bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping;
-
-public class GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy
- extends AbstractOrmJoinColumnInRelationshipMappingJoiningStrategy
-{
-
- public GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy(
- OrmJoinColumnEnabledRelationshipReference parent,
- XmlJoinColumnsMapping resource) {
- super(parent, resource);
- }
-
- public TypeMapping getRelationshipSource() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- return relationshipMapping == null ? null : relationshipMapping.getResolvedTargetEntity();
- }
-
- public TypeMapping getRelationshipTarget() {
- return getRelationshipMapping().getTypeMapping();
- }
-
- @Override
- protected Entity getRelationshipTargetEntity() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return relationshipTarget.getKey() == MappingKeys.ENTITY_TYPE_MAPPING_KEY ? (Entity) relationshipTarget : null;
- }
-
- public boolean isTargetForeignKeyRelationship() {
- return true;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0ContextNodeFactory.java
deleted file mode 100644
index b8abde8624..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0ContextNodeFactory.java
+++ /dev/null
@@ -1,219 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer.Owner;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-
-public class GenericOrmXml2_0ContextNodeFactory extends AbstractOrmXmlContextNodeFactory
-{
-
- @Override
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType parent, org.eclipse.jpt.core.resource.orm.XmlEmbeddable resourceMapping) {
- return new GenericOrmEmbeddable2_0(parent, resourceMapping);
- }
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, org.eclipse.jpt.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new GenericOrmPersistentAttribute2_0(parent, owner, resourceMapping);
- }
-
- @Override
- public OrmAssociationOverrideRelationshipReference buildOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, org.eclipse.jpt.core.resource.orm.XmlAssociationOverride associationOverride) {
- return new GenericOrmAssociationOverrideRelationshipReference2_0(parent, associationOverride);
- }
-
- @Override
- public OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator2_0(parent, resourceSequenceGenerator);
- }
-
- @Override
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(
- OrmEmbeddedMapping2_0 parent,
- Owner owner) {
-
- return new GenericOrmAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public OrmDerivedIdentity2_0 buildOrmDerivedIdentity(
- OrmSingleRelationshipMapping2_0 parent, XmlSingleRelationshipMapping_2_0 resource) {
- return new GenericOrmDerivedIdentity2_0(parent, resource);
- }
-
- @Override
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(
- OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
-
- return new GenericOrmElementCollectionMapping2_0(parent, resourceMapping);
- }
-
- @Override
- public OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource) {
- return new GenericOrmCacheable2_0(parent, resource);
- }
-
- @Override
- public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource) {
- return new GenericOrmOrphanRemoval2_0(parent, resource);
- }
-
- @Override
- public OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- return new GenericOrmNamedQuery2_0(parent, resourceNamedQuery);
- }
-
- @Override
- public OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, XmlCollectionTable resource) {
- return new GenericOrmCollectionTable2_0(parent, resource);
- }
-
- @Override
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany resourceMapping) {
- return new GenericOrmOneToManyMapping2_0(parent, resourceMapping);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- return new GenericOrmManyToOneMapping2_0(parent, resourceMapping);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- return new GenericOrmOneToOneMapping2_0(parent, resourceMapping);
- }
-
- // ********** ORM Virtual Resource Model **********
-
- @Override
- public XmlAssociationOverride buildVirtualXmlAssociationOverride(String name, OrmTypeMapping parent, JoiningStrategy joiningStrategy) {
- return new VirtualXmlAssociationOverride2_0(name, parent, joiningStrategy);
- }
-
- @Override
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- return new VirtualXmlBasic2_0(ormTypeMapping, javaBasicMapping);
- }
-
- @Override
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- return new VirtualXmlId2_0(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- return new VirtualXmlEmbeddedId2_0(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- return new VirtualXmlEmbedded2_0(ormTypeMapping, (JavaEmbeddedMapping2_0) javaEmbeddedMapping);
- }
-
- @Override
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- return new VirtualXmlManyToMany2_0(ormTypeMapping, (JavaManyToManyMapping2_0) javaManyToManyMapping);
- }
-
- @Override
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- return new VirtualXmlManyToOne2_0(ormTypeMapping, (JavaManyToOneMapping2_0) javaManyToOneMapping);
- }
-
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualXmlOneToMany2_0(ormTypeMapping, (JavaOneToManyMapping2_0) javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualXmlOneToOne2_0(ormTypeMapping, (JavaOneToOneMapping2_0) javaOneToOneMapping);
- }
-
- @Override
- public XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- return new VirtualXmlTransient2_0(ormTypeMapping, javaTransientMapping);
- }
-
- @Override
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- return new VirtualXmlVersion2_0(ormTypeMapping, javaVersionMapping);
- }
-
- @Override
- public XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtualXmlNullAttributeMapping2_0(ormTypeMapping, javaAttributeMapping);
- }
-
- @Override
- public XmlElementCollection buildVirtualXmlElementCollection2_0(OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping) {
- return new VirtualXmlElementCollection2_0(ormTypeMapping, javaMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0Definition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0Definition.java
deleted file mode 100644
index 181bfa4df9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/GenericOrmXml2_0Definition.java
+++ /dev/null
@@ -1,107 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-
-public class GenericOrmXml2_0Definition
- extends AbstractOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE =
- new GenericOrmXml2_0Definition();
-
-
- /**
- * Return the singleton
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private GenericOrmXml2_0Definition() {
- super();
- }
-
-
- public EFactory getResourceNodeFactory() {
- return OrmFactory.eINSTANCE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new GenericOrmXml2_0ContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.ORM_XML_2_0_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 Generic2_0JpaPlatformProvider})
- 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 Generic2_0JpaPlatformProvider})
- return new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmElementCollectionMapping2_0Definition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmCacheable2_0.java
deleted file mode 100644
index 9bcf898ae8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmCacheable2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class NullOrmCacheable2_0
- extends AbstractOrmXmlContextNode
- implements OrmCacheable2_0
-{
- public NullOrmCacheable2_0(OrmCacheableHolder2_0 parent) {
- super(parent);
- }
-
- public boolean isCacheable() {
- return false;
- }
-
- public boolean isDefaultCacheable() {
- return false;
- }
-
- public Boolean getSpecifiedCacheable() {
- return null;
- }
-
- public void setSpecifiedCacheable(Boolean newSpecifiedCacheable) {
- throw new UnsupportedOperationException();
- }
-
- public void update() {
- //no-op
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmDerivedIdentity2_0.java
deleted file mode 100644
index ca5f71be79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmDerivedIdentity2_0.java
+++ /dev/null
@@ -1,88 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.AbstractXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmMapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class NullOrmDerivedIdentity2_0 extends AbstractXmlContextNode
- implements OrmDerivedIdentity2_0
-{
- public NullOrmDerivedIdentity2_0(OrmSingleRelationshipMapping2_0 parent) {
- super(parent);
- }
-
-
- public OrmSingleRelationshipMapping2_0 getMapping() {
- return (OrmSingleRelationshipMapping2_0) getParent();
- }
-
- public void update() {
- // no op
- }
-
- public DerivedIdentityStrategy2_0 getPredominantDerivedIdentityStrategy() {
- return null;
- }
-
- public OrmMapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy() {
- return null;
- }
-
- public boolean usesMapsIdDerivedIdentityStrategy() {
- return false;
- }
-
- public void setMapsIdDerivedIdentityStrategy() {
- // no op
- }
-
- public void unsetMapsIdDerivedIdentityStrategy() {
- // no op
- }
-
- public OrmIdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy() {
- return null;
- }
-
- public boolean usesIdDerivedIdentityStrategy() {
- return false;
- }
-
- public void setIdDerivedIdentityStrategy() {
- // no op
- }
-
- public void unsetIdDerivedIdentityStrategy() {
- // no op
- }
-
- public boolean usesNullDerivedIdentityStrategy() {
- return true;
- }
-
- public void setNullDerivedIdentityStrategy() {
- // no op
- }
-
- public void initializeFrom(OrmDerivedIdentity2_0 oldDerivedIdentity) {
- // no op
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmOrphanRemoval2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmOrphanRemoval2_0.java
deleted file mode 100644
index 9c90fa5da1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/NullOrmOrphanRemoval2_0.java
+++ /dev/null
@@ -1,52 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * NullOrmOrphanRemovable2_0
- */
-public class NullOrmOrphanRemoval2_0
- extends AbstractOrmXmlContextNode
- implements OrmOrphanRemovable2_0
-{
- public NullOrmOrphanRemoval2_0(OrmOrphanRemovalHolder2_0 parent) {
- super(parent);
- }
-
- public boolean isDefaultOrphanRemoval() {
- return false;
- }
-
- public boolean isOrphanRemoval() {
- return false;
- }
-
- public Boolean getSpecifiedOrphanRemoval() {
- return null;
- }
-
- public void setSpecifiedOrphanRemoval(Boolean newSpecifiedOrphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- public void update() {
- // do nothing
- }
-
- public TextRange getValidationTextRange() {
- return null;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/OrmElementCollectionMapping2_0Definition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/OrmElementCollectionMapping2_0Definition.java
deleted file mode 100644
index 66c9a0556e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/OrmElementCollectionMapping2_0Definition.java
+++ /dev/null
@@ -1,75 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-
-public class OrmElementCollectionMapping2_0Definition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmAttributeMappingDefinition INSTANCE =
- new OrmElementCollectionMapping2_0Definition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmElementCollectionMapping2_0Definition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- OrmPackage.eINSTANCE.getXmlElementCollection(),
- XmlElementCollection.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((OrmXml2_0ContextNodeFactory) factory).buildOrmElementCollectionMapping2_0(parent, (XmlElementCollection) resourceMapping);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return ((OrmXml2_0ContextNodeFactory) factory).buildVirtualXmlElementCollection2_0(ormTypeMapping, (JavaElementCollectionMapping2_0) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualMapKeyClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualMapKeyClassReference.java
deleted file mode 100644
index 375ee49628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualMapKeyClassReference.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-
-public class VirtualMapKeyClassReference extends XmlClassReference
-{
- JavaCollectionMapping2_0 javaCollectionMapping;
-
- public VirtualMapKeyClassReference(JavaCollectionMapping2_0 collectionMapping) {
- super();
- this.javaCollectionMapping = collectionMapping;
- }
-
- @Override
- public String getClassName() {
- return this.javaCollectionMapping.getFullyQualifiedMapKeyClass();
- }
-
- @Override
- public void setClassName(String newClassName) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlAssociationOverride2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlAssociationOverride2_0.java
deleted file mode 100644
index a4e66fee61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlAssociationOverride2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.JoinTable;
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAssociationOverride;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-
-public class VirtualXmlAssociationOverride2_0 extends XmlAssociationOverride
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JoiningStrategy joiningStrategy;
-
- protected final VirtualXmlAssociationOverride virtualXmlAssociationOverride;
-
- public VirtualXmlAssociationOverride2_0(String name, OrmTypeMapping ormTypeMapping, JoiningStrategy joiningStrategy) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.joiningStrategy = joiningStrategy;
- this.virtualXmlAssociationOverride = new VirtualXmlAssociationOverride(name, ormTypeMapping, joiningStrategy);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAssociationOverride.getName();
- }
-
- @Override
- public void setName(String value) {
- this.virtualXmlAssociationOverride.setName(value);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlAssociationOverride.getJoinColumns();
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- if (this.joiningStrategy instanceof JoinTableJoiningStrategy) {
- JoinTable joinTable = ((JoinTableJoiningStrategy) this.joiningStrategy).getJoinTable();
- if (joinTable != null) {
- return new VirtualXmlJoinTable(
- this.ormTypeMapping,
- joinTable);
- }
- }
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable newJoinTable) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlBasic2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlBasic2_0.java
deleted file mode 100644
index ed7ac05655..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlBasic2_0.java
+++ /dev/null
@@ -1,150 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlBasic;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlBasic2_0 extends XmlBasic
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaBasicMapping javaAttributeMapping;
-
- protected final VirtualXmlBasic virtualXmlBasic;
-
- public VirtualXmlBasic2_0(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapping;
- this.virtualXmlBasic = new VirtualXmlBasic(ormTypeMapping, javaBasicMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlBasic.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlBasic.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlBasic.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlBasic.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlBasic.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlBasic.setColumn(value);
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlBasic.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlBasic.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlBasic.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlBasic.setOptional(newOptional);
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlBasic.isLob();
- }
-
- @Override
- public void setLob(boolean newLob) {
- this.virtualXmlBasic.setLob(newLob);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlBasic.getLobTextRange();
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlBasic.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType setTemporal){
- this.virtualXmlBasic.setTemporal(setTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlBasic.getTemporalTextRange();
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlBasic.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType setEnumerated) {
- this.virtualXmlBasic.setEnumerated(setEnumerated);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCascadeType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCascadeType2_0.java
deleted file mode 100644
index 33caed6a85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCascadeType2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.VirtualCascadeType;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-
-public class VirtualXmlCascadeType2_0
- extends CascadeType
-{
- protected Cascade2_0 javaCascade;
-
- protected final VirtualCascadeType virtualXmlCascadeType1_0;
-
-
- public VirtualXmlCascadeType2_0(Cascade2_0 javaCascade) {
- super();
- this.javaCascade = javaCascade;
- this.virtualXmlCascadeType1_0 = new VirtualCascadeType(javaCascade);
- }
-
-
- @Override
- public boolean isCascadeDetach() {
- return this.javaCascade.isDetach();
- }
-
- @Override
- public void setCascadeDetach(boolean newCascadeDetach) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- // **************** JPA 1.0 functionality *********************************
-
- @Override
- public boolean isCascadeAll() {
- return this.virtualXmlCascadeType1_0.isCascadeAll();
- }
-
- @Override
- public void setCascadeAll(boolean value) {
- this.virtualXmlCascadeType1_0.setCascadeAll(value);
- }
-
- @Override
- public boolean isCascadeMerge() {
- return this.virtualXmlCascadeType1_0.isCascadeMerge();
- }
-
- @Override
- public void setCascadeMerge(boolean value) {
- this.virtualXmlCascadeType1_0.setCascadeMerge(value);
- }
-
- @Override
- public boolean isCascadePersist() {
- return this.virtualXmlCascadeType1_0.isCascadePersist();
- }
-
- @Override
- public void setCascadePersist(boolean value) {
- this.virtualXmlCascadeType1_0.setCascadePersist(value);
- }
-
- @Override
- public boolean isCascadeRefresh() {
- return this.virtualXmlCascadeType1_0.isCascadeRefresh();
- }
-
- @Override
- public void setCascadeRefresh(boolean value) {
- this.setCascadeRefresh(value);
- }
-
- @Override
- public boolean isCascadeRemove() {
- return this.virtualXmlCascadeType1_0.isCascadeRemove();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCollectionTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCollectionTable.java
deleted file mode 100644
index 18b149712c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlCollectionTable.java
+++ /dev/null
@@ -1,127 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlUniqueConstraint;
-import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class VirtualXmlCollectionTable
- extends XmlCollectionTable
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected CollectionTable2_0 collectionTable;
-
-
- public VirtualXmlCollectionTable(OrmTypeMapping ormTypeMapping, CollectionTable2_0 collectionTable) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.collectionTable = collectionTable;
- }
-
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getName() {
- if (this.isOrmMetadataComplete()) {
- return this.collectionTable.getDefaultName();
- }
- return this.collectionTable.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getCatalog() {
- if (this.isOrmMetadataComplete()) {
- return this.collectionTable.getDefaultCatalog();
- }
- return this.collectionTable.getCatalog();
- }
-
- @Override
- public void setCatalog(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getSchema() {
- if (this.isOrmMetadataComplete()) {
- return this.collectionTable.getDefaultSchema();
- }
- return this.collectionTable.getSchema();
- }
-
- @Override
- public void setSchema(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- //VirtualXmlJoinTable is rebuilt every time, so just rebuilding the joinColumns list as well
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_COLLECTION_TABLE__JOIN_COLUMNS);
- if (this.collectionTable == null || isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn : CollectionTools.iterable(this.collectionTable.specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- @Override
- public EList<XmlUniqueConstraint> getUniqueConstraints() {
- EList<XmlUniqueConstraint> xmlUniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_COLLECTION_TABLE__UNIQUE_CONSTRAINTS);
- if (this.collectionTable == null || isOrmMetadataComplete()) {
- return xmlUniqueConstraints;
- }
- for (UniqueConstraint uniqueConstraint : CollectionTools.iterable(this.collectionTable.uniqueConstraints())) {
- XmlUniqueConstraint xmlUniqueConstraint = new VirtualXmlUniqueConstraint(uniqueConstraint, isOrmMetadataComplete());
- xmlUniqueConstraints.add(xmlUniqueConstraint);
- }
-
- return xmlUniqueConstraints;
- }
-
- @Override
- public TextRange getNameTextRange() {
- return null;
- }
-
- @Override
- public TextRange getCatalogTextRange() {
- return null;
- }
-
- @Override
- public TextRange getSchemaTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlElementCollection2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlElementCollection2_0.java
deleted file mode 100644
index 7c41ccf44c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlElementCollection2_0.java
+++ /dev/null
@@ -1,286 +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.core.internal.jpa2.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualMapKey;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverride;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOrderColumn;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualXmlElementCollection2_0 is an implementation of XmlElementCollection used when there is
- * no tag in the orm.xml and an underlying java element collection exists.
- */
-public class VirtualXmlElementCollection2_0 extends XmlElementCollection
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaElementCollectionMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- protected final MapKey mapKey;
-
- protected final XmlClassReference mapKeyClass;
-
- protected final VirtualXmlOrderColumn orderColumn;
-
- protected final VirtualXmlCollectionTable collectionTable;
-
- protected final VirtualXmlColumn valueColumn;
-
- protected final VirtualXmlColumn mapKeyColumn;
-
- public VirtualXmlElementCollection2_0(
- OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaMapping);
- this.mapKey = new VirtualMapKey(javaMapping);
- this.mapKeyClass = new VirtualMapKeyClassReference(javaMapping);
- this.orderColumn = new VirtualXmlOrderColumn(
- ((Orderable2_0) this.javaAttributeMapping.getOrderable()).getOrderColumn(),
- this.ormTypeMapping);
- this.collectionTable = new VirtualXmlCollectionTable(
- this.ormTypeMapping,
- this.javaAttributeMapping.getCollectionTable());
- this.valueColumn = new VirtualXmlColumn(ormTypeMapping, javaMapping.getValueColumn());
- this.mapKeyColumn = new VirtualXmlColumn(ormTypeMapping, javaMapping.getMapKeyColumn());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- if (this.isOrmMetadataComplete()) {
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getDefaultFetch());
- }
- return org.eclipse.jpt.core.context.FetchType.toOrmResourceModel(this.javaAttributeMapping.getFetch());
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public String getTargetClass() {
- if (this.isOrmMetadataComplete()) {
- return this.javaAttributeMapping.getDefaultTargetClass();
- }
- return this.javaAttributeMapping.getFullyQualifiedTargetClass();
- }
-
- @Override
- public void setTargetClass(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getTargetClassTextRange() {
- return null;
- }
-
-
- @Override
- public XmlCollectionTable getCollectionTable() {
- return this.collectionTable;
- }
-
- @Override
- public void setCollectionTable(XmlCollectionTable value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.valueColumn;
- }
-
- @Override
- public void setColumn(XmlColumn newColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getValueAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getValueAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-
- @Override
- public EList<XmlAssociationOverride> getAssociationOverrides() {
- EList<XmlAssociationOverride> associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES);
- ListIterator<JavaAssociationOverride> javaAssociationOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAssociationOverrides = this.javaAttributeMapping.getValueAssociationOverrideContainer().associationOverrides();
- }
- else {
- javaAssociationOverrides = this.javaAttributeMapping.getValueAssociationOverrideContainer().virtualAssociationOverrides();
- }
- for (JavaAssociationOverride javaAssociationOverride : CollectionTools.iterable(javaAssociationOverrides)) {
- XmlAssociationOverride xmlAssociationOverride = new VirtualXmlAssociationOverride2_0(javaAssociationOverride.getName(), this.ormTypeMapping, javaAssociationOverride.getRelationshipReference().getPredominantJoiningStrategy());
- associationOverrides.add(xmlAssociationOverride);
- }
- return associationOverrides;
- }
-
- @Override
- public MapKey getMapKey() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.isNoMapKey()) {
- return null;
- }
- return this.mapKey;
- }
-
- @Override
- public void setMapKey(MapKey value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.mapKeyClass;
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference newMapKeyClass) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getOrderBy() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.javaAttributeMapping.getOrderable().getSpecifiedOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- if (((Orderable2_0) this.javaAttributeMapping.getOrderable()).isOrderColumnOrdering()) {
- return this.orderColumn;
- }
- return null;
- }
-
- @Override
- public void setOrderColumn(XmlOrderColumn newOrderColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbedded2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbedded2_0.java
deleted file mode 100644
index e4b8d33cf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbedded2_0.java
+++ /dev/null
@@ -1,102 +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.core.internal.jpa2.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbedded;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlEmbedded2_0 extends XmlEmbedded
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlEmbedded virtualXmlEmbedded;
-
- public VirtualXmlEmbedded2_0(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping2_0 javaEmbeddedMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedMapping;
- this.virtualXmlEmbedded = new VirtualXmlEmbedded(ormTypeMapping, javaEmbeddedMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbedded.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbedded.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbedded.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbedded.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbedded.getAttributeOverrides();
- }
-
- @Override
- public EList<XmlAssociationOverride> getAssociationOverrides() {
- EList<XmlAssociationOverride> associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES);
- ListIterator<JavaAssociationOverride> javaAssociationOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAssociationOverrides = this.javaAttributeMapping.getAssociationOverrideContainer().associationOverrides();
- }
- else {
- javaAssociationOverrides = this.javaAttributeMapping.getAssociationOverrideContainer().virtualAssociationOverrides();
- }
- for (JavaAssociationOverride javaAssociationOverride : CollectionTools.iterable(javaAssociationOverrides)) {
- XmlAssociationOverride xmlAssociationOverride = new VirtualXmlAssociationOverride2_0(javaAssociationOverride.getName(), this.ormTypeMapping, javaAssociationOverride.getRelationshipReference().getPredominantJoiningStrategy());
- associationOverrides.add(xmlAssociationOverride);
- }
- return associationOverrides;
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbeddedId2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbeddedId2_0.java
deleted file mode 100644
index 4fed9661b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlEmbeddedId2_0.java
+++ /dev/null
@@ -1,75 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlEmbeddedId2_0 extends XmlEmbeddedId
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedIdMapping javaAttributeMapping;
-
- protected final VirtualXmlEmbeddedId virtualXmlEmbeddedId;
-
- public VirtualXmlEmbeddedId2_0(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedIdMapping;
- this.virtualXmlEmbeddedId = new VirtualXmlEmbeddedId(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbeddedId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbeddedId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbeddedId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbeddedId.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbeddedId.getAttributeOverrides();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlId2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlId2_0.java
deleted file mode 100644
index 710664c2b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlId2_0.java
+++ /dev/null
@@ -1,171 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlId;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlId;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlId2_0 extends XmlId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaIdMapping javaAttributeMapping;
-
- protected final VirtualXmlId virtualXmlId;
-
- protected final VirtualXmlSequenceGenerator2_0 virtualSequenceGenerator;
-
- public VirtualXmlId2_0(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaIdMapping;
- this.virtualXmlId = new VirtualXmlId(ormTypeMapping, javaIdMapping);
- this.virtualSequenceGenerator = new VirtualXmlSequenceGenerator2_0(javaIdMapping.getGeneratorContainer(), this.isOrmMetadataComplete());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlId.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlId.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlId.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlId.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- this.virtualXmlId.setTemporal(newTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlId.getTemporalTextRange();
- }
-
- @Override
- public XmlGeneratedValue getGeneratedValue() {
- return this.virtualXmlId.getGeneratedValue();
- }
-
- @Override
- public void setGeneratedValue(XmlGeneratedValue value) {
- this.virtualXmlId.setGeneratedValue(value);
- }
-
- @Override
- public XmlSequenceGenerator getSequenceGenerator() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getGeneratorContainer().getSequenceGenerator() != null) {
- return this.virtualSequenceGenerator;
- }
- return null;
- }
-
- @Override
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTableGenerator getTableGenerator() {
- return this.virtualXmlId.getTableGenerator();
- }
-
- @Override
- public void setTableGenerator(XmlTableGenerator value) {
- this.virtualXmlId.setTableGenerator(value);
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlId.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- this.virtualXmlId.setEnumerated(value);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlId.getEnumeratedTextRange();
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlId.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- this.virtualXmlId.setLob(value);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlId.getLobTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java
deleted file mode 100644
index 6a5ed68540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToMany2_0.java
+++ /dev/null
@@ -1,246 +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.core.internal.jpa2.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverride;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToMany;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOrderColumn;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlManyToMany2_0
- extends XmlManyToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToManyMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlManyToMany virtualXmlManyToMany;
-
- protected final VirtualXmlCascadeType2_0 virtualXmlCascadeType;
-
- protected final XmlClassReference mapKeyClass;
-
- protected VirtualXmlOrderColumn orderColumn;
-
- protected final VirtualXmlColumn mapKeyColumn;
-
-
- public VirtualXmlManyToMany2_0(
- OrmTypeMapping ormTypeMapping, JavaManyToManyMapping2_0 javaManyToManyMapping) {
-
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToManyMapping;
- this.virtualXmlManyToMany = new VirtualXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- this.virtualXmlCascadeType = new VirtualXmlCascadeType2_0(javaManyToManyMapping.getCascade());
- this.mapKeyClass = new VirtualMapKeyClassReference(javaManyToManyMapping);
- this.orderColumn = new VirtualXmlOrderColumn(
- ((Orderable2_0) this.javaAttributeMapping.getOrderable()).getOrderColumn(),
- this.ormTypeMapping);
- this.mapKeyColumn = new VirtualXmlColumn(ormTypeMapping, javaManyToManyMapping.getMapKeyColumn());
- }
-
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualXmlCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlManyToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlManyToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlManyToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlManyToMany.setMapKey(value);
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.mapKeyClass;
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference newMapKeyClass) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlManyToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlManyToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- if (((Orderable2_0) this.javaAttributeMapping.getOrderable()).isOrderColumnOrdering()) {
- return this.orderColumn;
- }
- return null;
- }
-
- @Override
- public void setOrderColumn(XmlOrderColumn newOrderColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlManyToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToMany.getTargetEntityTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_MANY_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToOne2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToOne2_0.java
deleted file mode 100644
index c8ce2d0bc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlManyToOne2_0.java
+++ /dev/null
@@ -1,184 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinTable;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToOne;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlManyToOne2_0 extends XmlManyToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToOneMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlManyToOne virtualXmlManyToOne;
-
- protected final VirtualXmlCascadeType2_0 virtualXmlCascadeType;
-
-
- public VirtualXmlManyToOne2_0(
- OrmTypeMapping ormTypeMapping,
- JavaManyToOneMapping2_0 javaManyToOneMapping) {
-
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToOneMapping;
- this.virtualXmlManyToOne = new VirtualXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- this.virtualXmlCascadeType = new VirtualXmlCascadeType2_0(javaManyToOneMapping.getCascade());
- }
-
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlManyToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlManyToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlManyToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualXmlCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- if (this.javaAttributeMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable() != null) {
- return new VirtualXmlJoinTable(
- this.ormTypeMapping,
- this.javaAttributeMapping.getRelationshipReference().
- getJoinTableJoiningStrategy().getJoinTable());
- }
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToOne.setTargetEntity(value);
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToOne.getTargetEntityTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getId() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- boolean javaIdValue = this.javaAttributeMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue();
- return (javaIdValue) ? Boolean.TRUE : null;
- }
-
- @Override
- public void setId(Boolean newId) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getMapsId() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- DerivedIdentity2_0 derivedIdentity = this.javaAttributeMapping.getDerivedIdentity();
- if (derivedIdentity.usesMapsIdDerivedIdentityStrategy()) {
- return derivedIdentity.getMapsIdDerivedIdentityStrategy().getValue();
- }
- else {
- return derivedIdentity.getMapsIdDerivedIdentityStrategy().getSpecifiedValue();
- }
- }
-
- @Override
- public void setMapsId(String newMapsId) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlNullAttributeMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlNullAttributeMapping2_0.java
deleted file mode 100644
index c95d82fae1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlNullAttributeMapping2_0.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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtualXmlNullAttributeMapping2_0 extends XmlNullAttributeMapping implements XmlAttributeMapping
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaAttributeMapping javaAttributeMapping;
-
- protected final VirtualXmlNullAttributeMapping virtualXmlNullAttributeMapping;
-
- public VirtualXmlNullAttributeMapping2_0(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- this.virtualXmlNullAttributeMapping = new VirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getMappingKey() {
- return this.virtualXmlNullAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlNullAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlNullAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlNullAttributeMapping.getNameTextRange();
- }
-
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java
deleted file mode 100644
index 5604457304..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToMany2_0.java
+++ /dev/null
@@ -1,284 +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.core.internal.jpa2.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverride;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToMany;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOrderColumn;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlOneToMany2_0 extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaOneToManyMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlOneToMany virtualXmlOneToMany;
-
- protected final VirtualXmlCascadeType2_0 virtualXmlCascadeType;
-
- protected final XmlClassReference mapKeyClass;
-
- protected VirtualXmlOrderColumn orderColumn;
-
- protected final VirtualXmlColumn mapKeyColumn;
-
-
- public VirtualXmlOneToMany2_0(
- OrmTypeMapping ormTypeMapping, JavaOneToManyMapping2_0 javaOneToManyMapping) {
-
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.virtualXmlOneToMany = new VirtualXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- this.virtualXmlCascadeType = new VirtualXmlCascadeType2_0(javaOneToManyMapping.getCascade());
- this.mapKeyClass = new VirtualMapKeyClassReference(javaOneToManyMapping);
- this.orderColumn = new VirtualXmlOrderColumn(
- ((Orderable2_0) this.javaAttributeMapping.getOrderable()).getOrderColumn(),
- this.ormTypeMapping);
- this.mapKeyColumn = new VirtualXmlColumn(ormTypeMapping, javaOneToManyMapping.getMapKeyColumn());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualXmlCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
- }
- return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlOneToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlOneToMany.setMapKey(value);
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- if (this.isOrmMetadataComplete()) {
- return null;
- }
- return this.mapKeyClass;
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference newMapKeyClass) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.mapKeyColumn;
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlOneToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlOneToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- if (((Orderable2_0) this.javaAttributeMapping.getOrderable()).isOrderColumnOrdering()) {
- return this.orderColumn;
- }
- return null;
- }
-
- @Override
- public void setOrderColumn(XmlOrderColumn newOrderColumn) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToMany.getTargetEntityTextRange();
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS);
- if (isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- this.javaAttributeMapping.getRelationshipReference().
- getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- EList<XmlAttributeOverride> attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ONE_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES);
- ListIterator<JavaAttributeOverride> javaAttributeOverrides;
- if (!this.isOrmMetadataComplete()) {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().attributeOverrides();
- }
- else {
- javaAttributeOverrides = this.javaAttributeMapping.getMapKeyAttributeOverrideContainer().virtualAttributeOverrides();
- }
- for (JavaAttributeOverride javaAttributeOverride : CollectionTools.iterable(javaAttributeOverrides)) {
- XmlColumn xmlColumn = new VirtualXmlColumn(this.ormTypeMapping, javaAttributeOverride.getColumn());
- XmlAttributeOverride xmlAttributeOverride = new VirtualXmlAttributeOverride(javaAttributeOverride.getName(), xmlColumn);
- attributeOverrides.add(xmlAttributeOverride);
- }
- return attributeOverrides;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToOne2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToOne2_0.java
deleted file mode 100644
index cf8ef49ef4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlOneToOne2_0.java
+++ /dev/null
@@ -1,225 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinTable;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToOne;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-
-public class VirtualXmlOneToOne2_0 extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaOneToOneMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlOneToOne virtualXmlOneToOne;
-
- protected final VirtualXmlCascadeType2_0 virtualXmlCascadeType;
-
-
- public VirtualXmlOneToOne2_0(
- OrmTypeMapping ormTypeMapping,
- JavaOneToOneMapping2_0 javaOneToOneMapping) {
-
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.virtualXmlOneToOne = new VirtualXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- this.virtualXmlCascadeType = new VirtualXmlCascadeType2_0(javaOneToOneMapping.getCascade());
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlOneToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlOneToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.virtualXmlCascadeType;
- }
-
- @Override
- public void setCascade(CascadeType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
- }
- return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- if (this.javaAttributeMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable() != null) {
- return new VirtualXmlJoinTable(
- this.ormTypeMapping,
- this.javaAttributeMapping.getRelationshipReference().
- getJoinTableJoiningStrategy().getJoinTable());
- }
- return null;
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToOne.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToOne.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToOne.setMappedBy(value);
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- return this.virtualXmlOneToOne.getPrimaryKeyJoinColumns();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToOne.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToOne.getTargetEntityTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Boolean getId() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- boolean javaIdValue = this.javaAttributeMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue();
- return (javaIdValue) ? Boolean.TRUE : null;
- }
-
- @Override
- public void setId(Boolean newId) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getMapsId() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- DerivedIdentity2_0 derivedIdentity = this.javaAttributeMapping.getDerivedIdentity();
- if (derivedIdentity.usesMapsIdDerivedIdentityStrategy()) {
- return derivedIdentity.getMapsIdDerivedIdentityStrategy().getValue();
- }
- else {
- return derivedIdentity.getMapsIdDerivedIdentityStrategy().getSpecifiedValue();
- }
- }
-
- @Override
- public void setMapsId(String newMapsId) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java
deleted file mode 100644
index f2637eaf51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlSequenceGenerator2_0.java
+++ /dev/null
@@ -1,110 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlSequenceGenerator;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Generic2_0VirtualXmlSequenceGenerator
- */
-public class VirtualXmlSequenceGenerator2_0 extends XmlSequenceGenerator
-{
- protected final JavaGeneratorContainer javaGeneratorHolder;
-
- protected final boolean metadataComplete;
-
- protected final VirtualXmlSequenceGenerator virtualXmlSequenceGenerator;
-
- public VirtualXmlSequenceGenerator2_0(JavaGeneratorContainer javaGeneratorHolder, boolean metadataComplete) {
- super();
- this.javaGeneratorHolder = javaGeneratorHolder;
- this.metadataComplete = metadataComplete;
- this.virtualXmlSequenceGenerator = new VirtualXmlSequenceGenerator(javaGeneratorHolder, metadataComplete);
- }
-
- protected JavaSequenceGenerator getJavaSequenceGenerator() {
- return this.javaGeneratorHolder.getSequenceGenerator();
- }
-
- @Override
- public String getCatalog() {
- return ((GenericJavaSequenceGenerator2_0)this.getJavaSequenceGenerator()).getCatalog();
- }
-
- @Override
- public void setCatalog(String newCatalog) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getSchema() {
- return ((GenericJavaSequenceGenerator2_0)this.getJavaSequenceGenerator()).getSchema();
- }
-
- @Override
- public void setSchema(String newSchema) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public Integer getAllocationSize() {
- return this.virtualXmlSequenceGenerator.getAllocationSize();
- }
-
- @Override
- public void setAllocationSize(Integer newAllocationSize) {
- this.virtualXmlSequenceGenerator.setAllocationSize(newAllocationSize);
- }
-
- @Override
- public Integer getInitialValue() {
- return this.virtualXmlSequenceGenerator.getInitialValue();
- }
-
- @Override
- public void setInitialValue(Integer newInitialValue) {
- this.virtualXmlSequenceGenerator.setInitialValue(newInitialValue);
- }
-
- @Override
- public String getName() {
- return this.virtualXmlSequenceGenerator.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlSequenceGenerator.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlSequenceGenerator.getNameTextRange();
- }
-
- @Override
- public String getSequenceName() {
- return this.virtualXmlSequenceGenerator.getSequenceName();
- }
-
- @Override
- public void setSequenceName(String newSequenceName) {
- this.virtualXmlSequenceGenerator.setSequenceName(newSequenceName);
- }
-
- @Override
- public boolean isVirtual() {
- return this.virtualXmlSequenceGenerator.isVirtual();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlTransient2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlTransient2_0.java
deleted file mode 100644
index ade064eea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlTransient2_0.java
+++ /dev/null
@@ -1,72 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlTransient;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlTransient2_0 extends XmlTransient
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaTransientMapping javaAttributeMapping;
-
- protected final VirtualXmlTransient virtualXmlTransient;
-
- public VirtualXmlTransient2_0(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransientMapping;
- this.virtualXmlTransient = new VirtualXmlTransient(ormTypeMapping, javaTransientMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlTransient.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlTransient.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlTransient.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlTransient.getNameTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlVersion2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlVersion2_0.java
deleted file mode 100644
index 3cc3534bc2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/VirtualXmlVersion2_0.java
+++ /dev/null
@@ -1,130 +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.core.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlVersion;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualXmlVersion2_0 extends XmlVersion
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaVersionMapping javaAttributeMapping;
-
- protected final VirtualXmlVersion virtualXmlVersion;
-
- public VirtualXmlVersion2_0(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVersionMapping;
- this.virtualXmlVersion = new VirtualXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlVersion.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlVersion.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlVersion.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlVersion.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlVersion.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlVersion.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlVersion.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlVersion.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlVersion.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlVersion.getEnumeratedTextRange();
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlVersion.getLobTextRange();
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlVersion.getTemporalTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlContextNodeFactory.java
deleted file mode 100644
index e810ba8343..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,31 +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.core.internal.jpa2.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.internal.jpa2.context.persistence.connection.GenericConnection2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.persistence.options.GenericOptions2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-
-public class Generic2_0PersistenceXmlContextNodeFactory extends AbstractPersistenceXmlContextNodeFactory
-{
-
- public JpaConnection2_0 buildConnection(PersistenceUnit parent) {
- return new GenericConnection2_0(parent);
- }
-
- public JpaOptions2_0 buildOptions(PersistenceUnit parent) {
- return new GenericOptions2_0(parent);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlDefinition.java
deleted file mode 100644
index 00658ee3ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/Generic2_0PersistenceXmlDefinition.java
+++ /dev/null
@@ -1,56 +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.core.internal.jpa2.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Factory;
-
-public class Generic2_0PersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE =
- new Generic2_0PersistenceXmlDefinition();
-
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private Generic2_0PersistenceXmlDefinition() {
- super();
- }
-
-
- public EFactory getResourceNodeFactory() {
- return PersistenceV2_0Factory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new Generic2_0PersistenceXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/GenericConnection2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/GenericConnection2_0.java
deleted file mode 100644
index 48f975c8b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/GenericConnection2_0.java
+++ /dev/null
@@ -1,194 +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.core.internal.jpa2.context.persistence.connection;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * GenericConnection2_0
- */
-public class GenericConnection2_0 extends AbstractPersistenceUnitProperties
- implements JpaConnection2_0
-{
- // ********** GenericConnection properties **********
- private String driver;
- private String url;
- private String user;
- private String password;
-
-
- // ********** constructors **********
- public GenericConnection2_0(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.driver =
- this.getStringValue(PERSISTENCE_JDBC_DRIVER);
- this.url =
- this.getStringValue(PERSISTENCE_JDBC_URL);
- this.user =
- this.getStringValue(PERSISTENCE_JDBC_USER);
- this.password =
- this.getStringValue(PERSISTENCE_JDBC_PASSWORD);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_URL)) {
- this.urlChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_USER)) {
- this.userChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_URL)) {
- this.urlChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_USER)) {
- this.userChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- PERSISTENCE_JDBC_DRIVER,
- DRIVER_PROPERTY);
- propertyNames.put(
- PERSISTENCE_JDBC_URL,
- URL_PROPERTY);
- propertyNames.put(
- PERSISTENCE_JDBC_USER,
- USER_PROPERTY);
- propertyNames.put(
- PERSISTENCE_JDBC_PASSWORD,
- PASSWORD_PROPERTY);
- }
-
- // ********** Driver **********
- public String getDriver() {
- return this.driver;
- }
-
- public void setDriver(String newDriver) {
- String old = this.driver;
- this.driver = newDriver;
- this.putProperty(DRIVER_PROPERTY, newDriver);
- this.firePropertyChanged(DRIVER_PROPERTY, old, newDriver);
- }
-
- private void driverChanged(String newValue) {
- String old = this.driver;
- this.driver = newValue;
- this.firePropertyChanged(DRIVER_PROPERTY, old, newValue);
- }
-
- public String getDefaultDriver() {
- return DEFAULT_JDBC_DRIVER;
- }
-
- // ********** URL **********
- public String getUrl() {
- return this.url;
- }
-
- public void setUrl(String newUrl) {
- String old = this.url;
- this.url = newUrl;
- this.putProperty(URL_PROPERTY, newUrl);
- this.firePropertyChanged(URL_PROPERTY, old, newUrl);
- }
-
- private void urlChanged(String newValue) {
- String old = this.url;
- this.url = newValue;
- this.firePropertyChanged(URL_PROPERTY, old, newValue);
- }
-
- public String getDefaultUrl() {
- return DEFAULT_JDBC_URL;
- }
-
- // ********** User **********
- public String getUser() {
- return this.user;
- }
-
- public void setUser(String newUser) {
- String old = this.user;
- this.user = newUser;
- this.putProperty(USER_PROPERTY, newUser);
- this.firePropertyChanged(USER_PROPERTY, old, newUser);
- }
-
- private void userChanged(String newValue) {
- String old = this.user;
- this.user = newValue;
- this.firePropertyChanged(USER_PROPERTY, old, newValue);
- }
-
- public String getDefaultUser() {
- return DEFAULT_JDBC_USER;
- }
-
- // ********** Password **********
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String newPassword) {
- String old = this.password;
- this.password = newPassword;
- this.putProperty(PASSWORD_PROPERTY, newPassword);
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newPassword);
- }
-
- private void passwordChanged(String newValue) {
- String old = this.password;
- this.password = newValue;
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newValue);
- }
-
- public String getDefaultPassword() {
- return DEFAULT_JDBC_PASSWORD;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/NullConnection2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/NullConnection2_0.java
deleted file mode 100644
index 2e7130f1d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/connection/NullConnection2_0.java
+++ /dev/null
@@ -1,110 +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.core.internal.jpa2.context.persistence.connection;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * GenericConnection2_0
- */
-public class NullConnection2_0 extends AbstractPersistenceUnitProperties
- implements JpaConnection2_0
-{
-
-
- // ********** constructors **********
- public NullConnection2_0(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- //do nothing
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- //do nothing
- }
-
- public void propertyRemoved(String propertyName) {
- //do nothing
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- //do nothing
- }
-
- // ********** Driver **********
- public String getDriver() {
- return null;
- }
-
- public void setDriver(String newDriver) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultDriver() {
- return DEFAULT_JDBC_DRIVER;
- }
-
- // ********** URL **********
- public String getUrl() {
- return null;
- }
-
- public void setUrl(String newUrl) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultUrl() {
- return DEFAULT_JDBC_URL;
- }
-
- // ********** User **********
- public String getUser() {
- return null;
- }
-
- public void setUser(String newUser) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultUser() {
- return DEFAULT_JDBC_USER;
- }
-
- // ********** Password **********
- public String getPassword() {
- return null;
- }
-
- public void setPassword(String newPassword) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultPassword() {
- return DEFAULT_JDBC_PASSWORD;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/GenericOptions2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/GenericOptions2_0.java
deleted file mode 100644
index d9f70492b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/GenericOptions2_0.java
+++ /dev/null
@@ -1,239 +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.core.internal.jpa2.context.persistence.options;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * JPA 2.0 options
- */
-public class GenericOptions2_0 extends AbstractPersistenceUnitProperties
- implements JpaOptions2_0
-{
- // ********** GenericConnection properties **********
- private Integer lockTimeout;
- private Integer queryTimeout;
- private String validationGroupPrePersist;
- private String validationGroupPreUpdate;
- private String validationGroupPreRemove;
-
-
- // ********** constructors **********
- public GenericOptions2_0(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.lockTimeout =
- this.getIntegerValue(PERSISTENCE_LOCK_TIMEOUT);
- this.queryTimeout =
- this.getIntegerValue(PERSISTENCE_QUERY_TIMEOUT);
-
- // ValidationMode is initialized with the persistence unit element
- this.validationGroupPrePersist =
- this.getStringValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.validationGroupPreUpdate =
- this.getStringValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.validationGroupPreRemove =
- this.getStringValue(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String 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.validationGroupPrePersistChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdateChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemoveChanged(newValue);
- }
- }
-
- public void propertyRemoved(String 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.validationGroupPrePersistChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdateChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemoveChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> 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;
- }
-
-
- // ********** ValidationGroupPrePersist **********
- public String getValidationGroupPrePersist() {
- return this.validationGroupPrePersist;
- }
-
- public void setValidationGroupPrePersist(String newValidationGroupPrePersist) {
- String old = this.validationGroupPrePersist;
- this.validationGroupPrePersist = newValidationGroupPrePersist;
- this.putProperty(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, newValidationGroupPrePersist);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, old, newValidationGroupPrePersist);
- }
-
- private void validationGroupPrePersistChanged(String newValue) {
- String old = this.validationGroupPrePersist;
- this.validationGroupPrePersist = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPrePersist() {
- return DEFAULT_VALIDATION_GROUP_PRE_PERSIST;
- }
-
- // ********** ValidationGroupPreUpdate **********
- public String getValidationGroupPreUpdate() {
- return this.validationGroupPreUpdate;
- }
-
- public void setValidationGroupPreUpdate(String newValidationGroupPreUpdate) {
- String old = this.validationGroupPreUpdate;
- this.validationGroupPreUpdate = newValidationGroupPreUpdate;
- this.putProperty(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, newValidationGroupPreUpdate);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, old, newValidationGroupPreUpdate);
- }
-
- private void validationGroupPreUpdateChanged(String newValue) {
- String old = this.validationGroupPreUpdate;
- this.validationGroupPreUpdate = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPreUpdate() {
- return DEFAULT_VALIDATION_GROUP_PRE_UPDATE;
- }
-
- // ********** ValidationGroupPreRemove **********
- public String getValidationGroupPreRemove() {
- return this.validationGroupPreRemove;
- }
-
- public void setValidationGroupPreRemove(String newValidationGroupPreRemove) {
- String old = this.validationGroupPreRemove;
- this.validationGroupPreRemove = newValidationGroupPreRemove;
- this.putProperty(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, newValidationGroupPreRemove);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, old, newValidationGroupPreRemove);
- }
-
- private void validationGroupPreRemoveChanged(String newValue) {
- String old = this.validationGroupPreRemove;
- this.validationGroupPreRemove = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPreRemove() {
- return DEFAULT_VALIDATION_GROUP_PRE_REMOVE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/NullOptions2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/NullOptions2_0.java
deleted file mode 100644
index a09768382a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/persistence/options/NullOptions2_0.java
+++ /dev/null
@@ -1,124 +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.core.internal.jpa2.context.persistence.options;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * JPA 2.0 options
- */
-public class NullOptions2_0 extends AbstractPersistenceUnitProperties
- implements JpaOptions2_0
-{
-
-
- // ********** constructors **********
- public NullOptions2_0(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- //do nothing
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- //do nothing
- }
-
- public void propertyRemoved(String propertyName) {
- //do nothing
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- //do nothing
- }
-
- // ********** LockTimeout **********
- public Integer getLockTimeout() {
- return null;
- }
-
- public void setLockTimeout(Integer newLockTimeout) {
- throw new UnsupportedOperationException();
- }
-
- public Integer getDefaultLockTimeout() {
- return DEFAULT_LOCK_TIMEOUT;
- }
-
- // ********** QueryTimeout **********
- public Integer getQueryTimeout() {
- return null;
- }
-
- public void setQueryTimeout(Integer newQueryTimeout) {
- throw new UnsupportedOperationException();
- }
-
- public Integer getDefaultQueryTimeout() {
- return DEFAULT_QUERY_TIMEOUT;
- }
-
-
- // ********** ValidationGroupPrePersist **********
- public String getValidationGroupPrePersist() {
- return null;
- }
-
- public void setValidationGroupPrePersist(String newValidationGroupPrePersist) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultValidationGroupPrePersist() {
- return DEFAULT_VALIDATION_GROUP_PRE_PERSIST;
- }
-
- // ********** ValidationGroupPreUpdate **********
- public String getValidationGroupPreUpdate() {
- return null;
- }
-
- public void setValidationGroupPreUpdate(String newValidationGroupPreUpdate) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultValidationGroupPreUpdate() {
- return DEFAULT_VALIDATION_GROUP_PRE_UPDATE;
- }
-
- // ********** ValidationGroupPreRemove **********
- public String getValidationGroupPreRemove() {
- return null;
- }
-
- public void setValidationGroupPreRemove(String newValidationGroupPreRemove) {
- throw new UnsupportedOperationException();
- }
-
- public String getDefaultValidationGroupPreRemove() {
- return DEFAULT_VALIDATION_GROUP_PRE_REMOVE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.java
deleted file mode 100644
index ec2cd71009..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Access2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryAccess2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAccess2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Access
- */
-public final class Access2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new Access2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Access2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceAccess2_0Annotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullAccess2_0Annotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAccess2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return Access2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.java
deleted file mode 100644
index d885db7ebf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverride2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryAssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class AssociationOverride2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverride2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverride2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceAssociationOverride2_0Annotation.buildAssociationOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverride2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.java
deleted file mode 100644
index 3d9b6239d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/AssociationOverrides2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryAssociationOverrides2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceAssociationOverrides2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class AssociationOverrides2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverrides2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverrides2_0AnnotationDefinition() {
- super();
- }
-
- public AssociationOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceAssociationOverrides2_0Annotation(parent, member);
- }
-
- public AssociationOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverrides2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverridesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.java
deleted file mode 100644
index e5911e193b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/Cacheable2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryCacheable2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceCacheable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Cacheable
- */
-public final class Cacheable2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new Cacheable2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Cacheable2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceCacheable2_0Annotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryCacheable2_0Annotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return Cacheable2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.java
deleted file mode 100644
index 83740dbc57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/CollectionTable2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryCollectionTable2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceCollectionTable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.CollectionTable
- */
-public final class CollectionTable2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new CollectionTable2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private CollectionTable2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceCollectionTable2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullCollectionTable2_0Annotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryCollectionTable2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return CollectionTable2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.java
deleted file mode 100644
index 867ffbf4bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/ElementCollection2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryElementCollection2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceElementCollection2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.ElementCollection
- */
-public final class ElementCollection2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ElementCollection2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ElementCollection2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceElementCollection2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryElementCollection2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ElementCollection2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java
deleted file mode 100644
index 42a60a11a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/GeneratedAnnotationDefinition.java
+++ /dev/null
@@ -1,64 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryGeneratedAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceGeneratedAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.annotation.Generated
- * <p>
- * This annotation definition is not really required; it's just here for a bit
- * of consistency....
- */
-public final class GeneratedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final GeneratedAnnotationDefinition INSTANCE = new GeneratedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static GeneratedAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GeneratedAnnotationDefinition() {
- super();
- }
-
- public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceGeneratedAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public GeneratedAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return null;
- }
-
- public GeneratedAnnotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryGeneratedAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return GeneratedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.java
deleted file mode 100644
index 0d2aa5b318..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyClass2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyClass
- */
-public final class MapKeyClass2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyClass2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyClass2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyClass2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyClass2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyClass2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.java
deleted file mode 100644
index 92e276eb68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyColumn
- */
-public final class MapKeyColumn2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyColumn2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyColumn2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullMapKeyColumnAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyColumn2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyColumn2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.java
deleted file mode 100644
index db6c09c0ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyTemporal
- */
-public final class MapKeyEnumerated2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyEnumerated2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyEnumerated2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyEnumerated2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyEnumerated2_0Annotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.java
deleted file mode 100644
index f4e77d272a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyJoinColumn
- */
-public final class MapKeyJoinColumn2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyJoinColumn2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyJoinColumn2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceMapKeyJoinColumn2_0Annotation.createMapKeyJoinColumn(parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyJoinColumn2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.java
deleted file mode 100644
index 5054f2349c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyJoinColumns2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyJoinColumns
- */
-public final class MapKeyJoinColumns2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyJoinColumns2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyJoinColumns2_0AnnotationDefinition() {
- super();
- }
-
- public MapKeyJoinColumns2_0Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyJoinColumns2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public MapKeyJoinColumns2_0Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyJoinColumns2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyJoinColumns2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.java
deleted file mode 100644
index 86ada7cf70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyTemporal
- */
-public final class MapKeyTemporal2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyTemporal2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyTemporal2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyTemporal2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyTemporal2_0Annotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java
deleted file mode 100644
index b8fb43cd26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/MapsId2_0AnnotationDefinition.java
+++ /dev/null
@@ -1,64 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryMapsId2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceMapsId2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapsId
- */
-public class MapsId2_0AnnotationDefinition implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapsId2_0AnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private MapsId2_0AnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapsId2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullMapsId2_0Annotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapsId2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapsId2_0Annotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.java
deleted file mode 100644
index 2c17accad0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQueries2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryNamedQueries2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceNamedQueries2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQueries
- */
-public class NamedQueries2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQueries2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQueries2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceNamedQueries2_0Annotation(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQueries2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueriesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.java
deleted file mode 100644
index 5c09d18be5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NamedQuery2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryNamedQuery2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceNamedQuery2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQuery
- */
-public class NamedQuery2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQuery2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQuery2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceNamedQuery2_0Annotation(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQuery2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAccess2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAccess2_0Annotation.java
deleted file mode 100644
index d3990a5aaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAccess2_0Annotation.java
+++ /dev/null
@@ -1,55 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Access
- */
-public class NullAccess2_0Annotation
- extends NullAnnotation
- implements Access2_0Annotation
-{
-
- protected NullAccess2_0Annotation(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected Access2_0Annotation addAnnotation() {
- return (Access2_0Annotation) super.addAnnotation();
- }
-
- // ***** value
- public AccessType getValue() {
- return null;
- }
-
- public void setValue(AccessType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAssociationOverrideJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAssociationOverrideJoinTableAnnotation.java
deleted file mode 100644
index 142f918b92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullAssociationOverrideJoinTableAnnotation.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jpt.core.internal.resource.java.NullJoinTableAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * javax.persistence.JoinTable found in a javax.persistence.AssociationOverride annotation
- */
-public class NullAssociationOverrideJoinTableAnnotation
- extends NullJoinTableAnnotation
-{
- public NullAssociationOverrideJoinTableAnnotation(AssociationOverride2_0Annotation parent) {
- super(parent);
- }
-
- private AssociationOverride2_0Annotation getAssociationOverride2_0Annotation() {
- return (AssociationOverride2_0Annotation) this.parent;
- }
-
- @Override
- protected JoinTableAnnotation addAnnotation() {
- return this.getAssociationOverride2_0Annotation().addJoinTable();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullCollectionTable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullCollectionTable2_0Annotation.java
deleted file mode 100644
index 6574d3f5d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullCollectionTable2_0Annotation.java
+++ /dev/null
@@ -1,70 +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.core.internal.jpa2.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.internal.resource.java.NullBaseTableAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * javax.persistence.CollectionTable
- */
-public class NullCollectionTable2_0Annotation
- extends NullBaseTableAnnotation
- implements CollectionTable2_0Annotation
-{
- public NullCollectionTable2_0Annotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected CollectionTable2_0Annotation addAnnotation() {
- return (CollectionTable2_0Annotation) super.addAnnotation();
- }
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- // the CollectionTable annotation is missing, add both it and a join column at the same time
- return this.addAnnotation().addJoinColumn(index);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyColumnAnnotation.java
deleted file mode 100644
index cae6ddbfed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyColumnAnnotation.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullBaseColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapKeyColumn
- */
-public class NullMapKeyColumnAnnotation
- extends NullBaseColumnAnnotation
- implements MapKeyColumn2_0Annotation
-{
- public NullMapKeyColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected MapKeyColumn2_0Annotation addAnnotation() {
- return (MapKeyColumn2_0Annotation) super.addAnnotation();
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- this.addAnnotation().setLength(length);
- }
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** scale
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- this.addAnnotation().setScale(scale);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** precision
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- this.addAnnotation().setPrecision(precision);
- }
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyEnumerated2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyEnumerated2_0Annotation.java
deleted file mode 100644
index 922c7c9efa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyEnumerated2_0Annotation.java
+++ /dev/null
@@ -1,57 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapKeyEnumerated
- */
-public final class NullMapKeyEnumerated2_0Annotation
- extends NullAnnotation
- implements MapKeyEnumerated2_0Annotation
-{
- protected NullMapKeyEnumerated2_0Annotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected MapKeyEnumerated2_0Annotation addAnnotation() {
- return (MapKeyEnumerated2_0Annotation) super.addAnnotation();
- }
-
-
- // ********** MapKeyEnumerated2_0Annotation implementation **********
-
- // ***** value
- public EnumType getValue() {
- return null;
- }
-
- public void setValue(EnumType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyTemporal2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyTemporal2_0Annotation.java
deleted file mode 100644
index 0d9142feb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapKeyTemporal2_0Annotation.java
+++ /dev/null
@@ -1,57 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapKeyTemporal
- */
-public final class NullMapKeyTemporal2_0Annotation
- extends NullAnnotation
- implements MapKeyTemporal2_0Annotation
-{
- protected NullMapKeyTemporal2_0Annotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected MapKeyTemporal2_0Annotation addAnnotation() {
- return (MapKeyTemporal2_0Annotation) super.addAnnotation();
- }
-
-
- // ********** MapKeyTemporal2_0Annotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return null;
- }
-
- public void setValue(TemporalType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapsId2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapsId2_0Annotation.java
deleted file mode 100644
index 823e0a4577..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullMapsId2_0Annotation.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapsId
- */
-public class NullMapsId2_0Annotation
- extends NullAnnotation
- implements MapsId2_0Annotation
-{
- protected NullMapsId2_0Annotation(JavaResourcePersistentMember parent) {
- super(parent);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected MapsId2_0Annotation addAnnotation() {
- return (MapsId2_0Annotation) super.addAnnotation();
- }
-
- public String getValue() {
- return null;
- }
-
- public void setValue(String newValue) {
- if (newValue != null) {
- this.addAnnotation().setValue(newValue);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullOrderColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullOrderColumn2_0Annotation.java
deleted file mode 100644
index c97eaba31b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/NullOrderColumn2_0Annotation.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullNamedColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OrderColumn
- */
-public final class NullOrderColumn2_0Annotation
- extends NullNamedColumnAnnotation
- implements OrderColumn2_0Annotation
-{
- public NullOrderColumn2_0Annotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected OrderColumn2_0Annotation addAnnotation() {
- return (OrderColumn2_0Annotation) super.addAnnotation();
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return null;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (updatable != null) {
- this.addAnnotation().setUpdatable(updatable);
- }
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return null;
- }
-
- public void setInsertable(Boolean insertable) {
- if (insertable != null) {
- this.addAnnotation().setInsertable(insertable);
- }
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** nullable
- public Boolean getNullable() {
- return null;
- }
-
- public void setNullable(Boolean nullable) {
- if (nullable != null) {
- this.addAnnotation().setNullable(nullable);
- }
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.java
deleted file mode 100644
index 114a3a704e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/OrderColumn2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryOrderColumn2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceOrderColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.OrderColumn
- */
-public final class OrderColumn2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OrderColumn2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrderColumn2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryOrderColumn2_0Annotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OrderColumn2_0Annotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.java
deleted file mode 100644
index f3d9aed822..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationDefinition.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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinarySequenceGenerator2_0Annotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceSequenceGenerator2_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public final class SequenceGenerator2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SequenceGenerator2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SequenceGenerator2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceSequenceGenerator2_0Annotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinarySequenceGenerator2_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SequenceGeneratorAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java
deleted file mode 100644
index 7d5aa069a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumn2_0Annotation.java
+++ /dev/null
@@ -1,116 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceBaseJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.NestableMapKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.MapKeyJoinColumn
- */
-public final class SourceMapKeyJoinColumn2_0Annotation
- extends SourceBaseJoinColumnAnnotation
- implements NestableMapKeyJoinColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, attribute, daa, annotationAdapter);
- }
-
- public SourceMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- this(parent, attribute, daa, new MemberAnnotationAdapter(attribute, daa));
- }
-
- public SourceMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, Attribute attribute, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, attribute, idaa, new MemberIndexedAnnotationAdapter(attribute, idaa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** SourceBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-
- // ********** static methods **********
-
- public static SourceMapKeyJoinColumn2_0Annotation createMapKeyJoinColumn(JavaResourceNode parent, Attribute attribute) {
- return new SourceMapKeyJoinColumn2_0Annotation(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static SourceMapKeyJoinColumn2_0Annotation createNestedMapKeyJoinColumn(JavaResourceNode parent, Attribute attribute, int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(attribute, idaa);
- return new SourceMapKeyJoinColumn2_0Annotation(parent, attribute, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(joinColumnsAdapter, index, JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java
deleted file mode 100644
index 68ca7dafc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/SourceMapKeyJoinColumns2_0Annotation.java
+++ /dev/null
@@ -1,115 +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.core.internal.jpa2.resource.java;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.NestableMapKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.MapKeyJoinColumns
- */
-public final class SourceMapKeyJoinColumns2_0Annotation
- extends SourceAnnotation<Attribute>
- implements MapKeyJoinColumns2_0Annotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableMapKeyJoinColumnAnnotation> mapKeyJoinColumns = new Vector<NestableMapKeyJoinColumnAnnotation>();
-
-
- public SourceMapKeyJoinColumns2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.mapKeyJoinColumns);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMNS__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableMapKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableMapKeyJoinColumnAnnotation>(this.mapKeyJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.mapKeyJoinColumns.size();
- }
-
- public NestableMapKeyJoinColumnAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.mapKeyJoinColumns.size());
- }
-
- private NestableMapKeyJoinColumnAnnotation addNestedAnnotation(int index) {
- NestableMapKeyJoinColumnAnnotation joinColumn = this.buildMapKeyJoinColumn(index);
- this.mapKeyJoinColumns.add(joinColumn);
- return joinColumn;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.mapKeyJoinColumns.size();
- NestableMapKeyJoinColumnAnnotation joinColumn = this.addNestedAnnotation(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(MAP_KEY_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableMapKeyJoinColumnAnnotation buildMapKeyJoinColumn(int index) {
- return SourceMapKeyJoinColumn2_0Annotation.createNestedMapKeyJoinColumn(this, this.member, index, this.daa);
- }
-
- public NestableMapKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.mapKeyJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableMapKeyJoinColumnAnnotation removeNestedAnnotation(int index) {
- return this.mapKeyJoinColumns.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.mapKeyJoinColumns, MAP_KEY_JOIN_COLUMNS_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java
deleted file mode 100644
index 76686e5815..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/StaticMetamodelAnnotationDefinition.java
+++ /dev/null
@@ -1,64 +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.core.internal.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.binary.BinaryStaticMetamodelAnnotation;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.source.SourceStaticMetamodelAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.StaticMetamodelAnnotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.metamodel.StaticMetamodel
- * <p>
- * This annotation definition is not really required; it's just here for a bit
- * of consistency....
- */
-public final class StaticMetamodelAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final StaticMetamodelAnnotationDefinition INSTANCE = new StaticMetamodelAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static StaticMetamodelAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private StaticMetamodelAnnotationDefinition() {
- super();
- }
-
- public StaticMetamodelAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceStaticMetamodelAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public StaticMetamodelAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return null;
- }
-
- public StaticMetamodelAnnotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryStaticMetamodelAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return StaticMetamodelAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAccess2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAccess2_0Annotation.java
deleted file mode 100644
index c4fc19b2bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAccess2_0Annotation.java
+++ /dev/null
@@ -1,77 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Access
- */
-public final class BinaryAccess2_0Annotation
- extends BinaryAnnotation
- implements Access2_0Annotation
-{
- private AccessType value;
-
-
- public BinaryAccess2_0Annotation(JavaResourcePersistentMember 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());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** AccessAnnotation implementation **********
-
- // ***** value
- public AccessType getValue() {
- return this.value;
- }
-
- public void setValue(AccessType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(AccessType value) {
- AccessType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private AccessType buildValue() {
- return AccessType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA2_0.ACCESS));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverride2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverride2_0Annotation.java
deleted file mode 100644
index 27c9fba3da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverride2_0Annotation.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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.NullJoinTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinTableAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * BinarySequenceGenerator2_0Annotation
- */
-public final class BinaryAssociationOverride2_0Annotation
- extends BinaryAssociationOverrideAnnotation
- implements AssociationOverride2_0Annotation
-{
- private JoinTableAnnotation joinTable;
-
- public BinaryAssociationOverride2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinTable = this.buildJoinTable();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinTable();
- }
-
-
- // ********** AssociationOverride2_0Annotation implementation **********
-
- // ***** joinTable
- public JoinTableAnnotation getJoinTable() {
- return this.joinTable;
- }
-
- public JoinTableAnnotation getNonNullJoinTable() {
- return (this.joinTable != null) ? this.joinTable : new NullJoinTableAnnotation(this);
- }
-
- public JoinTableAnnotation addJoinTable() {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinTable() {
- throw new UnsupportedOperationException();
- }
-
- private JoinTableAnnotation buildJoinTable() {
- IAnnotation jdtJoinTable = this.getJdtJoinTable();
- return (jdtJoinTable == null) ? null : this.buildJoinTable(jdtJoinTable);
- }
-
- private JoinTableAnnotation buildJoinTable(IAnnotation jdtJoinTable) {
- return new BinaryJoinTableAnnotation(this, jdtJoinTable);
- }
-
- private IAnnotation getJdtJoinTable() {
- return (IAnnotation) this.getJdtMemberValue(JPA2_0.ASSOCIATION_OVERRIDE__JOIN_TABLE);
- }
-
- // TODO
- private void updateJoinTable() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtJoinTable = this.getJdtJoinTable();
-// if (jdtJoinTable == null) {
-// this.setJoinTable(null);
-// } else {
-// if (this.column == null) {
-// this.setJoinTable(this.buildJoinTable(jdtJoinTable));
-// } else {
-// this.column.update(jdtJoinTable);
-// }
-// }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverrides2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverrides2_0Annotation.java
deleted file mode 100644
index d47f13bc82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryAssociationOverrides2_0Annotation.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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public class BinaryAssociationOverrides2_0Annotation
- extends BinaryAssociationOverridesAnnotation
-{
-
- public BinaryAssociationOverrides2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- protected NestableAssociationOverrideAnnotation buildAssociationOverride(Object jdtAssociationOverride) {
- return new BinaryAssociationOverride2_0Annotation(this, (IAnnotation) jdtAssociationOverride);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCacheable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCacheable2_0Annotation.java
deleted file mode 100644
index 1a737311cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCacheable2_0Annotation.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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Cacheable
- */
-public final class BinaryCacheable2_0Annotation
- extends BinaryAnnotation
- implements Cacheable2_0Annotation
-{
- private Boolean value;
-
-
- public BinaryCacheable2_0Annotation(JavaResourcePersistentType 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());
- }
-
-
- // ********** Cacheable2_0Annotation 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(JPA2_0.CACHEABLE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCollectionTable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCollectionTable2_0Annotation.java
deleted file mode 100644
index 1465decdd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryCollectionTable2_0Annotation.java
+++ /dev/null
@@ -1,118 +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.core.internal.jpa2.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryBaseTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.CollectionTable
- */
-public final class BinaryCollectionTable2_0Annotation
- extends BinaryBaseTableAnnotation
- implements CollectionTable2_0Annotation
-{
- private final Vector<JoinColumnAnnotation> joinColumns;
-
-
- public BinaryCollectionTable2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.COLLECTION_TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA2_0.COLLECTION_TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA2_0.COLLECTION_TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA2_0.COLLECTION_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ********** CollectionTable2_0Annotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA2_0.COLLECTION_TABLE__JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryElementCollection2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryElementCollection2_0Annotation.java
deleted file mode 100644
index 12d2654def..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryElementCollection2_0Annotation.java
+++ /dev/null
@@ -1,103 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public class BinaryElementCollection2_0Annotation
- extends BinaryAnnotation
- implements ElementCollection2_0Annotation
-{
- private String targetClass;
- private FetchType fetch;
-
-
- public BinaryElementCollection2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.targetClass = this.buildTargetClass();
- this.fetch = this.buildFetch();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setTargetClass_(this.buildTargetClass());
- this.setFetch_(this.buildFetch());
- }
-
-
- // ********** ElementCollection2_0Annotation implementation **********
-
- // ***** target entity
- public String getTargetClass() {
- return this.targetClass;
- }
-
- public void setTargetClass(String targetClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setTargetClass_(String targetClass) {
- String old = this.targetClass;
- this.targetClass = targetClass;
- this.firePropertyChanged(TARGET_CLASS_PROPERTY, old, targetClass);
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_CLASS_NAME_PROPERTY, old, targetClass);
- }
-
- private String buildTargetClass() {
- return (String) this.getJdtMemberValue(JPA2_0.ELEMENT_COLLECTION__TARGET_CLASS);
- }
-
- public TextRange getTargetClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetClassName() {
- return this.targetClass;
- }
-
- // ***** 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(JPA2_0.ELEMENT_COLLECTION__FETCH));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryGeneratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryGeneratedAnnotation.java
deleted file mode 100644
index e9f51b48b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryGeneratedAnnotation.java
+++ /dev/null
@@ -1,140 +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.core.internal.jpa2.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.annotation.Generated
- */
-public final class BinaryGeneratedAnnotation
- extends BinaryAnnotation
- implements GeneratedAnnotation
-{
- private final Vector<String> values;
- private String date;
- private String comments;
-
-
- public BinaryGeneratedAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.values = this.buildValues();
- this.date = this.buildDate();
- this.comments = this.buildComments();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateValues();
- this.setDate_(this.buildDate());
- this.setComments_(this.buildComments());
- }
-
- // TODO
- private void updateValues() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** GeneratedAnnotation implementation **********
-
- // ***** values
- public ListIterator<String> values() {
- return new CloneListIterator<String>(this.values);
- }
-
- public int valuesSize() {
- return this.values.size();
- }
-
- public String getValue(int index) {
- return this.values.get(index);
- }
-
- private Vector<String> buildValues() {
- Object[] jdtValues = this.getJdtMemberValues(VALUE_ELEMENT_NAME);
- Vector<String> result = new Vector<String>(jdtValues.length);
- for (Object value : jdtValues) {
- result.add((String) value);
- }
- return result;
- }
-
- public void addValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- public void addValue(int index, String value) {
- throw new UnsupportedOperationException();
- }
-
- public void moveValue(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- public void removeValue(int index) {
- throw new UnsupportedOperationException();
- }
-
- // ***** date
- public String getDate() {
- return this.date;
- }
-
- public void setDate(String date) {
- throw new UnsupportedOperationException();
- }
-
- private void setDate_(String date) {
- String old = this.date;
- this.date = date;
- this.firePropertyChanged(DATE_PROPERTY, old, date);
- }
-
- private String buildDate() {
- return (String) this.getJdtMemberValue(DATE_ELEMENT_NAME);
- }
-
- // ***** comments
- public String getComments() {
- return this.comments;
- }
-
- public void setComments(String comments) {
- throw new UnsupportedOperationException();
- }
-
- private void setComments_(String comments) {
- String old = this.comments;
- this.comments = comments;
- this.firePropertyChanged(COMMENTS_PROPERTY, old, comments);
- }
-
- private String buildComments() {
- return (String) this.getJdtMemberValue(COMMENTS_ELEMENT_NAME);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyClass2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyClass2_0Annotation.java
deleted file mode 100644
index b1072c0d6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyClass2_0Annotation.java
+++ /dev/null
@@ -1,80 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapKeyClass
- */
-public final class BinaryMapKeyClass2_0Annotation
- extends BinaryAnnotation
- implements MapKeyClass2_0Annotation
-{
- private String value;
-
-
- public BinaryMapKeyClass2_0Annotation(JavaResourcePersistentAttribute 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());
- }
-
-
- // ********** MapKeyClass2_0Annotation 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_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA2_0.MAP_KEY_CLASS__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.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyColumn2_0Annotation.java
deleted file mode 100644
index 37f9db5d65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyColumn2_0Annotation.java
+++ /dev/null
@@ -1,93 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryCompleteColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.MapKeyColumn
- */
-public final class BinaryMapKeyColumn2_0Annotation
- extends BinaryCompleteColumnAnnotation
- implements MapKeyColumn2_0Annotation
-{
-
- public BinaryMapKeyColumn2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- public String getAnnotationName() {
- return MapKeyColumn2_0Annotation.ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.MAP_KEY_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA2_0.MAP_KEY_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA2_0.MAP_KEY_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA2_0.MAP_KEY_COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA2_0.MAP_KEY_COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA2_0.MAP_KEY_COLUMN__SCALE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyEnumerated2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyEnumerated2_0Annotation.java
deleted file mode 100644
index 34b8d1dfb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyEnumerated2_0Annotation.java
+++ /dev/null
@@ -1,38 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryBaseEnumeratedAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.MapKeyEnumerated
- */
-public final class BinaryMapKeyEnumerated2_0Annotation
- extends BinaryBaseEnumeratedAnnotation
- implements MapKeyEnumerated2_0Annotation
-{
-
- public BinaryMapKeyEnumerated2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyEnumerated2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA2_0.MAP_KEY_ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumn2_0Annotation.java
deleted file mode 100644
index a08c62aeb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumn2_0Annotation.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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryBaseJoinColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.NestableMapKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.MapKeyJoinColumn
- */
-public final class BinaryMapKeyJoinColumn2_0Annotation
- extends BinaryBaseJoinColumnAnnotation
- implements NestableMapKeyJoinColumnAnnotation
-{
-
- public BinaryMapKeyJoinColumn2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA2_0.MAP_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumns2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumns2_0Annotation.java
deleted file mode 100644
index 0f9bf96948..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyJoinColumns2_0Annotation.java
+++ /dev/null
@@ -1,69 +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.core.internal.jpa2.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryContainerAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyJoinColumns2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.NestableMapKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.MapKeyJoinColumns
- */
-public final class BinaryMapKeyJoinColumns2_0Annotation
- extends BinaryContainerAnnotation<NestableMapKeyJoinColumnAnnotation>
- implements MapKeyJoinColumns2_0Annotation
-{
- private final Vector<NestableMapKeyJoinColumnAnnotation> mapKeyJoinColumns;
-
-
- public BinaryMapKeyJoinColumns2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mapKeyJoinColumns = this.buildMapKeyJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableMapKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableMapKeyJoinColumnAnnotation>(this.mapKeyJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.mapKeyJoinColumns.size();
- }
-
- private Vector<NestableMapKeyJoinColumnAnnotation> buildMapKeyJoinColumns() {
- Object[] jdtMapKeyJoinColumns = this.getJdtMemberValues(JPA2_0.MAP_KEY_JOIN_COLUMNS__VALUE);
- Vector<NestableMapKeyJoinColumnAnnotation> result = new Vector<NestableMapKeyJoinColumnAnnotation>(jdtMapKeyJoinColumns.length);
- for (Object jdtMapKeyJoinColumn : jdtMapKeyJoinColumns) {
- result.add(new BinaryMapKeyJoinColumn2_0Annotation(this, (IAnnotation) jdtMapKeyJoinColumn));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateMapKeyJoinColumns();
- }
-
- // TODO
- private void updateMapKeyJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyTemporal2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyTemporal2_0Annotation.java
deleted file mode 100644
index 051d689227..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapKeyTemporal2_0Annotation.java
+++ /dev/null
@@ -1,38 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryBaseTemporalAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.MapKeyTemporal
- */
-public final class BinaryMapKeyTemporal2_0Annotation
- extends BinaryBaseTemporalAnnotation
- implements MapKeyTemporal2_0Annotation
-{
-
- public BinaryMapKeyTemporal2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyTemporal2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA2_0.MAP_KEY_TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapsId2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapsId2_0Annotation.java
deleted file mode 100644
index c6176cbc10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryMapsId2_0Annotation.java
+++ /dev/null
@@ -1,80 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapsId
- */
-public class BinaryMapsId2_0Annotation
- extends BinaryAnnotation
- implements MapsId2_0Annotation
-{
- private String value;
-
-
- public BinaryMapsId2_0Annotation(JavaResourcePersistentAttribute 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());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** MapsId2_0Annotation implementation **********
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String newValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String newValue) {
- String oldValue = this.value;
- this.value = newValue;
- this.firePropertyChanged(VALUE_PROPERTY, oldValue, newValue);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA2_0.MAPS_ID__VALUE);
- }
-
- 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.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQueries2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQueries2_0Annotation.java
deleted file mode 100644
index 23c5499dff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQueries2_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class BinaryNamedQueries2_0Annotation
- extends BinaryNamedQueriesAnnotation
-{
- public BinaryNamedQueries2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- protected NamedQueryAnnotation buildNamedQuery(Object jdtQuery) {
- return new BinaryNamedQuery2_0Annotation(this, (IAnnotation) jdtQuery);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQuery2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQuery2_0Annotation.java
deleted file mode 100644
index c42b1289dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryNamedQuery2_0Annotation.java
+++ /dev/null
@@ -1,69 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedQueryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * BinaryNamedQuery2_0Annotation
- */
-public final class BinaryNamedQuery2_0Annotation
- extends BinaryNamedQueryAnnotation
- implements NamedQuery2_0Annotation
-{
- private LockModeType_2_0 lockMode;
-
- public BinaryNamedQuery2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.lockMode = this.buildLockMode();
- }
-
- @Override
- public void update() {
- super.update();
- this.setLockMode_(this.buildLockMode());
- }
-
- // ********** NamedQuery2_0Annotation implementation **********
-
- public LockModeType_2_0 getLockMode() {
- return this.lockMode;
- }
-
- public void setLockMode(LockModeType_2_0 lockMode) {
- throw new UnsupportedOperationException();
- }
-
- private void setLockMode_(LockModeType_2_0 lockMode) {
- LockModeType_2_0 old = this.lockMode;
- this.lockMode = lockMode;
- this.firePropertyChanged(LOCK_MODE_PROPERTY, old, lockMode);
- }
-
- public TextRange getLockModeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean lockModeTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private LockModeType_2_0 buildLockMode() {
- return LockModeType_2_0.fromJavaAnnotationValue(this.getJdtMemberValue(JPA2_0.NAMED_QUERY__LOCK_MODE));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryOrderColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryOrderColumn2_0Annotation.java
deleted file mode 100644
index cc581030c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryOrderColumn2_0Annotation.java
+++ /dev/null
@@ -1,147 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedColumnAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OrderColumn
- */
-public class BinaryOrderColumn2_0Annotation
- extends BinaryNamedColumnAnnotation
- implements OrderColumn2_0Annotation
-{
- private Boolean nullable;
- private Boolean insertable;
- private Boolean updatable;
-
-
- public BinaryOrderColumn2_0Annotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.nullable = this.buildNullable();
- this.insertable = this.buildInsertable();
- this.updatable = this.buildUpdatable();
- }
-
- @Override
- public void update() {
- super.update();
- this.setNullable_(this.buildNullable());
- this.setInsertable_(this.buildInsertable());
- this.setUpdatable_(this.buildUpdatable());
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- //************* BinaryNamedColumnAnnotation implementation *************
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- //************* OrderColumn2_0Annotation implementation *************
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNullable_(Boolean nullable) {
- Boolean old = this.nullable;
- this.nullable = nullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, nullable);
- }
-
- private Boolean buildNullable() {
- return (Boolean) this.getJdtMemberValue(getNullableElementName());
- }
-
- String getNullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- throw new UnsupportedOperationException();
- }
-
- private void setInsertable_(Boolean insertable) {
- Boolean old = this.insertable;
- this.insertable = insertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, insertable);
- }
-
- private Boolean buildInsertable() {
- return (Boolean) this.getJdtMemberValue(this.getInsertableElementName());
- }
-
- String getInsertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- throw new UnsupportedOperationException();
- }
-
- private void setUpdatable_(Boolean updatable) {
- Boolean old = this.updatable;
- this.updatable = updatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, updatable);
- }
-
- private Boolean buildUpdatable() {
- return (Boolean) this.getJdtMemberValue(this.getUpdatableElementName());
- }
-
- String getUpdatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinarySequenceGenerator2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinarySequenceGenerator2_0Annotation.java
deleted file mode 100644
index 6919129230..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinarySequenceGenerator2_0Annotation.java
+++ /dev/null
@@ -1,102 +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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinarySequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * BinarySequenceGenerator2_0Annotation
- */
-public final class BinarySequenceGenerator2_0Annotation
- extends BinarySequenceGeneratorAnnotation
- implements SequenceGenerator2_0Annotation
-{
- private String catalog;
- private String schema;
-
-
- public BinarySequenceGenerator2_0Annotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.catalog = this.buildCatalog();
- this.schema = this.buildSchema();
- }
-
- @Override
- public void update() {
- super.update();
- this.setCatalog_(this.buildCatalog());
- this.setSchema_(this.buildSchema());
- }
-
- // ********** SequenceGenerator2_0Annotation implementation **********
-
- // ********** catalog **********
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- private void setCatalog_(String catalog) {
- String old = this.catalog;
- this.catalog = catalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, catalog);
- }
-
- private String buildCatalog() {
- return (String) this.getJdtMemberValue(JPA2_0.SEQUENCE_GENERATOR__CATALOG);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ********** schema **********
-
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- private void setSchema_(String schema) {
- String old = this.schema;
- this.schema = schema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, schema);
- }
-
- private String buildSchema() {
- return (String) this.getJdtMemberValue(JPA2_0.SEQUENCE_GENERATOR__SCHEMA);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryStaticMetamodelAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryStaticMetamodelAnnotation.java
deleted file mode 100644
index caa427c79b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/binary/BinaryStaticMetamodelAnnotation.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.core.internal.jpa2.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.StaticMetamodelAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.metamodel.StaticMetamodel
- */
-public final class BinaryStaticMetamodelAnnotation
- extends BinaryAnnotation
- implements StaticMetamodelAnnotation
-{
- private String value;
-
-
- public BinaryStaticMetamodelAnnotation(JavaResourcePersistentType 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());
- }
-
-
- // ********** StaticMetamodelAnnotation 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_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA2_0.STATIC_METAMODEL__VALUE);
- }
-
- // ***** fully-qualified class name
- /**
- * binary is already fully-qualified
- */
- public String getFullyQualifiedClassName() {
- return this.value;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.java
deleted file mode 100644
index 0fa89552f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAccess2_0Annotation.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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Access
- */
-public final class SourceAccess2_0Annotation
- extends SourceAnnotation<Member>
- implements Access2_0Annotation
-{
- 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 AccessType value;
-
-
- public SourceAccess2_0Annotation(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(member, 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 void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** AccessAnnotation implementation **********
-
- // ***** value
- public AccessType getValue() {
- return this.value;
- }
-
- public void setValue(AccessType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(AccessType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(AccessType astValue) {
- AccessType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private AccessType buildValue(CompilationUnit astRoot) {
- return AccessType.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, JPA2_0.ACCESS__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java
deleted file mode 100644
index e006d46218..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverride2_0Annotation.java
+++ /dev/null
@@ -1,137 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.NullAssociationOverrideJoinTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinTableAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinTableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * SourceSequenceGenerator2_0Annotation
- */
-public final class SourceAssociationOverride2_0Annotation
- extends SourceAssociationOverrideAnnotation
- implements AssociationOverride2_0Annotation
-{
- private final MemberAnnotationAdapter joinTableAdapter;
- private NestableJoinTableAnnotation joinTable;
-
-
- // ********** constructor **********
- public SourceAssociationOverride2_0Annotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.joinTableAdapter = new MemberAnnotationAdapter(this.member, buildJoinTableAnnotationAdapter(this.daa));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.joinTableAdapter.getAnnotation(astRoot) != null) {
- this.joinTable = buildJoinTableAnnotation(this, this.member, this.daa);
- this.joinTable.initialize(astRoot);
- }
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncJoinTable(astRoot);
- }
-
- //************ AssociationOverride2_0Annotation implementation ****************
-
- // ***** joinTable
- public JoinTableAnnotation getJoinTable() {
- return this.joinTable;
- }
-
- public JoinTableAnnotation getNonNullJoinTable() {
- return (this.joinTable != null) ? this.joinTable : new NullAssociationOverrideJoinTableAnnotation(this);
- }
-
- public NestableJoinTableAnnotation addJoinTable() {
- if (this.joinTable != null) {
- throw new IllegalStateException("'joinTable' element already exists: " + this.joinTable); //$NON-NLS-1$
- }
- this.joinTable = buildJoinTableAnnotation(this, this.member, this.daa);
- this.joinTable.newAnnotation();
- return this.joinTable;
- }
-
- public void removeJoinTable() {
- if (this.joinTable == null) {
- throw new IllegalStateException("'joinTable' element does not exist"); //$NON-NLS-1$
- }
- this.joinTable.removeAnnotation();
- this.joinTable = null;
- }
-
- private void syncJoinTable(CompilationUnit astRoot) {
- if (this.joinTableAdapter.getAnnotation(astRoot) == null) {
- this.syncJoinTable_(null);
- } else {
- if (this.joinTable == null) {
- NestableJoinTableAnnotation table = buildJoinTableAnnotation(this, this.member, this.daa);
- table.initialize(astRoot);
- this.syncJoinTable_(table);
- } else {
- this.joinTable.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncJoinTable_(NestableJoinTableAnnotation astJoinTable) {
- JoinTableAnnotation old = this.joinTable;
- this.joinTable = astJoinTable;
- this.firePropertyChanged(JOIN_TABLE_PROPERTY, old, astJoinTable);
- }
-
-
- // ********** static methods **********
-
- public static SourceAssociationOverride2_0Annotation buildAssociationOverride(JavaResourceNode parent, Member member) {
- return new SourceAssociationOverride2_0Annotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static NestableJoinTableAnnotation buildJoinTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter associationOverrideAnnotationAdapter) {
- return new SourceJoinTableAnnotation(parent, member, buildJoinTableAnnotationAdapter(associationOverrideAnnotationAdapter));
- }
-
- static DeclarationAnnotationAdapter buildJoinTableAnnotationAdapter(DeclarationAnnotationAdapter associationOverrideAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(associationOverrideAnnotationAdapter, JPA2_0.ASSOCIATION_OVERRIDE__JOIN_TABLE, org.eclipse.jpt.core.resource.java.JPA.JOIN_TABLE);
- }
-
-
- static SourceAssociationOverrideAnnotation buildNestedAssociationOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourceAssociationOverride2_0Annotation(parent, member, idaa, annotationAdapter);
- }
-
- protected static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, org.eclipse.jpt.core.resource.java.JPA.ASSOCIATION_OVERRIDE);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java
deleted file mode 100644
index 9a72dd220e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceAssociationOverrides2_0Annotation.java
+++ /dev/null
@@ -1,33 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class SourceAssociationOverrides2_0Annotation
- extends SourceAssociationOverridesAnnotation
-{
-
- public SourceAssociationOverrides2_0Annotation(JavaResourceNode parent, Member member) {
- super(parent, member);
- }
-
- @Override
- protected NestableAssociationOverrideAnnotation buildAssociationOverride(int index) {
- return SourceAssociationOverride2_0Annotation.buildNestedAssociationOverride(this, this.member, index, this.daa);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.java
deleted file mode 100644
index 85fd521da8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCacheable2_0Annotation.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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Cacheable
- */
-public final class SourceCacheable2_0Annotation
- extends SourceAnnotation<Member>
- implements Cacheable2_0Annotation
-{
- 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 SourceCacheable2_0Annotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<Boolean>(type, 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 void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** Cacheable2_0Annotation 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, JPA2_0.CACHEABLE__VALUE, false, BooleanExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java
deleted file mode 100644
index 8591d533b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceCollectionTable2_0Annotation.java
+++ /dev/null
@@ -1,235 +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.core.internal.jpa2.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceBaseTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.CollectionTable
- */
-public final class SourceCollectionTable2_0Annotation
- extends SourceBaseTableAnnotation
- implements CollectionTable2_0Annotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.COLLECTION_TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.COLLECTION_TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.COLLECTION_TABLE__CATALOG);
-
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final JoinColumnsAnnotationContainer joinColumnsContainer = new JoinColumnsAnnotationContainer();
-
-
- public SourceCollectionTable2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.joinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.joinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @CollectionTable is never nested
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @CollectionTable is never nested
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @CollectionTable is never nested
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA2_0.COLLECTION_TABLE__UNIQUE_CONSTRAINTS;
- }
-
- // ********** CollectionTable2_0Annotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumnAnnotation addJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addJoinColumn_() {
- return this.addJoinColumn_(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(joinColumn);
- return joinColumn;
- }
-
- void syncAddJoinColumn(Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return new SourceJoinColumnAnnotation(this, this.member, buildJoinColumnAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildJoinColumnAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- void joinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeJoinColumn_(int index) {
- return this.joinColumns.remove(index);
- }
-
- void syncRemoveJoinColumns(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
-
- // ********** annotation containers **********
-
- /**
- * adapt the AnnotationContainer interface to the collection table's join columns
- */
- class JoinColumnsAnnotationContainer
- implements AnnotationContainer<NestableJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceCollectionTable2_0Annotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA2_0.COLLECTION_TABLE__JOIN_COLUMNS;
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceCollectionTable2_0Annotation.this.getNestableJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceCollectionTable2_0Annotation.this.joinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceCollectionTable2_0Annotation.this.addJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceCollectionTable2_0Annotation.this.syncAddJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceCollectionTable2_0Annotation.this.moveJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceCollectionTable2_0Annotation.this.removeJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceCollectionTable2_0Annotation.this.syncRemoveJoinColumns(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java
deleted file mode 100644
index 9c2cbbc509..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceElementCollection2_0Annotation.java
+++ /dev/null
@@ -1,168 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public final class SourceElementCollection2_0Annotation
- extends SourceAnnotation<Attribute>
- implements ElementCollection2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_CLASS_ADAPTER = buildTargetClassAdapter();
- private final AnnotationElementAdapter<String> targetClassAdapter;
- private String targetClass;
-
- String fullyQualifiedTargetClassName;
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
- private final AnnotationElementAdapter<String> fetchAdapter;
- private FetchType fetch;
-
-
- public SourceElementCollection2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.targetClassAdapter = new MemberAnnotationElementAdapter<String>(attribute, TARGET_CLASS_ADAPTER);
- this.fetchAdapter = new MemberAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.targetClass = this.buildTargetClass(astRoot);
- this.fullyQualifiedTargetClassName = this.buildFullyQualifiedTargetClassName(astRoot);
- this.fetch = this.buildFetch(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncTargetClass(this.buildTargetClass(astRoot));
- this.syncFullyQualifiedTargetClassName(this.buildFullyQualifiedTargetClassName(astRoot));
- this.syncFetch(this.buildFetch(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.targetClass);
- }
-
-
- // ********** ElementCollection2_0Annotation implementation **********
-
- // ***** target class
- public String getTargetClass() {
- return this.targetClass;
- }
-
- public void setTargetClass(String targetClass) {
- if (this.attributeValueHasChanged(this.targetClass, targetClass)) {
- this.targetClass = targetClass;
- this.targetClassAdapter.setValue(targetClass);
- }
- }
-
- private void syncTargetClass(String astTargetClass) {
- String old = this.targetClass;
- this.targetClass = astTargetClass;
- this.firePropertyChanged(TARGET_CLASS_PROPERTY, old, astTargetClass);
- }
-
- private String buildTargetClass(CompilationUnit astRoot) {
- return this.targetClassAdapter.getValue(astRoot);
- }
-
- public TextRange getTargetClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TARGET_CLASS_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetClassName() {
- return this.fullyQualifiedTargetClassName;
- }
-
- private void syncFullyQualifiedTargetClassName(String name) {
- String old = this.fullyQualifiedTargetClassName;
- this.fullyQualifiedTargetClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTargetClassName(CompilationUnit astRoot) {
- return (this.targetClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.targetClassAdapter.getExpression(astRoot));
- }
-
- // ***** 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);
- }
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ELEMENT_COLLECTION__FETCH, false);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetClassAdapter() {
- return buildTargetClassAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ELEMENT_COLLECTION__TARGET_CLASS);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetClassAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- // TODO what about QualifiedType?
- return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, false, converter);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java
deleted file mode 100644
index fa8da6ec08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceGeneratedAnnotation.java
+++ /dev/null
@@ -1,218 +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.core.internal.jpa2.resource.java.source;
-
-import java.util.Arrays;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.annotation.Generated
- */
-public final class SourceGeneratedAnnotation
- extends SourceAnnotation<Type>
- implements GeneratedAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String[]> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String[]> valueAdapter;
- private final Vector<String> values = new Vector<String>();
-
- private static final DeclarationAnnotationElementAdapter<String> DATE_ADAPTER = buildAdapter(DATE_ELEMENT_NAME);
- private final AnnotationElementAdapter<String> dateAdapter;
- private String date;
-
- private static final DeclarationAnnotationElementAdapter<String> COMMENTS_ADAPTER = buildAdapter(COMMENTS_ELEMENT_NAME);
- private final AnnotationElementAdapter<String> commentsAdapter;
- private String comments;
-
-
- public SourceGeneratedAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = this.buildAnnotationElementAdapter(VALUE_ADAPTER);
- this.dateAdapter = this.buildAdapter(DATE_ADAPTER);
- this.commentsAdapter = this.buildAdapter(COMMENTS_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new MemberAnnotationElementAdapter<String[]>(this.member, daea);
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.initializeValues(astRoot);
- this.date = this.buildDate(astRoot);
- this.comments = this.buildComments(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValues(astRoot);
- this.syncDate(this.buildDate(astRoot));
- this.syncComments(this.buildComments(astRoot));
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.values);
- }
-
-
- // ********** GeneratedAnnotation implementation **********
-
- // ***** values
- public ListIterator<String> values() {
- return new CloneListIterator<String>(this.values);
- }
-
- public int valuesSize() {
- return this.values.size();
- }
-
- public String getValue(int index) {
- return this.values.get(index);
- }
-
- public void addValue(String value) {
- this.addValue(this.values.size(), value);
- }
-
- public void addValue(int index, String value) {
- this.values.add(index, value);
- this.writeValues();
- }
-
- public void moveValue(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.values, targetIndex, sourceIndex);
- this.writeValues();
- }
-
- public void removeValue(String value) {
- this.values.remove(value);
- this.writeValues();
- }
-
- public void removeValue(int index) {
- this.values.remove(index);
- this.writeValues();
- }
-
- private void writeValues() {
- this.valueAdapter.setValue(this.values.toArray(new String[this.values.size()]));
- }
-
- private void initializeValues(CompilationUnit astRoot) {
- String[] astValues = this.valueAdapter.getValue(astRoot);
- for (int i = 0; i < astValues.length; i++) {
- this.values.add(astValues[i]);
- }
- }
-
- private void syncValues(CompilationUnit astRoot) {
- String[] astValues = this.valueAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(astValues), this.values, VALUES_LIST);
- }
-
- // ***** date
- public String getDate() {
- return this.date;
- }
-
- public void setDate(String date) {
- if (this.attributeValueHasChanged(this.date, date)) {
- this.date = date;
- this.dateAdapter.setValue(date);
- }
- }
-
- protected void syncDate(String astDate) {
- String old = this.date;
- this.date = astDate;
- this.firePropertyChanged(DATE_PROPERTY, old, astDate);
- }
-
- private String buildDate(CompilationUnit astRoot) {
- return this.dateAdapter.getValue(astRoot);
- }
-
- // ***** comments
- public String getComments() {
- return this.comments;
- }
-
- public void setComments(String comments) {
- if (this.attributeValueHasChanged(this.comments, comments)) {
- this.comments = comments;
- this.commentsAdapter.setValue(comments);
- }
- }
-
- protected void syncComments(String astComments) {
- String old = this.comments;
- this.comments = astComments;
- this.firePropertyChanged(COMMENTS_PROPERTY, old, astComments);
- }
-
- private String buildComments(CompilationUnit astRoot) {
- return this.commentsAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String[]> buildValueAdapter() {
- return buildArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, VALUE_ELEMENT_NAME);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, false, converter);
- }
-
- protected static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java
deleted file mode 100644
index 27177fdb01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyClass2_0Annotation.java
+++ /dev/null
@@ -1,119 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.MapKeyClass
- */
-public final class SourceMapKeyClass2_0Annotation
- extends SourceAnnotation<Attribute>
- implements MapKeyClass2_0Annotation
-{
- 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;
-
- private String fullyQualifiedClassName;
-
-
- public SourceMapKeyClass2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedClassName(this.buildFullyQualifiedClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** MapKeyClass2_0Annotation 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 class name
- public String getFullyQualifiedClassName() {
- return this.fullyQualifiedClassName;
- }
-
- private void syncFullyQualifiedClassName(String astfullyQualifiedClassName) {
- String old = this.fullyQualifiedClassName;
- this.fullyQualifiedClassName = astfullyQualifiedClassName;
- this.firePropertyChanged(FULLY_QUALIFIED_CLASS_NAME_PROPERTY, old, astfullyQualifiedClassName);
- }
-
- private String buildFullyQualifiedClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.MAP_KEY_CLASS__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyColumn2_0Annotation.java
deleted file mode 100644
index 100c78f90f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyColumn2_0Annotation.java
+++ /dev/null
@@ -1,95 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceCompleteColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKeyColumn
- */
-public final class SourceMapKeyColumn2_0Annotation
- extends SourceCompleteColumnAnnotation
- implements MapKeyColumn2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(MapKeyColumn2_0Annotation.ANNOTATION_NAME);
-
-
- public SourceMapKeyColumn2_0Annotation(JavaResourcePersistentAttribute parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return MapKeyColumn2_0Annotation.ANNOTATION_NAME;
- }
-
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.MAP_KEY_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA2_0.MAP_KEY_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA2_0.MAP_KEY_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA2_0.MAP_KEY_COLUMN__UPDATABLE;
- }
-
- // ********** SourceCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA2_0.MAP_KEY_COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA2_0.MAP_KEY_COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA2_0.MAP_KEY_COLUMN__SCALE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyEnumerated2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyEnumerated2_0Annotation.java
deleted file mode 100644
index 42bc8e3ce7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyEnumerated2_0Annotation.java
+++ /dev/null
@@ -1,41 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceBaseEnumeratedAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.MapKeyEnumerated
- */
-public final class SourceMapKeyEnumerated2_0Annotation
- extends SourceBaseEnumeratedAnnotation
- implements MapKeyEnumerated2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- public SourceMapKeyEnumerated2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return MapKeyEnumerated2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA2_0.MAP_KEY_ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyTemporal2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyTemporal2_0Annotation.java
deleted file mode 100644
index 92e1ce1156..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapKeyTemporal2_0Annotation.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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceBaseTemporalAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.MapKeyTemporal
- */
-public final class SourceMapKeyTemporal2_0Annotation
- extends SourceBaseTemporalAnnotation
- implements MapKeyTemporal2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
-
- public SourceMapKeyTemporal2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return MapKeyTemporal2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA2_0.MAP_KEY_TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java
deleted file mode 100644
index 4331c36a1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceMapsId2_0Annotation.java
+++ /dev/null
@@ -1,105 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.MapsId
- */
-public final class SourceMapsId2_0Annotation
- extends SourceAnnotation<Attribute>
- implements MapsId2_0Annotation
-{
- 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;
-
-
- public SourceMapsId2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, 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 void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** MapsId2_0Annotation implementation **********
-
- 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 this.elementTouches(VALUE_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(
- DECLARATION_ANNOTATION_ADAPTER, JPA2_0.MAPS_ID__VALUE, false);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.java
deleted file mode 100644
index 1e86f39717..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQueries2_0Annotation.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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class SourceNamedQueries2_0Annotation
- extends SourceNamedQueriesAnnotation
-{
- public SourceNamedQueries2_0Annotation(JavaResourceNode parent, Type type) {
- super(parent, type);
- }
-
- @Override
- protected NestableNamedQueryAnnotation buildNamedQuery(int index) {
- return SourceNamedQuery2_0Annotation.createNestedNamedQuery(this, member, index, this.daa);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java
deleted file mode 100644
index abc4264e2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceNamedQuery2_0Annotation.java
+++ /dev/null
@@ -1,135 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueryAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQuery
- */
-public final class SourceNamedQuery2_0Annotation
- extends SourceNamedQueryAnnotation
- implements NamedQuery2_0Annotation
-{
- private final DeclarationAnnotationElementAdapter<String> lockModeDeclarationAdapter;
- private final AnnotationElementAdapter<String> lockModeAdapter;
- private LockModeType_2_0 lockMode;
-
- // ********** constructors **********
- public SourceNamedQuery2_0Annotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.lockModeDeclarationAdapter = this.buildLockModeTypeAdapter(daa);
- this.lockModeAdapter = new MemberAnnotationElementAdapter<String>(type, this.lockModeDeclarationAdapter);
- }
-
- public SourceNamedQuery2_0Annotation(JavaResourceNode parent, Type type) {
- this(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- private DeclarationAnnotationElementAdapter<String> buildLockModeTypeAdapter(DeclarationAnnotationAdapter daAdapter) {
- return new EnumDeclarationAnnotationElementAdapter(daAdapter, this.getLockModeElementName());
- }
-
- private String getLockModeElementName() {
- return JPA2_0.NAMED_QUERY__LOCK_MODE;
- }
-
- // ********** initialize/update **********
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.lockMode = this.buildLockMode(astRoot);
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
-
- NamedQuery2_0Annotation old = (NamedQuery2_0Annotation) oldAnnotation;
- this.setLockMode(old.getLockMode());
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncLockMode(this.buildLockMode(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.lockMode);
- }
-
- // ********** NamedQuery2_0Annotation implementation **********
-
- public LockModeType_2_0 getLockMode() {
- return this.lockMode;
- }
-
- public void setLockMode(LockModeType_2_0 lockMode) {
- if (this.attributeValueHasChanged(this.lockMode, lockMode)) {
- this.lockMode = lockMode;
- this.lockModeAdapter.setValue(LockModeType_2_0.toJavaAnnotationValue(lockMode));
- }
- }
-
- private void syncLockMode(LockModeType_2_0 astLockMode) {
- LockModeType_2_0 old = this.lockMode;
- this.lockMode = astLockMode;
- this.firePropertyChanged(LOCK_MODE_PROPERTY, old, astLockMode);
- }
-
- private LockModeType_2_0 buildLockMode(CompilationUnit astRoot) {
- return LockModeType_2_0.fromJavaAnnotationValue(this.lockModeAdapter.getValue(astRoot));
- }
-
- public TextRange getLockModeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.lockModeDeclarationAdapter, astRoot);
- }
-
- public boolean lockModeTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.lockModeDeclarationAdapter, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- static SourceNamedQuery2_0Annotation createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
-
- return new SourceNamedQuery2_0Annotation(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_QUERY);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java
deleted file mode 100644
index 177665cde2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceOrderColumn2_0Annotation.java
+++ /dev/null
@@ -1,187 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OrderColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.OrderColumn
- */
-public final class SourceOrderColumn2_0Annotation
- extends SourceNamedColumnAnnotation
- implements OrderColumn2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final DeclarationAnnotationElementAdapter<Boolean> nullableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> nullableAdapter;
- private Boolean nullable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> insertableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> insertableAdapter;
- private Boolean insertable;
-
- private final DeclarationAnnotationElementAdapter<Boolean> updatableDeclarationAdapter;
- private final AnnotationElementAdapter<Boolean> updatableAdapter;
- private Boolean updatable;
-
- public SourceOrderColumn2_0Annotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.nullableDeclarationAdapter = this.buildBooleanElementAdapter(this.getNullableElementName());
- this.nullableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nullableDeclarationAdapter);
- this.insertableDeclarationAdapter = this.buildBooleanElementAdapter(this.getInsertableElementName());
- this.insertableAdapter = this.buildShortCircuitBooleanElementAdapter(this.insertableDeclarationAdapter);
- this.updatableDeclarationAdapter = this.buildBooleanElementAdapter(this.getUpdatableElementName());
- this.updatableAdapter = this.buildShortCircuitBooleanElementAdapter(this.updatableDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.nullable = this.buildNullable(astRoot);
- this.insertable = this.buildInsertable(astRoot);
- this.updatable = this.buildUpdatable(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncNullable(this.buildNullable(astRoot));
- this.syncInsertable(this.buildInsertable(astRoot));
- this.syncUpdatable(this.buildUpdatable(astRoot));
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName, false);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(this.daa, elementName, false, BooleanExpressionConverter.instance());
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getNameElementName() {
- return JPA2_0.ORDER_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA2_0.ORDER_COLUMN__COLUMN_DEFINITION;
- }
- //************* OrderColumn2_0Annotation implementation *************
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- if (this.attributeValueHasChanged(this.nullable, nullable)) {
- this.nullable = nullable;
- this.nullableAdapter.setValue(nullable);
- }
- }
-
- private void syncNullable(Boolean astNullable) {
- Boolean old = this.nullable;
- this.nullable = astNullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, astNullable);
- }
-
- private Boolean buildNullable(CompilationUnit astRoot) {
- return this.nullableAdapter.getValue(astRoot);
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nullableDeclarationAdapter, astRoot);
- }
-
- String getNullableElementName() {
- return JPA2_0.ORDER_COLUMN__NULLABLE;
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- if (this.attributeValueHasChanged(this.insertable, insertable)) {
- this.insertable = insertable;
- this.insertableAdapter.setValue(insertable);
- }
- }
-
- private void syncInsertable(Boolean astInsertable) {
- Boolean old = this.insertable;
- this.insertable = astInsertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, astInsertable);
- }
-
- private Boolean buildInsertable(CompilationUnit astRoot) {
- return this.insertableAdapter.getValue(astRoot);
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.insertableDeclarationAdapter, astRoot);
- }
-
- String getInsertableElementName() {
- return JPA2_0.ORDER_COLUMN__INSERTABLE;
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (this.attributeValueHasChanged(this.updatable, updatable)) {
- this.updatable = updatable;
- this.updatableAdapter.setValue(updatable);
- }
- }
-
- private void syncUpdatable(Boolean astUpdatable) {
- Boolean old = this.updatable;
- this.updatable = astUpdatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, astUpdatable);
- }
-
- private Boolean buildUpdatable(CompilationUnit astRoot) {
- return this.updatableAdapter.getValue(astRoot);
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.updatableDeclarationAdapter, astRoot);
- }
-
- String getUpdatableElementName() {
- return JPA2_0.ORDER_COLUMN__UPDATABLE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceSequenceGenerator2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceSequenceGenerator2_0Annotation.java
deleted file mode 100644
index 1fa27a74f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceSequenceGenerator2_0Annotation.java
+++ /dev/null
@@ -1,119 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceSequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * SourceSequenceGenerator2_0Annotation
- */
-public final class SourceSequenceGenerator2_0Annotation
- extends SourceSequenceGeneratorAnnotation
- implements SequenceGenerator2_0Annotation
-{
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = buildAdapter(JPA2_0.SEQUENCE_GENERATOR__CATALOG);
- private final AnnotationElementAdapter<String> catalogAdapter;
- private String catalog;
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = buildAdapter(JPA2_0.SEQUENCE_GENERATOR__SCHEMA);
- private final AnnotationElementAdapter<String> schemaAdapter;
- private String schema;
-
-
- // ********** constructor **********
- public SourceSequenceGenerator2_0Annotation(JavaResourceNode parent, Member member) {
- super(parent, member);
- this.catalogAdapter = this.buildAdapter(CATALOG_ADAPTER);
- this.schemaAdapter = this.buildAdapter(SCHEMA_ADAPTER);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.catalog = this.buildCatalog(astRoot);
- this.schema = this.buildSchema(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncCatalog(this.buildCatalog(astRoot));
- this.syncSchema(this.buildSchema(astRoot));
- }
-
- // ********** catalog **********
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- if (this.attributeValueHasChanged(this.catalog, catalog)) {
- this.catalog = catalog;
- this.catalogAdapter.setValue(catalog);
- }
- }
-
- private void syncCatalog(String astCatalog) {
- String old = this.catalog;
- this.catalog = astCatalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, astCatalog);
- }
-
- private String buildCatalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CATALOG_ADAPTER, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(CATALOG_ADAPTER, pos, astRoot);
- }
-
- // ********** schema **********
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- if (this.attributeValueHasChanged(this.schema, schema)) {
- this.schema = schema;
- this.schemaAdapter.setValue(schema);
- }
- }
-
- private void syncSchema(String astSchema) {
- String old = this.schema;
- this.schema = astSchema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, astSchema);
- }
-
- private String buildSchema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SCHEMA_ADAPTER, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(SCHEMA_ADAPTER, pos, astRoot);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java
deleted file mode 100644
index 4a2ceea0ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/resource/java/source/SourceStaticMetamodelAnnotation.java
+++ /dev/null
@@ -1,114 +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.core.internal.jpa2.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.StaticMetamodelAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.metamodel.StaticMetamodel
- */
-public final class SourceStaticMetamodelAnnotation
- extends SourceAnnotation<Type>
- implements StaticMetamodelAnnotation
-{
- 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;
-
- private String fullyQualifiedClassName;
-
-
- public SourceStaticMetamodelAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedClassName(this.buildFullyQualifiedClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** StaticMetamodelAnnotation 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);
- }
-
- // ***** fully-qualified class name
- public String getFullyQualifiedClassName() {
- return this.fullyQualifiedClassName;
- }
-
- private void syncFullyQualifiedClassName(String astfullyQualifiedClassName) {
- String old = this.fullyQualifiedClassName;
- this.fullyQualifiedClassName = astfullyQualifiedClassName;
- this.firePropertyChanged(FULLY_QUALIFIED_CLASS_NAME_PROPERTY, old, astfullyQualifiedClassName);
- }
-
- private String buildFullyQualifiedClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.STATIC_METAMODEL__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java
deleted file mode 100644
index 3600851036..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationDataModelProvider.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.core.internal.operations;
-
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-
-public abstract class AbstractJpaFileCreationDataModelProvider
- extends AbstractDataModelProvider
- implements JpaFileCreationDataModelProperties
-{
- protected AbstractJpaFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked")
- Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(PROJECT_NAME);
- propertyNames.add(SOURCE_FOLDER);
- propertyNames.add(FILE_PATH);
- propertyNames.add(VERSION);
- return propertyNames;
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(SOURCE_FOLDER)) {
- IFolder sourceFolder = getDefaultSourceFolder();
- if (sourceFolder != null && sourceFolder.exists()) {
- return sourceFolder.getFullPath().toPortableString();
- }
- }
- else if (propertyName.equals(FILE_PATH)) {
- return getDefaultFilePath();
- }
- else if (propertyName.equals(VERSION)) {
- return getDefaultVersion();
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected abstract String getDefaultFilePath();
-
- protected abstract String getDefaultVersion();
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(PROJECT_NAME)) {
- this.model.notifyPropertyChange(SOURCE_FOLDER, IDataModel.DEFAULT_CHG);
- }
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(PROJECT_NAME)) {
- return ArrayTools.array(
- new TransformationIterator<IProject, DataModelPropertyDescriptor>(jpaIProjects()) {
- @Override
- protected DataModelPropertyDescriptor transform(IProject next) {
- return new DataModelPropertyDescriptor(next.getName());
- }
- },
- new DataModelPropertyDescriptor[0]);
- }
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PROJECT_NAME)) {
- return new DataModelPropertyDescriptor(getStringProperty(PROJECT_NAME));
- }
- return super.getPropertyDescriptor(propertyName);
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public IStatus validate(String propertyName) {
- IStatus status = Status.OK_STATUS;
- if (propertyName.equals(PROJECT_NAME)
- || propertyName.equals(SOURCE_FOLDER)
- || propertyName.equals(FILE_PATH)) {
- status = validateProjectSourceFolderAndFilePath();
- }
- if (! status.isOK()) {
- return status;
- }
-
- if (propertyName.equals(PROJECT_NAME)
- || propertyName.equals(VERSION)) {
- status = validateVersion();
- }
- if (! status.isOK()) {
- return status;
- }
-
- return status;
- }
-
- protected IStatus validateProjectSourceFolderAndFilePath() {
- String projectName = (String) getProperty(PROJECT_NAME);
- if (StringTools.stringIsEmpty(projectName)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_PROJECT_NOT_SPECIFIED);
- }
- String sourceFolderPath = getStringProperty(SOURCE_FOLDER);
- if (StringTools.stringIsEmpty(sourceFolderPath)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_SOURCE_FOLDER_NOT_SPECIFIED);
- }
- if (sourceFolderIsIllegal(sourceFolderPath)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_SOURCE_FOLDER_ILLEGAL);
- }
- if (sourceFolderNotInProject(sourceFolderPath)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- NLS.bind(
- JptCoreMessages.VALIDATE_SOURCE_FOLDER_NOT_IN_PROJECT,
- sourceFolderPath, projectName));
- }
- if (getVerifiedSourceFolder() == null) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- NLS.bind(JptCoreMessages.VALIDATE_SOURCE_FOLDER_DOES_NOT_EXIST, sourceFolderPath));
- }
- if (getVerifiedJavaSourceFolder() == null) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- NLS.bind(JptCoreMessages.VALIDATE_SOURCE_FOLDER_NOT_SOURCE_FOLDER, sourceFolderPath));
- }
- String filePath = getStringProperty(FILE_PATH);
- if (StringTools.stringIsEmpty(filePath)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_FILE_PATH_NOT_SPECIFIED);
- }
- if (getExistingFile() != null) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_FILE_ALREADY_EXISTS);
- }
- return Status.OK_STATUS;
- }
-
- protected IStatus validateVersion() {
- if (getProject() == null) {
- return Status.OK_STATUS;
- }
- String fileVersion = getStringProperty(VERSION);
- if (! fileVersionSupported(fileVersion)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_FILE_VERSION_NOT_SUPPORTED);
- }
- try {
- String jpaFacetVersion = getJpaFacetVersion(getProject());
- if (! fileVersionSupportedForFacetVersion(fileVersion, jpaFacetVersion)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- JptCoreMessages.VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION);
- }
- }
- catch (CoreException ce) {
- // project should have been validated already, so assume that this will never get hit
- // fall through to final return
- }
- return Status.OK_STATUS;
- }
-
- protected abstract boolean fileVersionSupported(String fileVersion);
-
- protected abstract boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion);
-
-
- // **************** helper methods *****************************************
-
- // Copied from ArtifactEditOperationDataModelProvider
- protected IProject getProject() {
- String projectName = (String) model.getProperty(PROJECT_NAME);
- if (StringTools.stringIsEmpty(projectName)) {
- return null;
- }
- return ProjectUtilities.getProject(projectName);
- }
-
- protected JpaProject getJpaProject() {
- IProject project = getProject();
- return (project == null) ? null : JptCorePlugin.getJpaProject(project);
- }
-
- /**
- * Return a best guess java source folder for the specified project
- */
- // Copied from NewJavaClassDataModelProvider
- protected IFolder getDefaultSourceFolder() {
- IProject project = getProject();
- if (project == null) {
- return null;
- }
- IPackageFragmentRoot[] sources = J2EEProjectUtilities.getSourceContainers(project);
- // Try and return the first source folder
- if (sources.length > 0) {
- try {
- return (IFolder) sources[0].getCorrespondingResource();
- } catch (Exception e) {
- return null;
- }
- }
- return null;
- }
-
- /**
- * Return whether the path provided can not be a valid IFolder path
- */
- protected boolean sourceFolderIsIllegal(String folderPath) {
- IProject project = getProject();
- if (project == null) {
- return false;
- }
- try {
- project.getWorkspace().getRoot().getFolder(new Path(folderPath));
- }
- catch (IllegalArgumentException e) {
- return true;
- }
- return false;
- }
-
- /**
- * Return whether the path provided is in the current project
- */
- protected boolean sourceFolderNotInProject(String folderPath) {
- IProject project = getProject();
- if (project == null) {
- return false;
- }
- IFolder folder;
- try {
- folder = project.getWorkspace().getRoot().getFolder(new Path(folderPath));
- }
- catch (IllegalArgumentException e) {
- return false;
- }
- return ! project.equals(folder.getProject());
- }
-
- /**
- * Return an IFolder represented by the SOURCE_FOLDER property, verified
- * to exist
- */
- protected IFolder getVerifiedSourceFolder() {
- String folderPath = getStringProperty(SOURCE_FOLDER);
- IProject project = getProject();
- if (project == null) {
- return null;
- }
- IFolder folder;
- try {
- folder = project.getWorkspace().getRoot().getFolder(new Path(folderPath));
- }
- catch (IllegalArgumentException e) {
- return null;
- }
- if (folder == null || ! folder.exists()) {
- return null;
- }
- return folder;
- }
-
- /**
- * Return the source folder, provided it is verified to be an actual java
- * source folder
- */
- protected IFolder getVerifiedJavaSourceFolder() {
- IFolder folder = getVerifiedSourceFolder();
- if (folder == null) {
- return null;
- }
- IJavaProject jProject = JavaCore.create(getProject());
- if (jProject == null) {
- return null;
- }
- IPackageFragmentRoot packageFragmentRoot = jProject.getPackageFragmentRoot(folder);
- if (packageFragmentRoot == null || ! packageFragmentRoot.exists()) {
- return null;
- }
- return folder;
- }
-
- protected IFile getExistingFile() {
- IFolder folder = getVerifiedSourceFolder();
- if (folder == null) {
- return null;
- }
- String filePath = getStringProperty(FILE_PATH);
- IFile existingFile = folder.getFile(new Path(filePath));
- if (! existingFile.exists()) {
- return null;
- }
- return existingFile;
- }
-
- protected Iterator<IProject> jpaIProjects() {
- return new FilteringIterator<IProject>(this.allIProjects(), this.buildJpaIProjectsFilter());
- }
-
- protected Iterator<IProject> allIProjects() {
- return CollectionTools.iterator(ProjectUtilities.getAllProjects());
- }
-
- protected Filter<IProject> buildJpaIProjectsFilter() {
- return new JpaIProjectsFilter();
- }
-
- protected class JpaIProjectsFilter implements Filter<IProject> {
- public boolean accept(IProject project) {
- try {
- return this.accept_(project);
- } catch (CoreException ex) {
- return false;
- }
- }
- protected boolean accept_(IProject project) throws CoreException {
- return hasJpaFacet(project) && hasSupportedPlatformId(project);
- }
- }
-
- protected boolean hasJpaFacet(IProject project) throws CoreException {
- return FacetedProjectFramework.hasProjectFacet(project, JptCorePlugin.FACET_ID);
- }
-
- protected String getJpaFacetVersion(IProject project) throws CoreException {
- IFacetedProject fproj = ProjectFacetsManager.create(project);
- return fproj.getProjectFacetVersion(
- ProjectFacetsManager.getProjectFacet(JptCorePlugin.FACET_ID)).getVersionString();
- }
-
- protected boolean hasSupportedPlatformId(IProject project) {
- JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- return (jpaProject != null) && isSupportedPlatformId(jpaProject.getJpaPlatform().getId());
- }
-
- protected boolean isSupportedPlatformId(String id) {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationOperation.java
deleted file mode 100644
index 806bc48a52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/AbstractJpaFileCreationOperation.java
+++ /dev/null
@@ -1,124 +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.core.internal.operations;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class AbstractJpaFileCreationOperation
- extends AbstractDataModelOperation
- implements JpaFileCreationDataModelProperties
-{
- /**
- * Will be null until folder is created
- */
- protected IFolder createdSourceFolder;
-
- /**
- * Will be null until file is created
- */
- protected IFile createdFile;
-
-
- protected AbstractJpaFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // Create source folder if it does not exist
- createSourceFolder();
- // Create file
- createFile();
- return OK_STATUS;
- }
-
- protected IProject getProject() throws ExecutionException {
- String projectName = (String) getDataModel().getProperty(PROJECT_NAME);
- IProject project = ProjectUtilities.getProject(projectName);
- if (project == null) {
- throw new ExecutionException("No project name specified"); //$NON-NLS-1$
- }
- return project;
- }
-
- protected JpaProject getJpaProject() throws ExecutionException {
- IProject project = getProject();
- JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- if (jpaProject == null) {
- throw new ExecutionException("Project does not have JPA content"); //$NON-NLS-1$
- }
- return jpaProject;
- }
-
- /**
- * This method will return the source folder as specified in the data model.
- * It will create the source folder if it does not exist. It will not add
- * it as a source folder to the project build path if it is not already.
- * This method may return null.
- */
- // copied from NewJavaClassOperation
- protected void createSourceFolder() throws ExecutionException {
- // Get the source folder name from the data model
- String folderPath = model.getStringProperty(SOURCE_FOLDER);
- IProject project = getProject();
- IFolder folder = project.getWorkspace().getRoot().getFolder(new Path(folderPath));
- // If folder does not exist, create the folder with the specified path
- if (! folder.exists()) {
- try {
- folder.create(true, true, null);
- } catch (CoreException e) {
- throw new ExecutionException("Could not create folder", e); //$NON-NLS-1$
- }
- }
- // Return the source folder
- this.createdSourceFolder = folder;
- }
-
- protected void createFile() {
- String filePath = getDataModel().getStringProperty(FILE_PATH);
- IFile newFile = this.createdSourceFolder.getFile(new Path(filePath));
- AbstractXmlResourceProvider resourceProvider = getXmlResourceProvider(newFile);
- try {
- resourceProvider.createFileAndResource(getDataModel());
- }
- catch (CoreException e) {
- JptCorePlugin.log(e);
- newFile = null;
- }
- this.createdFile = newFile;
- }
-
- @Override
- public ISchedulingRule getSchedulingRule() {
- try {
- return this.getProject();
- } catch (ExecutionException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected abstract AbstractXmlResourceProvider getXmlResourceProvider(IFile file);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/JpaFileCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/JpaFileCreationDataModelProperties.java
deleted file mode 100644
index 62b1e36c80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/JpaFileCreationDataModelProperties.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.core.internal.operations;
-
-public interface JpaFileCreationDataModelProperties
-{
- /**
- * Required, type String, identifies the name of the project in which to create the file
- */
- public static final String PROJECT_NAME = "JpaFileCreationDataModelProperties.PROJECT_NAME";
-
- /**
- * Required, type String, identifies the fully pathed source folder in which to create the file
- */
- public static final String SOURCE_FOLDER = "JpaFileCreationDataModelProperties.SOURCE_FOLDER";
-
- /**
- * Required, type String, identifies the file path relative to the source folder
- */
- public static final String FILE_PATH = "JpaFileCreationDataModelProperties.FILE_PATH";
-
- /**
- * Required, type String, identifies the version of the file to create
- */
- public static final String VERSION = "JpaFileCreationDataModelProperties.VERSION";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.java
deleted file mode 100644
index 75e2083b37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProperties.java
+++ /dev/null
@@ -1,32 +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.core.internal.operations;
-
-public interface OrmFileCreationDataModelProperties
- extends JpaFileCreationDataModelProperties
-{
- /**
- * Optional, type AccessType, specifies the default access type (or null)
- */
- public static final String DEFAULT_ACCESS = "OrmFileCreationDataModelProperties.DEFAULT_ACCESS";
-
- /**
- * Required, type Boolean, specifies whether to add a reference to the file
- * in the persistence unit
- */
- public static final String ADD_TO_PERSISTENCE_UNIT = "OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT";
-
- /**
- * Optional (unless ADD_TO_PERSISTENCE_UNIT property is true), type String,
- * identifies the persistence unit to which to add a reference to the file
- */
- public static final String PERSISTENCE_UNIT = "OrmFileCreationDataModelProperties.PERSISTENCE_UNIT";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java
deleted file mode 100644
index 86d5cdb701..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,273 +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.core.internal.operations;
-
-import java.util.Iterator;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class OrmFileCreationDataModelProvider
- extends AbstractJpaFileCreationDataModelProvider
- implements OrmFileCreationDataModelProperties
-{
- /**
- * required default constructor
- */
- public OrmFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public IDataModelOperation getDefaultOperation() {
- return new OrmFileCreationOperation(getDataModel());
- }
-
- @Override
- public Set<String> getPropertyNames() {
- @SuppressWarnings("unchecked")
- Set<String> propertyNames = super.getPropertyNames();
- propertyNames.add(DEFAULT_ACCESS);
- propertyNames.add(ADD_TO_PERSISTENCE_UNIT);
- propertyNames.add(PERSISTENCE_UNIT);
- return propertyNames;
- }
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(PERSISTENCE_UNIT)) {
- return getBooleanProperty(ADD_TO_PERSISTENCE_UNIT);
- }
- return super.isPropertyEnabled(propertyName);
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(DEFAULT_ACCESS)) {
- return null;
- }
- else if (propertyName.equals(ADD_TO_PERSISTENCE_UNIT)) {
- return Boolean.FALSE;
- }
- else if (propertyName.equals(PERSISTENCE_UNIT)) {
- PersistenceUnit pUnit = getDefaultPersistenceUnit();
- if (pUnit != null) {
- return pUnit.getName();
- }
- }
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- protected String getDefaultFilePath() {
- return new Path(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH).toPortableString();
- }
-
- @Override
- protected String getDefaultVersion() {
- if (getProject() == null) {
- return null;
- }
- return JptCorePlugin.getJpaPlatform(getProject()).getMostRecentSupportedResourceType(
- JptCorePlugin.ORM_XML_CONTENT_TYPE).getVersion();
- }
-
- protected PersistenceUnit getDefaultPersistenceUnit() {
- JpaProject jpaProject = getJpaProject();
- if (jpaProject == null) {
- return null;
- }
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- return null;
- }
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence == null) {
- return null;
- }
- if (persistence.persistenceUnitsSize() == 0) {
- return null;
- }
- return persistence.persistenceUnits().next();
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
- if (propertyName.equals(PROJECT_NAME)) {
- this.model.notifyPropertyChange(PERSISTENCE_UNIT, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(PERSISTENCE_UNIT, IDataModel.VALID_VALUES_CHG);
- }
- else if (propertyName.equals(ADD_TO_PERSISTENCE_UNIT)) {
- this.model.notifyPropertyChange(PERSISTENCE_UNIT, IDataModel.ENABLE_CHG);
- }
- return ok;
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (propertyName.equals(DEFAULT_ACCESS)) {
- DataModelPropertyDescriptor[] accessTypes = new DataModelPropertyDescriptor[3];
- accessTypes[0] = accessPropertyDescriptor(null);
- accessTypes[1] = accessPropertyDescriptor(AccessType.FIELD);
- accessTypes[2] = accessPropertyDescriptor(AccessType.PROPERTY);
- return accessTypes;
- }
- else if (propertyName.equals(PERSISTENCE_UNIT)) {
- return ArrayTools.array(
- new TransformationIterator<String, DataModelPropertyDescriptor>(new CompositeIterator<String>(null, persistenceUnitNames())) {
- @Override
- protected DataModelPropertyDescriptor transform(String next) {
- return persistenceUnitPropertyDescriptor(next);
- }
- },
- new DataModelPropertyDescriptor[0]);
- }
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- @Override
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- if (propertyName.equals(PERSISTENCE_UNIT)) {
- return persistenceUnitPropertyDescriptor(getStringProperty(PERSISTENCE_UNIT));
- }
- return super.getPropertyDescriptor(propertyName);
- }
-
- protected DataModelPropertyDescriptor accessPropertyDescriptor(AccessType accessType) {
- if (accessType == null) {
- return new DataModelPropertyDescriptor(null, JptCoreMessages.NONE);
- }
- return new DataModelPropertyDescriptor(accessType, accessType.getName());
- }
-
- DataModelPropertyDescriptor persistenceUnitPropertyDescriptor(String persistenceUnitName) {
- if (StringTools.stringIsEmpty(persistenceUnitName)) {
- return new DataModelPropertyDescriptor(null, JptCoreMessages.NONE);
- }
- return new DataModelPropertyDescriptor(persistenceUnitName);
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public IStatus validate(String propertyName) {
- IStatus status = super.validate(propertyName);
- if (! status.isOK()) {
- return status;
- }
-
- if (propertyName.equals(ADD_TO_PERSISTENCE_UNIT)
- || propertyName.equals(PERSISTENCE_UNIT)) {
- status = validatePersistenceUnit();
- }
- if (! status.isOK()) {
- return status;
- }
-
- return Status.OK_STATUS;
- }
-
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return (fileVersion.equals(JPA.SCHEMA_VERSION)
- || fileVersion.equals(JPA2_0.SCHEMA_VERSION));
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- if (jpaFacetVersion.equals(JptCorePlugin.JPA_FACET_VERSION_1_0)
- && fileVersion.equals(JPA2_0.SCHEMA_VERSION)) {
- return false;
- }
- return true;
- }
-
- protected IStatus validatePersistenceUnit() {
- boolean addToPUnit = getBooleanProperty(ADD_TO_PERSISTENCE_UNIT);
- String projectName = getStringProperty(PROJECT_NAME);
- String pUnitName = getStringProperty(PERSISTENCE_UNIT);
- if (addToPUnit) {
- if (StringTools.stringIsEmpty(pUnitName)) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- NLS.bind(JptCoreMessages.VALIDATE_PERSISTENCE_UNIT_DOES_NOT_SPECIFIED, pUnitName));
- }
- if (getPersistenceUnit() == null) {
- return new Status(
- IStatus.ERROR, JptCorePlugin.PLUGIN_ID,
- NLS.bind(JptCoreMessages.VALIDATE_PERSISTENCE_UNIT_NOT_IN_PROJECT, pUnitName, projectName));
- }
- }
- return Status.OK_STATUS;
- }
-
-
- // **************** helper methods *****************************************
-
- protected PersistenceUnit getPersistenceUnit() {
- String pUnitName = getStringProperty(PERSISTENCE_UNIT);
- JpaProject jpaProject =
- (StringTools.stringIsEmpty(pUnitName)) ? null : getJpaProject();
- PersistenceXml persistenceXml =
- (jpaProject == null) ? null : jpaProject.getRootContextNode().getPersistenceXml();
- Persistence persistence =
- (persistenceXml == null) ? null : persistenceXml.getPersistence();
- if (persistence != null) {
- for (Iterator<PersistenceUnit> stream = persistence.persistenceUnits(); stream.hasNext(); ) {
- PersistenceUnit next = stream.next();
- if (pUnitName.equals(next.getName())) {
- return next;
- }
- }
- }
- return null;
- }
-
- protected Iterator<PersistenceUnit> persistenceUnits() {
- //only get the persistence units for the selected JpaProject,
- //if no jpa project is selected, then no persistence units will be listed in the combo
- JpaProject jpaProject = getJpaProject();
- PersistenceXml persistenceXml = (jpaProject == null) ? null : jpaProject.getRootContextNode().getPersistenceXml();
- Persistence persistence = (persistenceXml == null) ? null : persistenceXml.getPersistence();
- return (persistence == null) ? EmptyIterator.<PersistenceUnit>instance() : persistence.persistenceUnits();
- }
-
- protected Iterator<String> persistenceUnitNames() {
- return new TransformationIterator<PersistenceUnit, String>(persistenceUnits()) {
- @Override
- protected String transform(PersistenceUnit next) {
- return next.getName();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java
deleted file mode 100644
index 17a63ec16c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/OrmFileCreationOperation.java
+++ /dev/null
@@ -1,97 +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.core.internal.operations;
-
-import java.util.Iterator;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.resource.orm.OrmXmlResourceProvider;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class OrmFileCreationOperation
- extends AbstractJpaFileCreationOperation
- implements OrmFileCreationDataModelProperties
-{
- public OrmFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IStatus status = super.execute(monitor, info);
-
- if (status.isOK()) {
- addMappingFileToPersistenceXml();
- }
-
- return OK_STATUS;
- }
-
- protected PersistenceUnit getPersistenceUnit() throws ExecutionException {
- String pUnitName = getDataModel().getStringProperty(PERSISTENCE_UNIT);
- JpaProject jpaProject = getJpaProject();
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- throw new ExecutionException("Project does not have a persistence.xml file"); //$NON-NLS-1$
- }
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence == null) {
- throw new ExecutionException("persistence.xml does not have a persistence node."); //$NON-NLS-1$
- }
- for (Iterator<PersistenceUnit> stream = persistence.persistenceUnits(); stream.hasNext(); ) {
- PersistenceUnit pUnit = stream.next();
- if (pUnitName.equals(pUnit.getName())) {
- return pUnit;
- }
- }
- throw new ExecutionException("persistence.xml does not have persistence unit named \'" + pUnitName + "\'"); //$NON-NLS-1$
- }
-
- protected void addMappingFileToPersistenceXml() throws ExecutionException {
- if (! getDataModel().getBooleanProperty(ADD_TO_PERSISTENCE_UNIT)) {
- return;
- }
- JpaProject jpaProject = JptCorePlugin.getJpaProject(this.createdFile.getProject());
- JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
-
- final PersistenceUnit pUnit = getPersistenceUnit();
-
- resource.modify(new Runnable() {
- public void run() {
- String filePath = getDataModel().getStringProperty(FILE_PATH);
- for (Iterator<MappingFileRef> stream = pUnit.specifiedMappingFileRefs(); stream.hasNext(); ) {
- if (filePath.equals(stream.next().getFileName())) {
- return;
- }
- }
- MappingFileRef mfRef = pUnit.addSpecifiedMappingFileRef();
- mfRef.setFileName(new Path(filePath).toPortableString());
- }
- });
- }
-
- @Override
- protected AbstractXmlResourceProvider getXmlResourceProvider(IFile file) {
- return OrmXmlResourceProvider.getXmlResourceProvider(file);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProperties.java
deleted file mode 100644
index 6d9c2578f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProperties.java
+++ /dev/null
@@ -1,17 +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.core.internal.operations;
-
-public interface PersistenceFileCreationDataModelProperties
- extends JpaFileCreationDataModelProperties
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProvider.java
deleted file mode 100644
index 9ff6f9c366..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationDataModelProvider.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.core.internal.operations;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.persistence.JPA;
-import org.eclipse.jpt.core.resource.persistence.v2_0.JPA2_0;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class PersistenceFileCreationDataModelProvider
- extends AbstractJpaFileCreationDataModelProvider
- implements PersistenceFileCreationDataModelProperties
-{
- /**
- * required default constructor
- */
- public PersistenceFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public IDataModelOperation getDefaultOperation() {
- return new PersistenceFileCreationOperation(getDataModel());
- }
-
- @Override
- protected String getDefaultFilePath() {
- return new Path(JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH).toPortableString();
- }
-
- @Override
- protected String getDefaultVersion() {
- if (getProject() == null) {
- return null;
- }
- return JptCorePlugin.getJpaPlatform(getProject()).getMostRecentSupportedResourceType(
- JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE).getVersion();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return (fileVersion.equals(JPA.SCHEMA_VERSION)
- || fileVersion.equals(JPA2_0.SCHEMA_VERSION));
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- if (jpaFacetVersion.equals(JptCorePlugin.JPA_FACET_VERSION_1_0)
- && fileVersion.equals(JPA2_0.SCHEMA_VERSION)) {
- return false;
- }
- return true;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationOperation.java
deleted file mode 100644
index e98e3316bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/operations/PersistenceFileCreationOperation.java
+++ /dev/null
@@ -1,31 +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.core.internal.operations;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.internal.resource.persistence.PersistenceXmlResourceProvider;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class PersistenceFileCreationOperation
- extends AbstractJpaFileCreationOperation
- implements PersistenceFileCreationDataModelProperties
-{
- public PersistenceFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- protected AbstractXmlResourceProvider getXmlResourceProvider(IFile file) {
- return PersistenceXmlResourceProvider.getXmlResourceProvider(file);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java
deleted file mode 100644
index fda01b3469..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/prefs/JpaPreferenceInitializer.java
+++ /dev/null
@@ -1,26 +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.core.internal.prefs;
-
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * Class used to initialize default preference values.
- * See <code>org.eclipse.core.runtime.preferences</code> extension point.
- */
-public class JpaPreferenceInitializer
- extends AbstractPreferenceInitializer
-{
- @Override
- public void initializeDefaultPreferences() {
- JptCorePlugin.initializeDefaultPreferences();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/contenttypes/IndeterminateContentDescriber.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/contenttypes/IndeterminateContentDescriber.java
deleted file mode 100644
index 79cd8932d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/contenttypes/IndeterminateContentDescriber.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.core.internal.resource.contenttypes;
-
-import java.io.InputStream;
-import java.io.Reader;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.core.runtime.content.IContentDescription;
-import org.eclipse.core.runtime.content.ITextContentDescriber;
-
-/**
- * This class simply returns INDETERMINATE for any contents it receives.
- *
- * It is used currently for org.eclipse.jpt.core.content.baseJpaContent in order
- * to make that content type act as an "abstract" content type.
- *
- * This is in its own package so that it can be excluded from bundle activation in the plugin.xml.
- * Content describers must be self-contained and not trigger auto-activation.
- */
-public class IndeterminateContentDescriber implements ITextContentDescriber
-{
- public int describe(InputStream contents, IContentDescription description) {
- return INDETERMINATE;
- }
-
- public int describe(Reader contents, IContentDescription description) {
- return INDETERMINATE;
- }
-
- public QualifiedName[] getSupportedOptions() {
- return new QualifiedName[0];
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.java
deleted file mode 100644
index f047f4d8ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AbstractJavaResourceNode.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.core.internal.resource.java;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.CallbackChangeSupport;
-import org.eclipse.jpt.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;
- }
-
-
- // ********** 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 CallbackChangeSupport(this, this.buildChangeSupportListener());
- }
-
- private CallbackChangeSupport.Listener buildChangeSupportListener() {
- return new CallbackChangeSupport.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.core.internal.resource.java.source.SourceCompilationUnit#getRoot()
- * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPackageFragmentRoot#getRoot()
- * @see org.eclipse.jpt.core.internal.resource.java.binary.BinaryPersistentTypeCache#getRoot()
- */
- public Root getRoot() {
- return this.parent.getRoot();
- }
-
- public IFile getFile() {
- return this.getRoot().getFile();
- }
-
-
- // ********** convenience methods **********
-
- protected JpaAnnotationProvider getAnnotationProvider() {
- return this.getRoot().getAnnotationProvider();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.java
deleted file mode 100644
index 9fc26e3348..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverrideAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryAssociationOverride1_0Annotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceAssociationOverride1_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public final class AssociationOverrideAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceAssociationOverride1_0Annotation.buildAssociationOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverride1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.java
deleted file mode 100644
index 2fd18af99f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AssociationOverridesAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryAssociationOverrides1_0Annotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceAssociationOverrides1_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public final class AssociationOverridesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AssociationOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AssociationOverridesAnnotationDefinition() {
- super();
- }
-
- public AssociationOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceAssociationOverrides1_0Annotation(parent, member);
- }
-
- public AssociationOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAssociationOverrides1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AssociationOverridesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.java
deleted file mode 100644
index 03b83f682e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverrideAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAttributeOverrideAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AttributeOverride
- */
-public final class AttributeOverrideAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AttributeOverrideAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AttributeOverrideAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceAttributeOverrideAnnotation.buildAttributeOverride(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAttributeOverrideAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.java
deleted file mode 100644
index 27c8986fcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/AttributeOverridesAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAttributeOverridesAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AttributeOverrides
- */
-public final class AttributeOverridesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new AttributeOverridesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private AttributeOverridesAnnotationDefinition() {
- super();
- }
-
- public AttributeOverridesAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceAttributeOverridesAnnotation(parent, member);
- }
-
- public AttributeOverridesAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryAttributeOverridesAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return AttributeOverridesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.java
deleted file mode 100644
index 989aa71ed0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/BasicAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryBasicAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceBasicAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Basic
- */
-public final class BasicAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new BasicAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private BasicAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceBasicAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullBasicAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryBasicAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return BasicAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.java
deleted file mode 100644
index 219c98745c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ColumnAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryColumnAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Column
- */
-public final class ColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceColumnAnnotation(parent, member, SourceColumnAnnotation.MAPPING_DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullColumnAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java
deleted file mode 100644
index 503bc038d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorColumnAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class DiscriminatorColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new DiscriminatorColumnAnnotationDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DiscriminatorColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryDiscriminatorColumnAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return DiscriminatorColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.java
deleted file mode 100644
index 449ccdadc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/DiscriminatorValueAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryDiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceDiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class DiscriminatorValueAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new DiscriminatorValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DiscriminatorValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullDiscriminatorValueAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryDiscriminatorValueAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return DiscriminatorValueAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.java
deleted file mode 100644
index fd7dbfa3c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddableAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryEmbeddableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class EmbeddableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceEmbeddableAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.java
deleted file mode 100644
index 1a3889fe3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryEmbeddedAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Embedded
- */
-public final class EmbeddedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEmbeddedAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.java
deleted file mode 100644
index 741375240d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EmbeddedIdAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryEmbeddedIdAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceEmbeddedIdAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class EmbeddedIdAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EmbeddedIdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmbeddedIdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEmbeddedIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EmbeddedIdAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.java
deleted file mode 100644
index 7c4f432ffe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EntityAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryEntityAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceEntityAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Entity
- */
-public final class EntityAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EntityAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EntityAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceEntityAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEntityAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EntityAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.java
deleted file mode 100644
index f5e9c49e1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/EnumeratedAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryEnumeratedAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceEnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class EnumeratedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EnumeratedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EnumeratedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEnumeratedAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEnumeratedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EnumeratedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.java
deleted file mode 100644
index 0b537e4757..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/GeneratedValueAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryGeneratedValueAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceGeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class GeneratedValueAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new GeneratedValueAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GeneratedValueAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryGeneratedValueAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return GeneratedValueAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.java
deleted file mode 100644
index 12ebf03b98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryIdAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceIdAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Id
- */
-public final class IdAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new IdAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private IdAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceIdAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryIdAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return IdAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.java
deleted file mode 100644
index 1f7bec270c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/IdClassAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryIdClassAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceIdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.IdClass
- */
-public final class IdClassAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new IdClassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private IdClassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceIdClassAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryIdClassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return IdClassAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.java
deleted file mode 100644
index 297ae12fa7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/InheritanceAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryInheritanceAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceInheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class InheritanceAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new InheritanceAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private InheritanceAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceInheritanceAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullInheritanceAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryInheritanceAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return InheritanceAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.java
deleted file mode 100644
index c2c248a86c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class JoinColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceJoinColumnAnnotation.createJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.java
deleted file mode 100644
index 1c00f40fde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinColumnsAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinColumnsAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.JoinColumns
- */
-public final class JoinColumnsAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinColumnsAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinColumnsAnnotationDefinition() {
- super();
- }
-
- public JoinColumnsAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceJoinColumnsAnnotation(parent, member);
- }
-
- public JoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinColumnsAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinColumnsAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.java
deleted file mode 100644
index a58445ec6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JoinTableAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryJoinTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceJoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.JoinTable
- */
-public final class JoinTableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new JoinTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private JoinTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceJoinTableAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullJoinTableAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryJoinTableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return JoinTableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.java
deleted file mode 100644
index fc4536f6c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/LobAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryLobAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceLobAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Lob
- */
-public final class LobAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new LobAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private LobAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceLobAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryLobAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return LobAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.java
deleted file mode 100644
index a10d93fec5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToManyAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryManyToManyAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceManyToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class ManyToManyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ManyToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceManyToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryManyToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ManyToManyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.java
deleted file mode 100644
index 140d7977b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/ManyToOneAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryManyToOneAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class ManyToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new ManyToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private ManyToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceManyToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryManyToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ManyToOneAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.java
deleted file mode 100644
index a104c7036d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MapKeyAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryMapKeyAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceMapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.MapKey
- */
-public final class MapKeyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MapKeyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MapKeyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMapKeyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMapKeyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MapKeyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.java
deleted file mode 100644
index c6452c9e68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/MappedSuperclassAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryMappedSuperclassAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceMappedSuperclassAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.MappedSuperclass
- */
-public final class MappedSuperclassAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new MappedSuperclassAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MappedSuperclassAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceMappedSuperclassAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryMappedSuperclassAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return MappedSuperclassAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.java
deleted file mode 100644
index 21d55cb918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueriesAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedNativeQueries
- */
-public final class NamedNativeQueriesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedNativeQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedNativeQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceNamedNativeQueriesAnnotation(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedNativeQueriesAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueriesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.java
deleted file mode 100644
index db6d640c07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedNativeQueryAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryNamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedNativeQuery
- */
-public final class NamedNativeQueryAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedNativeQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedNativeQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceNamedNativeQueryAnnotation.createNamedNativeQuery(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedNativeQueryAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.java
deleted file mode 100644
index ef71eec403..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueriesAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryNamedQueries1_0Annotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceNamedQueries1_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class NamedQueriesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQueriesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQueriesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceNamedQueries1_0Annotation(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQueries1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueriesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.java
deleted file mode 100644
index 9685560628..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NamedQueryAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinaryNamedQuery1_0Annotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQuery
- */
-public final class NamedQueryAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new NamedQueryAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NamedQueryAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceNamedQuery1_0Annotation(parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedQuery1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAnnotation.java
deleted file mode 100644
index f2036b030f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAnnotation.java
+++ /dev/null
@@ -1,77 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Simplify null annotation classes
- */
-public abstract class NullAnnotation
- 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 void newAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation() {
- 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 JavaResourcePersistentMember getMember() {
- return (JavaResourcePersistentMember) 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 Annotation addAnnotation() {
- return this.getMember().addAnnotation(this.getAnnotationName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java
deleted file mode 100644
index 85f0c6fe08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullAttributeOverrideColumnAnnotation.java
+++ /dev/null
@@ -1,33 +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.core.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-/**
- * javax.persistence.Column
- */
-public class NullAttributeOverrideColumnAnnotation
- extends NullColumnAnnotation
-{
- public NullAttributeOverrideColumnAnnotation(AttributeOverrideAnnotation parent) {
- super(parent);
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotation() {
- return (AttributeOverrideAnnotation) this.parent;
- }
-
- @Override
- protected ColumnAnnotation addAnnotation() {
- return this.getAttributeOverrideAnnotation().addColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumnAnnotation.java
deleted file mode 100644
index 477b7f8da0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseColumnAnnotation.java
+++ /dev/null
@@ -1,113 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- */
-public abstract class NullBaseColumnAnnotation
- extends NullNamedColumnAnnotation
- implements BaseColumnAnnotation
-{
- protected NullBaseColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- @Override
- protected BaseColumnAnnotation addAnnotation() {
- return (BaseColumnAnnotation) super.addAnnotation();
- }
-
- // ***** 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;
- }
-
- // ***** unique
- public Boolean getUnique() {
- return null;
- }
-
- public void setUnique(Boolean unique) {
- if (unique != null) {
- this.addAnnotation().setUnique(unique);
- }
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return null;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (updatable != null) {
- this.addAnnotation().setUpdatable(updatable);
- }
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return null;
- }
-
- public void setInsertable(Boolean insertable) {
- if (insertable != null) {
- this.addAnnotation().setInsertable(insertable);
- }
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** nullable
- public Boolean getNullable() {
- return null;
- }
-
- public void setNullable(Boolean nullable) {
- if (nullable != null) {
- this.addAnnotation().setNullable(nullable);
- }
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTableAnnotation.java
deleted file mode 100644
index 93160b0452..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBaseTableAnnotation.java
+++ /dev/null
@@ -1,127 +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.core.internal.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * javax.persistence.Table
- * javax.persistence.JoinTable
- */
-public abstract class NullBaseTableAnnotation
- extends NullAnnotation
- implements BaseTableAnnotation
-{
- protected NullBaseTableAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- @Override
- protected BaseTableAnnotation addAnnotation() {
- return (BaseTableAnnotation) super.addAnnotation();
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- // ***** 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;
- }
-
- // ***** schema
- public String getSchema() {
- return null;
- }
-
- public void setSchema(String schema) {
- if (schema != null) {
- this.addAnnotation().setSchema(schema);
- }
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** catalog
- public String getCatalog() {
- return null;
- }
-
- public void setCatalog(String catalog) {
- if (catalog != null) {
- this.addAnnotation().setCatalog(catalog);
- }
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return EmptyListIterator.instance();
- }
-
- public int uniqueConstraintsSize() {
- return 0;
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- throw new UnsupportedOperationException();
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- return this.addAnnotation().addUniqueConstraint(index);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasicAnnotation.java
deleted file mode 100644
index 0e16de1e07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullBasicAnnotation.java
+++ /dev/null
@@ -1,72 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * null javax.persistence.Basic
- */
-public final class NullBasicAnnotation
- extends NullAnnotation
- implements BasicAnnotation
-{
- protected NullBasicAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected BasicAnnotation addAnnotation() {
- return (BasicAnnotation) super.addAnnotation();
- }
-
-
- // ***** 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.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumnAnnotation.java
deleted file mode 100644
index 3bf5452a0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullColumnAnnotation.java
+++ /dev/null
@@ -1,82 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- */
-public class NullColumnAnnotation
- extends NullBaseColumnAnnotation
- implements ColumnAnnotation
-{
- public NullColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected ColumnAnnotation addAnnotation() {
- return (ColumnAnnotation) super.addAnnotation();
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- this.addAnnotation().setLength(length);
- }
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** scale
- public Integer getScale() {
- return null;
- }
-
- public void setScale(Integer scale) {
- if (scale != null) {
- this.addAnnotation().setScale(scale);
- }
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** precision
- public Integer getPrecision() {
- return null;
- }
-
- public void setPrecision(Integer precision) {
- if (precision != null) {
- this.addAnnotation().setPrecision(precision);
- }
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java
deleted file mode 100644
index 126ad60814..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class NullDiscriminatorColumnAnnotation
- extends NullNamedColumnAnnotation
- implements DiscriminatorColumnAnnotation
-{
- public NullDiscriminatorColumnAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected DiscriminatorColumnAnnotation addAnnotation() {
- return (DiscriminatorColumnAnnotation) super.addAnnotation();
- }
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (discriminatorType != null) {
- this.addAnnotation().setDiscriminatorType(discriminatorType);
- }
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- if (length != null) {
- this.addAnnotation().setLength(length);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValueAnnotation.java
deleted file mode 100644
index 7a68d3d2dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,53 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class NullDiscriminatorValueAnnotation
- extends NullAnnotation
- implements DiscriminatorValueAnnotation
-{
-
- protected NullDiscriminatorValueAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected DiscriminatorValueAnnotation addAnnotation() {
- return (DiscriminatorValueAnnotation) super.addAnnotation();
- }
-
- // ***** 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;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbeddedAnnotation.java
deleted file mode 100644
index 029d2a6ffd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEmbeddedAnnotation.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.core.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Embedded
- */
-public final class NullEmbeddedAnnotation
- extends NullAnnotation
- implements EmbeddedAnnotation
-{
- protected NullEmbeddedAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumeratedAnnotation.java
deleted file mode 100644
index 1e45dd51a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullEnumeratedAnnotation.java
+++ /dev/null
@@ -1,53 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class NullEnumeratedAnnotation
- extends NullAnnotation
- implements EnumeratedAnnotation
-{
- protected NullEnumeratedAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected EnumeratedAnnotation addAnnotation() {
- return (EnumeratedAnnotation) super.addAnnotation();
- }
-
- // ***** value
- public EnumType getValue() {
- return null;
- }
-
- public void setValue(EnumType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritanceAnnotation.java
deleted file mode 100644
index a4130b1b6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullInheritanceAnnotation.java
+++ /dev/null
@@ -1,53 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class NullInheritanceAnnotation
- extends NullAnnotation
- implements InheritanceAnnotation
-{
- protected NullInheritanceAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected InheritanceAnnotation addAnnotation() {
- return (InheritanceAnnotation) super.addAnnotation();
- }
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return null;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (strategy != null) {
- this.addAnnotation().setStrategy(strategy);
- }
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumnAnnotation.java
deleted file mode 100644
index 32c74fa036..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinColumnAnnotation.java
+++ /dev/null
@@ -1,54 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class NullJoinColumnAnnotation
- extends NullBaseColumnAnnotation
- implements JoinColumnAnnotation
-{
- public NullJoinColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected JoinColumnAnnotation addAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTableAnnotation.java
deleted file mode 100644
index 2f678c8f37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullJoinTableAnnotation.java
+++ /dev/null
@@ -1,99 +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.core.internal.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * javax.persistence.JoinTable
- */
-public class NullJoinTableAnnotation
- extends NullBaseTableAnnotation
- implements JoinTableAnnotation
-{
- public NullJoinTableAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected JoinTableAnnotation addAnnotation() {
- return (JoinTableAnnotation) super.addAnnotation();
- }
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int joinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return null;
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- // the JoinTable annotation is missing, add both it and a join column at the same time
- return this.addAnnotation().addJoinColumn(index);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return EmptyListIterator.instance();
- }
-
- public int inverseJoinColumnsSize() {
- return 0;
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return null;
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- throw new UnsupportedOperationException();
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- // the JoinTable annotation is missing, add both it and a join column at the same time
- return this.addAnnotation().addInverseJoinColumn(index);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumnAnnotation.java
deleted file mode 100644
index 0ae2b8cf38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullNamedColumnAnnotation.java
+++ /dev/null
@@ -1,74 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- * javax.persistence.DiscriminatorColumn
- * javax.persistence.PrimaryKeyJoinColumn.
- */
-public abstract class NullNamedColumnAnnotation
- extends NullAnnotation
- implements NamedColumnAnnotation
-{
- protected NullNamedColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- @Override
- protected NamedColumnAnnotation addAnnotation() {
- return (NamedColumnAnnotation) super.addAnnotation();
- }
-
- // ***** 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;
- }
-
- // ***** column definition
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (columnDefinition != null) {
- this.addAnnotation().setColumnDefinition(columnDefinition);
- }
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToManyAnnotation.java
deleted file mode 100644
index e8970e7665..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToManyAnnotation.java
+++ /dev/null
@@ -1,62 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class NullOneToManyAnnotation
- extends NullOwnableRelationshipMappingAnnotation
- implements OneToMany2_0Annotation
-{
- public NullOneToManyAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** JPA 2.0 - OrphanRemovable2_0 implementation **********
- public Boolean getOrphanRemoval() {
- return null;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (orphanRemoval != null) {
- this.addAnnotation().setOrphanRemoval(orphanRemoval);
- }
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- @Override
- protected OneToMany2_0Annotation addAnnotation() {
- return (OneToMany2_0Annotation) super.addAnnotation();
- }
-
- // ***** cascade detach - JPA 2.0
-
- public boolean isCascadeDetach() {
- return false;
- }
-
- public void setCascadeDetach(boolean detach) {
- this.addAnnotation().setCascadeDetach(detach);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOneAnnotation.java
deleted file mode 100644
index 2cd39e4298..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOneToOneAnnotation.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OneToOne
- */
-public final class NullOneToOneAnnotation
- extends NullOwnableRelationshipMappingAnnotation
- implements OneToOne2_0Annotation
-{
- public NullOneToOneAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected OneToOne2_0Annotation addAnnotation() {
- return (OneToOne2_0Annotation) super.addAnnotation();
- }
-
- // ***** 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;
- }
-
- // ********** JPA 2.0 - OrphanRemovable2_0 implementation **********
- public Boolean getOrphanRemoval() {
- return null;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (orphanRemoval != null) {
- this.addAnnotation().setOrphanRemoval(orphanRemoval);
- }
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** cascade detach - JPA 2.0
-
- public boolean isCascadeDetach() {
- return false;
- }
-
- public void setCascadeDetach(boolean detach) {
- this.addAnnotation().setCascadeDetach(detach);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOwnableRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOwnableRelationshipMappingAnnotation.java
deleted file mode 100644
index dd29a044d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullOwnableRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,156 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- */
-public abstract class NullOwnableRelationshipMappingAnnotation
- extends NullAnnotation
- implements OwnableRelationshipMappingAnnotation
-{
- protected NullOwnableRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
-
- @Override
- protected OwnableRelationshipMappingAnnotation addAnnotation() {
- return (OwnableRelationshipMappingAnnotation) super.addAnnotation();
- }
-
-
- // ***** target entity
-
- public String getTargetEntity() {
- return null;
- }
-
- public void setTargetEntity(String targetEntity) {
- if (targetEntity != null) {
- this.addAnnotation().setTargetEntity(targetEntity);
- }
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ***** fully-qualified target entity class name
-
- public String getFullyQualifiedTargetEntityClassName() {
- return null;
- }
-
-
- // ***** mapped by
-
- public String getMappedBy() {
- return null;
- }
-
- public void setMappedBy(String mappedBy) {
- if (mappedBy != null) {
- this.addAnnotation().setMappedBy(mappedBy);
- }
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-
- // ***** 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;
- }
-
-
- // ***** cascade all
-
- public boolean isCascadeAll() {
- return false;
- }
-
- public void setCascadeAll(boolean all) {
- this.addAnnotation().setCascadeAll(all);
- }
-
-
- // ***** cascade merge
-
- public boolean isCascadeMerge() {
- return false;
- }
-
- public void setCascadeMerge(boolean merge) {
- this.addAnnotation().setCascadeMerge(merge);
- }
-
-
- // ***** cascade persist
-
- public boolean isCascadePersist() {
- return false;
- }
-
- public void setCascadePersist(boolean persist) {
- this.addAnnotation().setCascadePersist(persist);
- }
-
-
- // ***** cascade refresh
-
- public boolean isCascadeRefresh() {
- return false;
- }
-
- public void setCascadeRefresh(boolean refresh) {
- this.addAnnotation().setCascadeRefresh(refresh);
- }
-
-
- // ***** cascade remove
-
- public boolean isCascadeRemove() {
- return false;
- }
-
- public void setCascadeRemove(boolean remove) {
- this.addAnnotation().setCascadeRemove(remove);
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index a2ff594c03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullPrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,55 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class NullPrimaryKeyJoinColumnAnnotation
- extends NullNamedColumnAnnotation
- implements PrimaryKeyJoinColumnAnnotation
-{
- public NullPrimaryKeyJoinColumnAnnotation(JavaResourceNode parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected NamedColumnAnnotation addAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return null;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return false;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTableAnnotation.java
deleted file mode 100644
index 7e829e2fe5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTableAnnotation.java
+++ /dev/null
@@ -1,35 +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.core.internal.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-/**
- * javax.persistence.Table
- */
-public final class NullTableAnnotation
- extends NullBaseTableAnnotation
- implements TableAnnotation
-{
- protected NullTableAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- @Override
- protected TableAnnotation addAnnotation() {
- return (TableAnnotation) super.addAnnotation();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporalAnnotation.java
deleted file mode 100644
index ec38b00a84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/NullTemporalAnnotation.java
+++ /dev/null
@@ -1,56 +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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Temporal
- */
-public final class NullTemporalAnnotation
- extends NullAnnotation
- implements TemporalAnnotation
-{
- protected NullTemporalAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected TemporalAnnotation addAnnotation() {
- return (TemporalAnnotation) super.addAnnotation();
- }
-
-
- // ********** TemporalAnnotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return null;
- }
-
- public void setValue(TemporalType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.java
deleted file mode 100644
index 0c9833eefd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToManyAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOneToManyAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceOneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class OneToManyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OneToManyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToManyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceOneToManyAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullOneToManyAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryOneToManyAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OneToManyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.java
deleted file mode 100644
index 6b600ca1f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OneToOneAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOneToOneAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceOneToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.OneToOne
- */
-public final class OneToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullOneToOneAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryOneToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OneToOneAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.java
deleted file mode 100644
index 59997519a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/OrderByAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryOrderByAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceOrderByAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class OrderByAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new OrderByAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private OrderByAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceOrderByAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryOrderByAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return OrderByAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.java
deleted file mode 100644
index 77499381c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class PrimaryKeyJoinColumnAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimaryKeyJoinColumnAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourcePrimaryKeyJoinColumnAnnotation.createPrimaryKeyJoinColumn(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryPrimaryKeyJoinColumnAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.java
deleted file mode 100644
index 0c67aba310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/PrimaryKeyJoinColumnsAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryPrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourcePrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumns
- */
-public final class PrimaryKeyJoinColumnsAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new PrimaryKeyJoinColumnsAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PrimaryKeyJoinColumnsAnnotationDefinition() {
- super();
- }
-
- public PrimaryKeyJoinColumnsAnnotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourcePrimaryKeyJoinColumnsAnnotation(parent, member);
- }
-
- public PrimaryKeyJoinColumnsAnnotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryPrimaryKeyJoinColumnsAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.java
deleted file mode 100644
index cca983ff52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTableAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinarySecondaryTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceSecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SecondaryTable
- */
-public final class SecondaryTableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SecondaryTableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SecondaryTableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return SourceSecondaryTableAnnotation.createSecondaryTable(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinarySecondaryTableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.java
deleted file mode 100644
index 037c96894c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SecondaryTablesAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinarySecondaryTablesAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceSecondaryTablesAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SecondaryTables
- */
-public final class SecondaryTablesAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SecondaryTablesAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SecondaryTablesAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceSecondaryTablesAnnotation((JavaResourcePersistentType) parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinarySecondaryTablesAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SecondaryTablesAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.java
deleted file mode 100644
index 884b36bb1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/SequenceGeneratorAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.binary.BinarySequenceGenerator1_0Annotation;
-import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceSequenceGenerator1_0Annotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public final class SequenceGeneratorAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new SequenceGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- protected SequenceGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceSequenceGenerator1_0Annotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinarySequenceGenerator1_0Annotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return SequenceGeneratorAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.java
deleted file mode 100644
index eb4880ad97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTableAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceTableAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Table
- */
-public final class TableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceTableAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullTableAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryTableAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.java
deleted file mode 100644
index 428e818d4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TableGeneratorAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTableGeneratorAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceTableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class TableGeneratorAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TableGeneratorAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TableGeneratorAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceTableGeneratorAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryTableGeneratorAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TableGeneratorAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.java
deleted file mode 100644
index a1661263c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TemporalAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTemporalAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceTemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Temporal
- */
-public final class TemporalAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TemporalAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TemporalAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceTemporalAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullTemporalAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryTemporalAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TemporalAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.java
deleted file mode 100644
index 4d84704c0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/TransientAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryTransientAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceTransientAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Transient
- */
-public final class TransientAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new TransientAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private TransientAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceTransientAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryTransientAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return TransientAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.java
deleted file mode 100644
index 3b11cce142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/VersionAnnotationDefinition.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.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryVersionAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceVersionAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Version
- */
-public final class VersionAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new VersionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private VersionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member) {
- return new SourceVersionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryVersionAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return VersionAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotation.java
deleted file mode 100644
index db134fd8b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAnnotation.java
+++ /dev/null
@@ -1,97 +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.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.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- * 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) {
- JptCorePlugin.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();
- }
-
- // ********** NestableAnnotation implementation **********
- public void moveAnnotation(@SuppressWarnings("unused") int index) {
- throw new UnsupportedOperationException();
- }
- public void initializeFrom(@SuppressWarnings("unused") NestableAnnotation oldAnnotation) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java
deleted file mode 100644
index 439b0442b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,101 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public abstract class BinaryAssociationOverrideAnnotation
- extends BinaryOverrideAnnotation
- implements NestableAssociationOverrideAnnotation
-{
- private final Vector<JoinColumnAnnotation> joinColumns;
-
-
- protected BinaryAssociationOverrideAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- }
-
-
- // ********** BinaryOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ASSOCIATION_OVERRIDE__NAME;
- }
-
-
- // ********** AssociationOverrideAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java
deleted file mode 100644
index f4894e174d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,70 +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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public abstract class BinaryAssociationOverridesAnnotation
- extends BinaryContainerAnnotation<NestableAssociationOverrideAnnotation>
- implements AssociationOverridesAnnotation
-{
- private final Vector<NestableAssociationOverrideAnnotation> associationOverrides;
-
-
- protected BinaryAssociationOverridesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.associationOverrides = this.buildAssociationOverrides();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableAssociationOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAssociationOverrideAnnotation>(this.associationOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- private Vector<NestableAssociationOverrideAnnotation> buildAssociationOverrides() {
- Object[] jdtAssociationOverrides = this.getJdtMemberValues(JPA.ASSOCIATION_OVERRIDES__VALUE);
- Vector<NestableAssociationOverrideAnnotation> result = new Vector<NestableAssociationOverrideAnnotation>(jdtAssociationOverrides.length);
- for (Object jdtAssociationOverride : jdtAssociationOverrides) {
- result.add(buildAssociationOverride(jdtAssociationOverride));
- }
- return result;
- }
-
- protected abstract NestableAssociationOverrideAnnotation buildAssociationOverride(Object jdtAssociationOverride);
-
- @Override
- public void update() {
- super.update();
- this.updateAssociationOverrides();
- }
-
- // TODO
- private void updateAssociationOverrides() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java
deleted file mode 100644
index 37add8b4d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,106 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverrideColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverrideAnnotation;
-
-/**
- * javax.persistence.AttributeOverride
- */
-public final class BinaryAttributeOverrideAnnotation
- extends BinaryOverrideAnnotation
- implements NestableAttributeOverrideAnnotation
-{
- private ColumnAnnotation column;
-
-
- public BinaryAttributeOverrideAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.column = this.buildColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumn();
- }
-
-
- //************ BinaryOverrideAnnotation implementation ****************
-
- @Override
- protected String getNameElementName() {
- return JPA.ATTRIBUTE_OVERRIDE__NAME;
- }
-
-
- //************ AttributeOverride implementation ****************
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : new NullAttributeOverrideColumnAnnotation(this);
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- private ColumnAnnotation buildColumn() {
- IAnnotation jdtColumn = this.getJdtColumn();
- return (jdtColumn == null) ? null : this.buildColumn(jdtColumn);
- }
-
- private ColumnAnnotation buildColumn(IAnnotation jdtColumn) {
- return new BinaryColumnAnnotation(this, jdtColumn);
- }
-
- private IAnnotation getJdtColumn() {
- return (IAnnotation) this.getJdtMemberValue(JPA.ATTRIBUTE_OVERRIDE__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.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.java
deleted file mode 100644
index 1cecad35c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryAttributeOverridesAnnotation.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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverrideAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.AttributeOverrides
- */
-public final class BinaryAttributeOverridesAnnotation
- extends BinaryContainerAnnotation<NestableAttributeOverrideAnnotation>
- implements AttributeOverridesAnnotation
-{
- private final Vector<NestableAttributeOverrideAnnotation> attributeOverrides;
-
-
- public BinaryAttributeOverridesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.attributeOverrides = this.buildAttributeOverrides();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableAttributeOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAttributeOverrideAnnotation>(this.attributeOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.attributeOverrides.size();
- }
-
- private Vector<NestableAttributeOverrideAnnotation> buildAttributeOverrides() {
- Object[] jdtAttributeOverrides = this.getJdtMemberValues(JPA.ATTRIBUTE_OVERRIDES__VALUE);
- Vector<NestableAttributeOverrideAnnotation> result = new Vector<NestableAttributeOverrideAnnotation>(jdtAttributeOverrides.length);
- for (Object jdtAttributeOverride : jdtAttributeOverrides) {
- result.add(new BinaryAttributeOverrideAnnotation(this, (IAnnotation) jdtAttributeOverride));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateAttributeOverrides();
- }
-
- // TODO
- private void updateAttributeOverrides() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java
deleted file mode 100644
index 2eb6eff7ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseColumnAnnotation.java
+++ /dev/null
@@ -1,184 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- */
-public abstract class BinaryBaseColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements BaseColumnAnnotation
-{
- private String table;
- private Boolean unique;
- private Boolean nullable;
- private Boolean insertable;
- private Boolean updatable;
-
-
- protected BinaryBaseColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.table = this.buildTable();
- this.unique = this.buildUnique();
- this.nullable = this.buildNullable();
- this.insertable = this.buildInsertable();
- this.updatable = this.buildUpdatable();
- }
-
- @Override
- public void update() {
- super.update();
- this.setTable_(this.buildTable());
- this.setUnique_(this.buildUnique());
- this.setNullable_(this.buildNullable());
- this.setInsertable_(this.buildInsertable());
- this.setUpdatable_(this.buildUpdatable());
- }
-
-
- //************* BaseColumnAnnotation implementation *************
-
- // ***** 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(this.getTableElementName());
- }
-
- protected abstract String getTableElementName();
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean unique) {
- throw new UnsupportedOperationException();
- }
-
- private void setUnique_(Boolean unique) {
- Boolean old = this.unique;
- this.unique = unique;
- this.firePropertyChanged(UNIQUE_PROPERTY, old, unique);
- }
-
- private Boolean buildUnique() {
- return (Boolean) this.getJdtMemberValue(this.getUniqueElementName());
- }
-
- protected abstract String getUniqueElementName();
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- throw new UnsupportedOperationException();
- }
-
- private void setNullable_(Boolean nullable) {
- Boolean old = this.nullable;
- this.nullable = nullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, nullable);
- }
-
- private Boolean buildNullable() {
- return (Boolean) this.getJdtMemberValue(this.getNullableElementName());
- }
-
- protected abstract String getNullableElementName();
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- throw new UnsupportedOperationException();
- }
-
- private void setInsertable_(Boolean insertable) {
- Boolean old = this.insertable;
- this.insertable = insertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, insertable);
- }
-
- private Boolean buildInsertable() {
- return (Boolean) this.getJdtMemberValue(this.getInsertableElementName());
- }
-
- protected abstract String getInsertableElementName();
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- throw new UnsupportedOperationException();
- }
-
- private void setUpdatable_(Boolean updatable) {
- Boolean old = this.updatable;
- this.updatable = updatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, updatable);
- }
-
- private Boolean buildUpdatable() {
- return (Boolean) this.getJdtMemberValue(this.getUpdatableElementName());
- }
-
- protected abstract String getUpdatableElementName();
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.java
deleted file mode 100644
index caa19cc127..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseEnumeratedAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Enumerated
- */
-public abstract class BinaryBaseEnumeratedAnnotation
- extends BinaryAnnotation
- implements EnumeratedAnnotation
-{
- private EnumType value;
-
-
- protected BinaryBaseEnumeratedAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** EnumeratedAnnotation implementation **********
-
- // ***** value
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(EnumType value) {
- EnumType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private EnumType buildValue() {
- return EnumType.fromJavaAnnotationValue(this.getJdtMemberValue(this.getValueElementName()));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java
deleted file mode 100644
index 281ae2e77b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseJoinColumnAnnotation.java
+++ /dev/null
@@ -1,73 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.JoinColumn
- * javax.persistence.MapKeyJoinColumn
- */
-public abstract class BinaryBaseJoinColumnAnnotation
- extends BinaryBaseColumnAnnotation
- implements BaseJoinColumnAnnotation
-{
- private String referencedColumnName;
-
-
- public BinaryBaseJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.referencedColumnName = this.buildReferencedColumnName();
- }
-
- @Override
- public void update() {
- super.update();
- this.setReferencedColumnName_(this.buildReferencedColumnName());
- }
-
- protected abstract String getReferencedColumnNameElementName();
-
-
- //************ BaseJoinColumnAnnotation implementation ***************
-
- // referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setReferencedColumnName_(String referencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, referencedColumnName);
- }
-
- private String buildReferencedColumnName() {
- return (String) this.getJdtMemberValue(JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseNamedQueryAnnotation.java
deleted file mode 100644
index cb7745ef78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseNamedQueryAnnotation.java
+++ /dev/null
@@ -1,154 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseNamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.NamedQuery
- * javax.persistence.NamedNativeQuery
- */
-abstract class BinaryBaseNamedQueryAnnotation
- extends BinaryAnnotation
- implements BaseNamedQueryAnnotation
-{
- String name;
- String query;
- final Vector<QueryHintAnnotation> hints;
-
-
- BinaryBaseNamedQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.query = this.buildQuery();
- this.hints = this.buildHints();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setQuery_(this.buildQuery());
- this.updateHints();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseNamedQueryAnnotation 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());
- }
-
- abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** query
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String query) {
- throw new UnsupportedOperationException();
- }
-
- private void setQuery_(String query) {
- String old = this.query;
- this.query = query;
- this.firePropertyChanged(QUERY_PROPERTY, old, query);
- }
-
- private String buildQuery() {
- return (String) this.getJdtMemberValue(this.getQueryElementName());
- }
-
- abstract String getQueryElementName();
-
- public TextRange getQueryTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** hints
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public QueryHintAnnotation hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation queryHint) {
- return this.hints.indexOf(queryHint);
- }
-
- public QueryHintAnnotation addHint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeHint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<QueryHintAnnotation> buildHints() {
- Object[] jdtHints = this.getJdtMemberValues(this.getHintsElementName());
- Vector<QueryHintAnnotation> result = new Vector<QueryHintAnnotation>(jdtHints.length);
- for (Object jdtHint : jdtHints) {
- result.add(new BinaryQueryHintAnnotation(this, (IAnnotation) jdtHint));
- }
- return result;
- }
-
- abstract String getHintsElementName();
-
- // TODO
- private void updateHints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java
deleted file mode 100644
index 490d800f7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTableAnnotation.java
+++ /dev/null
@@ -1,199 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.Table
- * javax.persistence.JoinTable
- * javax.persistence.SecondaryTable
- */
-public abstract class BinaryBaseTableAnnotation
- extends BinaryAnnotation
- implements BaseTableAnnotation
-{
- String name;
- String schema;
- String catalog;
- final Vector<UniqueConstraintAnnotation> uniqueConstraints;
-
-
- protected BinaryBaseTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.schema = this.buildSchema();
- this.catalog = this.buildCatalog();
- this.uniqueConstraints = this.buildUniqueConstraints();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setSchema_(this.buildSchema());
- this.setCatalog_(this.buildCatalog());
- this.updateUniqueConstraints();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseTableAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** 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());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- private void setSchema_(String schema) {
- String old = this.schema;
- this.schema = schema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, schema);
- }
-
- private String buildSchema() {
- return (String) this.getJdtMemberValue(this.getSchemaElementName());
- }
-
- protected abstract String getSchemaElementName();
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- private void setCatalog_(String catalog) {
- String old = this.catalog;
- this.catalog = catalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, catalog);
- }
-
- private String buildCatalog() {
- return (String) this.getJdtMemberValue(this.getCatalogElementName());
- }
-
- protected abstract String getCatalogElementName();
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<UniqueConstraintAnnotation> buildUniqueConstraints() {
- Object[] jdtUniqueConstraints = this.getJdtMemberValues(this.getUniqueConstraintElementName());
- Vector<UniqueConstraintAnnotation> result = new Vector<UniqueConstraintAnnotation>(jdtUniqueConstraints.length);
- for (Object jdtUniqueConstraint : jdtUniqueConstraints) {
- result.add(new BinaryUniqueConstraintAnnotation(this, (IAnnotation) jdtUniqueConstraint));
- }
- return result;
- }
-
- protected abstract String getUniqueConstraintElementName();
-
- // TODO
- private void updateUniqueConstraints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.java
deleted file mode 100644
index cc57a8ca3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBaseTemporalAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Temporal
- * javax.persistence.MapKeyTemporal
- */
-public abstract class BinaryBaseTemporalAnnotation
- extends BinaryAnnotation
- implements TemporalAnnotation
-{
- private TemporalType value;
-
-
- protected BinaryBaseTemporalAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** TemporalAnnotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(TemporalType value) {
- TemporalType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private TemporalType buildValue() {
- return TemporalType.fromJavaAnnotationValue(this.getJdtMemberValue(getValueElementName()));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getValueElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBasicAnnotation.java
deleted file mode 100644
index 9db25330ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryBasicAnnotation.java
+++ /dev/null
@@ -1,97 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Basic
- */
-public final class BinaryBasicAnnotation
- extends BinaryAnnotation
- implements BasicAnnotation
-{
- private Boolean optional;
- private FetchType fetch;
-
-
- public BinaryBasicAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- this.fetch = this.buildFetch();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- this.setFetch_(this.buildFetch());
- }
-
-
- //*************** Basic implementation ****************
-
- // ***** 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(JPA.BASIC__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** 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(JPA.BASIC__FETCH));
- }
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryClassFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryClassFile.java
deleted file mode 100644
index 037eda1ea4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryClassFile.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * binary class file
- */
-final class BinaryClassFile
- extends BinaryNode
- implements JavaResourceClassFile
-{
- /** JDT class file */
- private final IClassFile classFile;
-
- /** class file's persistent type */
- private final JavaResourcePersistentType persistentType;
-
-
- // ********** construction/initialization **********
-
- /**
- * The JDT type gets passed in because the package fragment inspects it
- * beforehand to determine whether it is "persistable". (We only build
- * class files for "persistable" types.)
- */
- BinaryClassFile(JavaResourcePackageFragment parent, IClassFile classFile, IType jdtType) {
- super(parent);
- this.classFile = classFile;
- this.persistentType = this.buildPersistentType(jdtType);
- }
-
- private JavaResourcePersistentType buildPersistentType(IType jdtType) {
- return new BinaryPersistentType(this, jdtType);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.classFile.getElementName());
- }
-
-
- // ********** JavaResourceClassFile implementation **********
-
- public JavaResourcePersistentType getPersistentType() {
- return this.persistentType;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
-// this.persistentType.update(this.classFile.getType());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryColumnAnnotation.java
deleted file mode 100644
index 89b17e7a43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryColumnAnnotation.java
+++ /dev/null
@@ -1,90 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * javax.persistence.Column
- */
-public final class BinaryColumnAnnotation
- extends BinaryCompleteColumnAnnotation
-{
-
- public BinaryColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- @Override
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA.COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA.COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA.COLUMN__SCALE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java
deleted file mode 100644
index bda54d8eeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryCompleteColumnAnnotation.java
+++ /dev/null
@@ -1,128 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Abstract implementation of ColumnAnnotation to be used for JPA annotations:
- * javax.persistence.Column
- * javax.persistence.MapKeyColumn
- */
-public abstract class BinaryCompleteColumnAnnotation
- extends BinaryBaseColumnAnnotation
- implements ColumnAnnotation
-{
- protected Integer length;
- protected Integer precision;
- protected Integer scale;
-
-
- protected BinaryCompleteColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.length = this.buildLength();
- this.precision = this.buildPrecision();
- this.scale = this.buildScale();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setLength_(this.buildLength());
- this.setPrecision_(this.buildPrecision());
- this.setScale_(this.buildScale());
- }
-
-
- // ********** ColumnAnnotation implementation **********
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- throw new UnsupportedOperationException();
- }
-
- private void setLength_(Integer length) {
- Integer old = this.length;
- this.length = length;
- this.firePropertyChanged(LENGTH_PROPERTY, old, length);
- }
-
- private Integer buildLength() {
- return (Integer) this.getJdtMemberValue(this.getLengthElementName());
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getLengthElementName();
-
- // ***** precision
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer precision) {
- throw new UnsupportedOperationException();
- }
-
- private void setPrecision_(Integer precision) {
- Integer old = this.precision;
- this.precision = precision;
- this.firePropertyChanged(PRECISION_PROPERTY, old, precision);
- }
-
- private Integer buildPrecision() {
- return (Integer) this.getJdtMemberValue(this.getPrecisionElementName());
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getPrecisionElementName();
-
- // ***** scale
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer scale) {
- throw new UnsupportedOperationException();
- }
-
- private void setScale_(Integer scale) {
- Integer old = this.scale;
- this.scale = scale;
- this.firePropertyChanged(SCALE_PROPERTY, old, scale);
- }
-
- private Integer buildScale() {
- return (Integer) this.getJdtMemberValue(this.getScaleElementName());
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- protected abstract String getScaleElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryContainerAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryContainerAnnotation.java
deleted file mode 100644
index b667810c42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryContainerAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- * JAR annotations do not support most of the container annotation protocol.
- */
-public abstract class BinaryContainerAnnotation<T extends NestableAnnotation>
- extends BinaryAnnotation
- implements ContainerAnnotation<T>
-{
-
- protected BinaryContainerAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getElementName() {
- throw new UnsupportedOperationException();
- }
-
- public String getNestedAnnotationName() {
- throw new UnsupportedOperationException();
- }
-
- public T addNestedAnnotation() {
- throw new UnsupportedOperationException();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- throw new UnsupportedOperationException();
- }
-
- public T moveNestedAnnotation(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public T removeNestedAnnotation(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java
deleted file mode 100644
index ea3b6ce596..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,100 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class BinaryDiscriminatorColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements DiscriminatorColumnAnnotation
-{
- private DiscriminatorType discriminatorType;
- private Integer length;
-
-
- public BinaryDiscriminatorColumnAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.discriminatorType = this.buildDiscriminatorType();
- this.length = this.buildLength();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDiscriminatorType_(this.buildDiscriminatorType());
- this.setLength_(this.buildLength());
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** DiscriminatorColumnAnnotation implementation **********
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return null;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- throw new UnsupportedOperationException();
- }
-
- private void setDiscriminatorType_(DiscriminatorType discriminatorType) {
- DiscriminatorType old = this.discriminatorType;
- this.discriminatorType = discriminatorType;
- this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType);
- }
-
- private DiscriminatorType buildDiscriminatorType() {
- return DiscriminatorType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE));
- }
-
- // ***** length
- public Integer getLength() {
- return null;
- }
-
- public void setLength(Integer length) {
- throw new UnsupportedOperationException();
- }
-
- private void setLength_(Integer length) {
- Integer old = this.length;
- this.length = length;
- this.firePropertyChanged(LENGTH_PROPERTY, old, length);
- }
-
- private Integer buildLength() {
- return (Integer) this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.java
deleted file mode 100644
index 287574f758..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryDiscriminatorValueAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class BinaryDiscriminatorValueAnnotation
- extends BinaryAnnotation
- implements DiscriminatorValueAnnotation
-{
- private String value;
-
-
- public BinaryDiscriminatorValueAnnotation(JavaResourcePersistentType 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());
- }
-
-
- // ********** DiscriminatorValueAnnotation 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(JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java
deleted file mode 100644
index 91db09f2a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddableAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class BinaryEmbeddableAnnotation
- extends BinaryAnnotation
- implements EmbeddableAnnotation
-{
-
- public BinaryEmbeddableAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java
deleted file mode 100644
index 2fd143485d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Embedded
- */
-public final class BinaryEmbeddedAnnotation
- extends BinaryAnnotation
- implements EmbeddedAnnotation
-{
-
- public BinaryEmbeddedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java
deleted file mode 100644
index 604f5be572..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class BinaryEmbeddedIdAnnotation
- extends BinaryAnnotation
- implements EmbeddedIdAnnotation
-{
-
- public BinaryEmbeddedIdAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEntityAnnotation.java
deleted file mode 100644
index bd4acb47b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEntityAnnotation.java
+++ /dev/null
@@ -1,75 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Entity
- */
-public final class BinaryEntityAnnotation
- extends BinaryAnnotation
- implements EntityAnnotation
-{
- private String name;
-
-
- public BinaryEntityAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** EntityAnnotation 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(JPA.ENTITY__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.java
deleted file mode 100644
index 08ffef0291..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryEnumeratedAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class BinaryEnumeratedAnnotation
- extends BinaryBaseEnumeratedAnnotation
- implements EnumeratedAnnotation
-{
-
- public BinaryEnumeratedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java
deleted file mode 100644
index 7ee085f303..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratedValueAnnotation.java
+++ /dev/null
@@ -1,101 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.GenerationType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class BinaryGeneratedValueAnnotation
- extends BinaryAnnotation
- implements GeneratedValueAnnotation
-{
- private GenerationType strategy;
- private String generator;
-
-
- public BinaryGeneratedValueAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.strategy = this.buildStrategy();
- this.generator = this.buildGenerator();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setStrategy_(this.buildStrategy());
- this.setGenerator_(this.buildGenerator());
- }
-
-
- // ********** GeneratedValueAnnotation implementation **********
-
- // ***** strategy
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType strategy) {
- throw new UnsupportedOperationException();
- }
-
- private void setStrategy_(GenerationType strategy) {
- GenerationType old = this.strategy;
- this.strategy = strategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, strategy);
- }
-
- private GenerationType buildStrategy() {
- return GenerationType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.GENERATED_VALUE__STRATEGY));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** generator
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String generator) {
- throw new UnsupportedOperationException();
- }
-
- private void setGenerator_(String generator) {
- String old = this.generator;
- this.generator = generator;
- this.firePropertyChanged(GENERATOR_PROPERTY, old, generator);
- }
-
- private String buildGenerator() {
- return (String) this.getJdtMemberValue(JPA.GENERATED_VALUE__GENERATOR);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean generatorTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java
deleted file mode 100644
index d89cff9ec8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryGeneratorAnnotation.java
+++ /dev/null
@@ -1,129 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.SequenceGenerator
- * javax.persistence.TableGenerator
- */
-abstract class BinaryGeneratorAnnotation
- extends BinaryAnnotation
- implements GeneratorAnnotation
-{
- String name;
- Integer initialValue;
- Integer allocationSize;
-
-
- BinaryGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.initialValue = this.buildInitialValue();
- this.allocationSize = this.buildAllocationSize();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setInitialValue_(this.buildInitialValue());
- this.setAllocationSize_(this.buildAllocationSize());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** GeneratorAnnotation 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());
- }
-
- abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** initial value
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer initialValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setInitialValue_(Integer initialValue) {
- Integer old = this.initialValue;
- this.initialValue = initialValue;
- this.firePropertyChanged(INITIAL_VALUE_PROPERTY, old, initialValue);
- }
-
- private Integer buildInitialValue() {
- return (Integer) this.getJdtMemberValue(this.getInitialValueElementName());
- }
-
- abstract String getInitialValueElementName();
-
- public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** name
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer allocationSize) {
- throw new UnsupportedOperationException();
- }
-
- private void setAllocationSize_(Integer allocationSize) {
- Integer old = this.allocationSize;
- this.allocationSize = allocationSize;
- this.firePropertyChanged(NAME_PROPERTY, old, allocationSize);
- }
-
- private Integer buildAllocationSize() {
- return (Integer) this.getJdtMemberValue(this.getAllocationSizeElementName());
- }
-
- abstract String getAllocationSizeElementName();
-
- public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdAnnotation.java
deleted file mode 100644
index 95946b447e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * javax.persistence.Id
- */
-public final class BinaryIdAnnotation
- extends BinaryAnnotation
- implements IdAnnotation
-{
-
- public BinaryIdAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdClassAnnotation.java
deleted file mode 100644
index 95b56dea9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryIdClassAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.IdClass
- */
-public final class BinaryIdClassAnnotation
- extends BinaryAnnotation
- implements IdClassAnnotation
-{
- private String value;
-
-
- public BinaryIdClassAnnotation(JavaResourcePersistentType 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());
- }
-
-
- // ********** IdClassAnnotation 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_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.ID_CLASS__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.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryInheritanceAnnotation.java
deleted file mode 100644
index 81711643ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryInheritanceAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class BinaryInheritanceAnnotation
- extends BinaryAnnotation
- implements InheritanceAnnotation
-{
- private InheritanceType strategy;
-
-
- public BinaryInheritanceAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.strategy = this.buildStrategy();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setStrategy_(this.buildStrategy());
- }
-
-
- // ********** InheritanceAnnotation implementation **********
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType strategy) {
- throw new UnsupportedOperationException();
- }
-
- private void setStrategy_(InheritanceType strategy) {
- InheritanceType old = this.strategy;
- this.strategy = strategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, strategy);
- }
-
- private InheritanceType buildStrategy() {
- return InheritanceType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.INHERITANCE__STRATEGY));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java
deleted file mode 100644
index f78bbe483e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnAnnotation.java
+++ /dev/null
@@ -1,82 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class BinaryJoinColumnAnnotation
- extends BinaryBaseJoinColumnAnnotation
- implements NestableJoinColumnAnnotation
-{
-
- public BinaryJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** BinaryBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** BinaryBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.java
deleted file mode 100644
index 28a12e517d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinColumnsAnnotation.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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.JoinColumns
- */
-public final class BinaryJoinColumnsAnnotation
- extends BinaryContainerAnnotation<NestableJoinColumnAnnotation>
- implements JoinColumnsAnnotation
-{
- private final Vector<NestableJoinColumnAnnotation> joinColumns;
-
-
- public BinaryJoinColumnsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- private Vector<NestableJoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_COLUMNS__VALUE);
- Vector<NestableJoinColumnAnnotation> result = new Vector<NestableJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java
deleted file mode 100644
index 12957724d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryJoinTableAnnotation.java
+++ /dev/null
@@ -1,163 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.JoinTable
- */
-public final class BinaryJoinTableAnnotation
- extends BinaryBaseTableAnnotation
- implements JoinTableAnnotation
-{
- private final Vector<JoinColumnAnnotation> joinColumns;
- private final Vector<JoinColumnAnnotation> inverseJoinColumns;
-
-
- public BinaryJoinTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.joinColumns = this.buildJoinColumns();
- this.inverseJoinColumns = this.buildInverseJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateJoinColumns();
- this.updateInverseJoinColumns();
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.JOIN_TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.JOIN_TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ********** JoinTableAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public JoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_TABLE__JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public JoinColumnAnnotation inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- public JoinColumnAnnotation addInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeInverseJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<JoinColumnAnnotation> buildInverseJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS);
- Vector<JoinColumnAnnotation> result = new Vector<JoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updateInverseJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryLobAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryLobAnnotation.java
deleted file mode 100644
index 0936195b51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryLobAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-
-/**
- * javax.persistence.Lob
- */
-public final class BinaryLobAnnotation
- extends BinaryAnnotation
- implements LobAnnotation
-{
- public BinaryLobAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java
deleted file mode 100644
index 42593c2c95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToManyAnnotation.java
+++ /dev/null
@@ -1,92 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class BinaryManyToManyAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements ManyToMany2_0Annotation
-{
- private String mappedBy;
-
-
- public BinaryManyToManyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = this.buildMappedBy();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.buildMappedBy());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.MANY_TO_MANY__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.MANY_TO_MANY__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.MANY_TO_MANY__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- 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(JPA.MANY_TO_MANY__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java
deleted file mode 100644
index 191b182208..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryManyToOneAnnotation.java
+++ /dev/null
@@ -1,88 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class BinaryManyToOneAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements ManyToOne2_0Annotation
-{
- private Boolean optional;
-
-
- public BinaryManyToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.MANY_TO_ONE__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.MANY_TO_ONE__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.MANY_TO_ONE__CASCADE;
- }
-
-
- // ********** ManyToOneMappingAnnotation implementation **********
-
- // ***** 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(JPA.MANY_TO_ONE__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMapKeyAnnotation.java
deleted file mode 100644
index 7699becdcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMapKeyAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.MapKey
- */
-public final class BinaryMapKeyAnnotation
- extends BinaryAnnotation
- implements MapKeyAnnotation
-{
- private String name;
-
-
- public BinaryMapKeyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** MapKeyAnnotation 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(JPA.MAP_KEY__NAME);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java
deleted file mode 100644
index 419bfaaa06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryMappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,28 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-
-public final class BinaryMappedSuperclassAnnotation
- extends BinaryAnnotation
- implements MappedSuperclassAnnotation
-{
- public BinaryMappedSuperclassAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java
deleted file mode 100644
index 2230a57bca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedColumnAnnotation.java
+++ /dev/null
@@ -1,111 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- * javax.persistence.DiscriminatorColumn
- * javax.persistence.PrimaryKeyJoinColumn.
- */
-public abstract class BinaryNamedColumnAnnotation
- extends BinaryAnnotation
- implements NamedColumnAnnotation
-{
- private String name;
- private String columnDefinition;
-
-
- protected BinaryNamedColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.columnDefinition = this.buildColumnDefinition();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setColumnDefinition_(this.buildColumnDefinition());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedColumn implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** 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());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** column definition
- public String getColumnDefinition() {
- return null;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- throw new UnsupportedOperationException();
- }
-
- private void setColumnDefinition_(String columnDefinition) {
- String old = this.columnDefinition;
- this.columnDefinition = columnDefinition;
- this.firePropertyChanged(COLUMN_DEFINITION_PROPERTY, old, columnDefinition);
- }
-
- private String buildColumnDefinition() {
- return (String) this.getJdtMemberValue(this.getColumnDefinitionElementName());
- }
-
- protected abstract String getColumnDefinitionElementName();
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.java
deleted file mode 100644
index 8f8a12d239..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueriesAnnotation.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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQueryAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.NamedNativeQueries
- */
-public final class BinaryNamedNativeQueriesAnnotation
- extends BinaryContainerAnnotation<NestableNamedNativeQueryAnnotation>
- implements NamedNativeQueriesAnnotation
-{
- private final Vector<NestableNamedNativeQueryAnnotation> namedNativeQueries;
-
-
- public BinaryNamedNativeQueriesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.namedNativeQueries = this.buildNamedNativeQueries();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedNativeQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedNativeQueryAnnotation>(this.namedNativeQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- private Vector<NestableNamedNativeQueryAnnotation> buildNamedNativeQueries() {
- Object[] jdtQueries = this.getJdtMemberValues(JPA.NAMED_NATIVE_QUERIES__VALUE);
- Vector<NestableNamedNativeQueryAnnotation> result = new Vector<NestableNamedNativeQueryAnnotation>(jdtQueries.length);
- for (Object jdtQuery : jdtQueries) {
- result.add(new BinaryNamedNativeQueryAnnotation(this, (IAnnotation) jdtQuery));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNamedNativeQueries();
- }
-
- // TODO
- private void updateNamedNativeQueries() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java
deleted file mode 100644
index 7b96cfc170..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,119 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.NamedNativeQuery
- */
-public final class BinaryNamedNativeQueryAnnotation
- extends BinaryBaseNamedQueryAnnotation
- implements NestableNamedNativeQueryAnnotation
-{
- private String resultClass;
- private String resultSetMapping;
-
-
- public BinaryNamedNativeQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.resultClass = this.buildResultClass();
- this.resultSetMapping = this.buildResultSetMapping();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setResultClass_(this.buildResultClass());
- this.setResultSetMapping_(this.buildResultSetMapping());
- }
-
-
- // ********** BinaryBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_NATIVE_QUERY__HINTS;
- }
-
-
- // ********** NamedNativeQueryAnnotation implementation **********
-
- // ***** result class
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String resultClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setResultClass_(String resultClass) {
- String old = this.resultClass;
- this.resultClass = resultClass;
- this.firePropertyChanged(RESULT_CLASS_PROPERTY, old, resultClass);
- }
-
- private String buildResultClass() {
- return (String) this.getJdtMemberValue(JPA.NAMED_NATIVE_QUERY__RESULT_CLASS);
- }
-
- public TextRange getResultClassTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified result class name
- public String getFullyQualifiedResultClassName() {
- return this.resultClass;
- }
-
- // ***** result set mapping
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String resultSetMapping) {
- throw new UnsupportedOperationException();
- }
-
- private void setResultSetMapping_(String resultSetMapping) {
- String old = this.resultSetMapping;
- this.resultSetMapping = resultSetMapping;
- this.firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, old, resultSetMapping);
- }
-
- private String buildResultSetMapping() {
- return (String) this.getJdtMemberValue(JPA.NAMED_NATIVE_QUERY__RESULT_CLASS);
- }
-
- public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java
deleted file mode 100644
index d5fee459b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueriesAnnotation.java
+++ /dev/null
@@ -1,71 +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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.NamedQueries
- */
-public abstract class BinaryNamedQueriesAnnotation
- extends BinaryContainerAnnotation<NestableNamedQueryAnnotation>
- implements NamedQueriesAnnotation
-{
- private final Vector<NestableNamedQueryAnnotation> namedQueries;
-
-
- public BinaryNamedQueriesAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.namedQueries = this.buildNamedQueries();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedQueryAnnotation>(this.namedQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- private Vector<NestableNamedQueryAnnotation> buildNamedQueries() {
- Object[] jdtQueries = this.getJdtMemberValues(JPA.NAMED_QUERIES__VALUE);
- Vector<NestableNamedQueryAnnotation> result = new Vector<NestableNamedQueryAnnotation>(jdtQueries.length);
- for (Object jdtQuery : jdtQueries) {
- result.add(this.buildNamedQuery(jdtQuery));
- }
- return result;
- }
-
- protected abstract NamedQueryAnnotation buildNamedQuery(Object jdtQuery);
-
- @Override
- public void update() {
- super.update();
- this.updateNamedQueries();
- }
-
- // TODO
- private void updateNamedQueries() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.java
deleted file mode 100644
index 158384ddb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNamedQueryAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
-
-/**
- * javax.persistence.NamedQuery
- */
-public abstract class BinaryNamedQueryAnnotation
- extends BinaryBaseNamedQueryAnnotation
- implements NestableNamedQueryAnnotation, NamedQueryAnnotation
-{
- public BinaryNamedQueryAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_QUERY__HINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryNode.java
deleted file mode 100644
index 8f01e8d048..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.resource.java.binary;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java
deleted file mode 100644
index b0872a9081..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToManyAnnotation.java
+++ /dev/null
@@ -1,121 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class BinaryOneToManyAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements OneToMany2_0Annotation
-{
- private String mappedBy;
-
- private Boolean orphanRemoval; //added in JPA 2.0
-
- public BinaryOneToManyAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.mappedBy = this.buildMappedBy();
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setMappedBy_(this.buildMappedBy());
- this.setOrphanRemoval_(this.buildOrphanRemoval());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.ONE_TO_MANY__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.ONE_TO_MANY__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.ONE_TO_MANY__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- 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(JPA.ONE_TO_MANY__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** OneToMany2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private Boolean buildOrphanRemoval() {
- return (Boolean) this.getJdtMemberValue(JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
- }
-
- private void setOrphanRemoval_(Boolean orphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = orphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, orphanRemoval);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java
deleted file mode 100644
index 9a5be7bc82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOneToOneAnnotation.java
+++ /dev/null
@@ -1,148 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OneToOne
- */
-public class BinaryOneToOneAnnotation
- extends BinaryRelationshipMappingAnnotation
- implements OneToOne2_0Annotation
-{
- private Boolean optional;
- private String mappedBy;
- private Boolean orphanRemoval; //added in JPA 2.0
-
- public BinaryOneToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.optional = this.buildOptional();
- this.mappedBy = this.buildMappedBy();
- this.orphanRemoval = this.buildOrphanRemoval();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setOptional_(this.buildOptional());
- this.setMappedBy_(this.buildMappedBy());
- this.setOrphanRemoval_(this.buildOrphanRemoval());
- }
-
-
- // ********** BinaryRelationshipMappingAnnotation implementation **********
-
- @Override
- String getTargetEntityElementName() {
- return JPA.ONE_TO_ONE__TARGET_ENTITY;
- }
-
- @Override
- String getFetchElementName() {
- return JPA.ONE_TO_ONE__FETCH;
- }
-
- @Override
- String getCascadeElementName() {
- return JPA.ONE_TO_ONE__CASCADE;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- 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(JPA.ONE_TO_ONE__MAPPED_BY);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- //**************** OneToOneAnnotation implementation **************
-
- // ***** 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(JPA.ONE_TO_ONE__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** OneToOne2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- private Boolean buildOrphanRemoval() {
- return (Boolean) this.getJdtMemberValue(JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
- private void setOrphanRemoval_(Boolean orphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = orphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, orphanRemoval);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOrderByAnnotation.java
deleted file mode 100644
index e8f87d7a32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOrderByAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class BinaryOrderByAnnotation
- extends BinaryAnnotation
- implements OrderByAnnotation
-{
- private String value;
-
-
- public BinaryOrderByAnnotation(JavaResourcePersistentAttribute parent, IAnnotation annotation) {
- super(parent, annotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** OrderByAnnotation 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(JPA.ORDER_BY__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOverrideAnnotation.java
deleted file mode 100644
index 4e129f6372..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryOverrideAnnotation.java
+++ /dev/null
@@ -1,78 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common behavior for
- * javax.persistence.AttributeOverride
- * javax.persistence.AssociationOverride
- */
-public abstract class BinaryOverrideAnnotation
- extends BinaryAnnotation
- implements OverrideAnnotation
-{
- private String name;
-
-
- public BinaryOverrideAnnotation(JavaResourceNode 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);
- }
-
-
- // ********** OverrideAnnotation 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(OverrideAnnotation.NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- protected abstract String getNameElementName();
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java
deleted file mode 100644
index 734439b56d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragment.java
+++ /dev/null
@@ -1,125 +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.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-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.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.java.JavaResourceClassFile;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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 (BinaryPersistentType.typeIsPersistable(jdtType)) {
- JavaResourceClassFile classFile = new BinaryClassFile(this, jdtClassFile, jdtType);
- if (classFile.getPersistentType().isAnnotated()) { // we only hold annotated types
- result.add(classFile);
- }
- }
- }
- return result;
- }
-
-
- // ********** JarResourceNode implementation **********
-
- @Override
- public void update() {
- super.update();
- this.updateClassFiles();
- }
-
- // TODO
- private void updateClassFiles() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** JavaResourcePackageFragment implementation **********
-
- public ListIterator<JavaResourceClassFile> classFiles() {
- return new CloneListIterator<JavaResourceClassFile>(this.classFiles);
- }
-
- public int classFilesSize() {
- return this.classFiles.size();
- }
-
- public Iterator<JavaResourcePersistentType> persistedTypes() {
- return new TransformationIterator<JavaResourceClassFile, JavaResourcePersistentType>(this.classFiles()) {
- @Override
- protected JavaResourcePersistentType transform(JavaResourceClassFile classFile) {
- return classFile.getPersistentType(); // we only hold annotated types
- }
- };
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- try {
- return this.packageFragment.getChildren();
- } catch (JavaModelException ex) {
- JptCorePlugin.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
deleted file mode 100644
index 52276c41a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPackageFragmentRoot.java
+++ /dev/null
@@ -1,133 +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.core.internal.resource.java.binary;
-
-import java.io.FileNotFoundException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-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.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragment;
-import org.eclipse.jpt.core.resource.java.JavaResourcePackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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, JpaAnnotationProvider 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 Iterator<JavaResourcePersistentType> persistentTypes() {
- return new CompositeIterator<JavaResourcePersistentType>(this.persistedTypeIterators());
- }
-
- private Iterator<Iterator<JavaResourcePersistentType>> persistedTypeIterators() {
- return new TransformationIterator<JavaResourcePackageFragment, Iterator<JavaResourcePersistentType>>(this.packageFragments()) {
- @Override
- protected Iterator<JavaResourcePersistentType> transform(JavaResourcePackageFragment fragment) {
- return fragment.persistedTypes();
- }
- };
- }
-
-
- // ********** JavaResourcePackageFragmentRoot implementation **********
-
- public Iterator<JavaResourcePackageFragment> packageFragments() {
- return new CloneIterator<JavaResourcePackageFragment>(this.packageFragments);
- }
-
- public int packageFragmentsSize() {
- return this.packageFragments.size();
- }
-
-
- // ********** misc **********
-
- private IJavaElement[] getJDTChildren() {
- try {
- return this.packageFragmentRoot.getChildren();
- } catch (JavaModelException ex) {
- // ignore FNFE - which can happen when the workspace is out of synch with O/S file system
- if ( ! (ex.getCause() instanceof FileNotFoundException)) {
- JptCorePlugin.log(ex);
- }
- return EMPTY_JAVA_ELEMENT_ARRAY;
- }
- }
- private static final IJavaElement[] EMPTY_JAVA_ELEMENT_ARRAY = new IJavaElement[0];
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getFile().getName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java
deleted file mode 100644
index 1b3f027257..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentAttribute.java
+++ /dev/null
@@ -1,649 +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.core.internal.resource.java.binary;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * binary persistent attribute (field or property)
- */
-final class BinaryPersistentAttribute
- extends BinaryPersistentMember
- implements JavaResourcePersistentAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- BinaryPersistentAttribute(JavaResourcePersistentType parent, IField field) {
- this(parent, new FieldAdapter(field));
- }
-
- BinaryPersistentAttribute(JavaResourcePersistentType parent, IMethod method) {
- this(parent, new MethodAdapter(method));
- }
-
- private BinaryPersistentAttribute(JavaResourcePersistentType parent, Adapter adapter) {
- super(parent, adapter);
- this.modifiers = this.buildModifiers();
- this.typeName = this.buildTypeName();
-
- IType type = this.getType(); // shouldn't be an array...
- this.typeIsInterface = this.buildTypeIsInterface(type);
- this.typeIsEnum = this.buildTypeIsEnum(type);
- this.typeSuperclassNames.addAll(this.buildTypeSuperclassNames(type));
- this.typeInterfaceNames.addAll(this.buildTypeInterfaceNames(type));
-
- this.typeTypeArgumentNames.addAll(this.buildTypeTypeArgumentNames());
- }
-
-
- // ******** overrides ********
-
- @Override
- public void update() {
- super.update();
- this.setModifiers(this.buildModifiers());
- this.setTypeName(this.buildTypeName());
-
- IType type = this.getType(); // shouldn't be an array...
- this.setTypeIsInterface(this.buildTypeIsInterface(type));
- this.setTypeIsEnum(this.buildTypeIsEnum(type));
- this.setTypeSuperclassNames(this.buildTypeSuperclassNames(type));
- this.setTypeInterfaceNames(this.buildTypeInterfaceNames(type));
-
- this.setTypeTypeArgumentNames(this.buildTypeTypeArgumentNames());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ********** BinaryPersistentMember implementation **********
-
- private Adapter getAdapter() {
- return (Adapter) this.adapter;
- }
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().attributeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(IAnnotation jdtAnnotation) {
- return this.getAnnotationProvider().buildAttributeAnnotation(this, jdtAnnotation);
- }
-
- Annotation buildNullAnnotation_(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeAnnotation(this, annotationName);
- }
-
-
- // ********** JavaResourcePersistentAttribute implementation **********
-
- public String getName() {
- return this.getAdapter().getAttributeName();
- }
-
- @Override
- public Annotation buildNullAnnotation(String annotationName) {
- return (annotationName == null) ? null : this.buildNullAnnotation_(annotationName);
- }
-
- public boolean isField() {
- return this.getAdapter().isField();
- }
-
- public boolean isProperty() {
- return ! this.isField();
- }
-
- public boolean isFor(MethodSignature methodSignature, int occurrence) {
- throw new UnsupportedOperationException();
- }
-
- public AccessType getSpecifiedAccess() {
- Access2_0Annotation accessAnnotation = (Access2_0Annotation) this.getAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- return accessAnnotation == null ? null : accessAnnotation.getValue();
- }
-
- 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) {
- JptCorePlugin.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);
- }
-
- /**
- * JARs don't have array types;
- * also, no generic type parameters
- */
- private String buildTypeName() {
- return convertTypeSignatureToTypeName(this.getTypeSignature());
- }
-
- // ***** 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) {
- JptCorePlugin.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) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** type superclass hierarchy
- public ListIterator<String> typeSuperclassNames() {
- return new CloneListIterator<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 Iterator<String> typeInterfaceNames() {
- return new CloneIterator<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 ListIterator<String> typeTypeArgumentNames() {
- return new CloneListIterator<String>(this.typeTypeArgumentNames);
- }
-
- public int typeTypeArgumentNamesSize() {
- 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);
- }
-
- /**
- * 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() {
- String typeSignature = this.getTypeSignature();
- 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));
- }
- return names;
- }
-
-
- // ********** convenience methods **********
-
- private String getTypeSignature() {
- try {
- return this.getAdapter().getTypeSignature();
- } catch (JavaModelException ex) {
- JptCorePlugin.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) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- private String[] getSuperInterfaceTypeSignatures(IType type) {
- try {
- return type.getSuperInterfaceTypeSignatures();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return EMPTY_STRING_ARRAY;
- }
- }
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
- 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) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- private IJavaProject getJavaProject() {
- return this.getMember().getJavaProject();
- }
-
-
-
- // ********** adapters **********
-
- /**
- * Adapt an IField or IMethod.
- */
- interface Adapter
- extends BinaryPersistentMember.Adapter
- {
- /**
- * Return the field or getter method's "attribute" name
- * (e.g. field "foo" -> "foo"; method "getFoo" -> "foo").
- */
- String getAttributeName();
-
- /**
- * Return whether the attribute is a Java field (as opposed to a method).
- */
- boolean isField();
-
- /**
- * Return the attribute's type signature.
- */
- String getTypeSignature() throws JavaModelException;
- }
-
- /**
- * IField adapter
- */
- static class FieldAdapter
- implements Adapter
- {
- final IField field;
-
- FieldAdapter(IField field) {
- super();
- this.field = field;
- }
-
- public IField getMember() {
- return this.field;
- }
-
- public boolean isPersistable() {
- return this.field.exists() && JPTTools.fieldIsPersistable(new JPTToolsAdapter());
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.field.getAnnotations();
- }
-
- public String getAttributeName() {
- return this.field.getElementName();
- }
-
- public boolean isField() {
- return true;
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.field.getTypeSignature();
- }
-
- /**
- * JPTTools needs an adapter so it can work with either an IField
- * or an IVariableBinding etc.
- */
- class JPTToolsAdapter implements JPTTools.FieldAdapter {
- public int getModifiers() {
- try {
- return FieldAdapter.this.field.getFlags();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return 0;
- }
- }
-
- }
-
- }
-
- /**
- * IMethod adapter
- */
- static class MethodAdapter
- implements Adapter
- {
- final IMethod method;
- static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- MethodAdapter(IMethod method) {
- super();
- this.method = method;
- }
-
- public IMethod getMember() {
- return this.method;
- }
-
- public boolean isPersistable() {
- return JPTTools.methodIsPersistablePropertyGetter(new JPTToolsAdapter());
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.method.getAnnotations();
- }
-
- public String getAttributeName() {
- return NameTools.convertGetterMethodNameToPropertyName(this.method.getElementName());
- }
-
- public boolean isField() {
- return false;
- }
-
- public String getTypeSignature() throws JavaModelException {
- return this.method.getReturnType();
- }
-
- /**
- * JPTTools needs an adapter so it can work with either an IMethod
- * or an IMethodBinding etc.
- */
- abstract static class AbstractJPTToolsAdapter
- implements JPTTools.SimpleMethodAdapter
- {
- AbstractJPTToolsAdapter() {
- super();
- }
-
- abstract IMethod getMethod();
-
- public int getModifiers() {
- try {
- return this.getMethod().getFlags();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return 0;
- }
- }
-
- public String getReturnTypeErasureName() {
- return convertTypeSignatureToTypeName(this.getReturnTypeSignature());
- }
-
- private String getReturnTypeSignature() {
- try {
- return this.getMethod().getReturnType();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- public boolean isConstructor() {
- try {
- return this.getMethod().isConstructor();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- }
-
- static class SimpleJPTToolsAdapter
- extends AbstractJPTToolsAdapter
- {
- private final IMethod method;
-
- SimpleJPTToolsAdapter(IMethod method) {
- super();
- this.method = method;
- }
-
- @Override
- IMethod getMethod() {
- return this.method;
- }
-
- }
-
- class JPTToolsAdapter
- extends AbstractJPTToolsAdapter
- implements JPTTools.MethodAdapter
- {
- JPTToolsAdapter() {
- super();
- }
-
- @Override
- IMethod getMethod() {
- return MethodAdapter.this.method;
- }
-
- public String getName() {
- return this.getMethod().getElementName();
- }
-
- public int getParametersLength() {
- return this.getMethod().getParameterTypes().length;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name) {
- for (IMethod sibling : this.getSiblings()) {
- if ((sibling.getParameterTypes().length == 0)
- && sibling.getElementName().equals(name)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- public JPTTools.SimpleMethodAdapter getSibling(String name, String parameterTypeErasureName) {
- for (IMethod sibling : this.getSiblings()) {
- String[] parmTypes = sibling.getParameterTypes();
- if ((parmTypes.length == 1)
- && sibling.getElementName().equals(name)
- && convertTypeSignatureToTypeName(parmTypes[0]).equals(parameterTypeErasureName)) {
- return new SimpleJPTToolsAdapter(sibling);
- }
- }
- return null;
- }
-
- private IMethod[] getSiblings() {
- try {
- return this.getMethod().getDeclaringType().getMethods();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return EMPTY_METHOD_ARRAY;
- }
- }
-
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java
deleted file mode 100644
index ddf89016c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentMember.java
+++ /dev/null
@@ -1,272 +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.core.internal.resource.java.binary;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IMember;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-/**
- * binary persistent member
- */
-abstract class BinaryPersistentMember
- extends BinaryNode
- implements JavaResourcePersistentMember
-{
- /** JDT member adapter */
- final Adapter adapter;
-
- /** annotations */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- boolean persistable;
-
-
- // ********** construction/initialization **********
-
- public BinaryPersistentMember(JavaResourceNode parent, Adapter adapter) {
- super(parent);
- this.adapter = adapter;
- this.initializeAnnotations();
- this.persistable = this.buildPersistable();
- }
-
- private void initializeAnnotations() {
- for (IAnnotation annotation : this.getJdtAnnotations()) {
- this.addAnnotation(annotation);
- }
- }
-
- private void addAnnotation(IAnnotation jdtAnnotation) {
- if (this.annotationIsValid(jdtAnnotation)) {
- this.annotations.add(this.buildAnnotation(jdtAnnotation));
- }
- }
-
-
- // ********** updating **********
-
- @Override
- public void update() {
- super.update();
- this.updateAnnotations();
- this.setPersistable(this.buildPersistable());
- }
-
- // TODO
- private void updateAnnotations() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** annotations **********
-
- public Iterator<Annotation> annotations() {
- return this.getAnnotations().iterator();
- }
-
- private Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int annotationsSize() {
- return this.annotations.size();
- }
-
- 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.buildNullAnnotation(annotationName);
- }
-
- public Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.getNestedAnnotations().iterator();
- }
- NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- return (nestableAnnotation == null) ?
- EmptyListIterator.<NestableAnnotation>instance() :
- new SingleElementIterator<NestableAnnotation>(nestableAnnotation);
- }
-
- private NestableAnnotation getNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.getAnnotation(annotationName);
- }
-
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName);
- }
-
- private boolean annotationIsValid(IAnnotation jdtAnnotation) {
- return CollectionTools.contains(this.validAnnotationNames(), jdtAnnotation.getElementName());
- }
-
- abstract Iterator<String> validAnnotationNames();
-
- abstract Annotation buildAnnotation(IAnnotation jdtAnnotation);
-
- abstract Annotation buildNullAnnotation(String annotationName);
-
-
- // ********** simple state **********
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- private void setPersistable(boolean persistable) {
- boolean old = this.persistable;
- this.persistable = persistable;
- this.firePropertyChanged(PERSISTABLE_PROPERTY, old, persistable);
- }
-
- private boolean buildPersistable() {
- return this.adapter.isPersistable();
- }
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty();
- }
-
-
- // ********** miscellaneous **********
-
- IMember getMember() {
- return this.adapter.getMember();
- }
-
- private Annotation selectAnnotationNamed(Iterable<Annotation> annotationList, String annotationName) {
- for (Annotation annotation : annotationList) {
- if (annotation.getAnnotationName().equals(annotationName)) {
- return annotation;
- }
- }
- return null;
- }
-
- /**
- * convenience method
- */
- <T extends JavaResourcePersistentMember> Iterator<T> persistableMembers(Iterator<T> members) {
- return new FilteringIterator<T>(members) {
- @Override
- protected boolean accept(T m) {
- return m.isPersistable();
- }
- };
- }
-
- /**
- * Strip off the type signature's parameters if present.
- * Convert to a readable string.
- */
- static String convertTypeSignatureToTypeName(String typeSignature) {
- return (typeSignature == null) ? null : convertTypeSignatureToTypeName_(typeSignature);
- }
-
- /**
- * no null check
- */
- static String convertTypeSignatureToTypeName_(String typeSignature) {
- return Signature.toString(Signature.getTypeErasure(typeSignature));
- }
-
- private IAnnotation[] getJdtAnnotations() {
- try {
- return this.adapter.getAnnotations();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return EMPTY_JDT_ANNOTATION_ARRAY;
- }
- }
- private static final IAnnotation[] EMPTY_JDT_ANNOTATION_ARRAY = new IAnnotation[0];
-
-
- // ********** IMember adapter **********
-
- interface Adapter {
- /**
- * Return the adapter's JDT member (IType, IField, IMethod).
- */
- IMember getMember();
-
- /**
- * Return whether the adapter's member is "persistable"
- * (i.e. according to the JPA spec the member can be mapped)
- */
- boolean isPersistable();
-
- /**
- * Return the adapter's member'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, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(String annotationName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFor(String memberName, int occurrence) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java
deleted file mode 100644
index 887d519751..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentType.java
+++ /dev/null
@@ -1,583 +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.core.internal.resource.java.binary;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.Flags;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * binary persistent type
- */
-final class BinaryPersistentType
- extends BinaryPersistentMember
- implements JavaResourcePersistentType2_0
-{
- private String name;
-
- private String qualifiedName;
-
- private String superclassQualifiedName;
-
- private String declaringTypeName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private final Vector<JavaResourcePersistentAttribute> fields;
-
- private final Vector<JavaResourcePersistentAttribute> methods;
-
- private AccessType access;
-
-
- // ********** construction/initialization **********
-
- BinaryPersistentType(JavaResourceNode parent, IType type) {
- super(parent, new TypeAdapter(type));
- this.name = this.buildName();
- this.qualifiedName = this.buildQualifiedName();
- this.superclassQualifiedName = this.buildSuperclassQualifiedName();
- this.declaringTypeName = this.buildDeclaringTypeName();
- this.abstract_ = this.buildAbstract();
- this.fields = this.buildFields();
- this.methods = this.buildMethods();
- // need to wait until everything is built to calculate 'access'
- this.access = this.buildAccess();
- }
-
-
- // ********** overrides **********
-
- @Override
- public void update() {
- super.update();
- this.setName(this.buildName());
- this.setQualifiedName(this.buildQualifiedName());
- this.setSuperclassQualifiedName(this.buildSuperclassQualifiedName());
- this.setDeclaringTypeName(this.buildDeclaringTypeName());
- this.setAbstract(this.buildAbstract());
- this.updateFields();
- this.updateMethods();
- // need to wait until everything is updated to calculate 'access'
- this.setAccess(this.buildAccess());
- }
-
- // TODO
- private void updateFields() {
- throw new UnsupportedOperationException();
- }
-
- // TODO
- private void updateMethods() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BinaryPersistentMember implementation **********
-
- @Override
- Annotation buildAnnotation(IAnnotation jdtAnnotation) {
- return this.getAnnotationProvider().buildTypeAnnotation(this, jdtAnnotation);
- }
-
- @Override
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeAnnotation(this, annotationName);
- }
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().typeAnnotationNames();
- }
-
-
- // ********** JavaResourcePersistentType 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
- }
-
- // ***** 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) {
- JptCorePlugin.log(ex);
- return null;
- }
- }
-
- // ***** 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
- }
-
- // ***** 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) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- // ***** access
- public AccessType getAccess() {
- return this.access;
- }
-
- private void setAccess(AccessType access) {
- AccessType old = this.access;
- this.access = access;
- this.firePropertyChanged(ACCESS_PROPERTY, old, access);
- }
-
- private AccessType buildAccess() {
- return JPTTools.buildAccess(this);
- }
-
- public boolean isMapped() {
- for (Annotation each : CollectionTools.iterable(annotations())) {
- if (CollectionTools.contains(
- getAnnotationProvider().typeMappingAnnotationNames(),
- each.getAnnotationName())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * check only persistable attributes
- */
- public boolean hasAnyAnnotatedAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableAttributes(); stream.hasNext(); ) {
- if (stream.next().isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public IType getMember() {
- return (IType) super.getMember();
- }
-
-
- // ********** fields **********
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return this.getFields().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getFields() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.fields);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFields() {
- return this.persistableMembers(this.fields());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(this.persistableFields()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute resourceAttribute) {
- return resourceAttribute.getSpecifiedAccess() == AccessType.FIELD;
- }
- };
- }
-
- private void addField(JavaResourcePersistentAttribute field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourcePersistentAttribute getField(String fieldName, int occurrence) {
- for (JavaResourcePersistentAttribute field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private Vector<JavaResourcePersistentAttribute> buildFields() {
- IField[] jdtFields = this.getFields(this.getMember());
- Vector<JavaResourcePersistentAttribute> result = new Vector<JavaResourcePersistentAttribute>(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) {
- JptCorePlugin.log(ex);
- return EMPTY_FIELD_ARRAY;
- }
- }
- private static final IField[] EMPTY_FIELD_ARRAY = new IField[0];
-
- private JavaResourcePersistentAttribute buildField(IField jdtField) {
- return new BinaryPersistentAttribute(this, jdtField);
- }
-
-
- // ********** methods **********
-
- public Iterator<JavaResourcePersistentAttribute> methods() {
- return this.getMethods().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getMethods() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.methods);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableProperties() {
- return persistableMembers(this.methods());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(this.persistableProperties()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute resourceAttribute) {
- return resourceAttribute.getSpecifiedAccess() == AccessType.PROPERTY;
- }
- };
- }
-
- private JavaResourcePersistentAttribute getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourcePersistentAttribute method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourcePersistentAttribute method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private Vector<JavaResourcePersistentAttribute> buildMethods() {
- IMethod[] jdtMethods = this.getMethods(this.getMember());
- Vector<JavaResourcePersistentAttribute> result = new Vector<JavaResourcePersistentAttribute>(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) {
- JptCorePlugin.log(ex);
- return EMPTY_METHOD_ARRAY;
- }
- }
- private static final IMethod[] EMPTY_METHOD_ARRAY = new IMethod[0];
-
- private JavaResourcePersistentAttribute buildMethod(IMethod jdtMethod) {
- return new BinaryPersistentAttribute(this, jdtMethod);
- }
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistableProperties()
- );
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess) {
- if (specifiedAccess == null) {
- throw new IllegalArgumentException("specified access is null"); //$NON-NLS-1$
- }
- return (specifiedAccess == AccessType.FIELD) ?
- this.persistableAttributesForFieldAccessType() :
- this.persistableAttributesForPropertyAccessType();
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForFieldAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistablePropertiesWithSpecifiedPropertyAccess()
- );
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForPropertyAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- this.persistableFieldsWithSpecifiedFieldAccess()
- );
- }
-
-
- // ********** IType adapter **********
-
- static class TypeAdapter implements Adapter {
- private final IType type;
-
- TypeAdapter(IType type) {
- super();
- this.type = type;
- }
-
- public IType getMember() {
- return this.type;
- }
-
- public boolean isPersistable() {
- return true; // we only build a JAR type if it is "persistable"
- }
-
- public IAnnotation[] getAnnotations() throws JavaModelException {
- return this.type.getAnnotations();
- }
-
- }
-
-
- // ********** "persistable" check **********
-
- static boolean typeIsPersistable(IType type) {
- return (type != null)
- && type.exists()
- && JPTTools.typeIsPersistable(new JPTToolsAdapter(type));
- }
-
-
- // ********** JPT tools adapter **********
-
- /**
- * JPTTools needs an adapter so it can work with either an IType
- * or an ITypeBinding etc.
- */
- static class JPTToolsAdapter implements JPTTools.TypeAdapter {
- private final IType type;
-
- protected JPTToolsAdapter(IType type) {
- super();
- if (type == null) {
- throw new NullPointerException();
- }
- this.type = type;
- }
-
- public int getModifiers() {
- try {
- return this.type.getFlags();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return 0;
- }
- }
-
- public boolean isAnnotation() {
- try {
- return this.type.isAnnotation();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isAnonymous() {
- try {
- return this.type.isAnonymous();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isArray() {
- return false; // ???
- }
-
- public boolean isEnum() {
- try {
- return this.type.isEnum();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isInterface() {
- try {
- return this.type.isInterface();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isLocal() {
- try {
- return this.type.isLocal();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isMember() {
- try {
- return this.type.isMember();
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- public boolean isPrimitive() {
- return false; // ???
- }
-
- }
-
-
- // ********** unsupported JavaResourcePersistentType implementation **********
-
- public Iterator<JavaResourcePersistentType> types() {
- throw new UnsupportedOperationException();
- }
-
- public Iterator<JavaResourcePersistentType> allTypes() {
- throw new UnsupportedOperationException();
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isGeneratedMetamodelTopLevelType(IPackageFragmentRoot sourceFolder) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isGeneratedMetamodelTopLevelType() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isMetamodel() {
- throw new UnsupportedOperationException();
- }
-
- public GeneratedAnnotation getGeneratedAnnotation() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentTypeCache.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentTypeCache.java
deleted file mode 100644
index bc1b8a1225..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPersistentTypeCache.java
+++ /dev/null
@@ -1,149 +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.core.internal.resource.java.binary;
-
-import java.util.Iterator;
-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.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentTypeCache;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * cache used to hold binary "external" Java resource persistent types
- * (typically derived from JARs on the project's build path)
- */
-public final class BinaryPersistentTypeCache
- extends RootBinaryNode
- implements JavaResourcePersistentTypeCache
-{
- /** populated on-demand */
- private final Vector<Entry> entries = new Vector<Entry>();
-
-
- // ********** construction **********
-
- public BinaryPersistentTypeCache(JpaAnnotationProvider annotationProvider) {
- super(null, annotationProvider);
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return this.getPersistentTypes().iterator();
- }
-
- private Iterable<JavaResourcePersistentType> getPersistentTypes() {
- return new TransformationIterable<Entry, JavaResourcePersistentType>(this.getEntries()) {
- @Override
- protected JavaResourcePersistentType transform(Entry entry) {
- return entry.persistentType;
- }
- };
- }
-
- private Iterable<Entry> getEntries() {
- return new LiveCloneIterable<Entry>(this.entries);
- }
-
-
- // ********** JavaResourcePersistentTypeCache implementation **********
-
- public int persistentTypesSize() {
- return this.entries.size();
- }
-
- public JavaResourcePersistentType addPersistentType(IType jdtType) {
- Entry entry = this.buildEntry(jdtType);
- this.entries.add(entry);
- this.fireItemAdded(PERSISTENT_TYPES_COLLECTION, entry.persistentType);
- return entry.persistentType;
- }
-
- private Entry buildEntry(IType jdtType) {
- return new Entry(this.buildPersistentType(jdtType), jdtType.getResource());
- }
-
- private JavaResourcePersistentType buildPersistentType(IType jdtType) {
- return new BinaryPersistentType(this, jdtType);
- }
-
- public boolean removePersistentTypes(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(PERSISTENT_TYPES_COLLECTION, entry.persistentType);
- }
-
-
- // ********** 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(PERSISTENT_TYPES_COLLECTION)) {
- super.aspectChanged(aspectName);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.entries);
- }
-
-
- // ********** cache entry **********
-
- /**
- * Associate a persistent 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 JavaResourcePersistentType persistentType;
- final IResource resource;
-
- Entry(JavaResourcePersistentType persistentType, IResource resource) {
- super();
- this.persistentType = persistentType;
- this.resource = resource;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.persistentType);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index e4c9a1c5ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,87 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class BinaryPrimaryKeyJoinColumnAnnotation
- extends BinaryNamedColumnAnnotation
- implements NestablePrimaryKeyJoinColumnAnnotation
-{
- private String referencedColumnName;
-
-
- public BinaryPrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.referencedColumnName = this.buildReferencedColumnName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setReferencedColumnName_(this.buildReferencedColumnName());
- }
-
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** PrimaryKeyJoinColumnAnnotation implementation **********
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setReferencedColumnName_(String referencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, referencedColumnName);
- }
-
- private String buildReferencedColumnName() {
- return (String) this.getJdtMemberValue(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java
deleted file mode 100644
index 53fb9f0d46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryPrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,69 +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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumns
- */
-public final class BinaryPrimaryKeyJoinColumnsAnnotation
- extends BinaryContainerAnnotation<NestablePrimaryKeyJoinColumnAnnotation>
- implements PrimaryKeyJoinColumnsAnnotation
-{
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns;
-
-
- public BinaryPrimaryKeyJoinColumnsAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.pkJoinColumns = this.buildPkJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- private Vector<NestablePrimaryKeyJoinColumnAnnotation> buildPkJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.PRIMARY_KEY_JOIN_COLUMNS__VALUE);
- Vector<NestablePrimaryKeyJoinColumnAnnotation> result = new Vector<NestablePrimaryKeyJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryPrimaryKeyJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePkJoinColumns();
- }
-
- // TODO
- private void updatePkJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java
deleted file mode 100644
index c3f76581e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryQueryHintAnnotation.java
+++ /dev/null
@@ -1,101 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.QueryHint
- */
-class BinaryQueryHintAnnotation
- extends BinaryAnnotation
- implements QueryHintAnnotation
-{
- private String name;
- private String value;
-
-
- BinaryQueryHintAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- this.setValue_(this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** QueryHintAnnotation 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(JPA.QUERY_HINT__NAME);
- }
-
- public TextRange getNameTextRange(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);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(JPA.QUERY_HINT__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.java
deleted file mode 100644
index 6da0b80236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryRelationshipMappingAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.resource.java.CascadeType;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * javax.persistence.ManyToMany
- * javax.persistence.ManyToOne
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- */
-abstract class BinaryRelationshipMappingAnnotation
- extends BinaryAnnotation
- implements RelationshipMapping2_0Annotation
-{
- String targetEntity;
- FetchType fetch;
- boolean cascadeAll;
- boolean cascadeMerge;
- boolean cascadePersist;
- boolean cascadeRefresh;
- boolean cascadeRemove;
- boolean cascadeDetach; //added in JPA 2.0
-
-
- BinaryRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.targetEntity = this.buildTargetEntity();
- this.fetch = this.buildFetch();
- this.initializeCascadeTypes(this.buildCascadeTypes());
- }
-
- protected void initializeCascadeTypes(CascadeType[] cascadeTypes) {
- this.cascadeAll = ArrayTools.contains(cascadeTypes, CascadeType.ALL);
- this.cascadeMerge = ArrayTools.contains(cascadeTypes, CascadeType.MERGE);
- this.cascadePersist = ArrayTools.contains(cascadeTypes, CascadeType.PERSIST);
- this.cascadeRefresh = ArrayTools.contains(cascadeTypes, CascadeType.REFRESH);
- this.cascadeRemove = ArrayTools.contains(cascadeTypes, CascadeType.REMOVE);
- this.cascadeDetach = ArrayTools.contains(cascadeTypes, CascadeType.DETACH);
- }
-
- @Override
- public void update() {
- super.update();
- this.setTargetEntity_(this.buildTargetEntity());
- this.setFetch_(this.buildFetch());
- this.updateCascadeTypes(this.buildCascadeTypes());
- }
-
- protected void updateCascadeTypes(CascadeType[] cascadeTypes) {
- this.setCascadeAll_(ArrayTools.contains(cascadeTypes, CascadeType.ALL));
- this.setCascadeMerge_(ArrayTools.contains(cascadeTypes, CascadeType.MERGE));
- this.setCascadePersist_(ArrayTools.contains(cascadeTypes, CascadeType.PERSIST));
- this.setCascadeRefresh_(ArrayTools.contains(cascadeTypes, CascadeType.REFRESH));
- this.setCascadeRemove_(ArrayTools.contains(cascadeTypes, CascadeType.REMOVE));
- this.setCascadeDetach_(ArrayTools.contains(cascadeTypes, CascadeType.DETACH));
- }
-
- // ********** RelationshipMappingAnnotation implementation **********
-
- // ***** target entity
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String targetEntity) {
- throw new UnsupportedOperationException();
- }
-
- private void setTargetEntity_(String targetEntity) {
- String old = this.targetEntity;
- this.targetEntity = targetEntity;
- this.firePropertyChanged(TARGET_ENTITY_PROPERTY, old, targetEntity);
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_ENTITY_CLASS_NAME_PROPERTY, old, targetEntity);
- }
-
- private String buildTargetEntity() {
- return (String) this.getJdtMemberValue(this.getTargetEntityElementName());
- }
-
- abstract String getTargetEntityElementName();
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetEntityClassName() {
- return this.targetEntity;
- }
-
- // ***** 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(this.getFetchElementName()));
- }
-
- abstract String getFetchElementName();
-
- public TextRange getFetchTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** cascade
- private CascadeType[] buildCascadeTypes() {
- return CascadeType.fromJavaAnnotationValues(this.getJdtMemberValues(this.getCascadeElementName()));
- }
-
- abstract String getCascadeElementName();
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** cascade all
- public boolean isCascadeAll() {
- return this.cascadeAll;
- }
-
- public void setCascadeAll(boolean cascadeAll) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeAll_(boolean cascadeAll) {
- boolean old = this.cascadeAll;
- this.cascadeAll = cascadeAll;
- this.firePropertyChanged(CASCADE_ALL_PROPERTY, old, cascadeAll);
- }
-
- // ***** cascade merge
- public boolean isCascadeMerge() {
- return this.cascadeMerge;
- }
-
- public void setCascadeMerge(boolean cascadeMerge) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeMerge_(boolean cascadeMerge) {
- boolean old = this.cascadeMerge;
- this.cascadeMerge = cascadeMerge;
- this.firePropertyChanged(CASCADE_MERGE_PROPERTY, old, cascadeMerge);
- }
-
- // ***** cascade persist
- public boolean isCascadePersist() {
- return this.cascadePersist;
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadePersist_(boolean cascadePersist) {
- boolean old = this.cascadePersist;
- this.cascadePersist = cascadePersist;
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, cascadePersist);
- }
-
- // ***** cascade refresh
- public boolean isCascadeRefresh() {
- return this.cascadeRefresh;
- }
-
- public void setCascadeRefresh(boolean cascadeRefresh) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeRefresh_(boolean cascadeRefresh) {
- boolean old = this.cascadeRefresh;
- this.cascadeRefresh = cascadeRefresh;
- this.firePropertyChanged(CASCADE_REFRESH_PROPERTY, old, cascadeRefresh);
- }
-
- // ***** cascade remove
- public boolean isCascadeRemove() {
- return this.cascadeRemove;
- }
-
- public void setCascadeRemove(boolean cascadeRemove) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeRemove_(boolean cascadeRemove) {
- boolean old = this.cascadeRemove;
- this.cascadeRemove = cascadeRemove;
- this.firePropertyChanged(CASCADE_REMOVE_PROPERTY, old, cascadeRemove);
- }
-
- // ***** cascade detach - JPA 2.0
- public boolean isCascadeDetach() {
- return this.cascadeDetach;
- }
-
- public void setCascadeDetach(boolean cascadeDetach) {
- throw new UnsupportedOperationException();
- }
-
- private void setCascadeDetach_(boolean cascadeDetach) {
- boolean old = this.cascadeDetach;
- this.cascadeDetach = cascadeDetach;
- this.firePropertyChanged(CASCADE_DETACH_PROPERTY, old, cascadeDetach);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.java
deleted file mode 100644
index 7e018e6cb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTableAnnotation.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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.SecondaryTable
- */
-public final class BinarySecondaryTableAnnotation
- extends BinaryBaseTableAnnotation
- implements NestableSecondaryTableAnnotation
-{
- private final Vector<PrimaryKeyJoinColumnAnnotation> pkJoinColumns;
-
- public BinarySecondaryTableAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.pkJoinColumns = this.buildPkJoinColumns();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updatePkJoinColumns();
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.SECONDARY_TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.SECONDARY_TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.SECONDARY_TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ************* SecondaryTableAnnotation implementation *******************
-
- // ***** pk join columns
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn) {
- return this.pkJoinColumns.indexOf(pkJoinColumn);
- }
-
- public PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removePkJoinColumn(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<PrimaryKeyJoinColumnAnnotation> buildPkJoinColumns() {
- Object[] jdtJoinColumns = this.getJdtMemberValues(JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS);
- Vector<PrimaryKeyJoinColumnAnnotation> result = new Vector<PrimaryKeyJoinColumnAnnotation>(jdtJoinColumns.length);
- for (Object jdtJoinColumn : jdtJoinColumns) {
- result.add(new BinaryPrimaryKeyJoinColumnAnnotation(this, (IAnnotation) jdtJoinColumn));
- }
- return result;
- }
-
- // TODO
- private void updatePkJoinColumns() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.java
deleted file mode 100644
index 5dbc1fd97f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySecondaryTablesAnnotation.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.core.internal.resource.java.binary;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.SecondaryTables
- */
-public final class BinarySecondaryTablesAnnotation
- extends BinaryContainerAnnotation<NestableSecondaryTableAnnotation>
- implements SecondaryTablesAnnotation
-{
- private final Vector<NestableSecondaryTableAnnotation> secondaryTables;
-
-
- public BinarySecondaryTablesAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.secondaryTables = this.buildSecondaryTables();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public Iterable<NestableSecondaryTableAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableSecondaryTableAnnotation>(this.secondaryTables);
- }
-
- public int getNestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- private Vector<NestableSecondaryTableAnnotation> buildSecondaryTables() {
- Object[] jdtSecondaryTables = this.getJdtMemberValues(JPA.SECONDARY_TABLES__VALUE);
- Vector<NestableSecondaryTableAnnotation> result = new Vector<NestableSecondaryTableAnnotation>(jdtSecondaryTables.length);
- for (Object jdtSecondaryTable : jdtSecondaryTables) {
- result.add(new BinarySecondaryTableAnnotation(this, (IAnnotation) jdtSecondaryTable));
- }
- return result;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateSecondaryTables();
- }
-
- // TODO
- private void updateSecondaryTables() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.java
deleted file mode 100644
index cfe2c821ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinarySequenceGeneratorAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public abstract class BinarySequenceGeneratorAnnotation
- extends BinaryGeneratorAnnotation
- implements SequenceGeneratorAnnotation
-{
- private String sequenceName;
-
-
- protected BinarySequenceGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.sequenceName = this.buildSequenceName();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setSequenceName_(this.buildSequenceName());
- }
-
-
- // ********** BinaryGeneratorAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.SEQUENCE_GENERATOR__NAME;
- }
-
- @Override
- String getInitialValueElementName() {
- return JPA.SEQUENCE_GENERATOR__INITIAL_VALUE;
- }
-
- @Override
- String getAllocationSizeElementName() {
- return JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE;
- }
-
-
- // ********** SequenceGeneratorAnnotation implementation **********
-
- // ***** sequence name
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String sequenceName) {
- throw new UnsupportedOperationException();
- }
-
- private void setSequenceName_(String sequenceName) {
- String old = this.sequenceName;
- this.sequenceName = sequenceName;
- this.firePropertyChanged(SEQUENCE_NAME_PROPERTY, old, sequenceName);
- }
-
- private String buildSequenceName() {
- return (String) this.getJdtMemberValue(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME);
- }
-
- public TextRange getSequenceNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableAnnotation.java
deleted file mode 100644
index e7bcdc7306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableAnnotation.java
+++ /dev/null
@@ -1,55 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-
-/**
- * javax.persistence.Table
- */
-public final class BinaryTableAnnotation
- extends BinaryBaseTableAnnotation
- implements TableAnnotation
-{
- public BinaryTableAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryBaseTableAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.TABLE__NAME;
- }
-
- @Override
- protected String getSchemaElementName() {
- return JPA.TABLE__SCHEMA;
- }
-
- @Override
- protected String getCatalogElementName() {
- return JPA.TABLE__CATALOG;
- }
-
- @Override
- protected String getUniqueConstraintElementName() {
- return JPA.TABLE__UNIQUE_CONSTRAINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java
deleted file mode 100644
index 0ecdebbb42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTableGeneratorAnnotation.java
+++ /dev/null
@@ -1,293 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class BinaryTableGeneratorAnnotation
- extends BinaryGeneratorAnnotation
- implements TableGeneratorAnnotation
-{
- private String table;
- private String schema;
- private String catalog;
- private String pkColumnName;
- private String valueColumnName;
- private String pkColumnValue;
- private final Vector<UniqueConstraintAnnotation> uniqueConstraints;
-
-
- public BinaryTableGeneratorAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.table = this.buildTable();
- this.schema = this.buildSchema();
- this.catalog = this.buildCatalog();
- this.pkColumnName = this.buildPkColumnName();
- this.valueColumnName = this.buildValueColumnName();
- this.pkColumnValue = this.buildPkColumnValue();
- this.uniqueConstraints = this.buildUniqueConstraints();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setTable_(this.buildTable());
- this.setSchema_(this.buildSchema());
- this.setCatalog_(this.buildCatalog());
- this.setPkColumnName_(this.buildPkColumnName());
- this.setValueColumnName_(this.buildValueColumnName());
- this.setPkColumnValue_(this.buildPkColumnValue());
- this.updateUniqueConstraints();
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.TABLE_GENERATOR__NAME;
- }
-
- @Override
- String getInitialValueElementName() {
- return JPA.TABLE_GENERATOR__INITIAL_VALUE;
- }
-
- @Override
- String getAllocationSizeElementName() {
- return JPA.TABLE_GENERATOR__ALLOCATION_SIZE;
- }
-
-
- // ********** TableGeneratorAnnotation implementation **********
-
- // ***** 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(JPA.TABLE_GENERATOR__TABLE);
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- throw new UnsupportedOperationException();
- }
-
- private void setSchema_(String schema) {
- String old = this.schema;
- this.schema = schema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, schema);
- }
-
- private String buildSchema() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__SCHEMA);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- throw new UnsupportedOperationException();
- }
-
- private void setCatalog_(String catalog) {
- String old = this.catalog;
- this.catalog = catalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, catalog);
- }
-
- private String buildCatalog() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__CATALOG);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** pk column name
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String pkColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setPkColumnName_(String pkColumnName) {
- String old = this.pkColumnName;
- this.pkColumnName = pkColumnName;
- this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, pkColumnName);
- }
-
- private String buildPkColumnName() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
- }
-
- public TextRange getPkColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** value column name
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String valueColumnName) {
- throw new UnsupportedOperationException();
- }
-
- private void setValueColumnName_(String valueColumnName) {
- String old = this.valueColumnName;
- this.valueColumnName = valueColumnName;
- this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, valueColumnName);
- }
-
- private String buildValueColumnName() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
- }
-
- public TextRange getValueColumnNameTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** pk column value
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String pkColumnValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setPkColumnValue_(String pkColumnValue) {
- String old = this.pkColumnValue;
- this.pkColumnValue = pkColumnValue;
- this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, pkColumnValue);
- }
-
- private String buildPkColumnValue() {
- return (String) this.getJdtMemberValue(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
- }
-
- public TextRange getPkColumnValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public boolean pkColumnValueTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public UniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public UniqueConstraintAnnotation addUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeUniqueConstraint(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<UniqueConstraintAnnotation> buildUniqueConstraints() {
- Object[] jdtUniqueConstraints = this.getJdtMemberValues(JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
- Vector<UniqueConstraintAnnotation> result = new Vector<UniqueConstraintAnnotation>(jdtUniqueConstraints.length);
- for (Object jdtUniqueConstraint : jdtUniqueConstraints) {
- result.add(new BinaryUniqueConstraintAnnotation(this, (IAnnotation) jdtUniqueConstraint));
- }
- return result;
- }
-
- // TODO
- private void updateUniqueConstraints() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTemporalAnnotation.java
deleted file mode 100644
index b4e6fd81ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTemporalAnnotation.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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-
-/**
- * javax.persistence.Temporal
- */
-public final class BinaryTemporalAnnotation
- extends BinaryBaseTemporalAnnotation
- implements TemporalAnnotation
-{
-
- public BinaryTemporalAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTransientAnnotation.java
deleted file mode 100644
index 92e643fd4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryTransientAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-
-/**
- * javax.persistence.Transient
- */
-public final class BinaryTransientAnnotation
- extends BinaryAnnotation
- implements TransientAnnotation
-{
-
- public BinaryTransientAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java
deleted file mode 100644
index 2d8af3aec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryUniqueConstraintAnnotation.java
+++ /dev/null
@@ -1,97 +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.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.UniqueConstraint
- */
-final class BinaryUniqueConstraintAnnotation
- extends BinaryAnnotation
- implements UniqueConstraintAnnotation
-{
- private final Vector<String> columnNames;
-
-
- BinaryUniqueConstraintAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.columnNames = this.buildColumnNames();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumnNames();
- }
-
- // TODO
- private void updateColumnNames() {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** UniqueConstraintAnnotation implementation **********
-
- // ***** column names
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- private Vector<String> buildColumnNames() {
- Object[] jdtColumnNames = this.getJdtMemberValues(JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- Vector<String> result = new Vector<String>(jdtColumnNames.length);
- for (Object jdtColumnName : jdtColumnNames) {
- result.add((String) jdtColumnName);
- }
- return result;
- }
-
- public void addColumnName(String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void addColumnName(int index, String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumnName(String columnName) {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumnName(int index) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryVersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryVersionAnnotation.java
deleted file mode 100644
index 37f3256a19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/BinaryVersionAnnotation.java
+++ /dev/null
@@ -1,32 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-
-/**
- * javax.persistence.Version
- */
-public final class BinaryVersionAnnotation
- extends BinaryAnnotation
- implements VersionAnnotation
-{
-
- public BinaryVersionAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/RootBinaryNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/RootBinaryNode.java
deleted file mode 100644
index 1a8152c288..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/binary/RootBinaryNode.java
+++ /dev/null
@@ -1,82 +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.core.internal.resource.java.binary;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaResourceModelListener;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.utility.internal.ListenerList;
-
-/**
- * JAR and external types
- */
-abstract class RootBinaryNode
- extends BinaryNode
- implements JavaResourceNode.Root
-{
- /** pluggable annotation provider */
- private final JpaAnnotationProvider annotationProvider;
-
- /** listeners notified whenever the resource model changes */
- private final ListenerList<JpaResourceModelListener> resourceModelListenerList = new ListenerList<JpaResourceModelListener>(JpaResourceModelListener.class);
-
-
- // ********** construction **********
-
- RootBinaryNode(JavaResourceNode parent, JpaAnnotationProvider annotationProvider) {
- super(parent);
- this.annotationProvider = annotationProvider;
- }
-
-
- // ********** overrides **********
-
- @Override
- protected boolean requiresParent() {
- return false;
- }
-
- @Override
- public Root getRoot() {
- return this;
- }
-
- @Override
- public JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- public void resourceModelChanged() {
- for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/AnnotationContainerTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/AnnotationContainerTools.java
deleted file mode 100644
index 2510e2128a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/AnnotationContainerTools.java
+++ /dev/null
@@ -1,266 +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.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-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.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.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * Utility methods for manipulating annotation containers.
- */
-public final class AnnotationContainerTools {
-
- /**
- * Add a nested annotation to the specified annotation container
- * at the specified index.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> NestableAnnotation addNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
- // add a new annotation to the end of the list...
- int sourceIndex = annotationContainer.getNestedAnnotationsSize();
- T nestedAnnotation = annotationContainer.addNestedAnnotation();
- nestedAnnotation.newAnnotation();
- // ...then move it to the specified index
- moveNestedAnnotation(index, sourceIndex, annotationContainer);
- return nestedAnnotation;
- }
-
- /**
- * Move the nested annotation at the specified source index in the
- * specified annotation container to the specified target index.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> void moveNestedAnnotation(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
- if (targetIndex != sourceIndex) {
- moveNestedAnnotation_(targetIndex, sourceIndex, annotationContainer);
- }
- }
-
- private static <T extends NestableAnnotation> void moveNestedAnnotation_(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer) {
- NestableAnnotation nestedAnnotation = annotationContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- syncAstAnnotationsAfterMove(targetIndex, sourceIndex, annotationContainer, nestedAnnotation);
- }
-
- /**
- * 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 static <T extends NestableAnnotation> void syncAstAnnotationsAfterMove(int targetIndex, int sourceIndex, AnnotationContainer<T> annotationContainer, NestableAnnotation nestedAnnotation) {
- // move the Java annotation to the end of the list...
- nestedAnnotation.moveAnnotation(annotationContainer.getNestedAnnotationsSize());
- // ...then shift the other AST annotations over one slot...
- List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
- if (sourceIndex < targetIndex) {
- for (int i = sourceIndex; i < targetIndex; i++) {
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- } else {
- for (int i = sourceIndex; i > targetIndex; i-- ) {
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- }
- // ...then move the AST annotation to the now empty slot at the target index
- nestedAnnotation.moveAnnotation(targetIndex);
- }
-
- /**
- * Remove the nested annotation at the specified index in the
- * specified annotation container.
- * This method modifies both the resource model annotation container and the
- * AST; with <em>no</em> change notification.
- */
- public static <T extends NestableAnnotation> void removeNestedAnnotation(int index, AnnotationContainer<T> annotationContainer) {
- T nestedAnnotation = annotationContainer.removeNestedAnnotation(index);
- nestedAnnotation.removeAnnotation();
- syncAstAnnotationsAfterRemove(index, annotationContainer);
- }
-
- /**
- * 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 static <T extends NestableAnnotation> void syncAstAnnotationsAfterRemove(int index, AnnotationContainer<T> annotationContainer) {
- List<T> nestableAnnotations = CollectionTools.list(annotationContainer.getNestedAnnotations());
- for (int i = index; i < nestableAnnotations.size(); 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
- nestableAnnotations.get(i).moveAnnotation(i);
- }
- }
-
- /**
- * Initialize the specified resource model annotation container to be in
- * sync with the specified AST. No change notification will occur.
- */
- public static <T extends NestableAnnotation> void initialize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
- // ignore the nested AST annotations themselves
- // (maybe someday we can use them during initialization...)
- int size = getNestedAstAnnotations(astRoot, annotationContainer).size();
- for (int i = 0; i < size; i++) {
- T nestedAnnotation = annotationContainer.addNestedAnnotation();
- nestedAnnotation.initialize(astRoot);
- }
- }
-
- /**
- * Return a list of the nested AST annotations.
- */
- private static <T extends NestableAnnotation> ArrayList<Annotation> getNestedAstAnnotations(CompilationUnit astRoot, AnnotationContainer<T> annotationContainer) {
- ArrayList<Annotation> result = new ArrayList<Annotation>();
- Annotation astContainerAnnotation = annotationContainer.getAstAnnotation(astRoot);
- if (astContainerAnnotation.isMarkerAnnotation()) {
- // no nested annotations
- }
- else if (astContainerAnnotation.isSingleMemberAnnotation()) {
- if (annotationContainer.getElementName().equals("value")) { //$NON-NLS-1$
- Expression ex = ((SingleMemberAnnotation) astContainerAnnotation).getValue();
- addAstAnnotationsTo(ex, annotationContainer.getNestedAnnotationName(), result);
- } else {
- // no nested annotations
- }
- }
- else if (astContainerAnnotation.isNormalAnnotation()) {
- MemberValuePair pair = getMemberValuePair((NormalAnnotation) astContainerAnnotation, annotationContainer.getElementName());
- if (pair == null) {
- // no nested annotations
- } else {
- addAstAnnotationsTo(pair.getValue(), annotationContainer.getNestedAnnotationName(), result);
- }
- }
- return result;
- }
-
- /**
- * Add whatever annotations are represented by the specified expression to
- * the specified list. Add null to the list for any non-annotation expression.
- */
- private static void addAstAnnotationsTo(Expression expression, String annotationName, ArrayList<Annotation> astAnnotations) {
- if (expression == null) {
- astAnnotations.add(null); // not sure how we would get here...
- }
- else if (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- addAstAnnotationsTo((ArrayInitializer) expression, annotationName, astAnnotations);
- }
- else {
- astAnnotations.add(getAstAnnotation_(expression, annotationName));
- }
- }
-
- private static void addAstAnnotationsTo(ArrayInitializer arrayInitializer, String annotationName, ArrayList<Annotation> astAnnotations) {
- @SuppressWarnings("unchecked")
- List<Expression> expressions = arrayInitializer.expressions();
- for (Expression expression : expressions) {
- astAnnotations.add(getAstAnnotation(expression, annotationName));
- }
- }
-
- /**
- * If the specified expression is an annotation with the specified name, return it;
- * otherwise return null.
- */
- private static Annotation getAstAnnotation(Expression expression, String annotationName) {
- // not sure how the expression could be null...
- return (expression == null) ? null : getAstAnnotation_(expression, annotationName);
- }
-
- /**
- * pre-condition: expression is not null
- */
- private static Annotation getAstAnnotation_(Expression expression, String annotationName) {
- switch (expression.getNodeType()) {
- case ASTNode.NORMAL_ANNOTATION:
- case ASTNode.SINGLE_MEMBER_ANNOTATION:
- case ASTNode.MARKER_ANNOTATION:
- Annotation astAnnotation = (Annotation) expression;
- if (getQualifiedName(astAnnotation).equals(annotationName)) {
- return astAnnotation;
- }
- return null;
- default:
- return null;
- }
- }
-
- private static String getQualifiedName(Annotation astAnnotation) {
- ITypeBinding typeBinding = astAnnotation.resolveTypeBinding();
- if (typeBinding != null) {
- String resolvedName = typeBinding.getQualifiedName();
- if (resolvedName != null) {
- return resolvedName;
- }
- }
- return astAnnotation.getTypeName().getFullyQualifiedName();
- }
-
- private static MemberValuePair getMemberValuePair(NormalAnnotation annotation, String elementName) {
- @SuppressWarnings("unchecked")
- List<MemberValuePair> pairs = annotation.values();
- for (MemberValuePair pair : pairs) {
- if (pair.getName().getFullyQualifiedName().equals(elementName)) {
- return pair;
- }
- }
- return null;
- }
-
- /**
- * Synchronize the resource model annotations in the specified annotation
- * container with those in the specified AST. Trigger the appropriate change
- * notification.
- */
- public static <T extends NestableAnnotation> void synchronize(AnnotationContainer<T> annotationContainer, CompilationUnit astRoot) {
- ArrayList<Annotation> astAnnotations = getNestedAstAnnotations(astRoot, annotationContainer);
- Iterator<Annotation> astAnnotationStream = astAnnotations.iterator();
-
- for (T nestedAnnotation : annotationContainer.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(astRoot);
- } else {
- // no more AST annotations - remove the remaining nested annotations and exit
- annotationContainer.syncRemoveNestedAnnotations(astAnnotations.size());
- return;
- }
- }
-
- // add nested annotations for any remaining AST annotations
- while (astAnnotationStream.hasNext()) {
- annotationContainer.syncAddNestedAnnotation(astAnnotationStream.next());
- }
- }
-
- private AnnotationContainerTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java
deleted file mode 100644
index 27e8e8c4e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAnnotation.java
+++ /dev/null
@@ -1,146 +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.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.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * some common state and behavior for Java source annotations;
- * and lots of convenience methods
- */
-public abstract class SourceAnnotation<M extends Member>
- extends SourceNode
- implements Annotation
-{
- protected final M member;
-
- protected final DeclarationAnnotationAdapter daa;
-
- protected final AnnotationAdapter annotationAdapter;
-
-
- /**
- * constructor for straight member annotation
- */
- protected SourceAnnotation(JavaResourceNode parent, M member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- /**
- * constructor for nested annotation (typically)
- */
- protected SourceAnnotation(JavaResourceNode parent, M member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent);
- this.member = member;
- 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();
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return the text range corresponding to the annotation.
- * If the annotation is missing, return null.
- */
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- return 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) {
- return this.getTextRange(this.getAnnotationElementExpression(adapter, astRoot));
- }
-
- /**
- * Return the specified AST DOM element.
- */
- protected Expression getAnnotationElementExpression(DeclarationAnnotationElementAdapter<?> adapter, CompilationUnit astRoot) {
- return adapter.getExpression(this.member.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 : new ASTNodeTextRange(astNode);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java
deleted file mode 100644
index ea11bfe3a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,218 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.AssociationOverride
- */
-public abstract class SourceAssociationOverrideAnnotation
- extends SourceOverrideAnnotation
- implements NestableAssociationOverrideAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final JoinColumnsAnnotationContainer joinColumnsContainer = new JoinColumnsAnnotationContainer();
-
-
- // ********** construction/initialization **********
-
- protected SourceAssociationOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.joinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.joinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ASSOCIATION_OVERRIDE__NAME;
- }
-
-
- // ********** AssociationOverrideAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumnAnnotation addJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addJoinColumn_() {
- return this.addJoinColumn_(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(joinColumn);
- return joinColumn;
- }
-
- void syncAddJoinColumn(Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return SourceJoinColumnAnnotation.createAssociationOverrideJoinColumn(this.daa, this, this.member, index);
- }
-
- void joinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeJoinColumn_(int index) {
- return this.joinColumns.remove(index);
- }
-
- void syncRemoveJoinColumns(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AssociationOverrideAnnotation oldOverride = (AssociationOverrideAnnotation) oldAnnotation;
- for (JoinColumnAnnotation oldJoinColumn : CollectionTools.iterable(oldOverride.joinColumns())) {
- NestableJoinColumnAnnotation newJoinColumn = this.addJoinColumn(oldOverride.indexOfJoinColumn(oldJoinColumn));
- newJoinColumn.initializeFrom((NestableAnnotation) oldJoinColumn);
- }
- }
-
- // ********** join column container **********
-
- /**
- * adapt the AnnotationContainer interface to the override's join columns
- */
- class JoinColumnsAnnotationContainer
- implements AnnotationContainer<NestableJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceAssociationOverrideAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS;
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceAssociationOverrideAnnotation.this.getNestableJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceAssociationOverrideAnnotation.this.joinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceAssociationOverrideAnnotation.this.addJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceAssociationOverrideAnnotation.this.syncAddJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceAssociationOverrideAnnotation.this.moveJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceAssociationOverrideAnnotation.this.removeJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceAssociationOverrideAnnotation.this.syncRemoveJoinColumns(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java
deleted file mode 100644
index bb5930a7fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,110 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAssociationOverrideAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.AssociationOverrides
- */
-public abstract class SourceAssociationOverridesAnnotation
- extends SourceAnnotation<Member>
- implements AssociationOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableAssociationOverrideAnnotation> associationOverrides = new Vector<NestableAssociationOverrideAnnotation>();
-
-
- protected SourceAssociationOverridesAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.associationOverrides);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.ASSOCIATION_OVERRIDES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return AssociationOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableAssociationOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAssociationOverrideAnnotation>(this.associationOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.associationOverrides.size();
- }
-
- public NestableAssociationOverrideAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.associationOverrides.size());
- }
-
- private NestableAssociationOverrideAnnotation addNestedAnnotation(int index) {
- NestableAssociationOverrideAnnotation associationOverride = this.buildAssociationOverride(index);
- this.associationOverrides.add(associationOverride);
- return associationOverride;
- }
-
- protected abstract NestableAssociationOverrideAnnotation buildAssociationOverride(int index);
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.associationOverrides.size();
- NestableAssociationOverrideAnnotation associationOverride = this.addNestedAnnotation(index);
- associationOverride.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(ASSOCIATION_OVERRIDES_LIST, index, associationOverride);
- }
-
- public NestableAssociationOverrideAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.associationOverrides, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableAssociationOverrideAnnotation removeNestedAnnotation(int index) {
- return this.associationOverrides.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.associationOverrides, ASSOCIATION_OVERRIDES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java
deleted file mode 100644
index f3f8f3b3c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,158 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAttributeOverrideColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.AttributeOverride
- */
-public final class SourceAttributeOverrideAnnotation
- extends SourceOverrideAnnotation
- implements NestableAttributeOverrideAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final MemberAnnotationAdapter columnAdapter;
- private NestableColumnAnnotation column;
-
-
- // ********** construction/initialization **********
-
- public SourceAttributeOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.columnAdapter = new MemberAnnotationAdapter(this.member, SourceColumnAnnotation.buildAttributeOverrideAnnotationAdapter(this.daa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, this.daa);
- this.column.initialize(astRoot);
- }
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncColumn(astRoot);
- }
-
-
- // ********** SourceOverrideAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.ATTRIBUTE_OVERRIDE__NAME;
- }
-
-
- //************ AttributeOverride implementation ****************
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : new NullAttributeOverrideColumnAnnotation(this);
- }
-
- public NestableColumnAnnotation addColumn() {
- if (this.column != null) {
- throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$
- }
- this.column = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, 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$
- }
- this.column.removeAnnotation();
- this.column = null;
- }
-
- private void syncColumn(CompilationUnit astRoot) {
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.syncColumn_(null);
- } else {
- if (this.column == null) {
- NestableColumnAnnotation col = SourceColumnAnnotation.createAttributeOverrideColumn(this, this.member, this.daa);
- col.initialize(astRoot);
- this.syncColumn_(col);
- } else {
- this.column.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncColumn_(NestableColumnAnnotation astColumn) {
- ColumnAnnotation old = this.column;
- this.column = astColumn;
- this.firePropertyChanged(COLUMN_PROPERTY, old, astColumn);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- AttributeOverrideAnnotation oldOverride = (AttributeOverrideAnnotation) oldAnnotation;
- ColumnAnnotation oldColumn = oldOverride.getColumn();
- if (oldColumn != null) {
- NestableColumnAnnotation newColumn = this.addColumn();
- newColumn.initializeFrom((NestableAnnotation) oldColumn);
- }
- }
-
-
- // ********** static methods **********
-
- public static SourceAttributeOverrideAnnotation buildAttributeOverride(JavaResourceNode parent, Member member) {
- return new SourceAttributeOverrideAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceAttributeOverrideAnnotation buildNestedAttributeOverride(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourceAttributeOverrideAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(attributeOverridesAdapter, index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java
deleted file mode 100644
index 21eb002c3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceAttributeOverridesAnnotation.java
+++ /dev/null
@@ -1,112 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAttributeOverrideAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.AttributeOverrides
- */
-public final class SourceAttributeOverridesAnnotation
- extends SourceAnnotation<Member>
- implements AttributeOverridesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableAttributeOverrideAnnotation> attributesOverrides = new Vector<NestableAttributeOverrideAnnotation>();
-
-
- public SourceAttributeOverridesAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.attributesOverrides);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.ATTRIBUTE_OVERRIDES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return AttributeOverrideAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableAttributeOverrideAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableAttributeOverrideAnnotation>(this.attributesOverrides);
- }
-
- public int getNestedAnnotationsSize() {
- return this.attributesOverrides.size();
- }
-
- public NestableAttributeOverrideAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.attributesOverrides.size());
- }
-
- private NestableAttributeOverrideAnnotation addNestedAnnotation(int index) {
- NestableAttributeOverrideAnnotation attributeOverride = this.buildAttributeOverride(index);
- this.attributesOverrides.add(attributeOverride);
- return attributeOverride;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.attributesOverrides.size();
- NestableAttributeOverrideAnnotation attributeOverride = this.addNestedAnnotation(index);
- attributeOverride.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(ATTRIBUTE_OVERRIDES_LIST, index, attributeOverride);
- }
-
- private NestableAttributeOverrideAnnotation buildAttributeOverride(int index) {
- return SourceAttributeOverrideAnnotation.buildNestedAttributeOverride(this, this.member, index, this.daa);
- }
-
- public NestableAttributeOverrideAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.attributesOverrides, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableAttributeOverrideAnnotation removeNestedAnnotation(int index) {
- return this.attributesOverrides.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.attributesOverrides, ATTRIBUTE_OVERRIDES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java
deleted file mode 100644
index 2dab34af2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseColumnAnnotation.java
+++ /dev/null
@@ -1,252 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.BaseColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- */
-public abstract class SourceBaseColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements BaseColumnAnnotation
-{
- protected final DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
- protected final AnnotationElementAdapter<String> tableAdapter;
- protected String table;
-
- protected final DeclarationAnnotationElementAdapter<Boolean> uniqueDeclarationAdapter;
- protected final AnnotationElementAdapter<Boolean> uniqueAdapter;
- protected Boolean unique;
-
- protected final DeclarationAnnotationElementAdapter<Boolean> nullableDeclarationAdapter;
- protected final AnnotationElementAdapter<Boolean> nullableAdapter;
- protected Boolean nullable;
-
- protected final DeclarationAnnotationElementAdapter<Boolean> insertableDeclarationAdapter;
- protected final AnnotationElementAdapter<Boolean> insertableAdapter;
- protected Boolean insertable;
-
- protected final DeclarationAnnotationElementAdapter<Boolean> updatableDeclarationAdapter;
- protected final AnnotationElementAdapter<Boolean> updatableAdapter;
- protected Boolean updatable;
-
-
- protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.tableDeclarationAdapter = this.buildStringElementAdapter(this.getTableElementName());
- this.tableAdapter = this.buildShortCircuitElementAdapter(this.tableDeclarationAdapter);
- this.uniqueDeclarationAdapter = this.buildBooleanElementAdapter(this.getUniqueElementName());
- this.uniqueAdapter = this.buildShortCircuitBooleanElementAdapter(this.uniqueDeclarationAdapter);
- this.nullableDeclarationAdapter = this.buildBooleanElementAdapter(this.getNullableElementName());
- this.nullableAdapter = this.buildShortCircuitBooleanElementAdapter(this.nullableDeclarationAdapter);
- this.insertableDeclarationAdapter = this.buildBooleanElementAdapter(this.getInsertableElementName());
- this.insertableAdapter = this.buildShortCircuitBooleanElementAdapter(this.insertableDeclarationAdapter);
- this.updatableDeclarationAdapter = this.buildBooleanElementAdapter(this.getUpdatableElementName());
- this.updatableAdapter = this.buildShortCircuitBooleanElementAdapter(this.updatableDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.buildTable(astRoot);
- this.unique = this.buildUnique(astRoot);
- this.nullable = this.buildNullable(astRoot);
- this.insertable = this.buildInsertable(astRoot);
- this.updatable = this.buildUpdatable(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncTable(this.buildTable(astRoot));
- this.syncUnique(this.buildUnique(astRoot));
- this.syncNullable(this.buildNullable(astRoot));
- this.syncInsertable(this.buildInsertable(astRoot));
- this.syncUpdatable(this.buildUpdatable(astRoot));
- }
-
-
- //************* BaseColumnAnnotation implementation *************
-
- // ***** 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);
- }
-
- protected abstract String getTableElementName();
-
- // ***** unique
- public Boolean getUnique() {
- return this.unique;
- }
-
- public void setUnique(Boolean unique) {
- if (this.attributeValueHasChanged(this.unique, unique)) {
- this.unique = unique;
- this.uniqueAdapter.setValue(unique);
- }
- }
-
- private void syncUnique(Boolean astUnique) {
- Boolean old = this.unique;
- this.unique = astUnique;
- this.firePropertyChanged(UNIQUE_PROPERTY, old, astUnique);
- }
-
- private Boolean buildUnique(CompilationUnit astRoot) {
- return this.uniqueAdapter.getValue(astRoot);
- }
-
- public TextRange getUniqueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.uniqueDeclarationAdapter, astRoot);
- }
-
- protected abstract String getUniqueElementName();
-
- // ***** nullable
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public void setNullable(Boolean nullable) {
- if (this.attributeValueHasChanged(this.nullable, nullable)) {
- this.nullable = nullable;
- this.nullableAdapter.setValue(nullable);
- }
- }
-
- private void syncNullable(Boolean astNullable) {
- Boolean old = this.nullable;
- this.nullable = astNullable;
- this.firePropertyChanged(NULLABLE_PROPERTY, old, astNullable);
- }
-
- private Boolean buildNullable(CompilationUnit astRoot) {
- return this.nullableAdapter.getValue(astRoot);
- }
-
- public TextRange getNullableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nullableDeclarationAdapter, astRoot);
- }
-
- protected abstract String getNullableElementName();
-
- // ***** insertable
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- public void setInsertable(Boolean insertable) {
- if (this.attributeValueHasChanged(this.insertable, insertable)) {
- this.insertable = insertable;
- this.insertableAdapter.setValue(insertable);
- }
- }
-
- private void syncInsertable(Boolean astInsertable) {
- Boolean old = this.insertable;
- this.insertable = astInsertable;
- this.firePropertyChanged(INSERTABLE_PROPERTY, old, astInsertable);
- }
-
- private Boolean buildInsertable(CompilationUnit astRoot) {
- return this.insertableAdapter.getValue(astRoot);
- }
-
- public TextRange getInsertableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.insertableDeclarationAdapter, astRoot);
- }
-
- protected abstract String getInsertableElementName();
-
- // ***** updatable
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- public void setUpdatable(Boolean updatable) {
- if (this.attributeValueHasChanged(this.updatable, updatable)) {
- this.updatable = updatable;
- this.updatableAdapter.setValue(updatable);
- }
- }
-
- private void syncUpdatable(Boolean astUpdatable) {
- Boolean old = this.updatable;
- this.updatable = astUpdatable;
- this.firePropertyChanged(UPDATABLE_PROPERTY, old, astUpdatable);
- }
-
- private Boolean buildUpdatable(CompilationUnit astRoot) {
- return this.updatableAdapter.getValue(astRoot);
- }
-
- public TextRange getUpdatableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.updatableDeclarationAdapter, astRoot);
- }
-
- protected abstract String getUpdatableElementName();
-
-
- //************* NestableAnnotation implementation *************
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- BaseColumnAnnotation oldColumn = (BaseColumnAnnotation) oldAnnotation;
- this.setTable(oldColumn.getTable());
- this.setUnique(oldColumn.getUnique());
- this.setNullable(oldColumn.getNullable());
- this.setInsertable(oldColumn.getInsertable());
- this.setUpdatable(oldColumn.getUpdatable());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java
deleted file mode 100644
index cd14ba5636..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseEnumeratedAnnotation.java
+++ /dev/null
@@ -1,87 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.EnumType;
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.Enumerated
- * javax.persistence.MapKeyEnumerated
- */
-public abstract class SourceBaseEnumeratedAnnotation
- extends SourceAnnotation<Attribute>
- implements EnumeratedAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private EnumType value;
-
-
- protected SourceBaseEnumeratedAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName(), false);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter);
- }
-
- 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);
- }
-
-
- // ********** EnumeratedAnnotation implementation **********
-
- // ***** value
- public EnumType getValue() {
- return this.value;
- }
-
- public void setValue(EnumType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(EnumType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(EnumType astValue) {
- EnumType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private EnumType buildValue(CompilationUnit astRoot) {
- return EnumType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.java
deleted file mode 100644
index 63e1dc52b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseJoinColumnAnnotation.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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.BaseJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.JoinColumn
- * javax.persistence.MapKeyJoinColumn
- */
-public abstract class SourceBaseJoinColumnAnnotation
- extends SourceBaseColumnAnnotation
- implements BaseJoinColumnAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
- private String referencedColumnName;
-
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(this.getReferencedColumnNameElementName());
- this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.buildReferencedColumnName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncReferencedColumnName(this.buildReferencedColumnName(astRoot));
- }
-
- protected abstract String getReferencedColumnNameElementName();
-
-
- //************ BaseJoinColumnAnnotation implementation ***************
-
- // referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- if (this.attributeValueHasChanged(this.referencedColumnName, referencedColumnName)) {
- this.referencedColumnName = referencedColumnName;
- this.referencedColumnNameAdapter.setValue(referencedColumnName);
- }
- }
-
- private void syncReferencedColumnName(String astReferencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = astReferencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, astReferencedColumnName);
- }
-
- private String buildReferencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- BaseJoinColumnAnnotation oldJoinColumn = (BaseJoinColumnAnnotation) oldAnnotation;
- this.setReferencedColumnName(oldJoinColumn.getReferencedColumnName());
- }
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- protected IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java
deleted file mode 100644
index 33c866bca1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseNamedQueryAnnotation.java
+++ /dev/null
@@ -1,311 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.BaseNamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHintAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.NamedQuery
- * javax.persistence.NamedNativeQuery
- */
-abstract class SourceBaseNamedQueryAnnotation
- extends SourceAnnotation<Type>
- implements BaseNamedQueryAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
-
- final DeclarationAnnotationElementAdapter<String> queryDeclarationAdapter;
- final AnnotationElementAdapter<String> queryAdapter;
- String query;
-
- final Vector<NestableQueryHintAnnotation> hints = new Vector<NestableQueryHintAnnotation>();
- final HintsAnnotationContainer hintsContainer = new HintsAnnotationContainer();
-
-
- SourceBaseNamedQueryAnnotation(JavaResourceNode parent, Type type,DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildNameAdapter(daa);
- this.queryDeclarationAdapter = this.buildQueryAdapter(daa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.queryAdapter = this.buildAdapter(this.queryDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.query = this.buildQuery(astRoot);
- AnnotationContainerTools.initialize(this.hintsContainer, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncQuery(this.buildQuery(astRoot));
- AnnotationContainerTools.synchronize(this.hintsContainer, astRoot);
- }
-
- /**
- * convenience method
- */
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseNamedQueryAnnotation 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);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, this.getNameElementName());
- }
-
- abstract String getNameElementName();
-
- // ***** query
- public String getQuery() {
- return this.query;
- }
-
- public void setQuery(String query) {
- if (this.attributeValueHasChanged(this.query, query)) {
- this.query = query;
- this.queryAdapter.setValue(query);
- }
- }
-
- private void syncQuery(String annotationQuery) {
- String old = this.query;
- this.query = annotationQuery;
- this.firePropertyChanged(QUERY_PROPERTY, old, annotationQuery);
- }
-
- private String buildQuery(CompilationUnit astRoot) {
- return this.queryAdapter.getValue(astRoot);
- }
-
- public TextRange getQueryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.queryDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildQueryAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, this.getQueryElementName());
- }
-
- abstract String getQueryElementName();
-
- // ***** hints
- public ListIterator<QueryHintAnnotation> hints() {
- return new CloneListIterator<QueryHintAnnotation>(this.hints);
- }
-
- Iterable<NestableQueryHintAnnotation> getNestableHints() {
- return new LiveCloneIterable<NestableQueryHintAnnotation>(this.hints);
- }
-
- public int hintsSize() {
- return this.hints.size();
- }
-
- public NestableQueryHintAnnotation hintAt(int index) {
- return this.hints.get(index);
- }
-
- public int indexOfHint(QueryHintAnnotation hint) {
- return this.hints.indexOf(hint);
- }
-
- public NestableQueryHintAnnotation addHint(int index) {
- return (NestableQueryHintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation addHint_() {
- return this.addHint_(this.hints.size());
- }
-
- private NestableQueryHintAnnotation addHint_(int index) {
- NestableQueryHintAnnotation hint = this.buildHint(index);
- this.hints.add(hint);
- return hint;
- }
-
- void syncAddHint(Annotation astAnnotation) {
- int index = this.hints.size();
- NestableQueryHintAnnotation hint = this.addHint_(index);
- hint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(HINTS_LIST, index, hint);
- }
-
- abstract NestableQueryHintAnnotation buildHint(int index);
-
- void hintAdded(int index, NestableQueryHintAnnotation hint) {
- this.fireItemAdded(HINTS_LIST, index, hint);
- }
-
- public void moveHint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation moveHint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.hints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeHint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.hintsContainer);
- }
-
- NestableQueryHintAnnotation removeHint_(int index) {
- return this.hints.remove(index);
- }
-
- void syncRemoveHints(int index) {
- this.removeItemsFromList(index, this.hints, HINTS_LIST);
- }
-
- abstract String getHintsElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- BaseNamedQueryAnnotation oldQuery = (BaseNamedQueryAnnotation) oldAnnotation;
- this.setName(oldQuery.getName());
- this.setQuery(oldQuery.getQuery());
- for (QueryHintAnnotation oldHint : CollectionTools.iterable(oldQuery.hints())) {
- NestableQueryHintAnnotation newHint = this.addHint(oldQuery.indexOfHint(oldHint));
- newHint.initializeFrom((NestableQueryHintAnnotation) oldHint);
- }
- }
-
- /**
- * 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;
- }
-
-
- // ********** hint container **********
-
- /**
- * adapt the AnnotationContainer interface to the override's join columns
- */
- class HintsAnnotationContainer
- implements AnnotationContainer<NestableQueryHintAnnotation>
- {
- public Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceBaseNamedQueryAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return SourceBaseNamedQueryAnnotation.this.getHintsElementName();
- }
-
- public String getNestedAnnotationName() {
- return QueryHintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableQueryHintAnnotation> getNestedAnnotations() {
- return SourceBaseNamedQueryAnnotation.this.getNestableHints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceBaseNamedQueryAnnotation.this.hintsSize();
- }
-
- public NestableQueryHintAnnotation addNestedAnnotation() {
- return SourceBaseNamedQueryAnnotation.this.addHint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceBaseNamedQueryAnnotation.this.syncAddHint(astAnnotation);
- }
-
- public NestableQueryHintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceBaseNamedQueryAnnotation.this.moveHint_(targetIndex, sourceIndex);
- }
-
- public NestableQueryHintAnnotation removeNestedAnnotation(int index) {
- return SourceBaseNamedQueryAnnotation.this.removeHint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceBaseNamedQueryAnnotation.this.syncRemoveHints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java
deleted file mode 100644
index 237510866e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTableAnnotation.java
+++ /dev/null
@@ -1,362 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.BaseTableAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraintAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.Table
- * javax.persistence.JoinTable
- * javax.persistence.SecondaryTable
- * javax.persistence.CollectionTable
- */
-public abstract class SourceBaseTableAnnotation
- extends SourceAnnotation<Member>
- implements BaseTableAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
-
- final DeclarationAnnotationElementAdapter<String> schemaDeclarationAdapter;
- final AnnotationElementAdapter<String> schemaAdapter;
- String schema;
-
- final DeclarationAnnotationElementAdapter<String> catalogDeclarationAdapter;
- final AnnotationElementAdapter<String> catalogAdapter;
- String catalog;
-
- final Vector<NestableUniqueConstraintAnnotation> uniqueConstraints = new Vector<NestableUniqueConstraintAnnotation>();
- final UniqueConstraintsAnnotationContainer uniqueConstraintsContainer = new UniqueConstraintsAnnotationContainer();
-
-
- protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected SourceBaseTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.getNameAdapter(daa);
- this.schemaDeclarationAdapter = this.getSchemaAdapter(daa);
- this.catalogDeclarationAdapter = this.getCatalogAdapter(daa);
- this.nameAdapter = this.buildAnnotationElementAdapter(this.nameDeclarationAdapter);
- this.schemaAdapter = this.buildAnnotationElementAdapter(this.schemaDeclarationAdapter);
- this.catalogAdapter = this.buildAnnotationElementAdapter(this.catalogDeclarationAdapter);
- }
-
- private AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.schema = this.buildSchema(astRoot);
- this.catalog = this.buildCatalog(astRoot);
- AnnotationContainerTools.initialize(this.uniqueConstraintsContainer, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncSchema(this.buildSchema(astRoot));
- this.syncCatalog(this.buildCatalog(astRoot));
- AnnotationContainerTools.synchronize(this.uniqueConstraintsContainer, astRoot);
- }
-
- /**
- * Return the uniqueConstraints element name
- */
- protected abstract String getUniqueConstraintsElementName();
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** BaseTableAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** 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 this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build and return a declaration element adapter for the table's 'name' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- if (this.attributeValueHasChanged(this.schema, schema)) {
- this.schema = schema;
- this.schemaAdapter.setValue(schema);
- }
- }
-
- private void syncSchema(String astSchema) {
- String old = this.schema;
- this.schema = astSchema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, astSchema);
- }
-
- private String buildSchema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.schemaDeclarationAdapter, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.schemaDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build and return a declaration element adapter for the table's 'schema' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- if (this.attributeValueHasChanged(this.catalog, catalog)) {
- this.catalog = catalog;
- this.catalogAdapter.setValue(catalog);
- }
- }
-
- private void syncCatalog(String astCatalog) {
- String old = this.catalog;
- this.catalog = astCatalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, astCatalog);
- }
-
- private String buildCatalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.catalogDeclarationAdapter, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.catalogDeclarationAdapter, pos, astRoot);
- }
-
- /**
- * Build and return a declaration element adapter for the table's 'catalog' element
- */
- protected abstract DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter);
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- Iterable<NestableUniqueConstraintAnnotation> getNestableUniqueConstraints() {
- return new LiveCloneIterable<NestableUniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraintAnnotation addUniqueConstraint(int index) {
- return (NestableUniqueConstraintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation addUniqueConstraint_() {
- return this.addUniqueConstraint_(this.uniqueConstraints.size());
- }
-
- private NestableUniqueConstraintAnnotation addUniqueConstraint_(int index) {
- NestableUniqueConstraintAnnotation uniqueConstraint = this.buildUniqueConstraint(index);
- this.uniqueConstraints.add(uniqueConstraint);
- return uniqueConstraint;
- }
-
- void syncAddUniqueConstraint(Annotation astAnnotation) {
- int index = this.uniqueConstraints.size();
- NestableUniqueConstraintAnnotation uniqueConstraint = this.addUniqueConstraint_(index);
- uniqueConstraint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) {
- return new SourceUniqueConstraintAnnotation(this, this.member, buildUniqueConstraintAnnotationAdapter(index));
- }
-
- IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, getUniqueConstraintsElementName(), index, JPA.UNIQUE_CONSTRAINT);
- }
-
- void uniqueConstraintAdded(int index, NestableUniqueConstraintAnnotation constraint) {
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, constraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation moveUniqueConstraint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeUniqueConstraint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation removeUniqueConstraint_(int index) {
- return this.uniqueConstraints.remove(index);
- }
-
- void syncRemoveUniqueConstraints(int index) {
- this.removeItemsFromList(index, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- protected void initializeFrom(NestableAnnotation oldAnnotation) {
- BaseTableAnnotation oldTable = (BaseTableAnnotation) oldAnnotation;
- this.setName(oldTable.getName());
- this.setSchema(oldTable.getSchema());
- this.setCatalog(oldTable.getCatalog());
- for (UniqueConstraintAnnotation oldUniqueConstraint : CollectionTools.iterable(oldTable.uniqueConstraints())) {
- NestableUniqueConstraintAnnotation newUniqueConstraint = this.addUniqueConstraint(oldTable.indexOfUniqueConstraint(oldUniqueConstraint));
- newUniqueConstraint.initializeFrom((NestableAnnotation) oldUniqueConstraint);
- }
- }
-
- // ********** unique constraint container **********
-
- /**
- * adapt the AnnotationContainer interface to the table's unique constraints
- */
- class UniqueConstraintsAnnotationContainer
- implements AnnotationContainer<NestableUniqueConstraintAnnotation>
- {
- public Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceBaseTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return SourceBaseTableAnnotation.this.getUniqueConstraintsElementName();
- }
-
- public String getNestedAnnotationName() {
- return UniqueConstraintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableUniqueConstraintAnnotation> getNestedAnnotations() {
- return SourceBaseTableAnnotation.this.getNestableUniqueConstraints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceBaseTableAnnotation.this.uniqueConstraintsSize();
- }
-
- public NestableUniqueConstraintAnnotation addNestedAnnotation() {
- return SourceBaseTableAnnotation.this.addUniqueConstraint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceBaseTableAnnotation.this.syncAddUniqueConstraint(astAnnotation);
- }
-
- public NestableUniqueConstraintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceBaseTableAnnotation.this.moveUniqueConstraint_(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraintAnnotation removeNestedAnnotation(int index) {
- return SourceBaseTableAnnotation.this.removeUniqueConstraint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceBaseTableAnnotation.this.syncRemoveUniqueConstraints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java
deleted file mode 100644
index 4845d65307..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBaseTemporalAnnotation.java
+++ /dev/null
@@ -1,88 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.core.resource.java.TemporalType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * Abstract implementation for JPA annotations
- * javax.persistence.Temporal
- * javax.persistence.MapKeyTemporal
- */
-public abstract class SourceBaseTemporalAnnotation
- extends SourceAnnotation<Attribute>
- implements TemporalAnnotation
-{
- protected final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private TemporalType value;
-
-
- protected SourceBaseTemporalAnnotation(JavaResourceNode parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.valueDeclarationAdapter = new EnumDeclarationAnnotationElementAdapter(daa, getValueElementName());
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, this.valueDeclarationAdapter);
- }
-
- 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);
- }
-
-
- // ********** TemporalAnnotation implementation **********
-
- // ***** value
- public TemporalType getValue() {
- return this.value;
- }
-
- public void setValue(TemporalType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(TemporalType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(TemporalType astValue) {
- TemporalType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private TemporalType buildValue(CompilationUnit astRoot) {
- return TemporalType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- protected abstract String getValueElementName();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java
deleted file mode 100644
index fe6151673c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceBasicAnnotation.java
+++ /dev/null
@@ -1,137 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.Basic
- */
-public final class SourceBasicAnnotation
- extends SourceAnnotation<Attribute>
- implements BasicAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
- private final AnnotationElementAdapter<String> fetchAdapter;
- private FetchType fetch;
-
-
- public SourceBasicAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = new MemberAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- this.fetchAdapter = new MemberAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.buildOptional(astRoot);
- this.fetch = this.buildFetch(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncOptional(this.buildOptional(astRoot));
- this.syncFetch(this.buildFetch(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.fetch);
- }
-
-
- //*************** Basic implementation ****************
-
- // ***** 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);
- }
-
- // ***** 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);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__OPTIONAL, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.BASIC__FETCH, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceColumnAnnotation.java
deleted file mode 100644
index 1d2f2864a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceColumnAnnotation.java
+++ /dev/null
@@ -1,129 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Column
- */
-public final class SourceColumnAnnotation
- extends SourceCompleteColumnAnnotation
- implements NestableColumnAnnotation
-{
- // this adapter is only used by a Column annotation associated with a mapping annotation (e.g. Basic)
- public static final DeclarationAnnotationAdapter MAPPING_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.COLUMN__UPDATABLE;
- }
-
- // ********** SourceCompleteColumnAnnotation implementation **********
-
- @Override
- protected String getLengthElementName() {
- return JPA.COLUMN__LENGTH;
- }
-
- @Override
- protected String getPrecisionElementName() {
- return JPA.COLUMN__PRECISION;
- }
-
- @Override
- protected String getScaleElementName() {
- return JPA.COLUMN__SCALE;
- }
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- ColumnAnnotation oldColumn = (ColumnAnnotation) oldAnnotation;
- this.setLength(oldColumn.getLength());
- this.setPrecision(oldColumn.getPrecision());
- this.setScale(oldColumn.getScale());
- }
-
- public void moveAnnotation(int newIndex) {
- // the only place where a column annotation is nested is in an
- // attribute override; and that only nests a single column, not an array
- // of columns; so #moveAnnotation(int) is never called
- // TODO maybe NestableAnnotation should be split up;
- // moving this method to something like IndexableAnnotation
- throw new UnsupportedOperationException();
- }
-
-
- // ********** static methods **********
-
- static NestableColumnAnnotation createAttributeOverrideColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new SourceColumnAnnotation(parent, member, buildAttributeOverrideAnnotationAdapter(attributeOverrideAnnotationAdapter));
- }
-
- static DeclarationAnnotationAdapter buildAttributeOverrideAnnotationAdapter(DeclarationAnnotationAdapter attributeOverrideAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(attributeOverrideAnnotationAdapter, JPA.ATTRIBUTE_OVERRIDE__COLUMN, JPA.COLUMN);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompilationUnit.java
deleted file mode 100644
index d7264195d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompilationUnit.java
+++ /dev/null
@@ -1,291 +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.core.internal.resource.java.source;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-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.TypeDeclaration;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaResourceModelListener;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * Java compilation unit (source file)
- */
-public final class SourceCompilationUnit
- extends SourceNode
- implements JavaResourceCompilationUnit
-{
- /** JDT compilation unit */
- private final ICompilationUnit compilationUnit;
-
- /** pluggable annotation provider */
- private final JpaAnnotationProvider 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<JpaResourceModelListener> resourceModelListenerList;
-
- /**
- * 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 JavaResourcePersistentType persistentType;
-
-
- // ********** construction **********
-
- public SourceCompilationUnit(
- ICompilationUnit compilationUnit,
- JpaAnnotationProvider 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<JpaResourceModelListener>(JpaResourceModelListener.class);
- this.persistentType = this.buildPersistentType();
- }
-
- public void initialize(CompilationUnit astRoot) {
- // never called?
- }
-
- private JavaResourcePersistentType buildPersistentType() {
- this.openCompilationUnit();
- CompilationUnit astRoot = this.buildASTRoot();
- this.closeCompilationUnit();
- return this.buildPersistentType(astRoot);
- }
-
- private void openCompilationUnit() {
- try {
- this.compilationUnit.open(null);
- } catch (JavaModelException ex) {
- // do nothing - we just won't have a primary type in this case
- }
- }
-
- private 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 JpaAnnotationProvider getAnnotationProvider() {
- return this.annotationProvider;
- }
-
-
- // ********** JavaResourceNode implementation **********
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncPersistentType(astRoot);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-
- // ********** JavaResourceNode.Root implementation **********
-
- /**
- * NB: return *all* the persistent types since we build them all
- */
- public Iterator<JavaResourcePersistentType> persistentTypes() {
- return (this.persistentType == null) ?
- EmptyIterator.<JavaResourcePersistentType>instance() :
- this.persistentType.allTypes();
- }
-
- public void resourceModelChanged() {
- for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
-
- // ********** JavaResourceCompilationUnit implementation **********
-
- public ICompilationUnit getCompilationUnit() {
- return this.compilationUnit;
- }
-
- public void resolveTypes() {
- if (this.persistentType != null) {
- this.persistentType.resolveTypes(this.buildASTRoot());
- }
- }
-
- public CommandExecutor getModifySharedDocumentCommandExecutor() {
- return this.modifySharedDocumentCommandExecutor;
- }
-
- public AnnotationEditFormatter getAnnotationEditFormatter() {
- return this.annotationEditFormatter;
- }
-
- public CompilationUnit buildASTRoot() {
- return ASTTools.buildASTRoot(this.compilationUnit);
- }
-
-
- // ********** persistent type **********
-
- private JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- return (td == null) ? null : this.buildPersistentType(astRoot, td);
- }
-
-
- private void syncPersistentType(CompilationUnit astRoot) {
- TypeDeclaration td = this.getPrimaryTypeDeclaration(astRoot);
- if (td == null) {
- this.syncPersistentType_(null);
- } else {
- if (this.persistentType == null) {
- this.syncPersistentType_(this.buildPersistentType(astRoot, td));
- } else {
- this.persistentType.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncPersistentType_(JavaResourcePersistentType astPersistentType) {
- JavaResourcePersistentType old = this.persistentType;
- this.persistentType = astPersistentType;
- this.firePropertyChanged(PERSISTENT_TYPES_COLLECTION, old, astPersistentType);
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- public void addResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-
- // ********** Java changes **********
-
- public void synchronizeWithJavaSource() {
- this.synchronizeWith(this.buildASTRoot());
- }
-
-
- // ********** internal **********
-
- private JavaResourcePersistentType buildPersistentType(CompilationUnit astRoot, TypeDeclaration typeDeclaration) {
- return SourcePersistentType.newInstance(this, typeDeclaration, astRoot);
- }
-
- /**
- * i.e. the type with the same name as the compilation unit;
- * return the first class or interface (ignore annotations and enums) with
- * the same name as the compilation unit (file);
- * NB: this type could be in error if there is an annotation or enum
- * 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 TypeDeclaration getPrimaryTypeDeclaration(CompilationUnit astRoot) {
- String primaryTypeName = this.getPrimaryTypeName();
- for (AbstractTypeDeclaration atd : this.types(astRoot)) {
- if (this.nodeIsPrimaryTypeDeclaration(atd, primaryTypeName)) {
- return (atd.resolveBinding() == null) ? null : (TypeDeclaration) atd;
- }
- }
- return null;
- }
-
- private boolean nodeIsPrimaryTypeDeclaration(AbstractTypeDeclaration atd, String primaryTypeName) {
- return (atd.getNodeType() == ASTNode.TYPE_DECLARATION) &&
- atd.getName().getFullyQualifiedName().equals(primaryTypeName);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
- /**
- * i.e. the name of the compilation unit
- */
- private String getPrimaryTypeName() {
- 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.getPrimaryTypeName());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java
deleted file mode 100644
index 766c351580..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceCompleteColumnAnnotation.java
+++ /dev/null
@@ -1,155 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * Abstract implementation of ColumnAnnotation to be used for JPA annotations:
- * javax.persistence.Column
- * javax.persistence.MapKeyColumn
- */
-public abstract class SourceCompleteColumnAnnotation
- extends SourceBaseColumnAnnotation
- implements ColumnAnnotation
-{
- protected final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
- protected final AnnotationElementAdapter<Integer> lengthAdapter;
- protected Integer length;
-
- protected final DeclarationAnnotationElementAdapter<Integer> precisionDeclarationAdapter;
- protected final AnnotationElementAdapter<Integer> precisionAdapter;
- protected Integer precision;
-
- protected final DeclarationAnnotationElementAdapter<Integer> scaleDeclarationAdapter;
- protected final AnnotationElementAdapter<Integer> scaleAdapter;
- protected Integer scale;
-
-
- protected SourceCompleteColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(this.getLengthElementName());
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- this.precisionDeclarationAdapter = this.buildIntegerElementAdapter(this.getPrecisionElementName());
- this.precisionAdapter = this.buildShortCircuitIntegerElementAdapter(this.precisionDeclarationAdapter);
- this.scaleDeclarationAdapter = this.buildIntegerElementAdapter(this.getScaleElementName());
- this.scaleAdapter = this.buildShortCircuitIntegerElementAdapter(this.scaleDeclarationAdapter);
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.length = this.buildLength(astRoot);
- this.precision = this.buildPrecision(astRoot);
- this.scale = this.buildScale(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncLength(this.buildLength(astRoot));
- this.syncPrecision(this.buildPrecision(astRoot));
- this.syncScale(this.buildScale(astRoot));
- }
-
-
- // ********** ColumnAnnotation implementation **********
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- if (this.attributeValueHasChanged(this.length, length)) {
- this.length = length;
- this.lengthAdapter.setValue(length);
- }
- }
-
- private void syncLength(Integer astLength) {
- Integer old = this.length;
- this.length = astLength;
- this.firePropertyChanged(LENGTH_PROPERTY, old, astLength);
- }
-
- private Integer buildLength(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
- public TextRange getLengthTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.lengthDeclarationAdapter, astRoot);
- }
-
- protected abstract String getLengthElementName();
-
- // ***** precision
- public Integer getPrecision() {
- return this.precision;
- }
-
- public void setPrecision(Integer precision) {
- if (this.attributeValueHasChanged(this.precision, precision)) {
- this.precision = precision;
- this.precisionAdapter.setValue(precision);
- }
- }
-
- private void syncPrecision(Integer astPrecision) {
- Integer old = this.precision;
- this.precision = astPrecision;
- this.firePropertyChanged(PRECISION_PROPERTY, old, astPrecision);
- }
-
- private Integer buildPrecision(CompilationUnit astRoot) {
- return this.precisionAdapter.getValue(astRoot);
- }
-
- public TextRange getPrecisionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.precisionDeclarationAdapter, astRoot);
- }
-
- protected abstract String getPrecisionElementName();
-
- // ***** scale
- public Integer getScale() {
- return this.scale;
- }
-
- public void setScale(Integer scale) {
- if (this.attributeValueHasChanged(this.scale, scale)) {
- this.scale = scale;
- this.scaleAdapter.setValue(scale);
- }
- }
-
- private void syncScale(Integer astScale) {
- Integer old = this.scale;
- this.scale = astScale;
- this.firePropertyChanged(SCALE_PROPERTY, old, astScale);
- }
-
- private Integer buildScale(CompilationUnit astRoot) {
- return this.scaleAdapter.getValue(astRoot);
- }
-
- public TextRange getScaleTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.scaleDeclarationAdapter, astRoot);
- }
-
- protected abstract String getScaleElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java
deleted file mode 100644
index e600666f3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,144 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.DiscriminatorColumn
- */
-public final class SourceDiscriminatorColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements DiscriminatorColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> DISCRIMINATOR_TYPE_ADAPTER = buildDiscriminatorTypeAdapter();
- private final AnnotationElementAdapter<String> discriminatorTypeAdapter;
- private DiscriminatorType discriminatorType;
-
- private final DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> lengthAdapter;
- private Integer length;
-
-
- public SourceDiscriminatorColumnAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.discriminatorTypeAdapter = new MemberAnnotationElementAdapter<String>(type, DISCRIMINATOR_TYPE_ADAPTER);
- this.lengthDeclarationAdapter = this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH);
- this.lengthAdapter = this.buildShortCircuitIntegerElementAdapter(this.lengthDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.discriminatorType = this.buildDiscriminatorType(astRoot);
- this.length = this.buildLength(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncLength(this.buildLength(astRoot));
- this.syncDiscriminatorType(this.buildDiscriminatorType(astRoot));
- }
-
-
- // ********** JavaSourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** DiscriminatorColumn implementation **********
-
- // ***** discriminator type
- public DiscriminatorType getDiscriminatorType() {
- return this.discriminatorType;
- }
-
- public void setDiscriminatorType(DiscriminatorType discriminatorType) {
- if (this.attributeValueHasChanged(this.discriminatorType, discriminatorType)) {
- this.discriminatorType = discriminatorType;
- this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(discriminatorType));
- }
- }
-
- private void syncDiscriminatorType(DiscriminatorType astDiscriminatorType) {
- DiscriminatorType old = this.discriminatorType;
- this.discriminatorType = astDiscriminatorType;
- this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, astDiscriminatorType);
- }
-
- private DiscriminatorType buildDiscriminatorType(CompilationUnit astRoot) {
- return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot));
- }
-
- // ***** length
- public Integer getLength() {
- return this.length;
- }
-
- public void setLength(Integer length) {
- if (this.attributeValueHasChanged(this.length, length)) {
- this.length = length;
- this.lengthAdapter.setValue(length);
- }
- }
-
- private void syncLength(Integer astLength) {
- Integer old = this.length;
- this.length = astLength;
- this.firePropertyChanged(LENGTH_PROPERTY, old, astLength);
- }
-
- private Integer buildLength(CompilationUnit astRoot) {
- return this.lengthAdapter.getValue(astRoot);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- throw new UnsupportedOperationException("DiscriminatorColumn is not a nestable annotation"); //$NON-NLS-1$
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java
deleted file mode 100644
index 17f63b8238..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceDiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,97 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.DiscriminatorValue
- */
-public final class SourceDiscriminatorValueAnnotation
- extends SourceAnnotation<Type>
- implements DiscriminatorValueAnnotation
-{
- 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;
-
-
- public SourceDiscriminatorValueAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, 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 void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** DiscriminatorValueAnnotation 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, JPA.DISCRIMINATOR_VALUE__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddableAnnotation.java
deleted file mode 100644
index a336c4466f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddableAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Embeddable
- */
-public final class SourceEmbeddableAnnotation
- extends SourceAnnotation<Type>
- implements EmbeddableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddableAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedAnnotation.java
deleted file mode 100644
index 2e29565656..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Embedded
- */
-public final class SourceEmbeddedAnnotation
- extends SourceAnnotation<Attribute>
- implements EmbeddedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java
deleted file mode 100644
index 17901e5a7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.EmbeddedId
- */
-public final class SourceEmbeddedIdAnnotation
- extends SourceAnnotation<Attribute>
- implements EmbeddedIdAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEmbeddedIdAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java
deleted file mode 100644
index 8aa53f278a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEntityAnnotation.java
+++ /dev/null
@@ -1,97 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Entity
- */
-public final class SourceEntityAnnotation
- extends SourceAnnotation<Type>
- implements EntityAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
-
- public SourceEntityAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new MemberAnnotationElementAdapter<String>(this.member, NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** EntityAnnotation 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);
- }
-
-
- //*********** static methods ****************
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ENTITY__NAME, false); // false = do not remove annotation when empty
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEnumeratedAnnotation.java
deleted file mode 100644
index 031706d84c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceEnumeratedAnnotation.java
+++ /dev/null
@@ -1,38 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Enumerated
- */
-public final class SourceEnumeratedAnnotation
- extends SourceBaseEnumeratedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- public SourceEnumeratedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.ENUMERATED__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java
deleted file mode 100644
index 75b8b9fe5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratedValueAnnotation.java
+++ /dev/null
@@ -1,141 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.core.resource.java.GenerationType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.GeneratedValue
- */
-public final class SourceGeneratedValueAnnotation
- extends SourceAnnotation<Member>
- implements GeneratedValueAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
- private final AnnotationElementAdapter<String> strategyAdapter;
- private GenerationType strategy;
-
- private static final DeclarationAnnotationElementAdapter<String> GENERATOR_ADAPTER = buildGeneratorAdapter();
- private final AnnotationElementAdapter<String> generatorAdapter;
- private String generator;
-
-
- public SourceGeneratedValueAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new MemberAnnotationElementAdapter<String>(attribute, STRATEGY_ADAPTER);
- this.generatorAdapter = new MemberAnnotationElementAdapter<String>(attribute, GENERATOR_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.buildStrategy(astRoot);
- this.generator = this.buildGenerator(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncStrategy(this.buildStrategy(astRoot));
- this.syncGenerator(this.buildGenerator(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.strategy);
- }
-
-
- // ********** GeneratedValueAnnotation implementation **********
-
- // ***** strategy
- public GenerationType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(GenerationType strategy) {
- if (this.attributeValueHasChanged(this.strategy, strategy)) {
- this.strategy = strategy;
- this.strategyAdapter.setValue(GenerationType.toJavaAnnotationValue(strategy));
- }
- }
-
- private void syncStrategy(GenerationType astStrategy) {
- GenerationType old = this.strategy;
- this.strategy = astStrategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, astStrategy);
- }
-
- private GenerationType buildStrategy(CompilationUnit astRoot) {
- return GenerationType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
- // ***** generator
- public String getGenerator() {
- return this.generator;
- }
-
- public void setGenerator(String generator) {
- if (this.attributeValueHasChanged(this.generator, generator)) {
- this.generator = generator;
- this.generatorAdapter.setValue(generator);
- }
- }
-
- private void syncGenerator(String astGenerator) {
- String old = this.generator;
- this.generator = astGenerator;
- this.firePropertyChanged(GENERATOR_PROPERTY, old, astGenerator);
- }
-
- private String buildGenerator(CompilationUnit astRoot) {
- return this.generatorAdapter.getValue(astRoot);
- }
-
- public TextRange getGeneratorTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(GENERATOR_ADAPTER, astRoot);
- }
-
- public boolean generatorTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(GENERATOR_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__STRATEGY, false);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildGeneratorAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.GENERATED_VALUE__GENERATOR, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java
deleted file mode 100644
index 7e2d84fe78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceGeneratorAnnotation.java
+++ /dev/null
@@ -1,178 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.resource.java.GeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SequenceGenerator
- * javax.persistence.TableGenerator
- */
-abstract class SourceGeneratorAnnotation
- extends SourceAnnotation<Member>
- implements GeneratorAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
-
- final DeclarationAnnotationElementAdapter<Integer> initialValueDeclarationAdapter;
- final AnnotationElementAdapter<Integer> initialValueAdapter;
- Integer initialValue;
-
- final DeclarationAnnotationElementAdapter<Integer> allocationSizeDeclarationAdapter;
- final AnnotationElementAdapter<Integer> allocationSizeAdapter;
- Integer allocationSize;
-
-
- SourceGeneratorAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.nameDeclarationAdapter = this.getNameAdapter();
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.initialValueDeclarationAdapter = this.getInitialValueAdapter();
- this.initialValueAdapter = this.buildIntegerAdapter(this.initialValueDeclarationAdapter);
- this.allocationSizeDeclarationAdapter = this.getAllocationSizeAdapter();
- this.allocationSizeAdapter = this.buildIntegerAdapter(this.allocationSizeDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new MemberAnnotationElementAdapter<Integer>(this.member, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.initialValue = this.buildInitialValue(astRoot);
- this.allocationSize = this.buildAllocationSize(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncInitialValue(this.buildInitialValue(astRoot));
- this.syncAllocationSize(this.buildAllocationSize(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** GeneratorAnnotation 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);
- }
-
- abstract DeclarationAnnotationElementAdapter<String> getNameAdapter();
-
- // ***** initial value
- public Integer getInitialValue() {
- return this.initialValue;
- }
-
- public void setInitialValue(Integer initialValue) {
- if (this.attributeValueHasChanged(this.initialValue, initialValue)) {
- this.initialValue = initialValue;
- this.initialValueAdapter.setValue(initialValue);
- }
- }
-
- private void syncInitialValue(Integer astIinitialValue) {
- Integer old = this.initialValue;
- this.initialValue = astIinitialValue;
- this.firePropertyChanged(INITIAL_VALUE_PROPERTY, old, astIinitialValue);
- }
-
- private Integer buildInitialValue(CompilationUnit astRoot) {
- return this.initialValueAdapter.getValue(astRoot);
- }
-
- public TextRange getInitialValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.initialValueDeclarationAdapter, astRoot);
- }
-
- abstract DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter();
-
- // ***** allocation size
- public Integer getAllocationSize() {
- return this.allocationSize;
- }
-
- public void setAllocationSize(Integer allocationSize) {
- if (this.attributeValueHasChanged(this.allocationSize, allocationSize)) {
- this.allocationSize = allocationSize;
- this.allocationSizeAdapter.setValue(allocationSize);
- }
- }
-
- private void syncAllocationSize(Integer astAllocationSize) {
- Integer old = this.allocationSize;
- this.allocationSize = astAllocationSize;
- this.firePropertyChanged(ALLOCATION_SIZE_PROPERTY, old, astAllocationSize);
- }
-
- private Integer buildAllocationSize(CompilationUnit astRoot) {
- return this.allocationSizeAdapter.getValue(astRoot);
- }
-
- public TextRange getAllocationSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.allocationSizeDeclarationAdapter, astRoot);
- }
-
- abstract DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter();
-
-
- // ********** static methods **********
-
- static DeclarationAnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(annotationAdapter, elementName);
- }
-
- static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, NumberIntegerExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdAnnotation.java
deleted file mode 100644
index 63cbbd11d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Id
- */
-public final class SourceIdAnnotation
- extends SourceAnnotation<Attribute>
- implements IdAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceIdAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.java
deleted file mode 100644
index 1160907e68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceIdClassAnnotation.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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.IdClass
- */
-public final class SourceIdClassAnnotation
- extends SourceAnnotation<Type>
- implements IdClassAnnotation
-{
- 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;
-
- private String fullyQualifiedClassName;
-
-
- public SourceIdClassAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedClassName(this.buildFullyQualifiedClassName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** IdClassAnnotation 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 class name
- public String getFullyQualifiedClassName() {
- return this.fullyQualifiedClassName;
- }
-
- private void syncFullyQualifiedClassName(String astFullyQualifiedClassName) {
- String old = this.fullyQualifiedClassName;
- this.fullyQualifiedClassName = astFullyQualifiedClassName;
- this.firePropertyChanged(FULLY_QUALIFIED_CLASS_NAME_PROPERTY, old, astFullyQualifiedClassName);
- }
-
- private String buildFullyQualifiedClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, JPA.ID_CLASS__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java
deleted file mode 100644
index e08d9abdd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceInheritanceAnnotation.java
+++ /dev/null
@@ -1,98 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.core.resource.java.InheritanceType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Inheritance
- */
-public final class SourceInheritanceAnnotation
- extends SourceAnnotation<Type>
- implements InheritanceAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> STRATEGY_ADAPTER = buildStrategyAdapter();
- private final AnnotationElementAdapter<String> strategyAdapter;
- private InheritanceType strategy;
-
-
- public SourceInheritanceAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.strategyAdapter = new MemberAnnotationElementAdapter<String>(type, STRATEGY_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.strategy = this.buildStrategy(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncStrategy(this.buildStrategy(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.strategy);
- }
-
-
- // ********** InheritanceAnnotation implementation **********
-
- // ***** strategy
- public InheritanceType getStrategy() {
- return this.strategy;
- }
-
- public void setStrategy(InheritanceType strategy) {
- if (this.attributeValueHasChanged(this.strategy, strategy)) {
- this.strategy = strategy;
- this.strategyAdapter.setValue(InheritanceType.toJavaAnnotationValue(strategy));
- }
- }
-
- private void syncStrategy(InheritanceType astStrategy) {
- InheritanceType old = this.strategy;
- this.strategy = astStrategy;
- this.firePropertyChanged(STRATEGY_PROPERTY, old, astStrategy);
- }
-
- private InheritanceType buildStrategy(CompilationUnit astRoot) {
- return InheritanceType.fromJavaAnnotationValue(this.strategyAdapter.getValue(astRoot));
- }
-
- public TextRange getStrategyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(STRATEGY_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildStrategyAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.INHERITANCE__STRATEGY);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java
deleted file mode 100644
index d1c8e0d657..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnAnnotation.java
+++ /dev/null
@@ -1,124 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.JoinColumn
- */
-public final class SourceJoinColumnAnnotation
- extends SourceBaseJoinColumnAnnotation
- implements NestableJoinColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public SourceJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** SourceBaseColumnAnnotation implementation **********
-
- @Override
- protected String getTableElementName() {
- return JPA.JOIN_COLUMN__TABLE;
- }
-
- @Override
- protected String getUniqueElementName() {
- return JPA.JOIN_COLUMN__UNIQUE;
- }
-
- @Override
- protected String getNullableElementName() {
- return JPA.JOIN_COLUMN__NULLABLE;
- }
-
- @Override
- protected String getInsertableElementName() {
- return JPA.JOIN_COLUMN__INSERTABLE;
- }
-
- @Override
- protected String getUpdatableElementName() {
- return JPA.JOIN_COLUMN__UPDATABLE;
- }
-
-
- // ********** SourceBaseJoinColumnAnnotation implementation **********
-
- @Override
- protected String getReferencedColumnNameElementName() {
- return JPA.JOIN_COLUMN__REFERENCED_COLUMN_NAME;
- }
-
-
- // ********** static methods **********
-
- public static SourceJoinColumnAnnotation createJoinColumn(JavaResourceNode parent, Member member) {
- return new SourceJoinColumnAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static SourceJoinColumnAnnotation createNestedJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, joinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourceJoinColumnAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter joinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(joinColumnsAdapter, index, JPA.JOIN_COLUMN);
- }
-
- static NestableJoinColumnAnnotation createAssociationOverrideJoinColumn(DeclarationAnnotationAdapter associationOverrideAdapter, JavaResourceNode parent, Member member, int index) {
- return new SourceJoinColumnAnnotation(parent, member, buildAssociationOverrideAnnotationAdapter(associationOverrideAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildAssociationOverrideAnnotationAdapter(DeclarationAnnotationAdapter associationOverrideAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(associationOverrideAdapter, JPA.ASSOCIATION_OVERRIDE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.java
deleted file mode 100644
index 81335c57d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinColumnsAnnotation.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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinColumnsAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.JoinColumns
- */
-public final class SourceJoinColumnsAnnotation
- extends SourceAnnotation<Member>
- implements JoinColumnsAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
-
-
- public SourceJoinColumnsAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.joinColumns);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.JOIN_COLUMNS__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addNestedAnnotation(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(joinColumn);
- return joinColumn;
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addNestedAnnotation(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return SourceJoinColumnAnnotation.createNestedJoinColumn(this, this.member, index, this.daa);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return this.joinColumns.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java
deleted file mode 100644
index 66bc641d8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceJoinTableAnnotation.java
+++ /dev/null
@@ -1,376 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableJoinTableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.JoinTable
- */
-public final class SourceJoinTableAnnotation
- extends SourceBaseTableAnnotation
- implements NestableJoinTableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JoinTableAnnotation.ANNOTATION_NAME);
-
-
- private final Vector<NestableJoinColumnAnnotation> joinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final JoinColumnsAnnotationContainer joinColumnsContainer = new JoinColumnsAnnotationContainer();
-
- private final Vector<NestableJoinColumnAnnotation> inverseJoinColumns = new Vector<NestableJoinColumnAnnotation>();
- private final InverseJoinColumnsContainerAnnotation inverseJoinColumnsContainer = new InverseJoinColumnsContainerAnnotation();
-
-
- public SourceJoinTableAnnotation(JavaResourceNode parent, Member member) {
- this(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public SourceJoinTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.joinColumnsContainer, astRoot);
- AnnotationContainerTools.initialize(this.inverseJoinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.joinColumnsContainer, astRoot);
- AnnotationContainerTools.synchronize(this.inverseJoinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.JOIN_TABLE__NAME);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.JOIN_TABLE__SCHEMA);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.JOIN_TABLE__CATALOG);
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS;
- }
-
- // ********** JoinTableAnnotation implementation **********
-
- // ***** join columns
- public ListIterator<JoinColumnAnnotation> joinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.joinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.joinColumns);
- }
-
- public int joinColumnsSize() {
- return this.joinColumns.size();
- }
-
- public NestableJoinColumnAnnotation joinColumnAt(int index) {
- return this.joinColumns.get(index);
- }
-
- public int indexOfJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.joinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumnAnnotation addJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addJoinColumn_() {
- return this.addJoinColumn_(this.joinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildJoinColumn(index);
- this.joinColumns.add(index, joinColumn);
- return joinColumn;
- }
-
- void syncAddJoinColumn(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.joinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildJoinColumn(int index) {
- return new SourceJoinColumnAnnotation(this, this.member, buildJoinColumnAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildJoinColumnAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.JOIN_TABLE__JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- public void moveJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.joinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.joinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeJoinColumn_(int index) {
- return this.joinColumns.remove(index);
- }
-
- void syncRemoveJoinColumns(int index) {
- this.removeItemsFromList(index, this.joinColumns, JOIN_COLUMNS_LIST);
- }
-
- // ***** inverse join columns
- public ListIterator<JoinColumnAnnotation> inverseJoinColumns() {
- return new CloneListIterator<JoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- Iterable<NestableJoinColumnAnnotation> getNestableInverseJoinColumns() {
- return new LiveCloneIterable<NestableJoinColumnAnnotation>(this.inverseJoinColumns);
- }
-
- public int inverseJoinColumnsSize() {
- return this.inverseJoinColumns.size();
- }
-
- public NestableJoinColumnAnnotation inverseJoinColumnAt(int index) {
- return this.inverseJoinColumns.get(index);
- }
-
- public int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn) {
- return this.inverseJoinColumns.indexOf(joinColumn);
- }
-
- public NestableJoinColumnAnnotation addInverseJoinColumn(int index) {
- return (NestableJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation addInverseJoinColumn_() {
- return this.addInverseJoinColumn_(this.inverseJoinColumns.size());
- }
-
- private NestableJoinColumnAnnotation addInverseJoinColumn_(int index) {
- NestableJoinColumnAnnotation joinColumn = this.buildInverseJoinColumn(index);
- this.inverseJoinColumns.add(joinColumn);
- return joinColumn;
- }
-
- void syncAddInverseJoinColumn(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.inverseJoinColumns.size();
- NestableJoinColumnAnnotation joinColumn = this.addInverseJoinColumn_(index);
- joinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- private NestableJoinColumnAnnotation buildInverseJoinColumn(int index) {
- return new SourceJoinColumnAnnotation(this, this.member, buildInverseJoinColumnAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildInverseJoinColumnAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS, index, JPA.JOIN_COLUMN);
- }
-
- void inverseJoinColumnAdded(int index, NestableJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(INVERSE_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void moveInverseJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation moveInverseJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.inverseJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- void inverseJoinColumnMoved(int targetIndex, int sourceIndex) {
- this.fireItemMoved(INVERSE_JOIN_COLUMNS_LIST, targetIndex, sourceIndex);
- }
-
- public void removeInverseJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.inverseJoinColumnsContainer);
- }
-
- NestableJoinColumnAnnotation removeInverseJoinColumn_(int index) {
- return this.inverseJoinColumns.remove(index);
- }
-
- void syncRemoveInverseJoinColumns(int index) {
- this.removeItemsFromList(index, this.inverseJoinColumns, INVERSE_JOIN_COLUMNS_LIST);
- }
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- JoinTableAnnotation oldJoinTable = (JoinTableAnnotation) oldAnnotation;
- for (JoinColumnAnnotation oldJoinColumn : CollectionTools.iterable(oldJoinTable.joinColumns())) {
- NestableJoinColumnAnnotation newJoinColumn = this.addJoinColumn(oldJoinTable.indexOfJoinColumn(oldJoinColumn));
- newJoinColumn.initializeFrom((NestableAnnotation) oldJoinColumn);
- }
- for (JoinColumnAnnotation oldInverseJoinColumn : CollectionTools.iterable(oldJoinTable.inverseJoinColumns())) {
- NestableJoinColumnAnnotation newInverseJoinColumn = this.addInverseJoinColumn(oldJoinTable.indexOfInverseJoinColumn(oldInverseJoinColumn));
- newInverseJoinColumn.initializeFrom((NestableAnnotation) oldInverseJoinColumn);
- }
- }
-
- public void moveAnnotation(int newIndex) {
- // the only place where a join table annotation is nested is in an
- // association override; and that only nests a single join table, not an array
- // of join tables; so #moveAnnotation(int) is never called
- // TODO maybe NestableAnnotation should be split up;
- // moving this method to something like IndexableAnnotation
- throw new UnsupportedOperationException();
- }
-
- // ********** annotation containers **********
-
- abstract class AbstractJoinColumnAnnotationContainer
- implements AnnotationContainer<NestableJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceJoinTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getNestedAnnotationName() {
- return JoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- /**
- * adapt the AnnotationContainer interface to the join table's join columns
- */
- class JoinColumnsAnnotationContainer
- extends AbstractJoinColumnAnnotationContainer
- {
- public String getElementName() {
- return JPA.JOIN_TABLE__JOIN_COLUMNS;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceJoinTableAnnotation.this.getNestableJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceJoinTableAnnotation.this.joinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceJoinTableAnnotation.this.addJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- SourceJoinTableAnnotation.this.syncAddJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceJoinTableAnnotation.this.moveJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceJoinTableAnnotation.this.removeJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceJoinTableAnnotation.this.syncRemoveJoinColumns(index);
- }
- }
-
-
- /**
- * adapt the AnnotationContainer interface to the join table's inverse join columns
- */
- class InverseJoinColumnsContainerAnnotation
- extends AbstractJoinColumnAnnotationContainer
- {
- public String getElementName() {
- return JPA.JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- }
-
- public Iterable<NestableJoinColumnAnnotation> getNestedAnnotations() {
- return SourceJoinTableAnnotation.this.getNestableInverseJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceJoinTableAnnotation.this.inverseJoinColumnsSize();
- }
-
- public NestableJoinColumnAnnotation addNestedAnnotation() {
- return SourceJoinTableAnnotation.this.addInverseJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- SourceJoinTableAnnotation.this.syncAddInverseJoinColumn(astAnnotation);
- }
-
- public NestableJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceJoinTableAnnotation.this.moveInverseJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestableJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceJoinTableAnnotation.this.removeInverseJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceJoinTableAnnotation.this.syncRemoveInverseJoinColumns(index);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceLobAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceLobAnnotation.java
deleted file mode 100644
index 103b3bc40a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceLobAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Lob
- */
-public final class SourceLobAnnotation
- extends SourceAnnotation<Attribute>
- implements LobAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceLobAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.java
deleted file mode 100644
index 59216f217e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToManyAnnotation.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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.ManyToMany
- */
-public final class SourceManyToManyAnnotation
- extends SourceRelationshipMappingAnnotation
- implements ManyToMany2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
-
- public SourceManyToManyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- //**************** OwnableRelationshipMappingAnnotation implementation **************
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.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, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToOneAnnotation.java
deleted file mode 100644
index 12ec5ec84b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceManyToOneAnnotation.java
+++ /dev/null
@@ -1,136 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.ManyToOne
- */
-public final class SourceManyToOneAnnotation
- extends SourceRelationshipMappingAnnotation
- implements ManyToOne2_0Annotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
-
- public SourceManyToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.optional = this.buildOptional(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncOptional(this.buildOptional(astRoot));
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** ManyToOneMappingAnnotation implementation **********
-
- // ***** 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<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java
deleted file mode 100644
index 24a3087ad8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMapKeyAnnotation.java
+++ /dev/null
@@ -1,101 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.MapKey
- */
-public final class SourceMapKeyAnnotation
- extends SourceAnnotation<Attribute>
- implements MapKeyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildNameAdapter();
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
-
- public SourceMapKeyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.nameAdapter = new MemberAnnotationElementAdapter<String>(attribute, NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** MapKeyAnnotation 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 this.elementTouches(NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildNameAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.MAP_KEY__NAME, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java
deleted file mode 100644
index 75f8cc48e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceMappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.MappedSuperclass
- */
-public final class SourceMappedSuperclassAnnotation
- extends SourceAnnotation<Type>
- implements MappedSuperclassAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceMappedSuperclassAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
deleted file mode 100644
index b168201eae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedColumnAnnotation.java
+++ /dev/null
@@ -1,178 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- * javax.persistence.DiscriminatorColumn
- * javax.persistence.PrimaryKeyJoinColumn.
- */
-public abstract class SourceNamedColumnAnnotation
- extends SourceAnnotation<Member>
- implements NamedColumnAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> columnDefinitionDeclarationAdapter;
- private final AnnotationElementAdapter<String> columnDefinitionAdapter;
- private String columnDefinition;
-
-
- protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- protected SourceNamedColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = this.buildStringElementAdapter(this.getNameElementName());
- this.nameAdapter = this.buildShortCircuitElementAdapter(this.nameDeclarationAdapter);
- this.columnDefinitionDeclarationAdapter = this.buildStringElementAdapter(this.getColumnDefinitionElementName());
- this.columnDefinitionAdapter = this.buildShortCircuitElementAdapter(this.columnDefinitionDeclarationAdapter);
- }
-
- protected DeclarationAnnotationElementAdapter<String> buildStringElementAdapter(String elementName) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, elementName);
- }
-
- protected DeclarationAnnotationElementAdapter<Boolean> buildBooleanElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(this.daa, elementName, BooleanExpressionConverter.instance());
- }
-
- protected DeclarationAnnotationElementAdapter<Integer> buildIntegerElementAdapter(String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(this.daa, elementName, NumberIntegerExpressionConverter.instance());
- }
-
- AnnotationElementAdapter<String> buildShortCircuitElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildShortCircuitBooleanElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new MemberAnnotationElementAdapter<Boolean>(this.member, daea);
- }
-
- protected AnnotationElementAdapter<Integer> buildShortCircuitIntegerElementAdapter(DeclarationAnnotationElementAdapter<Integer> daea) {
- return new MemberAnnotationElementAdapter<Integer>(this.member, daea);
- }
-
- AnnotationElementAdapter<String> buildShortCircuitStringElementAdapter(String elementName) {
- return this.buildShortCircuitElementAdapter(this.buildStringElementAdapter(elementName));
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.columnDefinition = this.buildColumnDefinition(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncColumnDefinition(this.buildColumnDefinition(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedColumn implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** 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 this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- protected abstract String getNameElementName();
-
- // ***** column definition
- public String getColumnDefinition() {
- return this.columnDefinition;
- }
-
- public void setColumnDefinition(String columnDefinition) {
- if (this.attributeValueHasChanged(this.columnDefinition, columnDefinition)) {
- this.columnDefinition = columnDefinition;
- this.columnDefinitionAdapter.setValue(columnDefinition);
- }
- }
-
- private void syncColumnDefinition(String astColumnDefinition) {
- String old = this.columnDefinition;
- this.columnDefinition = astColumnDefinition;
- this.firePropertyChanged(COLUMN_DEFINITION_PROPERTY, old, astColumnDefinition);
- }
-
- private String buildColumnDefinition(CompilationUnit astRoot) {
- return this.columnDefinitionAdapter.getValue(astRoot);
- }
-
- public TextRange getColumnDefinitionTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.columnDefinitionDeclarationAdapter, astRoot);
- }
-
- protected abstract String getColumnDefinitionElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- NamedColumnAnnotation oldColumn = (NamedColumnAnnotation) oldAnnotation;
- this.setName(oldColumn.getName());
- this.setColumnDefinition(oldColumn.getColumnDefinition());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java
deleted file mode 100644
index fba3361720..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueriesAnnotation.java
+++ /dev/null
@@ -1,112 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.NamedNativeQueries
- */
-public final class SourceNamedNativeQueriesAnnotation
- extends SourceAnnotation<Type>
- implements NamedNativeQueriesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableNamedNativeQueryAnnotation> namedNativeQueries = new Vector<NestableNamedNativeQueryAnnotation>();
-
-
- public SourceNamedNativeQueriesAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namedNativeQueries);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.NAMED_NATIVE_QUERIES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return NamedNativeQueryAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedNativeQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedNativeQueryAnnotation>(this.namedNativeQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedNativeQueries.size();
- }
-
- public NestableNamedNativeQueryAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.namedNativeQueries.size());
- }
-
- private NestableNamedNativeQueryAnnotation addNestedAnnotation(int index) {
- NestableNamedNativeQueryAnnotation namedNativeQuery = this.buildNamedNativeQuery(index);
- this.namedNativeQueries.add(namedNativeQuery);
- return namedNativeQuery;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.namedNativeQueries.size();
- NestableNamedNativeQueryAnnotation namedNativeQuery = this.addNestedAnnotation(index);
- namedNativeQuery.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(NAMED_NATIVE_QUERIES_LIST, index, namedNativeQuery);
- }
-
- private NestableNamedNativeQueryAnnotation buildNamedNativeQuery(int index) {
- return SourceNamedNativeQueryAnnotation.createNestedNamedNativeQuery(this, this.member, index, this.daa);
- }
-
- public NestableNamedNativeQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.namedNativeQueries, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableNamedNativeQueryAnnotation removeNestedAnnotation(int index) {
- return this.namedNativeQueries.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.namedNativeQueries, NAMED_NATIVE_QUERIES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java
deleted file mode 100644
index b3d3483af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,212 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedNativeQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedNativeQuery
- */
-public final class SourceNamedNativeQueryAnnotation
- extends SourceBaseNamedQueryAnnotation
- implements NestableNamedNativeQueryAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final DeclarationAnnotationElementAdapter<String> resultClassDeclarationAdapter;
- private final AnnotationElementAdapter<String> resultClassAdapter;
- private String resultClass;
-
- private String fullyQualifiedResultClassName;
-
- private final DeclarationAnnotationElementAdapter<String> resultSetMappingDeclarationAdapter;
- private final AnnotationElementAdapter<String> resultSetMappingAdapter;
- private String resultSetMapping;
-
-
- public SourceNamedNativeQueryAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- this.resultClassDeclarationAdapter = this.buildResultClassAdapter(daa);
- this.resultClassAdapter = this.buildAdapter(this.resultClassDeclarationAdapter);
- this.resultSetMappingDeclarationAdapter = this.buildResultSetMappingAdapter(daa);
- this.resultSetMappingAdapter = this.buildAdapter(this.resultSetMappingDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.resultClass = this.buildResultClass(astRoot);
- this.fullyQualifiedResultClassName = this.buildFullyQualifiedResultClassName(astRoot);
- this.resultSetMapping = this.buildResultSetMapping(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncResultClass(this.buildResultClass(astRoot));
- this.syncFullyQualifiedResultClassName(this.buildFullyQualifiedResultClassName(astRoot));
- this.syncResultSetMapping(this.buildResultSetMapping(astRoot));
- }
-
-
- // ********** AbstractBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_NATIVE_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_NATIVE_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_NATIVE_QUERY__HINTS;
- }
-
- @Override
- NestableQueryHintAnnotation buildHint(int index) {
- return SourceQueryHintAnnotation.createNamedNativeQueryQueryHint(this, this.member, this.daa, index);
- }
-
-
- // ********** NamedNativeQueryAnnotation implementation **********
-
- // ***** result class
- public String getResultClass() {
- return this.resultClass;
- }
-
- public void setResultClass(String resultClass) {
- if (this.attributeValueHasChanged(this.resultClass, resultClass)) {
- this.resultClass = resultClass;
- this.resultClassAdapter.setValue(resultClass);
- }
- }
-
- private void syncResultClass(String astResultClass) {
- String old = this.resultClass;
- this.resultClass = astResultClass;
- this.firePropertyChanged(RESULT_CLASS_PROPERTY, old, astResultClass);
- }
-
- private String buildResultClass(CompilationUnit astRoot) {
- return this.resultClassAdapter.getValue(astRoot);
- }
-
- public TextRange getResultClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultClassDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildResultClassAdapter(DeclarationAnnotationAdapter daAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(daAdapter, JPA.NAMED_NATIVE_QUERY__RESULT_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- // ***** fully-qualified result class name
- public String getFullyQualifiedResultClassName() {
- return this.fullyQualifiedResultClassName;
- }
-
- private void syncFullyQualifiedResultClassName(String astName) {
- String old = this.fullyQualifiedResultClassName;
- this.fullyQualifiedResultClassName = astName;
- this.firePropertyChanged(FULLY_QUALIFIED_RESULT_CLASS_NAME_PROPERTY, old, astName);
- }
-
- private String buildFullyQualifiedResultClassName(CompilationUnit astRoot) {
- return (this.resultClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.resultClassAdapter.getExpression(astRoot));
- }
-
- // ***** result set mapping
- public String getResultSetMapping() {
- return this.resultSetMapping;
- }
-
- public void setResultSetMapping(String resultSetMapping) {
- if (this.attributeValueHasChanged(this.resultSetMapping, resultSetMapping)) {
- this.resultSetMapping = resultSetMapping;
- this.resultSetMappingAdapter.setValue(resultSetMapping);
- }
- }
-
- private void syncResultSetMapping(String astResultSetMapping) {
- String old = this.resultSetMapping;
- this.resultSetMapping = astResultSetMapping;
- this.firePropertyChanged(RESULT_SET_MAPPING_PROPERTY, old, astResultSetMapping);
- }
-
- private String buildResultSetMapping(CompilationUnit astRoot) {
- return this.resultSetMappingAdapter.getValue(astRoot);
- }
-
- public TextRange getResultSetMappingTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.resultSetMappingDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildResultSetMappingAdapter(DeclarationAnnotationAdapter daAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(daAdapter, JPA.NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- NamedNativeQueryAnnotation oldQuery = (NamedNativeQueryAnnotation) oldAnnotation;
- this.setResultClass(oldQuery.getResultClass());
- this.setResultSetMapping(oldQuery.getResultSetMapping());
- }
-
-
- // ********** static methods **********
-
- public static SourceNamedNativeQueryAnnotation createNamedNativeQuery(JavaResourceNode parent, Type type) {
- return new SourceNamedNativeQueryAnnotation(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceNamedNativeQueryAnnotation createNestedNamedNativeQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
- return new SourceNamedNativeQueryAnnotation(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_NATIVE_QUERY);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java
deleted file mode 100644
index 451da89edd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueries1_0Annotation.java
+++ /dev/null
@@ -1,30 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQueries
- */
-public final class SourceNamedQueries1_0Annotation
- extends SourceNamedQueriesAnnotation
-{
- public SourceNamedQueries1_0Annotation(JavaResourceNode parent, Type type) {
- super(parent, type);
- }
-
- @Override
- protected NestableNamedQueryAnnotation buildNamedQuery(int index) {
- return SourceNamedQueryAnnotation.createNestedNamedQuery(this, member, index, this.daa);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java
deleted file mode 100644
index 2c097d285f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueriesAnnotation.java
+++ /dev/null
@@ -1,110 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueriesAnnotation;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableNamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.NamedQueries
- */
-public abstract class SourceNamedQueriesAnnotation
- extends SourceAnnotation<Type>
- implements NamedQueriesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableNamedQueryAnnotation> namedQueries = new Vector<NestableNamedQueryAnnotation>();
-
-
- public SourceNamedQueriesAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.namedQueries);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.NAMED_QUERIES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return NamedQueryAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableNamedQueryAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableNamedQueryAnnotation>(this.namedQueries);
- }
-
- public int getNestedAnnotationsSize() {
- return this.namedQueries.size();
- }
-
- public NestableNamedQueryAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.namedQueries.size());
- }
-
- private NestableNamedQueryAnnotation addNestedAnnotation(int index) {
- NestableNamedQueryAnnotation namedQuery = this.buildNamedQuery(index);
- this.namedQueries.add(namedQuery);
- return namedQuery;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.namedQueries.size();
- NestableNamedQueryAnnotation namedQuery = this.addNestedAnnotation(index);
- namedQuery.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(NAMED_QUERIES_LIST, index, namedQuery);
- }
-
- protected abstract NestableNamedQueryAnnotation buildNamedQuery(int index);
-
- public NestableNamedQueryAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.namedQueries, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableNamedQueryAnnotation removeNestedAnnotation(int index) {
- return this.namedQueries.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.namedQueries, NAMED_QUERIES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java
deleted file mode 100644
index 01c8053f22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNamedQueryAnnotation.java
+++ /dev/null
@@ -1,86 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.jpa1.resource.java.source.SourceNamedQuery1_0Annotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHintAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.NamedQuery
- */
-public abstract class SourceNamedQueryAnnotation
- extends SourceBaseNamedQueryAnnotation
- implements NamedQueryAnnotation
-{
- public static final SimpleDeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- // ********** constructors **********
- public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(type, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- public SourceNamedQueryAnnotation(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, type, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** AbstractBaseNamedQueryAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return JPA.NAMED_QUERY__NAME;
- }
-
- @Override
- String getQueryElementName() {
- return JPA.NAMED_QUERY__QUERY;
- }
-
- @Override
- String getHintsElementName() {
- return JPA.NAMED_QUERY__HINTS;
- }
-
- @Override
- NestableQueryHintAnnotation buildHint(int index) {
- return SourceQueryHintAnnotation.createNamedQueryQueryHint(this, this.member, this.daa, index);
- }
-
-
- // ********** static methods **********
-
- static SourceNamedQueryAnnotation createNestedNamedQuery(JavaResourceNode parent, Type type, int index, DeclarationAnnotationAdapter attributeOverridesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, attributeOverridesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(type, idaa);
-
- return new SourceNamedQuery1_0Annotation(parent, type, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter namedQueriesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueriesAdapter, index, JPA.NAMED_QUERY);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNode.java
deleted file mode 100644
index 354ba9d633..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceNode.java
+++ /dev/null
@@ -1,31 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.resource.java.AbstractJavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-
-/**
- * Source convenience methods
- */
-public abstract class SourceNode
- extends AbstractJavaResourceNode
-{
-
- public SourceNode(JavaResourceNode parent) {
- super(parent);
- }
-
- public JavaResourceCompilationUnit getJavaResourceCompilationUnit() {
- return (JavaResourceCompilationUnit) this.getRoot();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToManyAnnotation.java
deleted file mode 100644
index 925ed56585..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToManyAnnotation.java
+++ /dev/null
@@ -1,178 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.OneToMany
- */
-public final class SourceOneToManyAnnotation
- extends SourceRelationshipMappingAnnotation
- implements OneToMany2_0Annotation
-{
- protected static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
- //added in JPA2.0
- private static final DeclarationAnnotationElementAdapter<Boolean> ORPHAN_REMOVAL_ADAPTER = buildOrphanRemovalAdapter();
- private final AnnotationElementAdapter<Boolean> orphanRemovalAdapter;
- private Boolean orphanRemoval;
-
- public SourceOneToManyAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.orphanRemovalAdapter = this.buildBooleanAnnotationElementAdapter(ORPHAN_REMOVAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- this.orphanRemoval = this.buildOrphanRemoval(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- this.syncOrphanRemoval(this.buildOrphanRemoval(astRoot));
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** OwnableRelationshipMappingAnnotation implementation **********
-
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.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, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, astRoot);
- }
-
- // ********** OneToMany2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (this.attributeValueHasChanged(this.orphanRemoval, orphanRemoval)) {
- this.orphanRemoval = orphanRemoval;
- this.orphanRemovalAdapter.setValue(orphanRemoval);
- }
- }
-
- private void syncOrphanRemoval(Boolean astOrphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = astOrphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, astOrphanRemoval);
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ORPHAN_REMOVAL_ADAPTER, astRoot);
- }
-
- private Boolean buildOrphanRemoval(CompilationUnit astRoot) {
- return this.orphanRemovalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter() {
- return buildOrphanRemovalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ONE_TO_MANY__ORPHAN_REMOVAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToOneAnnotation.java
deleted file mode 100644
index 3ebc6a9ce2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOneToOneAnnotation.java
+++ /dev/null
@@ -1,219 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.OneToOne
- */
-public final class SourceOneToOneAnnotation
- extends SourceRelationshipMappingAnnotation
- implements OneToOne2_0Annotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
-
- private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildCascadeAdapter();
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
-
- private static final DeclarationAnnotationElementAdapter<String> MAPPED_BY_ADAPTER = buildMappedByAdapter();
- private final AnnotationElementAdapter<String> mappedByAdapter;
- private String mappedBy;
-
- //added in JPA 2.0
- private static final DeclarationAnnotationElementAdapter<Boolean> ORPHAN_REMOVAL_ADAPTER = buildOrphanRemovalAdapter();
- private final AnnotationElementAdapter<Boolean> orphanRemovalAdapter;
- private Boolean orphanRemoval;
-
- public SourceOneToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.mappedByAdapter = this.buildAnnotationElementAdapter(MAPPED_BY_ADAPTER);
- this.optionalAdapter = this.buildBooleanAnnotationElementAdapter(OPTIONAL_ADAPTER);
- this.orphanRemovalAdapter = this.buildBooleanAnnotationElementAdapter(ORPHAN_REMOVAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.mappedBy = this.buildMappedBy(astRoot);
- this.optional = this.buildOptional(astRoot);
- this.orphanRemoval = this.buildOrphanRemoval(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncMappedBy(this.buildMappedBy(astRoot));
- this.syncOptional(this.buildOptional(astRoot));
- this.syncOrphanRemoval(this.buildOrphanRemoval(astRoot));
- }
-
-
- // ********** SourceRelationshipMappingAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter() {
- return TARGET_ENTITY_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String> getFetchAdapter() {
- return FETCH_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter() {
- return CASCADE_ADAPTER;
- }
-
-
- // ********** OneToOneAnnotation implementation **********
-
- // ***** mapped by
- public String getMappedBy() {
- return this.mappedBy;
- }
-
- public void setMappedBy(String mappedBy) {
- if (this.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, astMappedBy);
- }
-
- private String buildMappedBy(CompilationUnit astRoot) {
- return this.mappedByAdapter.getValue(astRoot);
- }
-
- public TextRange getMappedByTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(MAPPED_BY_ADAPTER, astRoot);
- }
-
- public boolean mappedByTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(MAPPED_BY_ADAPTER, pos, 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);
- }
-
- // ********** OneToOne2_0Annotation implementation **********
-
- public Boolean getOrphanRemoval() {
- return this.orphanRemoval;
- }
-
- public void setOrphanRemoval(Boolean orphanRemoval) {
- if (this.attributeValueHasChanged(this.orphanRemoval, orphanRemoval)) {
- this.orphanRemoval = orphanRemoval;
- this.orphanRemovalAdapter.setValue(orphanRemoval);
- }
- }
-
- private void syncOrphanRemoval(Boolean astOrphanRemoval) {
- Boolean old = this.orphanRemoval;
- this.orphanRemoval = astOrphanRemoval;
- this.firePropertyChanged(ORPHAN_REMOVAL_PROPERTY, old, astOrphanRemoval);
- }
-
- public TextRange getOrphanRemovalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ORPHAN_REMOVAL_ADAPTER, astRoot);
- }
-
- private Boolean buildOrphanRemoval(CompilationUnit astRoot) {
- return this.orphanRemovalAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter() {
- return buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildMappedByAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__MAPPED_BY, false); // false = do not remove annotation when empty
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return buildFetchAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__FETCH);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return buildOptionalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__OPTIONAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildCascadeAdapter() {
- return buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter() {
- return buildOrphanRemovalAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA2_0.ONE_TO_ONE__ORPHAN_REMOVAL);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOrphanRemovalAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, false, BooleanExpressionConverter.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.java
deleted file mode 100644
index 08c060a41d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOrderByAnnotation.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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-
-/**
- * javax.persistence.OrderBy
- */
-public final class SourceOrderByAnnotation
- extends SourceAnnotation<Attribute>
- implements OrderByAnnotation
-{
- 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;
-
-
- public SourceOrderByAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, 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 void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** OrderByAnnotation implementation **********
-
- 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);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ORDER_BY__VALUE, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java
deleted file mode 100644
index dbb5b89a7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceOverrideAnnotation.java
+++ /dev/null
@@ -1,116 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * Common behavior for
- * javax.persistence.AttributeOverride
- * javax.persistence.AssociationOverride
- */
-abstract class SourceOverrideAnnotation
- extends SourceAnnotation<Member>
- implements OverrideAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
-
-
- // ********** construction/initialization **********
-
- SourceOverrideAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName(), false); // false = do not remove annotation when empty
- this.nameAdapter = new MemberAnnotationElementAdapter<String>(this.member, this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** OverrideAnnotation 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 this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- protected abstract String getNameElementName();
-
-
- // ********** NestableAnnotation implementation **********
-
- void initializeFrom(NestableAnnotation oldAnnotation) {
- OverrideAnnotation oldOverride = (OverrideAnnotation) oldAnnotation;
- this.setName(oldOverride.getName());
- }
-
- /**
- * convenience implementation of method from NestableAnnotation interface
- * for subclasses
- */
- public void moveAnnotation(int index) {
- this.getIndexedAnnotationAdapter().moveAnnotation(index);
- }
-
- private IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java
deleted file mode 100644
index 99852e1d54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentAttribute.java
+++ /dev/null
@@ -1,400 +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.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-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.core.internal.utility.jdt.JDTFieldAttribute;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTMethodAttribute;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * Java source persistent attribute (field or property)
- */
-final class SourcePersistentAttribute
- extends SourcePersistentMember<Attribute>
- implements JavaResourcePersistentAttribute
-{
- private int modifiers;
-
- private String typeName;
-
- private boolean typeIsInterface;
-
- private boolean typeIsEnum;
-
- private final Vector<String> typeSuperclassNames = new Vector<String>();
-
- private final Vector<String> typeInterfaceNames = new Vector<String>();
-
- private final Vector<String> typeTypeArgumentNames = new Vector<String>();
-
-
- /**
- * construct field attribute
- */
- static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- String name,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = new JDTFieldAttribute(
- declaringType,
- name,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute jrpa = new SourcePersistentAttribute(parent, attribute);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
- /**
- * construct property attribute
- */
- static JavaResourcePersistentAttribute newInstance(
- JavaResourcePersistentType parent,
- Type declaringType,
- MethodSignature signature,
- int occurrence,
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- CompilationUnit astRoot) {
- Attribute attribute = JDTMethodAttribute.newInstance(
- declaringType,
- signature,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentAttribute jrpa = new SourcePersistentAttribute(parent, attribute);
- jrpa.initialize(astRoot);
- return jrpa;
- }
-
- private SourcePersistentAttribute(JavaResourcePersistentType parent, Attribute 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.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));
- 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.syncTypeSuperclassNames(this.buildTypeSuperclassNames(typeBinding));
- this.syncTypeInterfaceNames(this.buildTypeInterfaceNames(typeBinding));
- this.syncTypeTypeArgumentNames(this.buildTypeTypeArgumentNames(typeBinding));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
-
- // ******** AbstractJavaResourcePersistentMember implementation ********
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().attributeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildAttributeAnnotation(this, this.member, annotationName);
- }
-
- Annotation buildNullAnnotation_(String annotationName) {
- return this.getAnnotationProvider().buildNullAttributeAnnotation(this, annotationName);
- }
-
- public boolean isFor(MethodSignature signature, int occurrence) {
- return ((MethodAttribute) this.member).matches(signature, occurrence);
- }
-
-
- // ******** JavaResourcePersistentAttribute implementation ********
-
- public String getName() {
- return this.member.getAttributeName();
- }
-
- @Override
- public Annotation buildNullAnnotation(String annotationName) {
- return (annotationName == null) ? null : this.buildNullAnnotation_(annotationName);
- }
-
- public boolean isField() {
- return this.member.isField();
- }
-
- public boolean isProperty() {
- return ! this.isField();
- }
-
- public AccessType getSpecifiedAccess() {
- Access2_0Annotation accessAnnotation = this.getAccessAnnotation();
- return (accessAnnotation == null) ? null : accessAnnotation.getValue();
- }
-
- private Access2_0Annotation getAccessAnnotation() {
- return (Access2_0Annotation) this.getAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- }
-
- 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.member.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.member.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;
- }
- // 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 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 superclass hierarchy
- public ListIterator<String> typeSuperclassNames() {
- return new CloneListIterator<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 Iterator<String> typeInterfaceNames() {
- return new CloneIterator<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 ListIterator<String> typeTypeArgumentNames() {
- return new CloneListIterator<String>(this.typeTypeArgumentNames);
- }
-
- public int typeTypeArgumentNamesSize() {
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java
deleted file mode 100644
index 114613bdfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentMember.java
+++ /dev/null
@@ -1,507 +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.core.internal.resource.java.source;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-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.BodyDeclaration;
-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.core.internal.utility.jdt.ASTNodeTextRange;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-/**
- * Java source persistent member (annotations, "persistable")
- */
-abstract class SourcePersistentMember<M extends Member>
- extends SourceNode
- implements JavaResourcePersistentMember
-{
- final M member;
-
- /**
- * annotations; no duplicates (java compiler has an error for duplicates)
- */
- final Vector<Annotation> annotations = new Vector<Annotation>();
-
- boolean persistable;
-
-
- // ********** construction/initialization **********
-
- SourcePersistentMember(JavaResourceNode parent, M member) {
- super(parent);
- this.member = member;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.member.getBodyDeclaration(astRoot).accept(this.buildInitialAnnotationVisitor(astRoot));
- this.persistable = this.buildPersistable(astRoot);
- }
-
- private ASTVisitor buildInitialAnnotationVisitor(CompilationUnit astRoot) {
- return new InitialAnnotationVisitor(astRoot, this.member.getBodyDeclaration(astRoot));
- }
-
- /**
- * called from {@link InitialAnnotationVisitor}
- */
- /* private */ void addInitialAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- this.addInitialAnnotation(jdtAnnotationName, astRoot);
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is not null
- */
- void addInitialAnnotation(String jdtAnnotationName, CompilationUnit astRoot) {
- if (this.annotationIsValid(jdtAnnotationName)) {
- if (this.selectAnnotationNamed(this.annotations, jdtAnnotationName) == null) { // ignore duplicates
- Annotation annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.annotations.add(annotation);
- }
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncAnnotations(astRoot);
- this.syncPersistable(this.buildPersistable(astRoot));
- }
-
-
- // ********** annotations **********
-
- public Iterator<Annotation> annotations() {
- return this.getAnnotations().iterator();
- }
-
- Iterable<Annotation> getAnnotations() {
- return new LiveCloneIterable<Annotation>(this.annotations);
- }
-
- public int annotationsSize() {
- return this.annotations.size();
- }
-
- 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.buildNullAnnotation(annotationName);
- }
-
- public Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- return containerAnnotation.getNestedAnnotations().iterator();
- }
- NestableAnnotation nestableAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- if (nestableAnnotation != null) {
- return new SingleElementIterator<NestableAnnotation>(nestableAnnotation);
- }
- return EmptyIterator.instance();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> getContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.getAnnotation(annotationName);
- }
-
- private NestableAnnotation getNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.getAnnotation(annotationName);
- }
-
- public Annotation addAnnotation(String annotationName) {
- Annotation annotation = this.buildAnnotation(annotationName);
- this.annotations.add(annotation);
- annotation.newAnnotation();
- return annotation;
- }
-
- /**
- * 1. check for a container annotation;
- * if it is present, add a nested annotation to it
- * 2. check for a stand-alone nested annotation;
- * if it is missing, add a stand-alone nested annotation
- * 3. if there is an existing stand-alone nested annotation,
- * add a container annotation and move the stand-alone nested annotation to it
- * and add a new nested annotation to it also
- */
- public NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation != null) {
- // ignore any stand-alone nestable annotations and just add to the container annotation
- return AnnotationContainerTools.addNestedAnnotation(index, containerAnnotation);
- }
- NestableAnnotation standAloneAnnotation = this.getNestableAnnotation(nestableAnnotationName);
- if (standAloneAnnotation == null) {
- // add a stand-alone nestable annotation since neither the nestable nor the container exist
- return (NestableAnnotation) this.addAnnotation(nestableAnnotationName);
- }
- // move the stand-alone nestable annotation to a container and add another nestable
- return this.addSecondNestedAnnotation(index, containerAnnotationName, standAloneAnnotation);
- }
-
- /**
- * "move" the existing nestable annotation to a new container annotation and
- * add a new nestable annotation at the specified index (which should be 0 or 1)
- */
- private NestableAnnotation addSecondNestedAnnotation(int index, String containerAnnotationName, NestableAnnotation standAloneAnnotation) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.buildContainerAnnotation(containerAnnotationName);
- this.annotations.add(containerAnnotation);
- containerAnnotation.newAnnotation();
-
- NestableAnnotation nestedAnnotation0 = containerAnnotation.addNestedAnnotation();
- nestedAnnotation0.newAnnotation();
- NestableAnnotation nestedAnnotation1 = containerAnnotation.addNestedAnnotation();
- nestedAnnotation1.newAnnotation();
- this.removeAnnotation(standAloneAnnotation);
-
- if (index == 0) {
- // adding new annotation at 0, so stand-alone is "copied" to slot 1
- nestedAnnotation1.initializeFrom(standAloneAnnotation);
- } else {
- // adding new annotation at 1, so stand-alone is "copied" to slot 0
- nestedAnnotation0.initializeFrom(standAloneAnnotation);
- }
-
- return (index == 0) ? nestedAnnotation0 : nestedAnnotation1;
- }
-
- public void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName) {
- this.moveAnnotation(targetIndex, sourceIndex, this.getContainerAnnotation(containerAnnotationName));
- }
-
- private void moveAnnotation(int targetIndex, int sourceIndex, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, containerAnnotation);
- }
-
- 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, String containerAnnotationName) {
- ContainerAnnotation<NestableAnnotation> containerAnnotation = this.getContainerAnnotation(containerAnnotationName);
- if (containerAnnotation == null) { // assume the index is 0
- this.removeAnnotation(this.getAnnotation(nestableAnnotationName));
- } else {
- this.removeAnnotation(index, containerAnnotation);
- }
- }
-
- /**
- * after we remove the nested annotation, check to see whether we need to
- * either remove the container (if it is empty) or convert the last nested
- * annotation to a stand-alone annotation
- */
- private void removeAnnotation(int index, ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- AnnotationContainerTools.removeNestedAnnotation(index, containerAnnotation);
- switch (containerAnnotation.getNestedAnnotationsSize()) {
- case 0:
- this.removeAnnotation(containerAnnotation);
- break;
- case 1:
- this.convertLastNestedAnnotation(containerAnnotation);
- break;
- default:
- break;
- }
- }
-
- /**
- * convert the last nested annotation in the container to a stand-alone
- * annotation
- */
- private void convertLastNestedAnnotation(ContainerAnnotation<NestableAnnotation> containerAnnotation) {
- NestableAnnotation lastNestedAnnotation = containerAnnotation.getNestedAnnotations().iterator().next();
- this.annotations.remove(containerAnnotation);
- containerAnnotation.removeAnnotation();
-
- NestableAnnotation standAloneAnnotation = this.buildNestableAnnotation(lastNestedAnnotation.getAnnotationName());
- this.annotations.add(standAloneAnnotation);
- standAloneAnnotation.newAnnotation();
- standAloneAnnotation.initializeFrom(lastNestedAnnotation);
- }
-
- 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();
- }
- }
- Annotation newPrimaryAnnotation = null;
- if ((primaryAnnotationName != null) && (this.getAnnotation(primaryAnnotationName) == null)) {
- newPrimaryAnnotation = this.buildAnnotation(primaryAnnotationName);
- this.annotations.add(newPrimaryAnnotation);
- newPrimaryAnnotation.newAnnotation();
- }
- // fire collection change event after all annotation changes are done
- this.fireCollectionChanged(ANNOTATIONS_COLLECTION, this.annotations);
- return newPrimaryAnnotation;
- }
-
- private boolean annotationIsValid(String annotationName) {
- return CollectionTools.contains(this.validAnnotationNames(), annotationName);
- }
-
- abstract Iterator<String> validAnnotationNames();
-
- abstract Annotation buildAnnotation(String mappingAnnotationName);
-
- abstract Annotation buildNullAnnotation(String annotationName);
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private ContainerAnnotation<NestableAnnotation> buildContainerAnnotation(String annotationName) {
- return (ContainerAnnotation<NestableAnnotation>) this.buildAnnotation(annotationName);
- }
-
- private NestableAnnotation buildNestableAnnotation(String annotationName) {
- return (NestableAnnotation) this.buildAnnotation(annotationName);
- }
-
- private void syncAnnotations(CompilationUnit astRoot) {
- HashSet<Annotation> annotationsToRemove = new HashSet<Annotation>(this.annotations);
-
- this.member.getBodyDeclaration(astRoot).accept(this.buildSynchronizeAnnotationVisitor(astRoot, annotationsToRemove));
-
- for (Annotation annotation : annotationsToRemove) {
- this.removeItemFromCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
- }
-
- private ASTVisitor buildSynchronizeAnnotationVisitor(CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- return new SynchronizeAnnotationVisitor(astRoot, this.member.getBodyDeclaration(astRoot), annotationsToRemove);
- }
-
- /**
- * called from {@link SynchronizeAnnotationVisitor}
- */
- /* private */ void addOrSyncAnnotation(org.eclipse.jdt.core.dom.Annotation node, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- String jdtAnnotationName = ASTTools.resolveAnnotation(node);
- if (jdtAnnotationName != null) {
- this.addOrSyncAnnotation(jdtAnnotationName, astRoot, annotationsToRemove);
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is not null
- */
- void addOrSyncAnnotation(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- if (this.annotationIsValid(jdtAnnotationName)) {
- this.addOrSyncAnnotation_(jdtAnnotationName, astRoot, annotationsToRemove);
- }
- }
-
- /**
- * pre-condition: jdtAnnotationName is valid
- */
- private void addOrSyncAnnotation_(String jdtAnnotationName, CompilationUnit astRoot, Set<Annotation> annotationsToRemove) {
- Annotation annotation = this.selectAnnotationNamed(annotationsToRemove, jdtAnnotationName);
- if (annotation != null) {
- annotation.synchronizeWith(astRoot);
- annotationsToRemove.remove(annotation);
- } else {
- annotation = this.buildAnnotation(jdtAnnotationName);
- annotation.initialize(astRoot);
- this.addItemToCollection(annotation, this.annotations, ANNOTATIONS_COLLECTION);
- }
- }
-
-
- // ********** persistable **********
-
- public boolean isPersistable() {
- return this.persistable;
- }
-
- private void syncPersistable(boolean astPersistable) {
- boolean old = this.persistable;
- this.persistable = astPersistable;
- this.firePropertyChanged(PERSISTABLE_PROPERTY, old, astPersistable);
- }
-
- private boolean buildPersistable(CompilationUnit astRoot) {
- return this.member.isPersistable(astRoot);
- }
-
-
- // ********** miscellaneous **********
-
- public boolean isAnnotated() {
- return ! this.annotations.isEmpty();
- }
-
- public boolean isFor(String memberName, int occurrence) {
- return this.member.matches(memberName, occurrence);
- }
-
- public TextRange getTextRange(CompilationUnit astRoot) {
- return this.fullTextRange(astRoot);
- }
-
- private TextRange fullTextRange(CompilationUnit astRoot) {
- return this.buildTextRange(this.member.getBodyDeclaration(astRoot));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return this.member.getNameTextRange(astRoot);
- }
-
- public void resolveTypes(CompilationUnit astRoot) {
- this.syncPersistable(this.buildPersistable(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 : new ASTNodeTextRange(astNode);
- }
-
- /**
- * convenience method
- */
- <T extends JavaResourcePersistentMember> Iterator<T> persistableMembers(Iterator<T> members) {
- return new FilteringIterator<T>(members) {
- @Override
- protected boolean accept(T m) {
- return m.isPersistable();
- }
- };
- }
-
-
- // ********** AST visitors **********
-
- /**
- * annotation visitor
- */
- protected static abstract class AnnotationVisitor
- extends ASTVisitor
- {
- protected final CompilationUnit astRoot;
- protected final BodyDeclaration bodyDeclaration;
-
- protected AnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration) {
- super();
- this.astRoot = astRoot;
- this.bodyDeclaration = bodyDeclaration;
- }
-
- @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.bodyDeclaration) {
- 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(CompilationUnit astRoot, BodyDeclaration bodyDeclaration) {
- super(astRoot, bodyDeclaration);
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourcePersistentMember.this.addInitialAnnotation(node, this.astRoot);
- }
- }
-
-
- /**
- * synchronize annotation visitor
- */
- protected class SynchronizeAnnotationVisitor
- extends AnnotationVisitor
- {
- protected final Set<Annotation> annotationsToRemove;
-
- protected SynchronizeAnnotationVisitor(CompilationUnit astRoot, BodyDeclaration bodyDeclaration, Set<Annotation> annotationsToRemove) {
- super(astRoot, bodyDeclaration);
- this.annotationsToRemove = annotationsToRemove;
- }
-
- @Override
- protected void visitChildAnnotation(org.eclipse.jdt.core.dom.Annotation node) {
- SourcePersistentMember.this.addOrSyncAnnotation(node, this.astRoot, this.annotationsToRemove);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java
deleted file mode 100644
index 058550bb3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePersistentType.java
+++ /dev/null
@@ -1,830 +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.core.internal.resource.java.source;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.FieldDeclaration;
-import org.eclipse.jdt.core.dom.IAnnotationBinding;
-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.core.internal.jpa2.resource.java.GeneratedAnnotationDefinition;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.StaticMetamodelAnnotationDefinition;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTType;
-import org.eclipse.jpt.core.internal.utility.jdt.JPTTools;
-import org.eclipse.jpt.core.jpa2.resource.java.GeneratedAnnotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.StaticMetamodelAnnotation;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.IntReference;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-
-/**
- * Java source persistent type
- */
-final class SourcePersistentType
- extends SourcePersistentMember<Type>
- implements JavaResourcePersistentType2_0
-{
- private String name;
-
- private String qualifiedName;
-
- private String superclassQualifiedName;
-
- private String declaringTypeName;
-
- private boolean abstract_; // 'abstract' is a reserved word
-
- private final Vector<JavaResourcePersistentType> types;
-
- private final Vector<JavaResourcePersistentAttribute> fields;
-
- private final Vector<JavaResourcePersistentAttribute> methods;
-
- private AccessType access;
-
- private StaticMetamodelAnnotation staticMetamodelAnnotation;
- //TODO move to interface after maintenance
- public static final String STATIC_METAMODEL_ANNOTATION_PROPERTY = "staticMetamodelAnnotation"; //$NON-NLS-1$
-
- private GeneratedAnnotation generatedAnnotation;
- //TODO move to interface after maintenance
- public static final String GENERATED_ANNOTATION_PROPERTY = "generatedAnnotation"; //$NON-NLS-1$
-
-
- private static final StaticMetamodelAnnotationDefinition STATIC_METAMODEL_ANNOTATION_DEFINITION = StaticMetamodelAnnotationDefinition.instance();
- private static final GeneratedAnnotationDefinition GENERATED_ANNOTATION_DEFINITION = GeneratedAnnotationDefinition.instance();
-
-
- // ********** construction/initialization **********
-
- /**
- * build top-level persistent type
- */
- static JavaResourcePersistentType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- TypeDeclaration typeDeclaration,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- typeDeclaration,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new SourcePersistentType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- /**
- * build nested persistent type
- */
- private static JavaResourcePersistentType newInstance(
- JavaResourceCompilationUnit javaResourceCompilationUnit,
- Type declaringType,
- TypeDeclaration typeDeclaration,
- int occurrence,
- CompilationUnit astRoot) {
- Type type = new JDTType(
- declaringType,
- typeDeclaration,
- occurrence,
- javaResourceCompilationUnit.getCompilationUnit(),
- javaResourceCompilationUnit.getModifySharedDocumentCommandExecutor(),
- javaResourceCompilationUnit.getAnnotationEditFormatter());
- JavaResourcePersistentType jrpt = new SourcePersistentType(javaResourceCompilationUnit, type);
- jrpt.initialize(astRoot);
- return jrpt;
- }
-
- private SourcePersistentType(JavaResourceCompilationUnit javaResourceCompilationUnit, Type type) {
- super(javaResourceCompilationUnit, type);
- this.types = new Vector<JavaResourcePersistentType>();
- this.fields = new Vector<JavaResourcePersistentAttribute>();
- this.methods = new Vector<JavaResourcePersistentAttribute>();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.name = this.buildName(astRoot);
- this.qualifiedName = this.buildQualifiedName(astRoot);
- this.superclassQualifiedName = this.buildSuperclassQualifiedName(astRoot);
- this.declaringTypeName = this.buildDeclaringTypeName(astRoot);
- this.abstract_ = this.buildAbstract(astRoot);
- this.initializeTypes(astRoot);
- this.initializeFields(astRoot);
- this.initializeMethods(astRoot);
- // need to wait until everything is built to calculate 'access'
- this.access = this.buildAccess();
- }
-
- /**
- * Handle the <code>StaticMetamodel</code> and <code>Generated</code>
- * annotations differently, since they are not really JPA "mapping"
- * annotations....
- */
- @Override
- void addInitialAnnotation(String jdtAnnotationName, CompilationUnit astRoot) {
- if (jdtAnnotationName.equals(STATIC_METAMODEL_ANNOTATION_DEFINITION.getAnnotationName())) {
- if (this.staticMetamodelAnnotation == null) { // ignore duplicates
- this.staticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.member);
- this.staticMetamodelAnnotation.initialize(astRoot);
- }
- } else if (jdtAnnotationName.equals(GENERATED_ANNOTATION_DEFINITION.getAnnotationName())) {
- if (this.generatedAnnotation == null) { // ignore duplicates
- this.generatedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.member);
- this.generatedAnnotation.initialize(astRoot);
- }
- } else {
- super.addInitialAnnotation(jdtAnnotationName, astRoot);
- }
- }
-
-
- // ********** update **********
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncName(this.buildName(astRoot));
- this.syncQualifiedName(this.buildQualifiedName(astRoot));
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(astRoot));
- this.syncDeclaringTypeName(this.buildDeclaringTypeName(astRoot));
- this.syncAbstract(this.buildAbstract(astRoot));
- this.syncTypes(astRoot);
- this.syncFields(astRoot);
- this.syncMethods(astRoot);
- this.syncMetamodelAnnotations(astRoot);
- // need to wait until everything is built to calculate 'access'
- this.syncAccess(this.buildAccess());
- }
-
- /**
- * Handle the <code>StaticMetamodel</code> and <code>Generated</code>
- * annotations differently, since they are not really JPA "mapping"
- * annotations. We aren't overriding {@link #addOrSyncAnnotation(String, CompilationUnit, java.util.Set)}
- * because we also have to handle removing these annotations separately.
- */
- private void syncMetamodelAnnotations(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- this.syncStaticMetamodelAnnotation(astRoot, binding);
- this.syncGeneratedAnnotation(astRoot, binding);
- }
-
- private void syncStaticMetamodelAnnotation(CompilationUnit astRoot, ITypeBinding binding) {
- if (binding != null && this.containsStaticMetamodelAnnotation(binding)) {
- if (this.staticMetamodelAnnotation != null) {
- this.staticMetamodelAnnotation.synchronizeWith(astRoot);
- }
- else {
- StaticMetamodelAnnotation newStaticMetamodelAnnotation = STATIC_METAMODEL_ANNOTATION_DEFINITION.buildAnnotation(this, this.member);
- newStaticMetamodelAnnotation.initialize(astRoot);
- this.setStaticMetamodelAnnotation(newStaticMetamodelAnnotation);
- }
- }
- else {
- this.setStaticMetamodelAnnotation(null);
- }
- }
-
- private void syncGeneratedAnnotation(CompilationUnit astRoot, ITypeBinding binding) {
- if (binding != null && this.containsGeneratedAnnotation(binding)) {
- if (this.generatedAnnotation != null) {
- this.generatedAnnotation.synchronizeWith(astRoot);
- }
- else {
- GeneratedAnnotation newGeneratedAnnotation = GENERATED_ANNOTATION_DEFINITION.buildAnnotation(this, this.member);
- newGeneratedAnnotation.initialize(astRoot);
- this.setGeneratedAnnotation(newGeneratedAnnotation);
- }
- }
- else {
- this.setGeneratedAnnotation(null);
- }
- }
-
- private boolean containsStaticMetamodelAnnotation(ITypeBinding binding) {
- return this.containsAnnotation(binding, STATIC_METAMODEL_ANNOTATION_DEFINITION.getAnnotationName());
- }
-
- private boolean containsGeneratedAnnotation(ITypeBinding binding) {
- return this.containsAnnotation(binding, GENERATED_ANNOTATION_DEFINITION.getAnnotationName());
- }
-
- private boolean containsAnnotation(ITypeBinding binding, String annotationName) {
- for (IAnnotationBinding annotationBinding : binding.getAnnotations()) {
- ITypeBinding annotationTypeBinding = annotationBinding.getAnnotationType();
- if (annotationTypeBinding != null && annotationTypeBinding.getQualifiedName().equals(annotationName)) {
- return true;
- }
- }
- return false;
- }
-
- // ********** SourcePersistentMember implementation **********
-
- @Override
- Iterator<String> validAnnotationNames() {
- return this.getAnnotationProvider().typeAnnotationNames();
- }
-
- @Override
- Annotation buildAnnotation(String mappingAnnotationName) {
- return this.getAnnotationProvider().buildTypeAnnotation(this, this.member, mappingAnnotationName);
- }
-
- @Override
- Annotation buildNullAnnotation(String annotationName) {
- return this.getAnnotationProvider().buildNullTypeAnnotation(this, annotationName);
- }
-
- @Override
- public void resolveTypes(CompilationUnit astRoot) {
- super.resolveTypes(astRoot);
-
- this.syncSuperclassQualifiedName(this.buildSuperclassQualifiedName(astRoot));
-
- for (JavaResourcePersistentAttribute 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 (JavaResourcePersistentAttribute method : this.getMethods()) {
- method.resolveTypes(astRoot);
- }
- for (JavaResourcePersistentType type : this.getTypes()) {
- type.resolveTypes(astRoot);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ******** JavaResourcePersistentType 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(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- 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(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- return (binding == null) ? null : binding.getQualifiedName();
- }
-
- // ***** 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(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- if (binding == null) {
- return null;
- }
- ITypeBinding superclass = binding.getSuperclass();
- return (superclass == null) ? null : superclass.getTypeDeclaration().getQualifiedName();
- }
-
- // ***** 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(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- if (binding == null) {
- return null;
- }
- ITypeBinding declaringClass = binding.getDeclaringClass();
- return (declaringClass == null) ? null : declaringClass.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(CompilationUnit astRoot) {
- ITypeBinding binding = this.member.getBinding(astRoot);
- return (binding == null) ? false : Modifier.isAbstract(binding.getModifiers());
- }
-
- // ***** access
- public AccessType getAccess() {
- return this.access;
- }
-
- // TODO
- //seems we could have a public changeAccess() api which would
- //move all annotations from fields to their corresponding methods or vice versa
- //though of course it's more complicated than that since what if the
- //corresponding field/method does not exist?
- //making this internal since it should only be set based on changes in the source, the
- //context model should not need to set this
- private void syncAccess(AccessType astAccess) {
- AccessType old = this.access;
- this.access = astAccess;
- this.firePropertyChanged(ACCESS_PROPERTY, old, astAccess);
- }
-
- private AccessType buildAccess() {
- return JPTTools.buildAccess(this);
- }
-
- public boolean isMapped() {
- for (Annotation each : this.getAnnotations()) {
- if (this.annotationIsMappingAnnotation(each)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean annotationIsMappingAnnotation(Annotation annotation) {
- return CollectionTools.contains(this.mappingAnnotationNames(), annotation.getAnnotationName());
- }
-
- private Iterator<String> mappingAnnotationNames() {
- return this.getAnnotationProvider().typeMappingAnnotationNames();
- }
-
- /**
- * check only persistable attributes
- */
- public boolean hasAnyAnnotatedAttributes() {
- for (Iterator<JavaResourcePersistentAttribute> stream = this.persistableAttributes(); stream.hasNext(); ) {
- if (stream.next().isAnnotated()) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** types **********
-
- public Iterator<JavaResourcePersistentType> types() {
- return this.getTypes().iterator();
- }
-
- private Iterable<JavaResourcePersistentType> getTypes() {
- return new LiveCloneIterable<JavaResourcePersistentType>(this.types); // read-only
- }
-
- public Iterator<JavaResourcePersistentType> allTypes() {
- return new TreeIterator<JavaResourcePersistentType>(this) {
- @Override
- protected Iterator<? extends JavaResourcePersistentType> children(JavaResourcePersistentType type) {
- return type.types();
- }
- };
- }
-
- public Iterator<JavaResourcePersistentType> persistableTypes() {
- return this.persistableMembers(this.types());
- }
-
- private JavaResourcePersistentType getType(String typeName, int occurrence) {
- for (JavaResourcePersistentType type : this.getTypes()) {
- if (type.isFor(typeName, occurrence)) {
- return type;
- }
- }
- return null;
- }
-
- private void addType(JavaResourcePersistentType type) {
- this.addItemToCollection(type, this.types, TYPES_COLLECTION);
- }
-
- private void removeTypes(Collection<JavaResourcePersistentType> remove) {
- this.removeItemsFromCollection(remove, this.types, TYPES_COLLECTION);
- }
-
- private void initializeTypes(CompilationUnit astRoot) {
- TypeDeclaration[] typeDeclarations = this.member.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.member.getTypes(astRoot);
- CounterMap counters = new CounterMap(typeDeclarations.length);
- HashSet<JavaResourcePersistentType> typesToRemove = new HashSet<JavaResourcePersistentType>(this.types);
- for (TypeDeclaration typeDeclaration : typeDeclarations) {
- String tdName = typeDeclaration.getName().getFullyQualifiedName();
- int occurrence = counters.increment(tdName);
-
- JavaResourcePersistentType 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 JavaResourcePersistentType buildType(TypeDeclaration nestedTypeDeclaration, int occurrence, CompilationUnit astRoot) {
- return newInstance(this.getJavaResourceCompilationUnit(), this.member, nestedTypeDeclaration, occurrence, astRoot);
- }
-
-
- // ********** fields **********
-
- public Iterator<JavaResourcePersistentAttribute> fields() {
- return this.getFields().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getFields() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.fields);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFields() {
- return this.persistableMembers(this.fields());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(this.persistableFields()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute resourceAttribute) {
- return resourceAttribute.getSpecifiedAccess() == AccessType.FIELD;
- }
- };
- }
-
- private void addField(JavaResourcePersistentAttribute field) {
- this.addItemToCollection(field, this.fields, FIELDS_COLLECTION);
- }
-
- private JavaResourcePersistentAttribute getField(String fieldName, int occurrence) {
- for (JavaResourcePersistentAttribute field : this.getFields()) {
- if (field.isFor(fieldName, occurrence)) {
- return field;
- }
- }
- return null;
- }
-
- private void removeFields(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.fields, FIELDS_COLLECTION);
- }
-
- private void initializeFields(CompilationUnit astRoot) {
- FieldDeclaration[] fieldDeclarations = this.member.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.member.getFields(astRoot);
- CounterMap counters = new CounterMap(fieldDeclarations.length);
- HashSet<JavaResourcePersistentAttribute> fieldsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.fields);
- for (FieldDeclaration fieldDeclaration : fieldDeclarations) {
- for (VariableDeclarationFragment fragment : fragments(fieldDeclaration)) {
- String fieldName = fragment.getName().getFullyQualifiedName();
- int occurrence = counters.increment(fieldName);
-
- JavaResourcePersistentAttribute 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 JavaResourcePersistentAttribute buildField(String fieldName, int occurrence, CompilationUnit astRoot) {
- return SourcePersistentAttribute.newInstance(this, this.member, fieldName, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private static List<VariableDeclarationFragment> fragments(FieldDeclaration fd) {
- return fd.fragments();
- }
-
-
- // ********** methods **********
-
- public Iterator<JavaResourcePersistentAttribute> methods() {
- return this.getMethods().iterator();
- }
-
- private Iterable<JavaResourcePersistentAttribute> getMethods() {
- return new LiveCloneIterable<JavaResourcePersistentAttribute>(this.methods);
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableProperties() {
- return this.persistableMembers(this.methods());
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess() {
- return new FilteringIterator<JavaResourcePersistentAttribute>(this.persistableProperties()) {
- @Override
- protected boolean accept(JavaResourcePersistentAttribute resourceAttribute) {
- return resourceAttribute.getSpecifiedAccess() == AccessType.PROPERTY;
- }
- };
- }
-
- private JavaResourcePersistentAttribute getMethod(MethodSignature signature, int occurrence) {
- for (JavaResourcePersistentAttribute method : this.getMethods()) {
- if (method.isFor(signature, occurrence)) {
- return method;
- }
- }
- return null;
- }
-
- private void addMethod(JavaResourcePersistentAttribute method) {
- this.addItemToCollection(method, this.methods, METHODS_COLLECTION);
- }
-
- private void removeMethods(Collection<JavaResourcePersistentAttribute> remove) {
- this.removeItemsFromCollection(remove, this.methods, METHODS_COLLECTION);
- }
-
- private void initializeMethods(CompilationUnit astRoot) {
- MethodDeclaration[] methodDeclarations = this.member.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.member.getMethods(astRoot);
- CounterMap counters = new CounterMap(methodDeclarations.length);
- HashSet<JavaResourcePersistentAttribute> methodsToRemove = new HashSet<JavaResourcePersistentAttribute>(this.methods);
- for (MethodDeclaration methodDeclaration : methodDeclarations) {
- MethodSignature signature = ASTTools.buildMethodSignature(methodDeclaration);
- int occurrence = counters.increment(signature);
-
- JavaResourcePersistentAttribute 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 JavaResourcePersistentAttribute buildMethod(MethodSignature signature, int occurrence, CompilationUnit astRoot) {
- return SourcePersistentAttribute.newInstance(this, this.member, signature, occurrence, this.getJavaResourceCompilationUnit(), astRoot);
- }
-
-
- // ********** attributes **********
-
- @SuppressWarnings("unchecked")
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistableProperties()
- );
- }
-
- public Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess) {
- if (specifiedAccess == null) {
- throw new IllegalArgumentException("specified access is null"); //$NON-NLS-1$
- }
- return (specifiedAccess == AccessType.FIELD) ?
- this.persistableAttributesForFieldAccessType() :
- this.persistableAttributesForPropertyAccessType();
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForFieldAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableFields(),
- this.persistablePropertiesWithSpecifiedPropertyAccess()
- );
- }
-
- @SuppressWarnings("unchecked")
- private Iterator<JavaResourcePersistentAttribute> persistableAttributesForPropertyAccessType() {
- return new CompositeIterator<JavaResourcePersistentAttribute>(
- this.persistableProperties(),
- this.persistableFieldsWithSpecifiedFieldAccess()
- );
- }
-
-
- // ********** metamodel **********
-
- public GeneratedAnnotation getGeneratedAnnotation() {
- return this.generatedAnnotation;
- }
-
- private void setGeneratedAnnotation(GeneratedAnnotation generatedAnnotation) {
- GeneratedAnnotation old = this.generatedAnnotation;
- this.generatedAnnotation = generatedAnnotation;
- firePropertyChanged(GENERATED_ANNOTATION_PROPERTY, old, this.generatedAnnotation);
- }
-
- private void setStaticMetamodelAnnotation(StaticMetamodelAnnotation staticMetamodelAnnotation) {
- StaticMetamodelAnnotation old = this.staticMetamodelAnnotation;
- this.staticMetamodelAnnotation = staticMetamodelAnnotation;
- firePropertyChanged(STATIC_METAMODEL_ANNOTATION_PROPERTY, old, this.staticMetamodelAnnotation);
- }
-
- /**
- * The type must be:<ul>
- * <li>in the specified source folder
- * <li>a top-level type
- * <li>annotated with <code>&#64;javax.annotation.Generated</code> with
- * the appropriate <code>value</code> and <code>date</code>
- * <li>either itself or one of its nested types annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>
- * </ul>
- */
- public boolean isGeneratedMetamodelTopLevelType(IPackageFragmentRoot sourceFolder) {
- if ( ! this.getSourceFolder().equals(sourceFolder)) {
- return false;
- }
- return this.isGeneratedMetamodelTopLevelType();
- }
-
- /**
- * The type must be:<ul>
- * <li>a top-level type
- * <li>annotated with <code>&#64;javax.annotation.Generated</code> with
- * the appropriate <code>value</code> and <code>date</code>
- * <li>either itself or one of its nested types annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>
- * </ul>
- */
- public boolean isGeneratedMetamodelTopLevelType() {
- if ( ! this.isGenerated()) {
- return false;
- }
- // if we get here we know we have a top-level type, since only top-level
- // types are annotated @Generated; now see if anything is a metamodel
- for (Iterator<JavaResourcePersistentType> stream = this.allTypes(); stream.hasNext(); ) {
- JavaResourcePersistentType2_0 type = (JavaResourcePersistentType2_0) stream.next();
- if (type.isMetamodel()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * The type must be annotated with
- * <code>&#64;javax.annotation.Generated</code> with the appropriate
- * <code>value</code> and <code>date</code>.
- */
- protected boolean isGenerated() {
- if (this.generatedAnnotation == null) {
- return false;
- }
- if (this.generatedAnnotation.valuesSize() != 1) {
- return false;
- }
- if ( ! this.generatedAnnotation.getValue(0).equals(METAMODEL_GENERATED_ANNOTATION_VALUE)) {
- return false;
- }
- if (StringTools.stringIsEmpty(this.generatedAnnotation.getDate())) {
- return false;
- }
- return true;
- }
-
- /**
- * The type must be annotated with
- * <code>&#64;javax.persistence.metamodel.StaticMetamodel</code>.
- */
- public boolean isMetamodel() {
- return this.staticMetamodelAnnotation != null;
- }
-
- private IPackageFragmentRoot getSourceFolder() {
- return (IPackageFragmentRoot) this.getJavaResourceCompilationUnit().getCompilationUnit().getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- }
-
-
- // ********** CounterMap **********
-
- private static class CounterMap {
- private final HashMap<Object, IntReference> counters;
-
- protected CounterMap(int initialCapacity) {
- super();
- this.counters = new HashMap<Object, IntReference>(initialCapacity);
- }
-
- /**
- * Return the incremented count for the specified object.
- */
- int increment(Object o) {
- IntReference counter = this.counters.get(o);
- if (counter == null) {
- counter = new IntReference();
- this.counters.put(o, counter);
- }
- counter.increment();
- return counter.getValue();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 65c7b71eca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,164 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumn
- */
-public final class SourcePrimaryKeyJoinColumnAnnotation
- extends SourceNamedColumnAnnotation
- implements NestablePrimaryKeyJoinColumnAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final DeclarationAnnotationElementAdapter<String> referencedColumnNameDeclarationAdapter;
- private final AnnotationElementAdapter<String> referencedColumnNameAdapter;
- private String referencedColumnName;
-
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- this.referencedColumnNameDeclarationAdapter = this.buildStringElementAdapter(JPA.PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
- this.referencedColumnNameAdapter = this.buildShortCircuitElementAdapter(this.referencedColumnNameDeclarationAdapter);
- }
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- this(parent, member, daa, new MemberAnnotationAdapter(member, daa));
- }
-
- public SourcePrimaryKeyJoinColumnAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.referencedColumnName = this.buildReferencedColumnName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncReferencedColumnName(this.buildReferencedColumnName(astRoot));
- }
-
-
- // ********** JavaSourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION;
- }
-
-
- // ********** PrimaryKeyJoinColumn implementation **********
-
- // ***** referenced column name
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- public void setReferencedColumnName(String referencedColumnName) {
- if (this.attributeValueHasChanged(this.referencedColumnName, referencedColumnName)) {
- this.referencedColumnName = referencedColumnName;
- this.referencedColumnNameAdapter.setValue(referencedColumnName);
- }
- }
-
- private void syncReferencedColumnName(String astReferencedColumnName) {
- String old = this.referencedColumnName;
- this.referencedColumnName = astReferencedColumnName;
- this.firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, old, astReferencedColumnName);
- }
-
- private String buildReferencedColumnName(CompilationUnit astRoot) {
- return this.referencedColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.referencedColumnNameDeclarationAdapter, astRoot);
- }
-
- public boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.referencedColumnNameDeclarationAdapter, pos, astRoot);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- PrimaryKeyJoinColumnAnnotation oldJoinColumn = (PrimaryKeyJoinColumnAnnotation) oldAnnotation;
- this.setReferencedColumnName(oldJoinColumn.getReferencedColumnName());
- }
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- protected IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
-
- // ********** static methods **********
-
- public static SourcePrimaryKeyJoinColumnAnnotation createPrimaryKeyJoinColumn(JavaResourceNode parent, Member member) {
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- static SourcePrimaryKeyJoinColumnAnnotation createNestedPrimaryKeyJoinColumn(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, pkJoinColumnsAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter pkJoinColumnsAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(pkJoinColumnsAdapter, index, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
-
- static NestablePrimaryKeyJoinColumnAnnotation createSecondaryTablePrimaryKeyJoinColumn(DeclarationAnnotationAdapter secondaryTableAdapter, JavaResourceNode parent, Member member, int index) {
- return new SourcePrimaryKeyJoinColumnAnnotation(parent, member, buildSecondaryTableAnnotationAdapter(secondaryTableAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildSecondaryTableAnnotationAdapter(DeclarationAnnotationAdapter secondaryTableAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTableAdapter, JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS, index, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java
deleted file mode 100644
index e687955999..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourcePrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,112 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnsAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.PrimaryKeyJoinColumns
- */
-public final class SourcePrimaryKeyJoinColumnsAnnotation
- extends SourceAnnotation<Member>
- implements PrimaryKeyJoinColumnsAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns = new Vector<NestablePrimaryKeyJoinColumnAnnotation>();
-
-
- public SourcePrimaryKeyJoinColumnsAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.pkJoinColumns);
- }
-
-
- // ********** AnnotationContainer Implementation **********
-
- public String getElementName() {
- return JPA.PRIMARY_KEY_JOIN_COLUMNS__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int getNestedAnnotationsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.pkJoinColumns.size());
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation(int index) {
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.buildPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(pkJoinColumn);
- return pkJoinColumn;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.pkJoinColumns.size();
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.addNestedAnnotation(index);
- pkJoinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) {
- return SourcePrimaryKeyJoinColumnAnnotation.createNestedPrimaryKeyJoinColumn(this, this.member, index, this.daa);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation removeNestedAnnotation(int index) {
- return this.pkJoinColumns.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.java
deleted file mode 100644
index 4b5718b105..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceQueryHintAnnotation.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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableQueryHintAnnotation;
-import org.eclipse.jpt.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.QueryHint
- */
-public final class SourceQueryHintAnnotation
- extends SourceAnnotation<Type>
- implements NestableQueryHintAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- private final AnnotationElementAdapter<String> nameAdapter;
- private String name;
-
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
-
- public SourceQueryHintAnnotation(JavaResourceNode parent, Type type, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, type, idaa, new MemberIndexedAnnotationAdapter(type, idaa));
- this.nameDeclarationAdapter = this.buildNameAdapter(idaa);
- this.nameAdapter = this.buildAdapter(this.nameDeclarationAdapter);
- this.valueDeclarationAdapter = this.buildValueAdapter(idaa);
- this.valueAdapter = this.buildAdapter(this.valueDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildNameAdapter(DeclarationAnnotationAdapter adapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(adapter, JPA.QUERY_HINT__NAME);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueAdapter(DeclarationAnnotationAdapter adapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(adapter, JPA.QUERY_HINT__VALUE);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.syncValue(this.buildValue(astRoot));
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** QueryHintAnnotation 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);
- }
-
- // ***** 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);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- QueryHintAnnotation oldHint = (QueryHintAnnotation) oldAnnotation;
- this.setName(oldHint.getName());
- this.setValue(oldHint.getValue());
- }
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** static methods **********
-
- static SourceQueryHintAnnotation createNamedQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new SourceQueryHintAnnotation(parent, type, buildNamedQueryQueryHintAnnotationAdapter(namedQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedQueryAdapter, JPA.NAMED_QUERY__HINTS, index, JPA.QUERY_HINT);
- }
-
- static SourceQueryHintAnnotation createNamedNativeQueryQueryHint(JavaResourceNode parent, Type type, DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new SourceQueryHintAnnotation(parent, type, buildNamedNativeQueryQueryHintAnnotationAdapter(namedNativeQueryAdapter, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNamedNativeQueryQueryHintAnnotationAdapter(DeclarationAnnotationAdapter namedNativeQueryAdapter, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(namedNativeQueryAdapter, JPA.NAMED_NATIVE_QUERY__HINTS, index, JPA.QUERY_HINT);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java
deleted file mode 100644
index 7877b36f0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,336 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumArrayDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-import org.eclipse.jpt.core.resource.java.CascadeType;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * javax.persistence.ManyToMany
- * javax.persistence.ManyToOne
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- */
-abstract class SourceRelationshipMappingAnnotation
- extends SourceAnnotation<Attribute>
- implements RelationshipMapping2_0Annotation
-{
- final DeclarationAnnotationElementAdapter<String> targetEntityDeclarationAdapter;
- final AnnotationElementAdapter<String> targetEntityAdapter;
- String targetEntity;
-
- String fullyQualifiedTargetEntityClassName;
-
- final DeclarationAnnotationElementAdapter<String> fetchDeclarationAdapter;
- final AnnotationElementAdapter<String> fetchAdapter;
- FetchType fetch;
-
- final DeclarationAnnotationElementAdapter<String[]> cascadeDeclarationAdapter;
- final AnnotationElementAdapter<String[]> cascadeAdapter;
- CascadeType[] cascadeTypes = EMPTY_CASCADE_TYPE_ARRAY; // this should never be null
- private static final CascadeType[] EMPTY_CASCADE_TYPE_ARRAY = new CascadeType[0];
-
-
- SourceRelationshipMappingAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.targetEntityDeclarationAdapter = this.getTargetEntityAdapter();
- this.targetEntityAdapter = this.buildAnnotationElementAdapter(this.targetEntityDeclarationAdapter);
- this.fetchDeclarationAdapter = this.getFetchAdapter();
- this.fetchAdapter = this.buildAnnotationElementAdapter(this.fetchDeclarationAdapter);
- this.cascadeDeclarationAdapter = this.getCascadeAdapter();
- this.cascadeAdapter = new MemberAnnotationElementAdapter<String[]>(attribute, this.cascadeDeclarationAdapter);
- }
-
- protected AnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- protected AnnotationElementAdapter<Boolean> buildBooleanAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Boolean> daea) {
- return new MemberAnnotationElementAdapter<Boolean>(this.member, daea);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.targetEntity = this.buildTargetEntity(astRoot);
- this.fullyQualifiedTargetEntityClassName = this.buildFullyQualifiedTargetEntityClassName(astRoot);
- this.fetch = this.buildFetch(astRoot);
- this.cascadeTypes = this.buildCascadeTypes(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFetch(this.buildFetch(astRoot));
- this.syncTargetEntity(this.buildTargetEntity(astRoot));
- this.syncFullyQualifiedTargetEntityClassName(this.buildFullyQualifiedTargetEntityClassName(astRoot));
- this.syncCascadeTypes(this.buildCascadeTypes(astRoot));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.targetEntity);
- }
-
-
- // ********** RelationshipMappingAnnotation implementation **********
-
- // ***** target entity
- public String getTargetEntity() {
- return this.targetEntity;
- }
-
- public void setTargetEntity(String targetEntity) {
- if (this.attributeValueHasChanged(this.targetEntity, targetEntity)) {
- this.targetEntity = targetEntity;
- this.targetEntityAdapter.setValue(targetEntity);
- }
- }
-
- private void syncTargetEntity(String astTargetEntity) {
- String old = this.targetEntity;
- this.targetEntity = astTargetEntity;
- this.firePropertyChanged(TARGET_ENTITY_PROPERTY, old, astTargetEntity);
- }
-
- private String buildTargetEntity(CompilationUnit astRoot) {
- return this.targetEntityAdapter.getValue(astRoot);
- }
-
- public TextRange getTargetEntityTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.targetEntityDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'targetEntity' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String> getTargetEntityAdapter();
-
- // ***** fully-qualified target entity class name
- public String getFullyQualifiedTargetEntityClassName() {
- return this.fullyQualifiedTargetEntityClassName;
- }
-
- private void syncFullyQualifiedTargetEntityClassName(String name) {
- String old = this.fullyQualifiedTargetEntityClassName;
- this.fullyQualifiedTargetEntityClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_TARGET_ENTITY_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedTargetEntityClassName(CompilationUnit astRoot) {
- return (this.targetEntity == null) ? null : ASTTools.resolveFullyQualifiedName(this.targetEntityAdapter.getExpression(astRoot));
- }
-
- // ***** 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(this.fetchDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'fetch' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String> getFetchAdapter();
-
- // ***** cascade types
- /**
- * pre-condition: state of 'cascadeTypes' is to change
- */
- private void setCascadeType(CascadeType cascadeType, boolean set) {
- this.setCascadeTypes(set ?
- ArrayTools.add(this.cascadeTypes, cascadeType) :
- ArrayTools.remove(this.cascadeTypes, cascadeType)
- );
- }
-
- /**
- * pre-condition: state of 'cascadeTypes' is to change
- */
- private void setCascadeTypes(CascadeType[] cascadeTypes) {
- this.cascadeTypes = cascadeTypes;
- this.cascadeAdapter.setValue(CascadeType.toJavaAnnotationValues(cascadeTypes));
- }
-
- private void syncCascadeTypes(CascadeType[] astCascadeTypes) {
- CascadeType[] old = this.cascadeTypes;
- this.cascadeTypes = astCascadeTypes;
- this.syncCascadeAll(old);
- this.syncCascadeMerge(old);
- this.syncCascadePersist(old);
- this.syncCascadeRefresh(old);
- this.syncCascadeRemove(old);
- this.syncCascadeDetach(old);
- }
-
- private CascadeType[] buildCascadeTypes(CompilationUnit astRoot) {
- return CascadeType.fromJavaAnnotationValues(this.cascadeAdapter.getValue(astRoot));
- }
-
- private boolean cascadeTypeIsTrue(CascadeType cascadeType) {
- return ArrayTools.contains(this.cascadeTypes, cascadeType);
- }
-
- public TextRange getCascadeTextRange(CompilationUnit astRoot) {
- return getElementTextRange(this.cascadeDeclarationAdapter, astRoot);
- }
-
- /**
- * return the Java adapter's 'cascade' element adapter config
- */
- abstract DeclarationAnnotationElementAdapter<String[]> getCascadeAdapter();
-
- // ***** cascade all
- public boolean isCascadeAll() {
- return this.cascadeTypeIsTrue(CascadeType.ALL);
- }
-
- public void setCascadeAll(boolean cascadeAll) {
- if (this.isCascadeAll() != cascadeAll) {
- this.setCascadeType(CascadeType.ALL, cascadeAll);
- }
- }
-
- private void syncCascadeAll(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.ALL);
- this.firePropertyChanged(CASCADE_ALL_PROPERTY, old, this.isCascadeAll());
- }
-
- // ***** cascade persist
- public boolean isCascadePersist() {
- return this.cascadeTypeIsTrue(CascadeType.PERSIST);
- }
-
- public void setCascadePersist(boolean cascadePersist) {
- if (this.isCascadePersist() != cascadePersist) {
- this.setCascadeType(CascadeType.PERSIST, cascadePersist);
- }
- }
-
- private void syncCascadePersist(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.PERSIST);
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, this.isCascadePersist());
- }
-
- // ***** cascade merge
- public boolean isCascadeMerge() {
- return this.cascadeTypeIsTrue(CascadeType.MERGE);
- }
-
- public void setCascadeMerge(boolean cascadeMerge) {
- if (this.isCascadeMerge() != cascadeMerge) {
- this.setCascadeType(CascadeType.MERGE, cascadeMerge);
- }
- }
-
- private void syncCascadeMerge(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.MERGE);
- this.firePropertyChanged(CASCADE_MERGE_PROPERTY, old, this.isCascadeMerge());
- }
-
- // ***** cascade remove
- public boolean isCascadeRemove() {
- return this.cascadeTypeIsTrue(CascadeType.REMOVE);
- }
-
- public void setCascadeRemove(boolean cascadeRemove) {
- if (this.isCascadeRemove() != cascadeRemove) {
- this.setCascadeType(CascadeType.REMOVE, cascadeRemove);
- }
- }
-
- private void syncCascadeRemove(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.REMOVE);
- this.firePropertyChanged(CASCADE_REMOVE_PROPERTY, old, this.isCascadeRemove());
- }
-
- // ***** cascade refresh
- public boolean isCascadeRefresh() {
- return this.cascadeTypeIsTrue(CascadeType.REFRESH);
- }
-
- public void setCascadeRefresh(boolean cascadeRefresh) {
- if (this.isCascadeRefresh() != cascadeRefresh) {
- this.setCascadeType(CascadeType.REFRESH, cascadeRefresh);
- }
- }
-
- private void syncCascadeRefresh(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.REFRESH);
- this.firePropertyChanged(CASCADE_REFRESH_PROPERTY, old, this.isCascadeRefresh());
- }
-
- // ***** cascade detach - JPA 2.0
- public boolean isCascadeDetach() {
- return this.cascadeTypeIsTrue(CascadeType.DETACH);
- }
-
- public void setCascadeDetach(boolean cascadeDetach) {
- if (this.isCascadeDetach() != cascadeDetach) {
- this.setCascadeType(CascadeType.DETACH, cascadeDetach);
- }
- }
-
- private void syncCascadeDetach(CascadeType[] oldCascadeTypes) {
- boolean old = ArrayTools.contains(oldCascadeTypes, CascadeType.DETACH);
- this.firePropertyChanged(CASCADE_DETACH_PROPERTY, old, this.isCascadeDetach());
- }
-
- // ********** static methods **********
-
- static DeclarationAnnotationElementAdapter<String> buildTargetEntityAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- // TODO what about QualifiedType?
- return buildAnnotationElementAdapter(annotationAdapter, elementName, SimpleTypeStringExpressionConverter.instance());
- }
-
- static DeclarationAnnotationElementAdapter<String> buildAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, false, converter);
- }
-
- static DeclarationAnnotationElementAdapter<String> buildFetchAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
- }
-
- static DeclarationAnnotationElementAdapter<String[]> buildEnumArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return new EnumArrayDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java
deleted file mode 100644
index b7cf02e2ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTableAnnotation.java
+++ /dev/null
@@ -1,265 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestablePrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.SecondaryTable
- */
-public final class SourceSecondaryTableAnnotation
- extends SourceBaseTableAnnotation
- implements NestableSecondaryTableAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(SecondaryTableAnnotation.ANNOTATION_NAME);
-
- private final Vector<NestablePrimaryKeyJoinColumnAnnotation> pkJoinColumns = new Vector<NestablePrimaryKeyJoinColumnAnnotation>();
- private final PkJoinColumnsAnnotationContainer pkJoinColumnsContainer = new PkJoinColumnsAnnotationContainer();
-
-
- public SourceSecondaryTableAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, member, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- AnnotationContainerTools.initialize(this.pkJoinColumnsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- AnnotationContainerTools.synchronize(this.pkJoinColumnsContainer, astRoot);
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__NAME);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__SCHEMA);
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, JPA.SECONDARY_TABLE__CATALOG);
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- }
-
-
- // ************* SecondaryTableAnnotation implementation *******************
-
- // ***** pk join columns
- public ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns() {
- return new CloneListIterator<PrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestablePkJoinColumns() {
- return new LiveCloneIterable<NestablePrimaryKeyJoinColumnAnnotation>(this.pkJoinColumns);
- }
-
- public int pkJoinColumnsSize() {
- return this.pkJoinColumns.size();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index) {
- return this.pkJoinColumns.get(index);
- }
-
- public int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation joinColumn) {
- return this.pkJoinColumns.indexOf(joinColumn);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index) {
- return (NestablePrimaryKeyJoinColumnAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn_() {
- return this.addPkJoinColumn_(this.pkJoinColumns.size());
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation addPkJoinColumn_(int index) {
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.buildPrimaryKeyJoinColumn(index);
- this.pkJoinColumns.add(pkJoinColumn);
- return pkJoinColumn;
- }
-
- void syncAddPkJoinColumn(Annotation astAnnotation) {
- int index = this.pkJoinColumns.size();
- NestablePrimaryKeyJoinColumnAnnotation pkJoinColumn = this.addPkJoinColumn_(index);
- pkJoinColumn.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, pkJoinColumn);
- }
-
- private NestablePrimaryKeyJoinColumnAnnotation buildPrimaryKeyJoinColumn(int index) {
- return SourcePrimaryKeyJoinColumnAnnotation.createSecondaryTablePrimaryKeyJoinColumn(this.daa, this, this.member, index);
- }
-
- void pkJoinColumnAdded(int index, NestablePrimaryKeyJoinColumnAnnotation joinColumn) {
- this.fireItemAdded(PK_JOIN_COLUMNS_LIST, index, joinColumn);
- }
-
- public void movePkJoinColumn(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation movePkJoinColumn_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.pkJoinColumns, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removePkJoinColumn(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.pkJoinColumnsContainer);
- }
-
- NestablePrimaryKeyJoinColumnAnnotation removePkJoinColumn_(int index) {
- return this.pkJoinColumns.remove(index);
- }
-
- void syncRemovePkJoinColumns(int index) {
- this.removeItemsFromList(index, this.pkJoinColumns, PK_JOIN_COLUMNS_LIST);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
- protected IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- @Override
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- super.initializeFrom(oldAnnotation);
- SecondaryTableAnnotation oldTable = (SecondaryTableAnnotation) oldAnnotation;
- for (PrimaryKeyJoinColumnAnnotation oldPkJoinColumn : CollectionTools.iterable(oldTable.pkJoinColumns())) {
- NestablePrimaryKeyJoinColumnAnnotation newPkJoinColumn = this.addPkJoinColumn(oldTable.indexOfPkJoinColumn(oldPkJoinColumn));
- newPkJoinColumn.initializeFrom((NestableAnnotation) oldPkJoinColumn);
- }
- }
-
-
- // ********** static methods **********
-
- public static SourceSecondaryTableAnnotation createSecondaryTable(JavaResourceNode parent, Member member) {
- return new SourceSecondaryTableAnnotation(parent, member, DECLARATION_ANNOTATION_ADAPTER, new MemberAnnotationAdapter(member, DECLARATION_ANNOTATION_ADAPTER));
- }
-
- static SourceSecondaryTableAnnotation createNestedSecondaryTable(JavaResourceNode parent, Member member, int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- IndexedDeclarationAnnotationAdapter idaa = buildNestedDeclarationAnnotationAdapter(index, secondaryTablesAdapter);
- IndexedAnnotationAdapter annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
- return new SourceSecondaryTableAnnotation(parent, member, idaa, annotationAdapter);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildNestedDeclarationAnnotationAdapter(int index, DeclarationAnnotationAdapter secondaryTablesAdapter) {
- return new NestedIndexedDeclarationAnnotationAdapter(secondaryTablesAdapter, index, JPA.SECONDARY_TABLE);
- }
-
-
- // ********** pk join column container **********
-
- /**
- * adapt the AnnotationContainer interface to the secondary table's
- * primary key join columns
- */
- class PkJoinColumnsAnnotationContainer
- implements AnnotationContainer<NestablePrimaryKeyJoinColumnAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceSecondaryTableAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.SECONDARY_TABLE__PK_JOIN_COLUMNS;
- }
-
- public String getNestedAnnotationName() {
- return PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestablePrimaryKeyJoinColumnAnnotation> getNestedAnnotations() {
- return SourceSecondaryTableAnnotation.this.getNestablePkJoinColumns();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceSecondaryTableAnnotation.this.pkJoinColumnsSize();
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation addNestedAnnotation() {
- return SourceSecondaryTableAnnotation.this.addPkJoinColumn_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceSecondaryTableAnnotation.this.syncAddPkJoinColumn(astAnnotation);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceSecondaryTableAnnotation.this.movePkJoinColumn_(targetIndex, sourceIndex);
- }
-
- public NestablePrimaryKeyJoinColumnAnnotation removeNestedAnnotation(int index) {
- return SourceSecondaryTableAnnotation.this.removePkJoinColumn_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceSecondaryTableAnnotation.this.syncRemovePkJoinColumns(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java
deleted file mode 100644
index 4729ee7537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSecondaryTablesAnnotation.java
+++ /dev/null
@@ -1,112 +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.core.internal.resource.java.source;
-
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableSecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.core.resource.java.SecondaryTablesAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-
-/**
- * javax.persistence.SecondaryTables
- */
-public final class SourceSecondaryTablesAnnotation
- extends SourceAnnotation<Member>
- implements SecondaryTablesAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final Vector<NestableSecondaryTableAnnotation> secondaryTables = new Vector<NestableSecondaryTableAnnotation>();
-
-
- public SourceSecondaryTablesAnnotation(JavaResourcePersistentType parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- AnnotationContainerTools.initialize(this, astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- AnnotationContainerTools.synchronize(this, astRoot);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.secondaryTables);
- }
-
-
- // ********** AnnotationContainer implementation **********
-
- public String getElementName() {
- return JPA.SECONDARY_TABLES__VALUE;
- }
-
- public String getNestedAnnotationName() {
- return SecondaryTableAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableSecondaryTableAnnotation> getNestedAnnotations() {
- return new LiveCloneIterable<NestableSecondaryTableAnnotation>(this.secondaryTables);
- }
-
- public int getNestedAnnotationsSize() {
- return this.secondaryTables.size();
- }
-
- public NestableSecondaryTableAnnotation addNestedAnnotation() {
- return this.addNestedAnnotation(this.secondaryTables.size());
- }
-
- private NestableSecondaryTableAnnotation addNestedAnnotation(int index) {
- NestableSecondaryTableAnnotation secondaryTable = this.buildSecondaryTable(index);
- this.secondaryTables.add(secondaryTable);
- return secondaryTable;
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- int index = this.secondaryTables.size();
- NestableSecondaryTableAnnotation secondaryTable = this.addNestedAnnotation(index);
- secondaryTable.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(SECONDARY_TABLES_LIST, index, secondaryTable);
- }
-
- private NestableSecondaryTableAnnotation buildSecondaryTable(int index) {
- return SourceSecondaryTableAnnotation.createNestedSecondaryTable(this, this.member, index, this.daa);
- }
-
- public NestableSecondaryTableAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.secondaryTables, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public NestableSecondaryTableAnnotation removeNestedAnnotation(int index) {
- return this.secondaryTables.remove(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- this.removeItemsFromList(index, this.secondaryTables, SECONDARY_TABLES_LIST);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java
deleted file mode 100644
index b1894b7eb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceSequenceGeneratorAnnotation.java
+++ /dev/null
@@ -1,126 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * javax.persistence.SequenceGenerator
- */
-public abstract class SourceSequenceGeneratorAnnotation
- extends SourceGeneratorAnnotation
- implements SequenceGeneratorAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.SEQUENCE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> SEQUENCE_NAME_ADAPTER = buildAdapter(JPA.SEQUENCE_GENERATOR__SEQUENCE_NAME);
- private final AnnotationElementAdapter<String> sequenceNameAdapter;
- private String sequenceName;
-
-
- protected SourceSequenceGeneratorAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.sequenceNameAdapter = this.buildAdapter(SEQUENCE_NAME_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.sequenceName = this.buildSequenceName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncSequenceName(this.buildSequenceName(astRoot));
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
-
- // ********** SequenceGeneratorAnnotation implementation **********
-
- // ***** sequence name
- public String getSequenceName() {
- return this.sequenceName;
- }
-
- public void setSequenceName(String sequenceName) {
- if (this.attributeValueHasChanged(this.sequenceName, sequenceName)) {
- this.sequenceName = sequenceName;
- this.sequenceNameAdapter.setValue(sequenceName);
- }
- }
-
- public void syncSequenceName(String astSequenceName) {
- String old = this.sequenceName;
- this.sequenceName = astSequenceName;
- this.firePropertyChanged(SEQUENCE_NAME_PROPERTY, old, astSequenceName);
- }
-
- private String buildSequenceName(CompilationUnit astRoot) {
- return this.sequenceNameAdapter.getValue(astRoot);
- }
-
- public TextRange getSequenceNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SEQUENCE_NAME_ADAPTER, astRoot);
- }
-
- public boolean sequenceNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(SEQUENCE_NAME_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- protected static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableAnnotation.java
deleted file mode 100644
index a7719dc774..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableAnnotation.java
+++ /dev/null
@@ -1,71 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-
-/**
- * javax.persistence.Table
- */
-public final class SourceTableAnnotation
- extends SourceBaseTableAnnotation
- implements TableAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__SCHEMA);
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__CATALOG);
-
-
- public SourceTableAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceBaseTableAnnotation implementation **********
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getNameAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return NAME_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getSchemaAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return SCHEMA_ADAPTER;
- }
-
- @Override
- protected DeclarationAnnotationElementAdapter<String> getCatalogAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- // ignore the daa passed in, @Table is never nested
- return CATALOG_ADAPTER;
- }
-
- @Override
- protected String getUniqueConstraintsElementName() {
- return JPA.TABLE__UNIQUE_CONSTRAINTS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java
deleted file mode 100644
index fe519ded24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTableGeneratorAnnotation.java
+++ /dev/null
@@ -1,459 +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.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraintAnnotation;
-import org.eclipse.jpt.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.TableGenerator
- */
-public final class SourceTableGeneratorAnnotation
- extends SourceGeneratorAnnotation
- implements TableGeneratorAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__NAME);
-
- private static final DeclarationAnnotationElementAdapter<Integer> INITIAL_VALUE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__INITIAL_VALUE);
-
- private static final DeclarationAnnotationElementAdapter<Integer> ALLOCATION_SIZE_ADAPTER = buildIntegerAdapter(JPA.TABLE_GENERATOR__ALLOCATION_SIZE);
-
- private static final DeclarationAnnotationElementAdapter<String> TABLE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__TABLE);
- private final AnnotationElementAdapter<String> tableAdapter;
- private String table;
-
- private static final DeclarationAnnotationElementAdapter<String> SCHEMA_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__SCHEMA);
- private final AnnotationElementAdapter<String> schemaAdapter;
- private String schema;
-
- private static final DeclarationAnnotationElementAdapter<String> CATALOG_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__CATALOG);
- private final AnnotationElementAdapter<String> catalogAdapter;
- private String catalog;
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_NAME);
- private final AnnotationElementAdapter<String> pkColumnNameAdapter;
- private String pkColumnName;
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_COLUMN_NAME_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__VALUE_COLUMN_NAME);
- private final AnnotationElementAdapter<String> valueColumnNameAdapter;
- private String valueColumnName;
-
- private static final DeclarationAnnotationElementAdapter<String> PK_COLUMN_VALUE_ADAPTER = buildAdapter(JPA.TABLE_GENERATOR__PK_COLUMN_VALUE);
- private final AnnotationElementAdapter<String> pkColumnValueAdapter;
- private String pkColumnValue;
-
- private final Vector<NestableUniqueConstraintAnnotation> uniqueConstraints = new Vector<NestableUniqueConstraintAnnotation>();
- private final UniqueConstraintsAnnotationContainer uniqueConstraintsContainer = new UniqueConstraintsAnnotationContainer();
-
-
- public SourceTableGeneratorAnnotation(JavaResourceNode parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.tableAdapter = this.buildAdapter(TABLE_ADAPTER);
- this.catalogAdapter = this.buildAdapter(CATALOG_ADAPTER);
- this.schemaAdapter = this.buildAdapter(SCHEMA_ADAPTER);
- this.pkColumnNameAdapter = this.buildAdapter(PK_COLUMN_NAME_ADAPTER);
- this.valueColumnNameAdapter = this.buildAdapter(VALUE_COLUMN_NAME_ADAPTER);
- this.pkColumnValueAdapter = this.buildAdapter(PK_COLUMN_VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.table = this.buildTable(astRoot);
- this.schema = this.buildSchema(astRoot);
- this.catalog = this.buildCatalog(astRoot);
- this.pkColumnName = this.buildPkColumnName(astRoot);
- this.valueColumnName = this.buildValueColumnName(astRoot);
- this.pkColumnValue = this.buildPkColumnValue(astRoot);
- AnnotationContainerTools.initialize(this.uniqueConstraintsContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncTable(this.buildTable(astRoot));
- this.syncSchema(this.buildSchema(astRoot));
- this.syncCatalog(this.buildCatalog(astRoot));
- this.syncPkColumnName(this.buildPkColumnName(astRoot));
- this.syncValueColumnName(this.buildValueColumnName(astRoot));
- this.syncPkColumnValue(this.buildPkColumnValue(astRoot));
- AnnotationContainerTools.synchronize(this.uniqueConstraintsContainer, astRoot);
- }
-
-
- // ********** AbstractGeneratorAnnotation implementation **********
-
- @Override
- DeclarationAnnotationElementAdapter<String> getNameAdapter() {
- return NAME_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getInitialValueAdapter() {
- return INITIAL_VALUE_ADAPTER;
- }
-
- @Override
- DeclarationAnnotationElementAdapter<Integer> getAllocationSizeAdapter() {
- return ALLOCATION_SIZE_ADAPTER;
- }
-
-
- // ********** TableGeneratorAnnotation implementation **********
-
- // ***** 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(TABLE_ADAPTER, astRoot);
- }
-
- public boolean tableTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(TABLE_ADAPTER, pos, astRoot);
- }
-
- // ***** schema
- public String getSchema() {
- return this.schema;
- }
-
- public void setSchema(String schema) {
- if (this.attributeValueHasChanged(this.schema, schema)) {
- this.schema = schema;
- this.schemaAdapter.setValue(schema);
- }
- }
-
- private void syncSchema(String astSchema) {
- String old = this.schema;
- this.schema = astSchema;
- this.firePropertyChanged(SCHEMA_PROPERTY, old, astSchema);
- }
-
- private String buildSchema(CompilationUnit astRoot) {
- return this.schemaAdapter.getValue(astRoot);
- }
-
- public TextRange getSchemaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SCHEMA_ADAPTER, astRoot);
- }
-
- public boolean schemaTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(SCHEMA_ADAPTER, pos, astRoot);
- }
-
- // ***** catalog
- public String getCatalog() {
- return this.catalog;
- }
-
- public void setCatalog(String catalog) {
- if (this.attributeValueHasChanged(this.catalog, catalog)) {
- this.catalog = catalog;
- this.catalogAdapter.setValue(catalog);
- }
- }
-
- private void syncCatalog(String astCatalog) {
- String old = this.catalog;
- this.catalog = astCatalog;
- this.firePropertyChanged(CATALOG_PROPERTY, old, astCatalog);
- }
-
- private String buildCatalog(CompilationUnit astRoot) {
- return this.catalogAdapter.getValue(astRoot);
- }
-
- public TextRange getCatalogTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CATALOG_ADAPTER, astRoot);
- }
-
- public boolean catalogTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(CATALOG_ADAPTER, pos, astRoot);
- }
-
- // ***** pk column name
- public String getPkColumnName() {
- return this.pkColumnName;
- }
-
- public void setPkColumnName(String pkColumnName) {
- if (this.attributeValueHasChanged(this.pkColumnName, pkColumnName)) {
- this.pkColumnName = pkColumnName;
- this.pkColumnNameAdapter.setValue(pkColumnName);
- }
- }
-
- private void syncPkColumnName(String astPkColumnName) {
- String old = this.pkColumnName;
- this.pkColumnName = astPkColumnName;
- this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, astPkColumnName);
- }
-
- private String buildPkColumnName(CompilationUnit astRoot) {
- return this.pkColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getPkColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(PK_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- public boolean pkColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(PK_COLUMN_NAME_ADAPTER, pos, astRoot);
- }
-
- // ***** value column name
- public String getValueColumnName() {
- return this.valueColumnName;
- }
-
- public void setValueColumnName(String valueColumnName) {
- if (this.attributeValueHasChanged(this.valueColumnName, valueColumnName)) {
- this.valueColumnName = valueColumnName;
- this.valueColumnNameAdapter.setValue(valueColumnName);
- }
- }
-
- private void syncValueColumnName(String astValueColumnName) {
- String old = this.valueColumnName;
- this.valueColumnName = astValueColumnName;
- this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, astValueColumnName);
- }
-
- private String buildValueColumnName(CompilationUnit astRoot) {
- return this.valueColumnNameAdapter.getValue(astRoot);
- }
-
- public TextRange getValueColumnNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_COLUMN_NAME_ADAPTER, astRoot);
- }
-
- public boolean valueColumnNameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(VALUE_COLUMN_NAME_ADAPTER, pos, astRoot);
- }
-
- // ***** pk column value
- public String getPkColumnValue() {
- return this.pkColumnValue;
- }
-
- public void setPkColumnValue(String pkColumnValue) {
- if (this.attributeValueHasChanged(this.pkColumnValue, pkColumnValue)) {
- this.pkColumnValue = pkColumnValue;
- this.pkColumnValueAdapter.setValue(pkColumnValue);
- }
- }
-
- private void syncPkColumnValue(String astPkColumnValue) {
- String old = this.pkColumnValue;
- this.pkColumnValue = astPkColumnValue;
- this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, astPkColumnValue);
- }
-
- private String buildPkColumnValue(CompilationUnit astRoot) {
- return this.pkColumnValueAdapter.getValue(astRoot);
- }
-
- public TextRange getPkColumnValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(PK_COLUMN_VALUE_ADAPTER, astRoot);
- }
-
- public boolean pkColumnValueTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(PK_COLUMN_VALUE_ADAPTER, pos, astRoot);
- }
-
- // ***** unique constraints
- public ListIterator<UniqueConstraintAnnotation> uniqueConstraints() {
- return new CloneListIterator<UniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- Iterable<NestableUniqueConstraintAnnotation> getNestableUniqueConstraints() {
- return new LiveCloneIterable<NestableUniqueConstraintAnnotation>(this.uniqueConstraints);
- }
-
- public int uniqueConstraintsSize() {
- return this.uniqueConstraints.size();
- }
-
- public NestableUniqueConstraintAnnotation uniqueConstraintAt(int index) {
- return this.uniqueConstraints.get(index);
- }
-
- public int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint) {
- return this.uniqueConstraints.indexOf(uniqueConstraint);
- }
-
- public NestableUniqueConstraintAnnotation addUniqueConstraint(int index) {
- return (NestableUniqueConstraintAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation addUniqueConstraint_() {
- return this.addUniqueConstraint_(this.uniqueConstraints.size());
- }
-
- private NestableUniqueConstraintAnnotation addUniqueConstraint_(int index) {
- NestableUniqueConstraintAnnotation uniqueConstraint = this.buildUniqueConstraint(index);
- this.uniqueConstraints.add(uniqueConstraint);
- return uniqueConstraint;
- }
-
- void syncAddUniqueConstraint(Annotation astAnnotation) {
- int index = this.uniqueConstraints.size();
- NestableUniqueConstraintAnnotation uniqueConstraint = this.addUniqueConstraint_(index);
- uniqueConstraint.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, uniqueConstraint);
- }
-
- NestableUniqueConstraintAnnotation buildUniqueConstraint(int index) {
- return new SourceUniqueConstraintAnnotation(this, this.member, buildUniqueConstraintAnnotationAdapter(index));
- }
-
- IndexedDeclarationAnnotationAdapter buildUniqueConstraintAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(this.daa, JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
- }
-
- void uniqueConstraintAdded(int index, NestableUniqueConstraintAnnotation constraint) {
- this.fireItemAdded(UNIQUE_CONSTRAINTS_LIST, index, constraint);
- }
-
- public void moveUniqueConstraint(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation moveUniqueConstraint_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.uniqueConstraints, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeUniqueConstraint(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.uniqueConstraintsContainer);
- }
-
- NestableUniqueConstraintAnnotation removeUniqueConstraint_(int index) {
- return this.uniqueConstraints.remove(index);
- }
-
- void syncRemoveUniqueConstraints(int index) {
- this.removeItemsFromList(index, this.uniqueConstraints, UNIQUE_CONSTRAINTS_LIST);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildAdapter(String elementName) {
- return buildAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildIntegerAdapter(String elementName) {
- return buildIntegerAdapter(DECLARATION_ANNOTATION_ADAPTER, elementName);
- }
-
-
- // ********** unique constraint container **********
-
- /**
- * adapt the AnnotationContainer interface to the table generator's unique constraints
- */
- class UniqueConstraintsAnnotationContainer
- implements AnnotationContainer<NestableUniqueConstraintAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceTableGeneratorAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return JPA.TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
- }
-
- public String getNestedAnnotationName() {
- return UniqueConstraintAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableUniqueConstraintAnnotation> getNestedAnnotations() {
- return SourceTableGeneratorAnnotation.this.getNestableUniqueConstraints();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceTableGeneratorAnnotation.this.uniqueConstraintsSize();
- }
-
- public NestableUniqueConstraintAnnotation addNestedAnnotation() {
- return SourceTableGeneratorAnnotation.this.addUniqueConstraint_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceTableGeneratorAnnotation.this.syncAddUniqueConstraint(astAnnotation);
- }
-
- public NestableUniqueConstraintAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceTableGeneratorAnnotation.this.moveUniqueConstraint_(targetIndex, sourceIndex);
- }
-
- public NestableUniqueConstraintAnnotation removeNestedAnnotation(int index) {
- return SourceTableGeneratorAnnotation.this.removeUniqueConstraint_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceTableGeneratorAnnotation.this.syncRemoveUniqueConstraints(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTemporalAnnotation.java
deleted file mode 100644
index ca5a5dea25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTemporalAnnotation.java
+++ /dev/null
@@ -1,39 +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.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Temporal
- */
-public final class SourceTemporalAnnotation
- extends SourceBaseTemporalAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceTemporalAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return JPA.TEMPORAL__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTransientAnnotation.java
deleted file mode 100644
index fe3c171d89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceTransientAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Transient
- */
-public final class SourceTransientAnnotation
- extends SourceAnnotation<Attribute>
- implements TransientAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceTransientAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.java
deleted file mode 100644
index 474d351479..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceUniqueConstraintAnnotation.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.core.internal.resource.java.source;
-
-import java.util.Arrays;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.AnnotationStringArrayExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableUniqueConstraintAnnotation;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * javax.persistence.UniqueConstraint
- */
-public final class SourceUniqueConstraintAnnotation
- extends SourceAnnotation<Member>
- implements NestableUniqueConstraintAnnotation
-{
- public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final DeclarationAnnotationElementAdapter<String[]> columnNamesDeclarationAdapter;
- private final AnnotationElementAdapter<String[]> columnNamesAdapter;
- private final Vector<String> columnNames = new Vector<String>();
-
-
- public SourceUniqueConstraintAnnotation(JavaResourceNode parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- this.columnNamesDeclarationAdapter = buildArrayAnnotationElementAdapter(idaa, JPA.UNIQUE_CONSTRAINT__COLUMN_NAMES);
- this.columnNamesAdapter = this.buildAnnotationElementAdapter(this.columnNamesDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- private AnnotationElementAdapter<String[]> buildAnnotationElementAdapter(DeclarationAnnotationElementAdapter<String[]> daea) {
- return new MemberAnnotationElementAdapter<String[]>(this.member, daea);
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- return buildArrayAnnotationElementAdapter(annotationAdapter, elementName, AnnotationStringArrayExpressionConverter.forStrings());
- }
-
- private static DeclarationAnnotationElementAdapter<String[]> buildArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<String[]> converter) {
- return new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, false, converter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.initializeColumnNames(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncColumnNames(astRoot);
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.columnNames);
- }
-
-
- // ********** UniqueConstraintAnnotation implementation **********
-
- // ***** column names
- public ListIterator<String> columnNames() {
- return new CloneListIterator<String>(this.columnNames);
- }
-
- public int columnNamesSize() {
- return this.columnNames.size();
- }
-
- public void addColumnName(String columnName) {
- this.addColumnName(this.columnNames.size(), columnName);
- }
-
- public void addColumnName(int index, String columnName) {
- this.columnNames.add(index, columnName);
- this.writeColumnNames();
- }
-
- public void moveColumnName(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.columnNames, targetIndex, sourceIndex);
- this.writeColumnNames();
- }
-
- public void removeColumnName(String columnName) {
- this.columnNames.remove(columnName);
- this.writeColumnNames();
- }
-
- public void removeColumnName(int index) {
- this.columnNames.remove(index);
- this.writeColumnNames();
- }
-
- private void writeColumnNames() {
- this.columnNamesAdapter.setValue(this.columnNames.toArray(new String[this.columnNames.size()]));
- }
-
- private void initializeColumnNames(CompilationUnit astRoot) {
- String[] astColumnNames = this.columnNamesAdapter.getValue(astRoot);
- for (int i = 0; i < astColumnNames.length; i++) {
- this.columnNames.add(astColumnNames[i]);
- }
- }
-
- private void syncColumnNames(CompilationUnit astRoot) {
- String[] javaColumnNames = this.columnNamesAdapter.getValue(astRoot);
- this.synchronizeList(Arrays.asList(javaColumnNames), this.columnNames, COLUMN_NAMES_LIST);
- }
-
- public boolean columnNamesTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.columnNamesDeclarationAdapter, pos, astRoot);
- }
-
-
- // ********** NestableAnnotation implementation **********
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- UniqueConstraintAnnotation oldConstraint = (UniqueConstraintAnnotation) oldAnnotation;
- for (String columnName : CollectionTools.iterable(oldConstraint.columnNames())) {
- this.addColumnName(columnName);
- }
- }
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceVersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceVersionAnnotation.java
deleted file mode 100644
index 7e1e448cd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/source/SourceVersionAnnotation.java
+++ /dev/null
@@ -1,45 +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.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-
-/**
- * javax.persistence.Version
- */
-public final class SourceVersionAnnotation
- extends SourceAnnotation<Attribute>
- implements VersionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceVersionAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmXmlResourceProvider.java
deleted file mode 100644
index 523bacf3ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/OrmXmlResourceProvider.java
+++ /dev/null
@@ -1,83 +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.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.core.runtime.Path;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class OrmXmlResourceProvider
- extends AbstractXmlResourceProvider
- implements OrmFileCreationDataModelProperties
-{
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given file.
- */
- public static OrmXmlResourceProvider getXmlResourceProvider(IFile file) {
- return getXmlResourceProvider_(file.getProject(), file.getFullPath().toString());
- }
-
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given project in the specified deploy location
- */
- public static OrmXmlResourceProvider getXmlResourceProvider(IProject project, String deployLocation) {
- return getXmlResourceProvider_(project, JptCorePlugin.getDeploymentURI(project, deployLocation));
- }
-
- /**
- * (Convenience method) Returns an ORM resource model provider for
- * the given project in the default deploy location
- */
- public static OrmXmlResourceProvider getDefaultXmlResourceProvider(IProject project) {
- return getXmlResourceProvider(project, JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- private static OrmXmlResourceProvider getXmlResourceProvider_(IProject project, String location) {
- return new OrmXmlResourceProvider(project, new Path(location));
- }
-
-
- public OrmXmlResourceProvider(IProject project) {
- this(project, new Path(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH));
- }
-
- public OrmXmlResourceProvider(IProject project, IPath filePath) {
- super(project, filePath, JptCorePlugin.ORM_XML_CONTENT_TYPE);
- }
-
- @Override
- protected void populateRoot(Object config) {
- IDataModel dataModel = (IDataModel) config;
- XmlEntityMappings entityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion(dataModel.getStringProperty(VERSION));
- getResourceContents().add(entityMappings);
-
- AccessType defaultAccess = (AccessType) dataModel.getProperty(DEFAULT_ACCESS);
- if (defaultAccess != null) {
- XmlPersistenceUnitMetadata puMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- entityMappings.setPersistenceUnitMetadata(puMetadata);
- XmlPersistenceUnitDefaults puDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- puMetadata.setPersistenceUnitDefaults(puDefaults);
- puDefaults.setAccess(defaultAccess);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceXmlResourceProvider.java
deleted file mode 100644
index 7db90820f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/persistence/PersistenceXmlResourceProvider.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.core.internal.resource.persistence;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.PersistenceFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class PersistenceXmlResourceProvider
- extends AbstractXmlResourceProvider
- implements PersistenceFileCreationDataModelProperties
-{
- /**
- * (Convenience method) Returns a persistence resource model provider for
- * the given file.
- */
- public static PersistenceXmlResourceProvider getXmlResourceProvider(IFile file) {
- return getXmlResourceProvider_(file.getProject(), file.getFullPath().toString());
- }
-
- /**
- * (Convenience method) Returns an persistence resource model provider for
- * the given project in the specified deploy location
- */
- public static PersistenceXmlResourceProvider getXmlResourceProvider(IProject project, String deployLocation) {
- return getXmlResourceProvider_(project, JptCorePlugin.getDeploymentURI(project, deployLocation));
- }
-
- /**
- * (Convenience method) Returns a persistence resource model provider for
- * the given project in the default deploy location
- */
- public static PersistenceXmlResourceProvider getDefaultXmlResourceProvider(IProject project) {
- return getXmlResourceProvider(project, JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH);
- }
-
- private static PersistenceXmlResourceProvider getXmlResourceProvider_(IProject project, String location) {
- return new PersistenceXmlResourceProvider(project, new Path(location));
- }
-
-
- public PersistenceXmlResourceProvider(IProject project) {
- this(project, new Path(JptCorePlugin.DEFAULT_PERSISTENCE_XML_FILE_PATH));
- }
-
- public PersistenceXmlResourceProvider(IProject project, IPath filePath) {
- super(project, filePath, JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE);
- }
-
-
- @Override
- protected void populateRoot(Object config) {
- IDataModel dataModel = (IDataModel) config;
- XmlPersistence persistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- persistence.setVersion(dataModel.getStringProperty(VERSION));
- XmlPersistenceUnit persistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- persistenceUnit.setName(getProject().getName());
- persistence.getPersistenceUnits().add(persistenceUnit);
- getResourceContents().add(persistence);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourceAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourceAdapterFactory.java
deleted file mode 100644
index c03f4b15b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourceAdapterFactory.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.core.internal.resource.xml;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.core.JpaFile;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-public class JpaXmlResourceAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaXmlResource.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("unchecked") Class adapterType) {
- if (adaptableObject instanceof IFile) {
- return this.getAdapter((IFile) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(final IFile file, Class <?>adapterType) {
- if (adapterType == JpaXmlResource.class) {
- JpaFile jpaFile = JptCorePlugin.getJpaFile(file);
- if (jpaFile != null) {
- JpaResourceModel resourceModel = jpaFile.getResourceModel();
- if (resourceModel instanceof JpaXmlResource) {
- return resourceModel;
- }
- }
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourcePropertyTester.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourcePropertyTester.java
deleted file mode 100644
index f1c518dffa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/xml/JpaXmlResourcePropertyTester.java
+++ /dev/null
@@ -1,53 +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.core.internal.resource.xml;
-
-import org.eclipse.core.expressions.PropertyTester;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.XmlFile;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-// TODO move to o.e.jpt.core.internal(.context)?
-// rename to JpaXmlPropertyTester
-public class JpaXmlResourcePropertyTester
- extends PropertyTester
-{
- public static final String IS_LATEST_SUPPORTED_VERSION = "isLatestSupportedVersion"; //$NON-NLS-1$
-
-
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
- JpaXmlResource xmlResource = null;
- if (receiver instanceof JpaXmlResource) {
- xmlResource = (JpaXmlResource) receiver;
- }
- else if (receiver instanceof XmlFile) {
- xmlResource = ((XmlFile) receiver).getXmlResource();
- }
- else {
- return false;
- }
-
- if (IS_LATEST_SUPPORTED_VERSION.equals(property)) {
- boolean expected = ((Boolean) expectedValue).booleanValue();
- JpaProject jpaProject = JptCorePlugin.getJpaProject(xmlResource.getProject());
- IContentType contentType = xmlResource.getContentType();
- boolean actual =
- xmlResource.getVersion() != null
- && xmlResource.getVersion().equals(
- jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(contentType).getVersion());
-
- return actual == expected;
- }
-
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
deleted file mode 100644
index 331ca73855..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/synch/SynchronizeClassesJob.java
+++ /dev/null
@@ -1,144 +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.core.internal.synch;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResourceRuleFactory;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Synchronizes the lists of persistent classes in a persistence unit and a
- * persistence project.
- */
-public class SynchronizeClassesJob extends WorkspaceJob
-{
- private IFile persistenceXmlFile;
-
-
- public SynchronizeClassesJob(IFile file) {
- super(JptCoreMessages.SYNCHRONIZE_CLASSES_JOB);
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- setRule(ruleFactory.modifyRule(file.getProject()));
- this.persistenceXmlFile = file;
- }
-
- @Override
- public IStatus runInWorkspace(final IProgressMonitor monitor) {
- monitor.beginTask(JptCoreMessages.SYNCHRONIZING_CLASSES_TASK, 200);
-
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
-
- final JpaProject jpaProject = JptCorePlugin.getJpaProject(this.persistenceXmlFile.getProject());
- final JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
- if (resource == null) {
- //the resource would only be null if the persistence.xml file had an invalid content type
- return Status.OK_STATUS;
- }
-
- monitor.worked(25);
-
- resource.modify(new Runnable() {
- public void run() {
- XmlPersistence persistence = (XmlPersistence) resource.getRootObject();
- XmlPersistenceUnit persistenceUnit;
-
- if (persistence.getPersistenceUnits().size() > 0) {
- persistenceUnit = persistence.getPersistenceUnits().get(0);
- }
- else {
- persistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- persistenceUnit.setName(jpaProject.getName());
- persistence.getPersistenceUnits().add(persistenceUnit);
- }
-
- persistenceUnit.getClasses().clear();
-
- monitor.worked(25);
-
- for (Iterator<String> stream = mappedClassNames(jpaProject, '$'); stream.hasNext(); ) {
- String fullyQualifiedTypeName = stream.next();
- if ( ! mappingFileContains(jpaProject, fullyQualifiedTypeName)) {
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(fullyQualifiedTypeName);
- persistenceUnit.getClasses().add(classRef);
- }
- }
-
- monitor.worked(100);
- }
- });
-
- monitor.done();
-
- return Status.OK_STATUS;
- }
-
- protected Iterator<String> mappedClassNames(final JpaProject jpaProject, final char enclosingTypeSeparator) {
- return new TransformationIterator<String, String>(jpaProject.mappedJavaSourceClassNames()) {
- @Override
- protected String transform(String fullyQualifiedName) {
- IType jdtType = SynchronizeClassesJob.this.findType(jpaProject, fullyQualifiedName);
- return jdtType.getFullyQualifiedName(enclosingTypeSeparator);
- }
- };
- }
-
- protected IType findType(JpaProject jpaProject, String typeName) {
- try {
- return jpaProject.getJavaProject().findType(typeName);
- } catch (JavaModelException ex) {
- return null; // ignore exception?
- }
- }
-
- boolean mappingFileContains(JpaProject jpaProject, String fullyQualifiedTypeName) {
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- return false;
- }
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence == null) {
- return false;
- }
- if (persistence.persistenceUnitsSize() == 0) {
- return false;
- }
- PersistenceUnit persistenceUnit = persistence.persistenceUnits().next();
- for (MappingFileRef mappingFileRef : CollectionTools.iterable(persistenceUnit.mappingFileRefs())) {
- if (mappingFileRef.getPersistentType(fullyQualifiedTypeName) != null) {
- return true;
- }
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/CallbackJobSynchronizer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/CallbackJobSynchronizer.java
deleted file mode 100644
index 7ddb587da5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/CallbackJobSynchronizer.java
+++ /dev/null
@@ -1,153 +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.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.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.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.
- */
-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.utility.internal.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobCommand.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobCommand.java
deleted file mode 100644
index f4b1a0d7d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobSynchronizer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/JobSynchronizer.java
deleted file mode 100644
index 30d5cf3648..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/KeyClassesValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/KeyClassesValidator.java
deleted file mode 100644
index a16f50d426..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/KeyClassesValidator.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 - ongoing maintenance
- *
- * Originally copied from
- * {@link org.eclipse.jst.common.project.facet.core.libprov.user.KeyClassesValidator}
- *******************************************************************************/
-package org.eclipse.jpt.core.internal.utility;
-
-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.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryValidator;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * This class differs from the original in that it does not give an error if multiple instances of
- * a class are discovered
- */
-public class KeyClassesValidator
- extends UserLibraryValidator
-{
- private final Set<String> classFileNames = new HashSet<String>();
-
- private final Map<String,String> classFileNameToClassName = new HashMap<String,String>();
-
-
- @Override
- public void init(final List<String> params) {
- for (String className : params) {
- String classFileName = className.replace('.', '/') + ".class";
- this.classFileNames.add(classFileName);
- this.classFileNameToClassName.put(classFileName, className);
- }
- }
-
- @Override
- public IStatus validate( final UserLibraryProviderInstallOperationConfig config ) {
- final Map<String,Integer> classAppearanceCounts = new HashMap<String,Integer>();
-
- for (String classFileName : this.classFileNames) {
- classAppearanceCounts.put(classFileName, 0);
- }
-
- for (IClasspathEntry cpe : config.resolve()) {
- if( cpe.getEntryKind() == IClasspathEntry.CPE_LIBRARY ) {
- final File file = cpe.getPath().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 = this.classFileNameToClassName.get(classFileName);
- final String message =
- NLS.bind(JptCoreMessages.KEY_CLASSES_VALIDATOR__CLASS_NOT_FOUND, className);
- return new Status(IStatus.ERROR, PLUGIN_ID, message);
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/PlatformTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/PlatformTools.java
deleted file mode 100644
index 1974095648..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/PlatformTools.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.core.internal.utility;
-
-import java.io.IOException;
-import java.io.InputStream;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.content.IContentTypeManager;
-import org.eclipse.jpt.core.JptCorePlugin;
-
-/**
- * A collection of utilities for dealing with the Eclipse platform API.
- */
-public class PlatformTools {
-
- /**
- * 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) {
- JptCorePlugin.log(ex);
- } finally {
- try {
- fileContents.close();
- } catch (IOException ex) {
- JptCorePlugin.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleSchedulingRule.java
deleted file mode 100644
index 575c775e80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility;
-
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleTextRange.java
deleted file mode 100644
index bbb398fc84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/SimpleTextRange.java
+++ /dev/null
@@ -1,41 +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.core.internal.utility;
-
-import org.eclipse.jpt.core.utility.AbstractTextRange;
-
-/**
- * Straightforward implementation of 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTNodeTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTNodeTextRange.java
deleted file mode 100644
index 1cb404987c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTNodeTextRange.java
+++ /dev/null
@@ -1,39 +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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.AbstractTextRange;
-
-/**
- * Adapt an ASTNode to the TextRange interface.
- */
-public class ASTNodeTextRange extends AbstractTextRange {
- private final ASTNode astNode;
-
- public ASTNodeTextRange(ASTNode astNode) {
- super();
- this.astNode = astNode;
- }
-
- public int getOffset() {
- return this.astNode.getStartPosition();
- }
-
- public int getLength() {
- return this.astNode.getLength();
- }
-
- public int getLineNumber() {
- return ((CompilationUnit) this.astNode.getRoot()).getLineNumber(this.getOffset());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTTools.java
deleted file mode 100644
index 531ae81be7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ASTTools.java
+++ /dev/null
@@ -1,206 +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.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.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.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.utility.internal.SimpleMethodSignature;
-
-/**
- * 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 a type literal, return the corresponding
- * type binding.
- */
- public static ITypeBinding resolveTypeBinding(Expression expression) {
- if (expression.getNodeType() == ASTNode.TYPE_LITERAL) {
- return ((TypeLiteral) expression).getType().resolveBinding();
- }
- return null;
- }
-
- 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.getQualifiedName();
- if (visited.contains(typeName)) {
- return null;
- }
- if (typeName.equals(searchTypeName)) {
- return typeBinding;
- }
- visited.add(typeName);
-
- ITypeBinding[] interfaceBindings = typeBinding.getInterfaces();
- for (ITypeBinding interfaceBinding : interfaceBindings) { // recurse up interfaces
- ITypeBinding result = findTypeInHierarchy(interfaceBinding, searchTypeName, visited);
- if (result != null) {
- return result;
- }
- }
-
- ITypeBinding superBinding = typeBinding.getSuperclass();
- if (superBinding != null) { // recurse up superclasses
- ITypeBinding result = findTypeInHierarchy(superBinding, searchTypeName, visited);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java
deleted file mode 100644
index 09631dee2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractAnnotationAdapter.java
+++ /dev/null
@@ -1,165 +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.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.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Adapt a member and a declaration annotation adapter.
- */
-public abstract class AbstractAnnotationAdapter implements AnnotationAdapter {
- private final Member member;
- private final DeclarationAnnotationAdapter daa;
-
-
- // ********** constructor **********
-
- public AbstractAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) {
- super();
- this.member = member;
- this.daa = daa;
- }
-
-
- // ********** AnnotationAdapter implementation **********
-
- public Annotation getAnnotation(CompilationUnit astRoot) {
- return this.daa.getAnnotation(this.member.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.member.getModifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daa);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(Member.Editor editor) {
- this.member.edit(editor);
- }
-
-
- // ********** factory methods **********
-
- protected Member.Editor buildNewMarkerAnnotationEditor() {
- return new NewMarkerAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildNewSingleMemberAnnotationEditor() {
- return new NewSingleMemberAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildNewNormalAnnotationEditor() {
- return new NewNormalAnnotationEditor(this.daa);
- }
-
- protected Member.Editor buildRemoveAnnotationEditor() {
- return new RemoveAnnotationEditor(this.daa);
- }
-
-
- // ********** member classes **********
-
- protected static class NewMarkerAnnotationEditor implements Member.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 Member.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 Member.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 Member.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractDeclarationAnnotationAdapter.java
deleted file mode 100644
index 85c4983f16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractExpressionConverter.java
deleted file mode 100644
index a4bde672a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.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(T, 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 9606e65926..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AbstractNestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,422 +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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Pull together some of the behavior common to NestedDeclarationAnnotationAdapter
- * and IndexedNestedDeclarationAnnotationAdapter
- */
-public abstract class AbstractNestedDeclarationAnnotationAdapter extends AbstractDeclarationAnnotationAdapter {
- private final DeclarationAnnotationAdapter outerAnnotationAdapter;
- private final String elementName;
- private final boolean removeOuterAnnotationWhenEmpty;
-
- // reduce NLS checks
- protected static final String VALUE = "value"; //$NON-NLS-1$
-
-
- // ********** constructors **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String annotationName) {
- this(outerAnnotationAdapter, VALUE, annotationName);
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName) {
- this(outerAnnotationAdapter, elementName, annotationName, true);
- }
-
- protected AbstractNestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(annotationName);
- this.outerAnnotationAdapter = outerAnnotationAdapter;
- this.elementName = elementName;
- this.removeOuterAnnotationWhenEmpty = removeOuterAnnotationWhenEmpty;
- }
-
-
- // ********** 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 *first* 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 *first* 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, remove the annotation or convert it to a marker annotation
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- } else {
- // 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 "value".
- */
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, @SuppressWarnings("unused") SingleMemberAnnotation outer) {
- if (this.elementName.equals(VALUE)) {
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- } else {
- // convert the annotation to a marker annotation
- this.outerAnnotationAdapter.newMarkerAnnotation(declaration);
- }
- }
- }
-
- protected void removeElementAndNormalize(ModifiedDeclaration declaration, @SuppressWarnings("unused") MarkerAnnotation outer) {
- if (this.removeOuterAnnotationWhenEmpty) {
- this.outerAnnotationAdapter.removeAnnotation(declaration);
- }
- }
-
- /**
- * 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java
deleted file mode 100644
index 889b59ea63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/AnnotationStringArrayExpressionConverter.java
+++ /dev/null
@@ -1,96 +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.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.core.utility.jdt.ExpressionConverter;
-
-/**
- * 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 standalone or
- * as elements in the array initializer.
- */
-public class AnnotationStringArrayExpressionConverter
- extends AbstractExpressionConverter<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) {
- return (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- this.arrayConverter.convertArrayInitializer((ArrayInitializer) expression)
- :
- new String[] {this.elementConverter.convert(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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/BooleanExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/BooleanExpressionConverter.java
deleted file mode 100644
index d6fc40d886..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CharacterStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CharacterStringExpressionConverter.java
deleted file mode 100644
index 1da206b188..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index e43a30e97c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/CombinationIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,496 +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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.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 SimpleDeclarationAnnotationAdapter 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(
- SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter,
- SimpleDeclarationAnnotationAdapter containerAnnotationAdapter,
- int index,
- String nestedAnnotationName
- ) {
- this(standAloneAnnotationAdapter, containerAnnotationAdapter, VALUE, index, nestedAnnotationName);
- }
-
- public CombinationIndexedDeclarationAnnotationAdapter(
- SimpleDeclarationAnnotationAdapter standAloneAnnotationAdapter,
- SimpleDeclarationAnnotationAdapter 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 standalone to container
- this.moveStandAloneAnnotationToContainerAnnotation(standAloneAnnotation, declaration);
- this.moveNestedAnnotation(newIndex, declaration);
- } else if (newIndex == 0) {
- // we are moving a 'null' entry on top of the standalone, 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 standalone 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.zeroNestedAnnotationAdapter.removeAnnotation(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 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 8a70c2230c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ConversionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,203 +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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap a declaration annotation element adapter that deals with AST
- * expressions, converting them to/from various other objects.
- * T is the type of the object to 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 "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter), converter);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter, elementName), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty, ExpressionConverter<T> converter) {
- this(new ExpressionDeclarationAnnotationElementAdapter<Expression>(annotationAdapter, elementName, removeAnnotationWhenEmpty), converter);
- }
-
- public ConversionDeclarationAnnotationElementAdapter(DeclarationAnnotationElementAdapter<Expression> adapter, ExpressionConverter<T> converter) {
- super();
- this.adapter = adapter;
- this.converter = 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 "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, StringExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; 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 expression converter expects string constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forStrings(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, StringExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; 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 expression converter expects number constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Integer> forNumbers(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(annotationAdapter, elementName, removeAnnotationWhenEmpty, NumberIntegerExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; 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 expression converter expects boolean constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<Boolean> forBooleans(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(annotationAdapter, elementName, removeAnnotationWhenEmpty, BooleanExpressionConverter.instance());
- }
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed;
- * the default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, CharacterStringExpressionConverter.instance());
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed; 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());
- }
-
- /**
- * The default expression converter expects character constant expressions.
- */
- public static ConversionDeclarationAnnotationElementAdapter<String> forCharacters(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- return new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, CharacterStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/DefaultAnnotationEditFormatter.java
deleted file mode 100644
index 0f6cfd917d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.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(" ")) {
- // 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?
- }
- 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, "");
- }
-
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 92c8728bc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumArrayDeclarationAnnotationElementAdapter.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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * 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;
-
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed and remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- /**
- * The default behavior is to remove the array initializer if it is empty.
- */
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- this(annotationAdapter, elementName, removeAnnotationWhenEmpty, true);
- }
-
- public EnumArrayDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty, boolean removeArrayInitializerWhenEmpty) {
- this(new ConversionDeclarationAnnotationElementAdapter<String[]>(annotationAdapter, elementName, removeAnnotationWhenEmpty, 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 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index c9ccb8d0a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/EnumDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,128 +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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.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 "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- public EnumDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- this(new ConversionDeclarationAnnotationElementAdapter<String>(annotationAdapter, elementName, removeAnnotationWhenEmpty, 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index b96a7de027..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ExpressionDeclarationAnnotationElementAdapter.java
+++ /dev/null
@@ -1,362 +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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.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;
-
- /**
- * Flag to indicate whether the element's annotation is to be
- * completely removed if, when the element itself is removed,
- * the annotation has no remaining elements.
- */
- private final boolean removeAnnotationWhenEmpty;
-
-
- // ********** constructors **********
-
- /**
- * The default element name is "value"; the default behavior is to
- * remove the annotation when the last element is removed.
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter) {
- this(annotationAdapter, VALUE);
- }
-
- /**
- * The default element name is "value".
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, boolean removeAnnotationWhenEmpty) {
- this(annotationAdapter, VALUE, removeAnnotationWhenEmpty);
- }
-
- /**
- * The default behavior is to remove the annotation when the last
- * element is removed.
- */
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
- this(annotationAdapter, elementName, true);
- }
-
- public ExpressionDeclarationAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, boolean removeAnnotationWhenEmpty) {
- super();
- this.annotationAdapter = annotationAdapter;
- this.elementName = elementName;
- this.removeAnnotationWhenEmpty = removeAnnotationWhenEmpty;
- }
-
-
- // ********** 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)) {
- if (this.removeAnnotationWhenEmpty) {
- // @Foo("xxx") =>
- this.annotationAdapter.removeAnnotation(declaration);
- } else {
- // @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)) {
- if (this.removeAnnotationWhenEmpty) {
- // @Foo(bar="xxx") =>
- this.annotationAdapter.removeAnnotation(declaration);
- } else {
- // @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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/GenericVisitor.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/GenericVisitor.java
deleted file mode 100644
index 284d615e26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAttribute.java
deleted file mode 100644
index 342aebf7e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTAttribute.java
+++ /dev/null
@@ -1,66 +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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.CommandExecutor;
-
-/**
- * Combine behavior common to JDTFieldAttribute and JDTMethodAttribute.
- * Not so sure this is useful....
- */
-public abstract class JDTAttribute
- extends JDTMember
- implements Attribute
-{
-
- // ********** constructors **********
-
- protected JDTAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor);
- }
-
- protected JDTAttribute(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
-
- // ********** Member/Attribute implementation **********
-
- public boolean isField() {
- return false;
- }
-
-
- // ********** 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java
deleted file mode 100644
index 1c18f297cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTFieldAttribute.java
+++ /dev/null
@@ -1,205 +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.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.VariableDeclarationFragment;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT field.
- * Attribute based on a Java field, e.g.
- * private int foo;
- */
-public class JDTFieldAttribute
- extends JDTAttribute
- 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 **********
-
- public IVariableBinding getBinding(CompilationUnit astRoot) {
- return this.getFragment(astRoot).resolveBinding();
- }
-
- public FieldDeclaration getBodyDeclaration(CompilationUnit astRoot) {
- return this.getSelectedDeclaration(astRoot, FIELD_DECLARATION_SELECTOR);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return new ASTNodeTextRange(this.getFragment(astRoot).getName());
- }
-
- public String getAttributeName() {
- return this.getName_();
- }
-
- public ITypeBinding getTypeBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getType().resolveBinding();
- }
-
- @Override
- 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 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) {
- return this.getDeclaringTypeDeclaration(astRoot).getFields();
- }
-
- // 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java
deleted file mode 100644
index c7c5ebbdb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMember.java
+++ /dev/null
@@ -1,236 +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.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.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.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 JDTMember
- implements Member
-{
- /** this will be null for the primary type */
- private final Type declaringType;
-
- /** the member's name (duh) */
- private final String name;
-
- /**
- * 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;
-
- /**
- * the compilation unit (file) containing the member;
- * used for building an AST when we modify the member
- */
- 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 member's annotations a bit */
- private final AnnotationEditFormatter annotationEditFormatter;
-
-
- // ********** constructors **********
-
- protected JDTMember(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, name, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- protected JDTMember(
- Type declaringType,
- String name,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor,
- AnnotationEditFormatter annotationEditFormatter) {
- super();
- this.declaringType = declaringType;
- this.name = name;
- this.occurrence = occurrence;
- this.compilationUnit = compilationUnit;
- this.modifySharedDocumentCommandExecutor = modifySharedDocumentCommandExecutor;
- this.annotationEditFormatter = annotationEditFormatter;
- }
-
-
- // ********** Member implementation **********
-
- public ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot) {
- return new JDTModifiedDeclaration(this.getBodyDeclaration(astRoot));
- }
-
- public ModifiedDeclaration getModifiedDeclaration() {
- return this.getModifiedDeclaration(this.buildASTRoot());
- }
-
- public boolean matches(String memberName, int occur) {
- return memberName.equals(this.name) && (occur == this.occurrence);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.name);
- }
-
-
- // ********** internal **********
-
- protected String getName_() {
- return this.name;
- }
-
- protected int getOccurrence() {
- return this.occurrence;
- }
-
- /**
- * this will return null for a top-level type
- */
- protected Type getDeclaringType() {
- return this.declaringType;
- }
-
-
- // ********** 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 {
- JDTMember.this.applyEdits(this.edits, this.doc);
- } catch (MalformedTreeException ex) {
- throw new RuntimeException(ex);
- } catch (BadLocationException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java
deleted file mode 100644
index 4316d6c198..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTMethodAttribute.java
+++ /dev/null
@@ -1,256 +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.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.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.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 JDTAttribute
- 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);
- }
-
- public JDTMethodAttribute(
- Type declaringType,
- MethodSignature methodSignature,
- int occurrence,
- ICompilationUnit compilationUnit,
- CommandExecutor modifySharedDocumentCommandExecutor) {
- this(declaringType, methodSignature, occurrence, compilationUnit, modifySharedDocumentCommandExecutor, DefaultAnnotationEditFormatter.instance());
- }
-
- public 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 **********
-
- public IMethodBinding getBinding(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).resolveBinding();
- }
-
- 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) {
- return new ASTNodeTextRange(this.getBodyDeclaration(astRoot).getName());
- }
-
- /**
- * return "foo" for a method named "getFoo" or "isFoo"
- */
- public String getAttributeName() {
- return NameTools.convertGetterMethodNameToPropertyName(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 MethodDeclaration[] getDeclaringTypeMethodDeclarations(CompilationUnit astRoot) {
- return this.getDeclaringTypeDeclaration(astRoot).getMethods();
- }
-
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java
deleted file mode 100644
index 96f2c739e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTModifiedDeclaration.java
+++ /dev/null
@@ -1,537 +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.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.SingleVariableDeclaration;
-import org.eclipse.jdt.core.dom.VariableDeclarationExpression;
-import org.eclipse.jdt.core.dom.VariableDeclarationStatement;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.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(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 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.java
deleted file mode 100644
index bf1e5661a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTTools.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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-
-/**
- * Convenience methods for dealing with JDT core
- */
-public final class JDTTools
-{
-
- public static boolean packageFragmentRootIsSourceFolder(IPackageFragmentRoot pfr) {
- try {
- return packageFragmentRootIsSourceFolder_(pfr);
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return false;
- }
- }
-
- protected static boolean packageFragmentRootIsSourceFolder_(IPackageFragmentRoot pfr) throws JavaModelException {
- return pfr.exists() && (pfr.getKind() == IPackageFragmentRoot.K_SOURCE);
- }
-
- //TODO move this method to JpaProject once API freeze is over
- public static Iterable<IPackageFragmentRoot> getJavaSourceFolders(IJavaProject javaProject) {
- try {
- return new FilteringIterable<IPackageFragmentRoot>(
- getPackageFragmentRoots(javaProject),
- SOURCE_PACKAGE_FRAGMENT_ROOT_FILTER
- );
- } catch (JavaModelException ex) {
- JptCorePlugin.log(ex);
- return EmptyIterable.instance();
- }
- }
-
- /**
- * This returns the first package fragment root found on this project.
- * I am not completely sure why, but the JavaTypeCompletionProcessor works with this.
- */
- //TODO move this method to JpaProject once API freeze is over
- public static IPackageFragmentRoot getCodeCompletionContextRoot(IJavaProject javaProject) {
- try {
- return javaProject.getPackageFragmentRoots()[0];
- }
- catch (JavaModelException e) {
- JptCorePlugin.log(e);
- return null;
- }
- }
-
- protected static Iterable<IPackageFragmentRoot> getJavaSourceFolders_(IJavaProject javaProject) throws JavaModelException {
- return new FilteringIterable<IPackageFragmentRoot>(
- getPackageFragmentRoots(javaProject),
- 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 packageFragmentRootIsSourceFolder_(pfr);
- }
- };
-
- protected static Iterable<IPackageFragmentRoot> getPackageFragmentRoots(IJavaProject javaProject) throws JavaModelException {
- return new ArrayIterable<IPackageFragmentRoot>(javaProject.getPackageFragmentRoots());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java
deleted file mode 100644
index f3438cfe8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JDTType.java
+++ /dev/null
@@ -1,238 +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.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.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.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.utility.CommandExecutor;
-
-/**
- * Adapt and extend a JDT type.
- */
-public class JDTType
- extends JDTMember
- 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.getName().getFullyQualifiedName(), occurrence, compilationUnit, modifySharedDocumentCommandExecutor, annotationEditFormatter);
- }
-
- /**
- * constructor for testing
- */
- public JDTType(Type declaringType, String name, int occurrence, ICompilationUnit compilationUnit) {
- super(declaringType, name, occurrence, compilationUnit, CommandExecutor.Default.instance(), DefaultAnnotationEditFormatter.instance());
- }
-
-
- // ********** Member/Type implementation **********
-
- public ITypeBinding getBinding(CompilationUnit astRoot) {
- TypeDeclaration td = this.getBodyDeclaration(astRoot);
- return (td == null) ? null : td.resolveBinding();
- }
-
- /**
- * find the type's body declaration in the specified AST
- */
- public TypeDeclaration 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 boolean isPersistable(CompilationUnit astRoot) {
- ITypeBinding binding = this.getBinding(astRoot);
- return (binding == null) ? false : JPTTools.typeIsPersistable(new JPTToolsAdapter(binding));
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot) {
- return new ASTNodeTextRange(this.getBodyDeclaration(astRoot).getName());
- }
-
- public TypeDeclaration[] getTypes(CompilationUnit astRoot) {
- return this.getBodyDeclaration(astRoot).getTypes();
- }
-
- 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
- */
- protected TypeDeclaration getTopLevelTypeDeclaration(CompilationUnit astRoot) {
- return this.getTypeDeclaration(types(astRoot));
- }
-
- protected TypeDeclaration getTypeDeclaration(List<AbstractTypeDeclaration> typeDeclarations) {
- return this.getTypeDeclaration(typeDeclarations.toArray(new AbstractTypeDeclaration[typeDeclarations.size()]));
- }
-
- /**
- * return the nested type with a matching name and occurrence
- */
- 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)
- */
- protected TypeDeclaration 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() == ASTNode.TYPE_DECLARATION) ? (TypeDeclaration) 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;
- }
-
- /**
- * we only instantiate a single top-level, non-enum, non-annotation
- * type per compilation unit (i.e. a class or interface); and, since
- * enums and annotations can only be top-level types (i.e. they cannot
- * be nested within another type) we will always have TypeDeclarations
- * in the CompilationUnit
- */
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected static List<AbstractTypeDeclaration> types(CompilationUnit astRoot) {
- return astRoot.types();
- }
-
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java
deleted file mode 100644
index 73b19d863b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/JPTTools.java
+++ /dev/null
@@ -1,341 +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.core.internal.utility.jdt;
-
-import java.lang.reflect.Modifier;
-import java.util.Iterator;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * Convenience methods for JPA-related queries concerning JDT objects.
- */
-public class JPTTools {
-
- // ********** type **********
-
- /**
- * Return whether the specified type can be "persisted", i.e. marked as
- * Entity, MappedSuperclass, Embeddable
- */
- // TODO check for no-arg constructor (or should that just be validation?)
- // TODO move other checks to validation (e.g. 'final', 'static')?
- 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(?)
- }
- int modifiers = typeAdapter.getModifiers();
- if (typeAdapter.isMember()) {
- if ( ! Modifier.isStatic(modifiers)) {
- return false;
- }
- }
- 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;
- }
- if (Modifier.isFinal(modifiers)) {
- return true;
- }
- if ( ! (Modifier.isPublic(modifiers) || Modifier.isProtected(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);
- }
-
-
- // ********** Access type **********
-
- /**
- * Return the AccessType currently implied by the Java source code
- * or class file:
- * - if only Fields are annotated => FIELD
- * - if only Properties are annotated => PROPERTY
- * - if both Fields and Properties are annotated => FIELD
- * - if nothing is annotated
- * - and fields exist => FIELD
- * - and properties exist, but no fields exist => PROPERTY
- * - and neither fields nor properties exist => null at this level (FIELD in the context model)
- */
- public static AccessType buildAccess(JavaResourcePersistentType jrpType) {
- boolean hasPersistableFields = false;
- for (Iterator<JavaResourcePersistentAttribute> stream = jrpType.persistableFields(); stream.hasNext(); ) {
- hasPersistableFields = true;
- if (stream.next().isAnnotated()) {
- // any field is annotated => FIELD
- return AccessType.FIELD;
- }
- }
-
- boolean hasPersistableProperties = false;
- for (Iterator<JavaResourcePersistentAttribute> stream = jrpType.persistableProperties(); stream.hasNext(); ) {
- hasPersistableProperties = true;
- if (stream.next().isAnnotated()) {
- // none of the fields are annotated and a getter is annotated => PROPERTY
- return AccessType.PROPERTY;
- }
- }
-
- if (hasPersistableProperties && ! hasPersistableFields) {
- return AccessType.PROPERTY;
- }
-
- // if no annotations exist, access is null at the resource model level
- return null;
- }
-
-
- // ********** suppressed constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private JPTTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java
deleted file mode 100644
index 5b92fa57d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationAdapter.java
+++ /dev/null
@@ -1,27 +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.core.internal.utility.jdt;
-
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * Adapt a member and a declaration annotation adapter.
- */
-public class MemberAnnotationAdapter extends AbstractAnnotationAdapter {
-
-
- // ********** constructor **********
-
- public MemberAnnotationAdapter(Member member, DeclarationAnnotationAdapter daa) {
- super(member, daa);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java
deleted file mode 100644
index 89f854f2e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberAnnotationElementAdapter.java
+++ /dev/null
@@ -1,99 +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.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.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.utility.internal.StringTools;
-
- /**
- * Adapt a member and a declaration annotation element adapter.
- */
-public class MemberAnnotationElementAdapter<T>
- implements AnnotationElementAdapter<T>
-{
- private final Member member;
- private final DeclarationAnnotationElementAdapter<T> daea;
-
-
- // ********** constructor **********
-
- public MemberAnnotationElementAdapter(Member member, DeclarationAnnotationElementAdapter<T> daea) {
- super();
- this.member = member;
- this.daea = daea;
- }
-
-
- // ********** AnnotationElementAdapter implementation **********
-
- public T getValue() {
- return this.daea.getValue(this.member.getModifiedDeclaration());
- }
-
- public T getValue(CompilationUnit astRoot) {
- return this.daea.getValue(this.member.getModifiedDeclaration(astRoot));
- }
-
- public void setValue(T value) {
- this.edit(this.buildSetValueEditor(value));
- }
-
- public Expression getExpression(CompilationUnit astRoot) {
- return this.daea.getExpression(this.member.getModifiedDeclaration(astRoot));
- }
-
- public ASTNode getAstNode(CompilationUnit astRoot) {
- return this.daea.getAstNode(this.member.getModifiedDeclaration(astRoot));
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.daea);
- }
-
-
- // ********** internal methods **********
-
- protected void edit(Member.Editor editor) {
- this.member.edit(editor);
- }
-
- protected Member.Editor buildSetValueEditor(T value) {
- return new SetValueEditor<T>(value, this.daea);
- }
-
-
- // ********** member classes **********
-
- protected static class SetValueEditor<T> implements Member.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java
deleted file mode 100644
index aceeb48616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/MemberIndexedAnnotationAdapter.java
+++ /dev/null
@@ -1,74 +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.core.internal.utility.jdt;
-
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Adapt a member and an indexed declaration annotation adapter.
- */
-public class MemberIndexedAnnotationAdapter
- extends AbstractAnnotationAdapter
- implements IndexedAnnotationAdapter
-{
- private final IndexedDeclarationAnnotationAdapter idaa;
-
-
- // ********** constructor **********
-
- public MemberIndexedAnnotationAdapter(Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(member, 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 Member.Editor buildMoveAnnotationEditor(int newIndex) {
- return new MoveAnnotationEditor(this.idaa, newIndex);
- }
-
-
- // ********** member classes **********
-
- protected static class MoveAnnotationEditor implements Member.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NameStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NameStringExpressionConverter.java
deleted file mode 100644
index 56fd65a386..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 2b991a7c2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,95 +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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.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 **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- 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);
- }
-
- public NestedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter outerAnnotationAdapter, String elementName, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(outerAnnotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty);
- }
-
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 8f39485e0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NestedIndexedDeclarationAnnotationAdapter.java
+++ /dev/null
@@ -1,334 +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.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.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.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 **********
-
- /**
- * default element name is "value";
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, int index, String annotationName) {
- super(annotationAdapter, annotationName);
- this.index = index;
- }
-
- /**
- * default behavior is to remove the outer annotation when it is empty
- */
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName) {
- super(annotationAdapter, elementName, annotationName);
- this.index = index;
- }
-
- public NestedIndexedDeclarationAnnotationAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName, int index, String annotationName, boolean removeOuterAnnotationWhenEmpty) {
- super(annotationAdapter, elementName, annotationName, removeOuterAnnotationWhenEmpty);
- 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$
- }
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullAnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullAnnotationEditFormatter.java
deleted file mode 100644
index 3c632f36c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationAdapter.java
deleted file mode 100644
index d81448ce1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullDeclarationAnnotationElementAdapter.java
deleted file mode 100644
index c53a69546a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.ModifiedDeclaration;
-
-/**
- * Behaviorless implementation.
- */
-public class NullDeclarationAnnotationElementAdapter<T>
- implements DeclarationAnnotationElementAdapter<T>
-{
-
- // singleton
- @SuppressWarnings("unchecked")
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NullExpressionConverter.java
deleted file mode 100644
index 803b983910..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jpt.core.utility.jdt.ExpressionConverter;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NumberIntegerExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/NumberIntegerExpressionConverter.java
deleted file mode 100644
index 526e1fe4aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/PrimitiveTypeStringExpressionConverter.java
deleted file mode 100644
index 3f9990680f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java
deleted file mode 100644
index 44c27535c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitAnnotationElementAdapter.java
+++ /dev/null
@@ -1,104 +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.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.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.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(Member member, DeclarationAnnotationElementAdapter<T> daea) {
- this(new MemberAnnotationElementAdapter<T>(member, 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java
deleted file mode 100644
index 01952fe059..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/ShortCircuitArrayAnnotationElementAdapter.java
+++ /dev/null
@@ -1,43 +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.core.internal.utility.jdt;
-
-import java.util.Arrays;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * 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(Member member, DeclarationAnnotationElementAdapter<T[]> daea) {
- super(member, 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleDeclarationAnnotationAdapter.java
deleted file mode 100644
index 16a657437b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.jdt;
-
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/SimpleTypeStringExpressionConverter.java
deleted file mode 100644
index f622562554..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringArrayExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringArrayExpressionConverter.java
deleted file mode 100644
index 35751f6e52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringArrayExpressionConverter.java
+++ /dev/null
@@ -1,111 +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.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.core.utility.jdt.ExpressionConverter;
-
-/**
- * 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[]>
-{
- private final ExpressionConverter<String> elementConverter;
- private final boolean removeArrayInitializerWhenEmpty;
-
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
-
- /**
- * 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;
- }
-
- @Override
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- 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 EMPTY_STRING_ARRAY;
- }
-
- @Override
- protected String[] convertExpression(Expression expression) {
- return (expression.getNodeType() == ASTNode.ARRAY_INITIALIZER) ?
- this.convertArrayInitializer((ArrayInitializer) expression)
- :
- EMPTY_STRING_ARRAY;
- }
-
- /*
- * this method is 'public' so it can be called by
- * AnnotationStringArrayExpressionConverter
- */
- public String[] convertArrayInitializer(ArrayInitializer arrayInitializer) {
- List<Expression> expressions = this.downcastExpressions(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;
- }
-
- @SuppressWarnings("unchecked")
- private List<Expression> downcastExpressions(ArrayInitializer arrayInitializer) {
- return arrayInitializer.expressions();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/StringExpressionConverter.java
deleted file mode 100644
index b5fee1e52d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/TypeStringExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/jdt/TypeStringExpressionConverter.java
deleted file mode 100644
index 4ca6248449..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/BooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/BooleanTranslator.java
deleted file mode 100644
index 46ebb2e816..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EmptyTagBooleanTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EmptyTagBooleanTranslator.java
deleted file mode 100644
index 8ee27fe218..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EmptyTagBooleanTranslator.java
+++ /dev/null
@@ -1,53 +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.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) {
- super(domPathAndNames, structuralFeature, EMPTY_TAG | BOOLEAN_FEATURE);
- }
-
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EnumeratedValueTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EnumeratedValueTranslator.java
deleted file mode 100644
index e0f3551e07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/EnumeratedValueTranslator.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.core.internal.utility.translators;
-
-import java.util.Iterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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 Iterator enumeratedObjectValues();
-
- @Override
- public Object convertStringToValue(String string, EObject owner) {
- for (Object each : CollectionTools.iterable(enumeratedObjectValues())) {
- if (each.toString().equals(string)) {
- return each;
- }
- }
- return null;
- }
-
- @Override
- public String convertValueToString(Object value, EObject owner) {
- return value.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleRootTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleRootTranslator.java
deleted file mode 100644
index 6f01afb5e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/utility/translators/SimpleTranslator.java
deleted file mode 100644
index 9b465cfe9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.core.internal.utility.translators;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java
deleted file mode 100644
index 2136e52e5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/DefaultJpaValidationMessages.java
+++ /dev/null
@@ -1,67 +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.core.internal.validation;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class DefaultJpaValidationMessages {
-
- 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;
- int severityPreference = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
- if (severityPreference!=JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
- severity = severityPreference;
- }
- IMessage message = new Message(JpaValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- 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
- JptCorePlugin.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 DefaultJpaValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java
deleted file mode 100644
index 7789238c30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaHelper.java
+++ /dev/null
@@ -1,32 +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.core.internal.validation;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.core.JpaNode;
-
-public class JpaHelper extends org.eclipse.wst.validation.internal.operations.WorkbenchContext {
-
- @Override
- public IResource getResource(Object obj) {
- return ((JpaNode) obj).getResource();
- }
-
- /*
- * This is used when no line number is set. We generally use line numbers.
- * Therefore, when this is called, we will use the default location, i.e.
- * null.
- */
- @Override
- public String getLocation(Object object) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java
deleted file mode 100644
index b93e76f6ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.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.core.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JpaValidationDescriptionMessages {
-
- public static String DOES_NOT_MATCH_JOIN_TABLE;
- public static String DOES_NOT_MATCH_COLLECTION_TABLE;
- public static String NOT_VALID_FOR_THIS_ENTITY;
-
- public static String ATTRIBUTE_DESC;
- public static String VIRTUAL_ATTRIBUTE_DESC;
-
-
- private static final String BUNDLE_NAME = "jpa_validation_description"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JpaValidationDescriptionMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JpaValidationDescriptionMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
deleted file mode 100644
index d559a919de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
+++ /dev/null
@@ -1,188 +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.core.internal.validation;
-
-@SuppressWarnings("nls")
-public interface JpaValidationMessages {
-
- public static final String BUNDLE_NAME = "jpa_validation";
-
- public static final String PROJECT_NO_CONNECTION = "PROJECT_NO_CONNECTION";
- public static final String PROJECT_INVALID_CONNECTION = "PROJECT_INVALID_CONNECTION";
- public static final String PROJECT_INACTIVE_CONNECTION = "PROJECT_INACTIVE_CONNECTION";
- public static final String PROJECT_NO_PERSISTENCE_XML = "PROJECT_NO_PERSISTENCE_XML";
- public static final String PROJECT_MULTIPLE_PERSISTENCE_XML = "PROJECT_MULTIPLE_PERSISTENCE_XML";
- public static final String XML_VERSION_NOT_LATEST = "XML_VERSION_NOT_LATEST";
- public static final String PERSISTENCE_XML_INVALID_CONTENT = "PERSISTENCE_XML_INVALID_CONTENT";
- public static final String PERSISTENCE_XML_UNSUPPORTED_CONTENT = "PERSISTENCE_XML_UNSUPPORTED_CONTENT";
- public static final String PERSISTENCE_NO_PERSISTENCE_UNIT = "PERSISTENCE_NO_PERSISTENCE_UNIT";
- public static final String PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS = "PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS";
- public static final String PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE = "PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE";
- public static final String PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT = "PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT";
- public static final String PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE = "PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE";
- public static final String PERSISTENCE_UNIT_INVALID_MAPPING_FILE = "PERSISTENCE_UNIT_INVALID_MAPPING_FILE";
- public static final String PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE = "PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE";
- public static final String PERSISTENCE_UNIT_UNSPECIFIED_CLASS = "PERSISTENCE_UNIT_UNSPECIFIED_CLASS";
- public static final String PERSISTENCE_UNIT_NONEXISTENT_CLASS = "PERSISTENCE_UNIT_NONEXISTENT_CLASS";
- public static final String PERSISTENCE_UNIT_INVALID_CLASS = "PERSISTENCE_UNIT_INVALID_CLASS";
- public static final String PERSISTENCE_UNIT_DUPLICATE_CLASS = "PERSISTENCE_UNIT_DUPLICATE_CLASS";
- public static final String PERSISTENCE_UNIT_REDUNDANT_CLASS = "PERSISTENCE_UNIT_REDUNDANT_CLASS";
- public static final String PERSISTENCE_UNIT_DUPLICATE_JAR_FILE = "PERSISTENCE_UNIT_DUPLICATE_JAR_FILE";
- public static final String PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE = "PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE";
- public static final String PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING = "PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING";
- public static final String PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE = "PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE";
- public static final String GENERATOR_DUPLICATE_NAME = "GENERATOR_DUPLICATE_NAME";
- public static final String QUERY_DUPLICATE_NAME = "QUERY_DUPLICATE_NAME";
- public static final String MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS = "MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_DEFAULTS";
- public static final String PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT = "PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT";
- public static final String PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT = "PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT";
- public static final String PERSISTENT_TYPE_UNSPECIFIED_CLASS = "PERSISTENT_TYPE_UNSPECIFIED_CLASS";
- public static final String PERSISTENT_TYPE_UNRESOLVED_CLASS = "PERSISTENT_TYPE_UNRESOLVED_CLASS";
- public static final String TYPE_MAPPING_PK_REDEFINED_ID_CLASS = "TYPE_MAPPING_PK_REDEFINED_ID_CLASS";
- public static final String TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE = "TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE";
- public static final String TYPE_MAPPING_ID_CLASS_REDEFINED = "TYPE_MAPPING_ID_CLASS_REDEFINED";
- public static final String TYPE_MAPPING_ID_CLASS_REQUIRED = "TYPE_MAPPING_ID_CLASS_REQUIRED";
- public static final String TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED = "TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED";
- public static final String TYPE_MAPPING_MULTIPLE_EMBEDDED_ID = "TYPE_MAPPING_MULTIPLE_EMBEDDED_ID";
- public static final String TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID = "TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID";
- public static final String TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE = "TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE";
- public static final String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH = "TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH";
- public static final String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH = "TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH";
- public static final String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH = "TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH";
- public static final String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY = "TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY";
- public static final String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE = "TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE";
- public static final String ENTITY_NON_ROOT_ID_CLASS_SPECIFIED = "ENTITY_NON_ROOT_ID_CLASS_SPECIFIED";
- public static final String ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED = "ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED";
- public static final String ENTITY_NO_PK = "ENTITY_NO_PK";
- public static final String ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE = "ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE";
- public static final String ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE = "ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE";
- public static final String ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED = "ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED";
- public static final String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED = "ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED";
- public static final String ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED = "ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED";
- public static final String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED = "ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED";
- public static final String PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME = "PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME";
- public static final String PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME = "PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME";
- public static final String PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED = "PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED";
- public static final String PERSISTENT_ATTRIBUTE_FINAL_FIELD = "PERSISTENT_ATTRIBUTE_FINAL_FIELD";
- public static final String PERSISTENT_ATTRIBUTE_PUBLIC_FIELD = "PERSISTENT_ATTRIBUTE_PUBLIC_FIELD";
- public static final String PERSISTENT_ATTRIBUTE_INVALID_MAPPING = "PERSISTENT_ATTRIBUTE_INVALID_MAPPING";
- public static final String MAPPING_UNRESOLVED_MAPPED_BY = "MAPPING_UNRESOLVED_MAPPED_BY";
- public static final String MAPPING_INVALID_MAPPED_BY = "MAPPING_INVALID_MAPPED_BY";
- public static final String MAPPING_MAPPED_BY_ON_BOTH_SIDES = "MAPPING_MAPPED_BY_ON_BOTH_SIDES";
- public static final String ID_MAPPING_UNRESOLVED_GENERATOR_NAME = "ID_MAPPING_UNRESOLVED_GENERATOR_NAME";
- public static final String ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED = "ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED";
- public static final String EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED = "EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED";
- public static final String ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED = "ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED";
- public static final String TABLE_UNRESOLVED_CATALOG = "TABLE_UNRESOLVED_CATALOG";
- public static final String TABLE_UNRESOLVED_SCHEMA = "TABLE_UNRESOLVED_SCHEMA";
- public static final String TABLE_UNRESOLVED_NAME = "TABLE_UNRESOLVED_NAME";
- public static final String SECONDARY_TABLE_UNRESOLVED_CATALOG = "SECONDARY_TABLE_UNRESOLVED_CATALOG";
- public static final String SECONDARY_TABLE_UNRESOLVED_SCHEMA = "SECONDARY_TABLE_UNRESOLVED_SCHEMA";
- public static final String SECONDARY_TABLE_UNRESOLVED_NAME = "SECONDARY_TABLE_UNRESOLVED_NAME";
- public static final String JOIN_TABLE_UNRESOLVED_CATALOG = "JOIN_TABLE_UNRESOLVED_CATALOG";
- public static final String JOIN_TABLE_UNRESOLVED_SCHEMA = "JOIN_TABLE_UNRESOLVED_SCHEMA";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA";
- public static final String JOIN_TABLE_UNRESOLVED_NAME = "JOIN_TABLE_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME";
- public static final String COLUMN_UNRESOLVED_TABLE = "COLUMN_UNRESOLVED_TABLE";
- public static final String COLUMN_UNRESOLVED_NAME = "COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_TABLE";
- public static final String JOIN_COLUMN_UNRESOLVED_NAME = "JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String INVERSE_JOIN_COLUMN_UNRESOLVED_NAME = "INVERSE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
-
- public static final String GENERATED_VALUE_UNRESOLVED_GENERATOR = "GENERATED_VALUE_UNRESOLVED_GENERATOR";
- public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME = "VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME = "VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME";
- public static final String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
- public static final String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS = "VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS";
-
- public static final String NO_JPA_PROJECT = "NO_JPA_PROJECT";
- public static final String TARGET_ENTITY_NOT_DEFINED = "TARGET_ENTITY_NOT_DEFINED";
- public static final String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED = "VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED";
- public static final String TARGET_ENTITY_IS_NOT_AN_ENTITY = "TARGET_ENTITY_IS_NOT_AN_ENTITY";
- public static final String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY = "VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY";
- public static final String DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM = "ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM";
- public static final String ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM = "ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM";
- public static final String TARGET_NOT_AN_EMBEDDABLE = "TARGET_NOT_AN_EMBEDDABLE";
-
- public static final String COLUMN_TABLE_NOT_VALID="COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID";
- public static final String JOIN_COLUMN_TABLE_NOT_VALID = "JOIN_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID = "VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID";
- public static final String INVERSE_JOIN_COLUMN_TABLE_NOT_VALID = "INVERSE_JOIN_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID = "VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID = "VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID";
-
- //JPA 2.0 validation messages
- public static final String MAPS_ID_VALUE_NOT_SPECIFIED = "MAPS_ID_VALUE_NOT_SPECIFIED";
- public static final String MAPS_ID_VALUE_NOT_RESOLVED = "MAPS_ID_VALUE_NOT_RESOLVED";
- public static final String MAPS_ID_VALUE_INVALID = "MAPS_ID_VALUE_INVALID";
- public static final String ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED = "ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED";
- public static final String ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED = "ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED";
- public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED";
- public static final String ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED = "ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED";
- public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_MAP_KEY_CLASS_NOT_DEFINED";
- public static final String ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE = "ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE";
- public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE";
- public static final String MAP_KEY_COLUMN_UNRESOLVED_NAME="MAP_KEY_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME="VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME";
- public static final String COLLECTION_TABLE_UNRESOLVED_CATALOG = "COLLECTION_TABLE_UNRESOLVED_CATALOG";
- public static final String COLLECTION_TABLE_UNRESOLVED_SCHEMA = "COLLECTION_TABLE_UNRESOLVED_SCHEMA";
- public static final String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG = "VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG";
- public static final String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA = "VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA";
- public static final String COLLECTION_TABLE_UNRESOLVED_NAME = "COLLECTION_TABLE_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME";
- public static final String ORDER_COLUMN_UNRESOLVED_NAME = "ORDER_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME";
-
- public static final String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID="VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID";
- public static final String MAP_KEY_COLUMN_TABLE_NOT_VALID="MAP_KEY_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java
deleted file mode 100644
index 30579306fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationPreferences.java
+++ /dev/null
@@ -1,140 +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.core.internal.validation;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jpt.core.IResourcePart;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.osgi.service.prefs.BackingStoreException;
-
-//TODO: Probably want to merge the behavior in this class into JptCorePlugin
-public class JpaValidationPreferences {
-
- /*
- * prefix for all preference strings. This is only used internally.
- * Clients of get*LevelProblemPrefernce() and set*LevelProblemPreference
- * should not include the prefix.
- */
- private static final String PROBLEM_PREFIX = "problem."; //$NON-NLS-1$
-
- public static final String ERROR = "error"; //$NON-NLS-1$
- public static final String WARNING = "warning"; //$NON-NLS-1$
- public static final String INFO = "info"; //$NON-NLS-1$
- public static final String IGNORE = "ignore"; //$NON-NLS-1$
-
- static final int NO_SEVERITY_PREFERENCE = -1;
-
- public static final String WORKSPACE_PREFERENCES_OVERRIDEN = "workspace_preferences_overriden"; //$NON-NLS-1$
-
- /**
- * Returns only the severity level of a given problem preference. This does not
- * include information on whether the problem is ignored. See isProblemIgnored.
- * @return an IMessage severity level
- */
- public static int getProblemSeverityPreference(Object targetObject, String messageId) {
- IProject project = getProject(targetObject);
- String problemPreference = getPreference(project, messageId);
-
- if (problemPreference == null){
- return NO_SEVERITY_PREFERENCE;
- } else if (problemPreference.equals(ERROR)){
- return IMessage.HIGH_SEVERITY;
- } else if (problemPreference.equals(WARNING)){
- return IMessage.NORMAL_SEVERITY;
- } else if (problemPreference.equals(INFO)){
- return IMessage.LOW_SEVERITY;
- }
- return NO_SEVERITY_PREFERENCE;
- }
-
- private static IProject getProject(Object targetObject) {
- IAdaptable target = (IAdaptable)targetObject;
- IResource resource = ((IResourcePart) target.getAdapter(IResourcePart.class)).getResource();
- IProject project = resource.getProject();
- return project;
- }
-
- /**
- * Returns whether or not this problem should be ignored based on project or
- * workspace preferences
- */
- public static boolean isProblemIgnored(IProject project, String messageId){
- String problemPreference = getPreference(project, messageId);
- if (problemPreference != null && problemPreference.equals(IGNORE)){
- return true;
- }
- return false;
- }
-
- private static String getPreference(IProject project, String messageId) {
- String problemPreference = null;
- problemPreference = getProjectLevelProblemPreference(project, messageId);
- //if severity is still null, check the workspace preferences
- if (problemPreference == null) {
- problemPreference = getWorkspaceLevelProblemPreference(messageId);
- }
- return problemPreference;
- }
-
- /**
- * Returns the String value of the problem preference from the project preferences
- */
- public static String getProjectLevelProblemPreference(IProject project, String messageId){
- return getPreference(JptCorePlugin.getProjectPreferences(project), messageId);
- }
-
- public static void setProjectLevelProblemPreference(IProject project, String messageId, String problemPreference) {
- IEclipsePreferences projectPreferences = JptCorePlugin.getProjectPreferences(project);
- setPreference(projectPreferences, messageId, problemPreference);
- flush(projectPreferences);
- }
-
- /**
- * Returns the String value of the problem preference from the workspace preferences
- */
- public static String getWorkspaceLevelProblemPreference(String messageId){
- return getPreference(JptCorePlugin.getWorkspacePreferences(), messageId);
- }
-
- public static void setWorkspaceLevelProblemPreference(String messageId, String problemPreference) {
- IEclipsePreferences workspacePreferences = JptCorePlugin.getWorkspacePreferences();
- setPreference(workspacePreferences, messageId, problemPreference);
- flush(workspacePreferences);
- }
-
- private static String getPreference(IEclipsePreferences preferences, String messageId) {
- return preferences.get(appendProblemPrefix(messageId), null);
- }
-
- private static void setPreference(IEclipsePreferences preferences, String messageId, String problemPreference) {
- if (problemPreference == null){
- preferences.remove(appendProblemPrefix(messageId));
- }
- else {
- preferences.put(appendProblemPrefix(messageId), problemPreference);
- }
- }
-
- private static String appendProblemPrefix(String messageId) {
- return PROBLEM_PREFIX + messageId;
- }
-
- public static void flush(IEclipsePreferences prefs) {
- try {
- prefs.flush();
- } catch(BackingStoreException ex) {
- JptCorePlugin.log(ex);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
deleted file mode 100644
index 72248499b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidator.java
+++ /dev/null
@@ -1,126 +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.core.internal.validation;
-
-import java.util.Iterator;
-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.core.IResourcePart;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.wst.validation.AbstractValidator;
-import org.eclipse.wst.validation.ValidationResult;
-import org.eclipse.wst.validation.ValidationState;
-import org.eclipse.wst.validation.ValidatorMessage;
-import org.eclipse.wst.validation.internal.ValConstants;
-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 JPA extension for the
- * WTP validator extension point.
- */
-public class JpaValidator extends AbstractValidator implements IValidator {
-
- public JpaValidator() {
- 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();
- try {
- clearMarkers(project);
- }
- catch (CoreException ce) {
- JptCorePlugin.log(ce);
- }
- result.setSuspendValidation(project);
- validate(reporter, project);
- return result;
- }
-
-
- // **************** internal conv. *****************************************
-
- private void clearMarkers(IProject project) throws CoreException {
- IMarker[] markers = project.findMarkers(ValConstants.ProblemMarker, true, IResource.DEPTH_INFINITE);
- String valId = JptCorePlugin.VALIDATOR_ID;
- for (IMarker marker : markers) {
- String id = marker.getAttribute(ValidatorMessage.ValidationId, null);
- if (valId.equals(id)) marker.delete();
- }
- }
-
- private void validate(IReporter reporter, IProject project) {
- reporter.removeAllMessages(this);
-
- for (Iterator<IMessage> stream = this.validationMessages(reporter, project); stream.hasNext(); ) {
- IMessage message = stream.next();
- // check to see if the message should be ignored based on preferences
- if (!JpaValidationPreferences.isProblemIgnored(project, message.getId())){
- reporter.addMessage(this, adjustMessage(message));
- }
- }
- }
-
- private IProject project(IValidationContext context) {
- return ((IProjectValidationContext) context).getProject();
- }
-
- private Iterator<IMessage> validationMessages(IReporter reporter, IProject project) {
- JpaProject jpaProject = JptCorePlugin.getJpaProject(project);
- if (jpaProject != null) {
- return jpaProject.validationMessages(reporter);
- }
- return new SingleElementIterator<IMessage>(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.NO_JPA_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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java
deleted file mode 100644
index 57bdc33923..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaFactory2_0.java
+++ /dev/null
@@ -1,86 +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.core.jpa2;
-
-import org.eclipse.jpt.core.JpaDataSource;
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-
-/**
- * JPA 2.0 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.
- *
- * @see org.eclipse.jpt.core.internal.jpa2.GenericJpaFactory2_0
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JpaFactory2_0
- extends JpaFactory
-{
-
- // ********** Core Model **********
-
- /**
- * Return an identifier adapter that can be used to convert database
- * identifiers to names and vice versa, respecting the <code>delimited-identifiers</code>
- * in <code>persistence.xml</code>.
- */
- DatabaseIdentifierAdapter buildDatabaseIdentifierAdapter(JpaDataSource dataSource);
-
- MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType);
-
-
- // ********** Java Context Model **********
-
- //overloaded because the 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner);
-
- JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent);
-
- JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent);
-
- JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent);
-
- JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent);
-
- JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner);
-
- JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent);
-
- JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, JavaBaseColumn.Owner owner);
-
- JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Orderable.Owner owner);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java
deleted file mode 100644
index 8137241489..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/JpaProject2_0.java
+++ /dev/null
@@ -1,102 +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.core.jpa2;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.jpa2.resource.java.JavaResourcePersistentType2_0;
-
-/**
- * JPA 2.0 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 2.3
- * @since 2.3
- */
-public interface JpaProject2_0
- extends JpaProject, MetamodelSynchronizer
-{
-
- // ********** Canonical Metamodel **********
-
- /**
- * ID string used when metamodelSourceFolderName property is changed.
- * @see #addPropertyChangeListener(String, org.eclipse.jpt.utility.model.listener.PropertyChangeListener)
- */
- String METAMODEL_SOURCE_FOLDER_NAME_PROPERTY = "metamodelSourceFolderName"; //$NON-NLS-1$
-
- /**
- * Return the name of the folder that holds the generated Canonical
- * Metamodel.
- */
- String getMetamodelSourceFolderName();
-
- /**
- * Set the name of the folder that holds the generated Canonical
- * Metamodel.
- */
- void setMetamodelSourceFolderName(String metamodelSourceFolderName);
-
- /**
- * Return the package fragment root that holds the generated Canonical
- * Metamodel.
- */
- IPackageFragmentRoot getMetamodelPackageFragmentRoot();
-
- /**
- * Return a list of the names of the Java source folders. (These
- * can be used to hold the generated Canonical Metamodel.)
- */
- Iterable<String> getJavaSourceFolderNames();
-
- /**
- * Return the JPA project's generated metamodel Java resource persistent
- * top-level types.
- * @see org.eclipse.jpt.core.internal.resource.java.source.SourcePersistentType#isGeneratedMetamodel(IPackageFragmentRoot)
- */
- Iterable<JavaResourcePersistentType2_0> getGeneratedMetamodelTopLevelTypes();
-
- /**
- * Return the top-level generated metamodel Java resource persistent type
- * in the specified file. Return null if any of the following is true:<ul>
- * <li>the file is not a Java source file
- * <li>the top-level Java class is not annotated with the appropriate
- * <code>javax.annotation.Generated</code> annotation
- * <li>neither the top-level Java class nor any of its nested classes
- * is annotated with the appropriate
- * <code>javax.persistence.metamodel.StaticMetamodel</code> annotation
- * <ul>
- */
- JavaResourcePersistentType2_0 getGeneratedMetamodelTopLevelType(IFile file);
-
-
- // ********** construction config **********
-
- /**
- * The settings used to construct a JPA 2.0 project.
- */
- interface Config extends JpaProject.Config {
-
- /**
- * Return the name of the folder that holds the generated Canonical
- * Metamodel. Return null if the Canonical Metamodel is not to be
- * generated.
- */
- String getMetamodelSourceFolderName();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MappingKeys2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MappingKeys2_0.java
deleted file mode 100644
index 2a8a27d43c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MappingKeys2_0.java
+++ /dev/null
@@ -1,28 +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.core.jpa2;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
- */
-@SuppressWarnings("nls")
-public interface MappingKeys2_0 {
-
- String ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY = "elementCollection";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MetamodelSynchronizer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MetamodelSynchronizer.java
deleted file mode 100644
index d3a1290ad1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/MetamodelSynchronizer.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.core.jpa2;
-
-import java.io.Serializable;
-
-/**
- * JPA 2.0 Canonical Metamodel synchronizer.
- * <p>
- * Notes:
- * <ul><li>
- * When a JPA project is first created (e.g. when the user adds the JPA
- * Facet to a Faceted project or when a workspace containing a JPA project is
- * opened), if it is configured to generate the
- * Canonical Metamodel (i.e. its metamodel source folder is non-null), it will
- * first discover what metamodel classes are already present in the metamodel
- * source folder. Any class appropriately annotated with
- * <code>javax.persistence.metamodel.StaticMetamodel</code>
- * and <code>javax.annotation.Generated</code>
- * will be added to the Canonical Metamodel
- * (see {@link org.eclipse.jpt.core.internal.resource.java.source.SourcePersistentType#isGeneratedMetamodel()}).
- * Once the JPA project's context model is constructed, a new Canonical
- * Metamodel is generated and merged with the classes already present in the
- * metamodel source folder.
- * </li><li>
- * When a JPA project's metamodel source folder setting is cleared, the Canonical
- * Metamodel is cleared from the context model, but the generated source files are
- * left in place.
- * </li><li>
- * When a JPA project's metamodel source folder is set to a non-null value,
- * like when a JPA project is first created, the resulting Canonical Metamodel
- * will be merged with whatever is already present in the folder.
- * </li></ul>
- * <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 MetamodelSynchronizer {
-
- void initializeMetamodel();
-
- void synchronizeMetamodel();
-
- void disposeMetamodel();
-
-
- /**
- * Singleton implemetation of the metamodel synchronizer interface that
- * does nothing. (Not sure we need this....)
- */
- final class Null implements MetamodelSynchronizer, Serializable {
- public static final MetamodelSynchronizer INSTANCE = new Null();
- public static MetamodelSynchronizer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void initializeMetamodel() {
- // do nothing
- }
- public void synchronizeMetamodel() {
- // do nothing
- }
- public void disposeMetamodel() {
- // do nothing
- }
- @Override
- public String toString() {
- return "MetamodelSynchronizer.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AssociationOverrideRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AssociationOverrideRelationshipReference2_0.java
deleted file mode 100644
index 46cdce349b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AssociationOverrideRelationshipReference2_0.java
+++ /dev/null
@@ -1,42 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-/**
- * An <code>AssociationOverrideRelationshipReference2_0</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy} or
- * {@link JoinTableJoiningStrategy}
- * <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 AssociationOverride
- *
- * @version 2.3
- * @since 2.3
- */
-public interface AssociationOverrideRelationshipReference2_0
- extends
- AssociationOverrideRelationshipReference,
- JoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeMapping2_0.java
deleted file mode 100644
index 08773fb486..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeMapping2_0.java
+++ /dev/null
@@ -1,45 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-
-/**
- * JPA 2.0 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 2.3
- * @since 2.3
- */
-public interface AttributeMapping2_0
- extends AttributeMapping
-{
- /**
- * Return the Canonical Metamodel field corresponding to the mapping.
- * Return null if the mapping is not to be part of the Canonical Metamodel.
- */
- MetamodelField getMetamodelField();
-
- /**
- * Return the name of the mapping's type as used in the Canonical Metamodel.
- */
- String getMetamodelTypeName();
-
- @SuppressWarnings("nls")
- Iterable<String> STANDARD_METAMODEL_FIELD_MODIFIERS =
- new ArrayIterable<String>(new String[] { "public", "static", "volatile" });
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeOverride2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeOverride2_0.java
deleted file mode 100644
index 036cd3a0d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/AttributeOverride2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AttributeOverride;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 AttributeOverride2_0
- extends AttributeOverride
-{
- /**
- * Property string associated with changes to the mapped by relationship
- */
- final String MAPPED_BY_RELATIONSHIP_PROPERTY = "mappedByRelationship";
-
- /**
- * Return whether this attribute override is mapped by a relationship
- * (i.e. a relationship maps this attribute override, possibly in an entity overriding
- * an id or an embedded id overriding any attribute)
- * N.B. - This might be several relationships (erroneously, of course)
- */
- boolean isMappedByRelationship();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cacheable2_0.java
deleted file mode 100644
index 436c918bf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cacheable2_0.java
+++ /dev/null
@@ -1,37 +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.core.jpa2.context;
-
-import org.eclipse.jpt.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.3
- * @since 2.3
- */
-public interface Cacheable2_0
- extends JpaContextNode
-{
- boolean isCacheable();
-
- boolean isDefaultCacheable();
- String DEFAULT_CACHEABLE_PROPERTY = "defaultCacheable"; //$NON-NLS-1$
-
- Boolean getSpecifiedCacheable();
- void setSpecifiedCacheable(Boolean newSpecifiedCacheable);
- String SPECIFIED_CACHEABLE_PROPERTY = "specifiedCacheable"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CacheableHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CacheableHolder2_0.java
deleted file mode 100644
index 2b14b7ff7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CacheableHolder2_0.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.JpaNode;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 CacheableHolder2_0
- extends JpaNode
-{
- Cacheable2_0 getCacheable();
-
- boolean calculateDefaultCacheable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cascade2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cascade2_0.java
deleted file mode 100644
index 8339d6cb05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Cascade2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.Cascade;
-
-/**
- * 1:m, m:m, element collection are all collection mappings.
- * <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 Cascade2_0
- extends Cascade
-{
- boolean isDetach();
- void setDetach(boolean value);
- String DETACH_PROPERTY = "detach"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionMapping2_0.java
deleted file mode 100644
index 95f399545d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionMapping2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.CollectionMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-
-/**
- * 1:m, m:m, element collection are all collection mappings.
- * <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 CollectionMapping2_0
- extends CollectionMapping
-{
-
- // **************** map key class **************************************
-
- String getMapKeyClass();
-
- String getSpecifiedMapKeyClass();
- void setSpecifiedMapKeyClass(String value);
- String SPECIFIED_MAP_KEY_CLASS_PROPERTY = "specifiedMapKeyClass"; //$NON-NLS-1$
-
- String getDefaultMapKeyClass();
- String DEFAULT_MAP_KEY_CLASS_PROPERTY = "defaultMapKeyClass"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the map key class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getMapKeyClassEnclosingTypeSeparator();
-
- /**
- * If the attribute type is not a map or if the map key class is a basic type this will return null.
- */
- Embeddable getResolvedMapKeyEmbeddable();
- String RESOLVED_MAP_KEY_EMBEDDABLE_PROPERTY = "resolvedMapKeyEmbeddable"; //$NON-NLS-1$
-
- /**
- * If the attribute type is not a map or if the map key class is a basic type this will return null.
- */
- Entity getResolvedMapKeyEntity();
- String RESOLVED_MAP_KEY_ENTITY_PROPERTY = "resolvedMapKeyEntity"; //$NON-NLS-1$
-
-
- // **************** key column **************************************
-
- /**
- * Return the map key column for this collection mapping.
- */
- Column getMapKeyColumn();
-
- AttributeOverrideContainer getMapKeyAttributeOverrideContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionTable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionTable2_0.java
deleted file mode 100644
index 5d92938b06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/CollectionTable2_0.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.ReferenceTable;
-
-/**
- * Used by ElementCollection mappings.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 CollectionTable2_0
- extends ReferenceTable
-{
- ElementCollectionMapping2_0 getParent();
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentity2_0.java
deleted file mode 100644
index 4304074d60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentity2_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.core.jpa2.context;
-
-import org.eclipse.jpt.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.3
- * @since 2.3
- */
-public interface DerivedIdentity2_0
- extends JpaContextNode
-{
- SingleRelationshipMapping2_0 getMapping();
-
- /**
- * String associated with changes to the predominant strategy property
- */
- final static String PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY =
- "predominantDerivedIdentityStrategy"; //$NON-NLS-1$
-
- /**
- * Return the predominant joining strategy, this should not be null
- */
- DerivedIdentityStrategy2_0 getPredominantDerivedIdentityStrategy();
-
- /**
- * Return whether there is no derived identity strategy
- */
- boolean usesNullDerivedIdentityStrategy();
-
- /**
- * Sets it so that there is no derived identity strategy. This will unset all other strategies.
- */
- void setNullDerivedIdentityStrategy();
-
- /**
- * Return the aggregate (never null) id strategy
- */
- IdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy();
-
- /**
- * Return whether id is the strategy currently used by this object
- */
- boolean usesIdDerivedIdentityStrategy();
-
- /**
- * Sets the id derived identity strategy. This will unset all other strategies.
- */
- void setIdDerivedIdentityStrategy();
-
- /**
- * Unsets the id derived identity strategy.
- * This will not set any other strategy, so whichever other strategy is present (or the null strategy)
- * will apply at that point.
- */
- void unsetIdDerivedIdentityStrategy();
-
- /**
- * Return the aggregate (never null) maps id derived identity strategy
- */
- MapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy();
-
- /**
- * Return whether maps id is the strategy currently used by this object
- */
- boolean usesMapsIdDerivedIdentityStrategy();
-
- /**
- * Sets the maps id derived identity strategy. This will unset all other strategies.
- */
- void setMapsIdDerivedIdentityStrategy();
-
- /**
- * Unsets the maps id derived identity strategy.
- * This will not set any other strategy, so whichever other strategy is present (or the null strategy)
- * will apply at that point.
- */
- void unsetMapsIdDerivedIdentityStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentityStrategy2_0.java
deleted file mode 100644
index 3253754190..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/DerivedIdentityStrategy2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.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.3
- * @since 2.3
- */
-public interface DerivedIdentityStrategy2_0
- extends JpaContextNode
-{
- /**
- * Return the mapping that employs this strategy
- */
- SingleRelationshipMapping2_0 getMapping();
-
- /**
- * Return the derived identity container
- */
- DerivedIdentity2_0 getDerivedIdentity();
-
- /**
- * Return whether the strategy is specified on the resource model
- */
- boolean isSpecified();
-
- /**
- * Add this strategy to the relationship reference
- */
- void addStrategy();
-
- /**
- * Remove this strategy from the relationship reference
- */
- void removeStrategy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ElementCollectionMapping2_0.java
deleted file mode 100644
index 65da4658d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,86 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.ConvertibleMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.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.3
- */
-public interface ElementCollectionMapping2_0
- extends AttributeMapping2_0, CollectionMapping2_0, ConvertibleMapping
-{
- /**
- * Return the entity that owns the mapping. This is
- * just a convenience method that calls getTypeMapping() and returns
- * null if it is not an Entity
- */
- Entity getEntity();
-
- // **************** target class **************************************
-
- String getTargetClass();
-
- String getSpecifiedTargetClass();
- void setSpecifiedTargetClass(String value);
- String SPECIFIED_TARGET_CLASS_PROPERTY = "specifiedTargetClass"; //$NON-NLS-1$
-
- String getDefaultTargetClass();
- String DEFAULT_TARGET_CLASS_PROPERTY = "defaultTargetClass"; //$NON-NLS-1$
-
- /**
- * If the target class is a basic type this will return null.
- */
- Embeddable getResolvedTargetEmbeddable();
- String RESOLVED_TARGET_EMBEDDABLE_PROPERTY = "resolvedTargetEmbeddable"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the target class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getTargetClassEnclosingTypeSeparator();
-
-
- // **************** collection table **************************************
-
- /**
- * Return the collection table for this element collection mapping.
- * This will not be null.
- */
- CollectionTable2_0 getCollectionTable();
-
-
- // **************** value column **************************************
-
- /**
- * Return the value column for this element collection mapping.
- */
- Column getValueColumn();
-
-
- // ******************* overrides **************************************
- AttributeOverrideContainer getValueAttributeOverrideContainer();
-
- AssociationOverrideContainer getValueAssociationOverrideContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedIdMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedIdMapping2_0.java
deleted file mode 100644
index 92034d8999..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedIdMapping2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EmbeddedIdMapping2_0
- extends EmbeddedIdMapping
-{
- /**
- * Property string associated with changes to the mapped by relationship
- */
- final String MAPPED_BY_RELATIONSHIP_PROPERTY = "mappedByRelationship";
-
- /**
- * Return whether this id is mapped by a relationship (i.e. a relationship maps this embedded id)
- * N.B. - This might be several relationships (erroneously, of course)
- */
- boolean isMappedByRelationship();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedMapping2_0.java
deleted file mode 100644
index 1334d829fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/EmbeddedMapping2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EmbeddedMapping2_0
- extends EmbeddedMapping
-{
- AssociationOverrideContainer getAssociationOverrideContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index b173b32fc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdDerivedIdentityStrategy2_0.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.core.jpa2.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.3
- * @since 2.3
- */
-public interface IdDerivedIdentityStrategy2_0
- extends DerivedIdentityStrategy2_0
-{
- /**
- * String associated with changes to the value property of this object
- */
- public static final String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Return whether this object uses a derived id
- */
- boolean getValue();
-
- /**
- * Set whether this object uses a derived id
- */
- void setValue(boolean newValue);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdMapping2_0.java
deleted file mode 100644
index 0cf39d99e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/IdMapping2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.IdMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 IdMapping2_0
- extends IdMapping
-{
- /**
- * Property string associated with changes to the mapped by relationship
- */
- final String MAPPED_BY_RELATIONSHIP_PROPERTY = "mappedByRelationship";
-
- /**
- * Return whether this id is mapped by a relationship (i.e. a relationship maps this id)
- * N.B. - This might be several relationships (erroneously, of course)
- */
- boolean isMappedByRelationship();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.java
deleted file mode 100644
index 1125ca1ee7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/JpaRootContextNode2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.JpaRootContextNode;
-import org.eclipse.jpt.core.jpa2.MetamodelSynchronizer;
-
-/**
- * Root of the Dali JPA 2.0 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 2.3
- * @since 2.3
- */
-public interface JpaRootContextNode2_0
- extends JpaRootContextNode, MetamodelSynchronizer
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/LockModeType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/LockModeType2_0.java
deleted file mode 100644
index 63a94dbaa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/LockModeType2_0.java
+++ /dev/null
@@ -1,120 +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.core.jpa2.context;
-
-/**
- * LockMode 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 2.3
- * @since 2.3
- */
-public enum LockModeType2_0 {
-
- READ(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.READ,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.READ
- ),
- WRITE(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.WRITE,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.WRITE
- ),
- OPTIMISTIC(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.OPTIMISTIC,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.OPTIMISTIC
- ),
- OPTIMISTIC_FORCE_INCREMENT(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.OPTIMISTIC_FORCE_INCREMENT,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.OPTIMISTIC_FORCE_INCREMENT
- ),
- PESSIMISTIC_READ(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.PESSIMISTIC_READ,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.PESSIMISTIC_READ
- ),
- PESSIMISTIC_WRITE(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.PESSIMISTIC_WRITE,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.PESSIMISTIC_WRITE
- ),
- PESSIMISTIC_FORCE_INCREMENT(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.PESSIMISTIC_FORCE_INCREMENT,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.PESSIMISTIC_FORCE_INCREMENT
- ),
- NONE(
- org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0.NONE,
- org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0.NONE
- );
-
-
- private org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 javaLockModeType;
- private org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 ormLockModeType;
-
- LockModeType2_0(org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 javaLockModeType, org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 ormLockModeType) {
- if (javaLockModeType == null) {
- throw new NullPointerException();
- }
- if (ormLockModeType == null) {
- throw new NullPointerException();
- }
- this.javaLockModeType = javaLockModeType;
- this.ormLockModeType = ormLockModeType;
- }
-
- public org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 getJavaLockModeType() {
- return this.javaLockModeType;
- }
-
- public org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 getOrmLockModeType() {
- return this.ormLockModeType;
- }
-
-
- // ********** static methods **********
-
- public static LockModeType2_0 fromJavaResourceModel(org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 javaLockModeType) {
- return (javaLockModeType == null) ? null : fromJavaResourceModel_(javaLockModeType);
- }
-
- private static LockModeType2_0 fromJavaResourceModel_(org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 javaLockModeType) {
- for (LockModeType2_0 lockModeType : LockModeType2_0.values()) {
- if (lockModeType.getJavaLockModeType() == javaLockModeType) {
- return lockModeType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.jpa2.resource.java.LockModeType_2_0 toJavaResourceModel(LockModeType2_0 lockModeType) {
- return (lockModeType == null) ? null : lockModeType.getJavaLockModeType();
- }
-
-
- public static LockModeType2_0 fromOrmResourceModel(org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 ormLockModeType) {
- return (ormLockModeType == null) ? null : fromOrmResourceModel_(ormLockModeType);
- }
-
- private static LockModeType2_0 fromOrmResourceModel_(org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 ormLockModeType) {
- for (LockModeType2_0 lockModeType : LockModeType2_0.values()) {
- if (lockModeType.getOrmLockModeType() == ormLockModeType) {
- return lockModeType;
- }
- }
- return null;
- }
-
- public static org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 toOrmResourceModel(LockModeType2_0 lockModeType) {
- return (lockModeType == null) ? null : lockModeType.getOrmLockModeType();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToManyMapping2_0.java
deleted file mode 100644
index 6dc15a7399..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToManyMapping2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToManyMapping2_0
- extends ManyToManyMapping, CollectionMapping2_0
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneMapping2_0.java
deleted file mode 100644
index 35ae4f9013..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneMapping2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToOneMapping2_0
- extends ManyToOneMapping, SingleRelationshipMapping2_0
-{
- ManyToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneRelationshipReference2_0.java
deleted file mode 100644
index 47ef365f4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/ManyToOneRelationshipReference2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.ManyToOneRelationshipReference;
-
-
-/**
- * Represents the {@link RelationshipReference} of a 2.0 {@link ManyToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToOneRelationshipReference2_0
- extends ManyToOneRelationshipReference, JoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MappingFilePersistenceUnitDefaults2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MappingFilePersistenceUnitDefaults2_0.java
deleted file mode 100644
index 9f6beea9a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MappingFilePersistenceUnitDefaults2_0.java
+++ /dev/null
@@ -1,28 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.MappingFilePersistenceUnitDefaults;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MappingFilePersistenceUnitDefaults2_0
- extends MappingFilePersistenceUnitDefaults
-{
- boolean isDelimitedIdentifiers();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MapsIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index f81c12f5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MapsIdDerivedIdentityStrategy2_0.java
+++ /dev/null
@@ -1,74 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapsIdDerivedIdentityStrategy2_0
- extends DerivedIdentityStrategy2_0
-{
- /**
- * String associated with changes to the specified value property of this object
- */
- public static final String SPECIFIED_VALUE_PROPERTY = "specified-value"; //$NON-NLS-1$
-
- /**
- * Return the specified value (the id which has been specified in code)
- * Will return null if no value is specified
- */
- String getSpecifiedValue();
-
- /**
- * Set the specified value (the id to specify in code)
- */
- void setSpecifiedValue(String newValue);
-
- /**
- * Return whether a default value is ever used (in some cases, there can be no default)
- */
- boolean usesDefaultValue();
-
- /**
- * String associated with changes to the default value property of this object
- */
- public static final String DEFAULT_VALUE_PROPERTY = "default-value"; //$NON-NLS-1$
-
- /**
- * Return the default value (the id which would be used in the absence of a specified value)
- */
- String getDefaultValue();
-
- /**
- * Return the specfied value, or in absence of that, the default value
- */
- String getValue();
-
- /**
- * Return a sorted iterator of possible value choices
- */
- Iterable<String> getSortedValueChoices();
-
- /**
- * Return a resolved attribute mapping, which may be a mapping on the entity, or a mapping
- * within an embeddable mapping on the entity
- */
- AttributeMapping getResolvedAttributeMappingValue();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelField.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelField.java
deleted file mode 100644
index de3728b090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelField.java
+++ /dev/null
@@ -1,36 +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.core.jpa2.context;
-
-/**
- * JPA 2.0 Canonical Metamodel field corresponding to a persistent attribute.
- * <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 MetamodelField {
-
- Iterable<String> getModifiers();
-
- String getTypeName();
-
- Iterable<String> getTypeArgumentNames();
-
- String getName();
-
- String DEFAULT_TYPE_NAME = java.lang.Object.class.getName(); // ???
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelSourceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelSourceType.java
deleted file mode 100644
index f94469bec2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/MetamodelSourceType.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.core.jpa2.context;
-
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.ListIterator;
-import java.util.Map;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.utility.BodySourceWriter;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * JPA 2.0 metamodel source type.
- * <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 MetamodelSourceType {
-
- /**
- * Return the source type's name.
- */
- String getName();
-
- /**
- * Return whether the source type is "managed" (i.e. persistent).
- */
- boolean isManaged();
-
- /**
- * Return the source type's super type.
- */
- PersistentType getSuperPersistentType();
-
- /**
- * Return the source type's attributes.
- */
- <T extends PersistentAttribute> ListIterator<T> attributes();
-
- /**
- * Return the file generated as a result of the metamodel synchronization.
- */
- IFile getMetamodelFile();
-
- /**
- * Return the source type's JPA project.
- */
- JpaProject getJpaProject();
-
- /**
- * Synchronize the source type's metamodel, using the specified member type
- * tree.
- */
- void synchronizeMetamodel(Map<String, Collection<MetamodelSourceType>> memberTypeTree);
-
- /**
- * Print the body of the source type's metamodel class on the specified
- * writer, using the specified member type tree.
- */
- void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree);
-
-
- /**
- * {@link Comparator} that can be used to compare source types.
- */
- Comparator<MetamodelSourceType> COMPARATOR =
- new Comparator<MetamodelSourceType>() {
- public int compare(MetamodelSourceType type1, MetamodelSourceType type2) {
- return Collator.getInstance().compare(type1.getName(), type2.getName());
- }
- };
-
-
- /**
- * This interface is used by the source type to synchronize the metamodel
- * as required by changes to the context model.
- */
- interface Synchronizer {
- /**
- * Return the file generated as a result of the metamodel synchronization.
- */
- IFile getFile();
-
- /**
- * Synchronize the metamodel with the current state of the source
- * type, using the specified member type tree.
- */
- void synchronize(Map<String, Collection<MetamodelSourceType>> memberTypeTree);
-
- /**
- * Print the body of the metamodel class on the specified writer,
- * using the specified member type tree.
- */
- void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/NamedQuery2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/NamedQuery2_0.java
deleted file mode 100644
index dd4eabcafa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/NamedQuery2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.NamedQuery;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NamedQuery2_0
- extends NamedQuery
-{
- /**
- * Return the specified lockMode if present, otherwise return the default
- * lockMode.
- */
- LockModeType2_0 getLockMode();
- LockModeType2_0 getSpecifiedLockMode();
- void setSpecifiedLockMode(LockModeType2_0 lockMode);
- String SPECIFIED_LOCK_MODE_PROPERTY = "specifiedLockMode"; //$NON-NLS-1$
- LockModeType2_0 getDefaultLockMode();
- String DEFAULT_LOCK_MODE_PROPERTY = "defaultLockMode"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyMapping2_0.java
deleted file mode 100644
index b63b1850d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyMapping2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToManyMapping2_0
- extends OneToManyMapping, CollectionMapping2_0
-{
- OneToManyRelationshipReference2_0 getRelationshipReference();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyRelationshipReference2_0.java
deleted file mode 100644
index 9661fdbce3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToManyRelationshipReference2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.OneToManyRelationshipReference;
-
-
-/**
- * Represents the {@link RelationshipReference} of a {@link OneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToManyRelationshipReference2_0
- extends OneToManyRelationshipReference,
- JoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneMapping2_0.java
deleted file mode 100644
index 0d010cf4e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneMapping2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToOneMapping2_0
- extends OneToOneMapping, SingleRelationshipMapping2_0
-{
- OneToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneRelationshipReference2_0.java
deleted file mode 100644
index 55d6225373..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OneToOneRelationshipReference2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.JoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.OneToOneRelationshipReference;
-
-/**
- * Represents the {@link RelationshipReference} of a 2.0 {@link OneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToOneRelationshipReference2_0
- extends OneToOneRelationshipReference, JoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.java
deleted file mode 100644
index 5e7dccd437..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrderColumn2_0.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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.NamedColumn;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrderColumn2_0
- extends NamedColumn
-{
-
- boolean isNullable();
-
- boolean isDefaultNullable();
- String DEFAULT_NULLABLE_PROPERTY = "defaultNullable"; //$NON-NLS-1$
- boolean DEFAULT_NULLABLE = true;
- Boolean getSpecifiedNullable();
- void setSpecifiedNullable(Boolean newSpecifiedNullable);
- String SPECIFIED_NULLABLE_PROPERTY = "specifiedNullable"; //$NON-NLS-1$
-
-
- boolean isInsertable();
-
- boolean isDefaultInsertable();
- String DEFAULT_INSERTABLE_PROPERTY = "defaultInsertable"; //$NON-NLS-1$
- boolean DEFAULT_INSERTABLE = true;
- Boolean getSpecifiedInsertable();
- void setSpecifiedInsertable(Boolean newSpecifiedInsertable);
- String SPECIFIED_INSERTABLE_PROPERTY = "specifiedInsertable"; //$NON-NLS-1$
-
-
- boolean isUpdatable();
-
- boolean isDefaultUpdatable();
- String DEFAULT_UPDATABLE_PROPERTY = "defaultUpdatable"; //$NON-NLS-1$
- boolean DEFAULT_UPDATABLE = true;
- Boolean getSpecifiedUpdatable();
- void setSpecifiedUpdatable(Boolean newSpecifiedUpdatable);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java
deleted file mode 100644
index a979b3979f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/Orderable2_0.java
+++ /dev/null
@@ -1,51 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.db.Table;
-
-/**
- * Multi-valued (1:m, m:m) relationship mappings support ordering.
- * <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 Orderable2_0
- extends Orderable
-{
-
- boolean isOrderColumnOrdering();
- void setOrderColumnOrdering(boolean value);
- String ORDER_COLUMN_ORDERING_PROPERTY = "orderColumnOrdering"; //$NON-NLS-1$
-
- OrderColumn2_0 getOrderColumn();
-
- String getDefaultTableName();
-
- /**
- * interface allowing Orderable2_0 to be used in multiple places
- */
- interface Owner extends Orderable.Owner {
- /**
- * Return the name of the table which the column belongs to
- */
- String getTableName();
-
- Table getDbTable(String tableName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovable2_0.java
deleted file mode 100644
index 321fa06748..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovable2_0.java
+++ /dev/null
@@ -1,37 +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.core.jpa2.context;
-
-import org.eclipse.jpt.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.3
- * @since 2.3
- */
-public interface OrphanRemovable2_0
- extends JpaContextNode
-{
- boolean isOrphanRemoval();
-
- boolean isDefaultOrphanRemoval();
- String DEFAULT_ORPHAN_REMOVAL_PROPERTY = "defaultOrphanRemoval"; //$NON-NLS-1$
- boolean DEFAULT_ORPHAN_REMOVAL = false;
-
- Boolean getSpecifiedOrphanRemoval();
- void setSpecifiedOrphanRemoval(Boolean newSpecifiedOrphanRemoval);
- String SPECIFIED_ORPHAN_REMOVAL_PROPERTY = "specifiedOrphanRemoval"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovalHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovalHolder2_0.java
deleted file mode 100644
index ac61f5ef33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/OrphanRemovalHolder2_0.java
+++ /dev/null
@@ -1,28 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.JpaNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrphanRemovalHolder2_0
- extends JpaNode
-{
- OrphanRemovable2_0 getOrphanRemoval();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentAttribute2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentAttribute2_0.java
deleted file mode 100644
index 88da656b16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentAttribute2_0.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-
-/**
- * JPA 2.0 persistent attribute (field or 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 2.3
- * @since 2.3
- */
-public interface PersistentAttribute2_0
- extends PersistentAttribute
-{
- /**
- * Return the name of the container type to be used in the metamodel field
- * declaration corresponding to the attribute's mapping.
- */
- String getMetamodelContainerFieldTypeName();
-
- /**
- * Return the name of the container map key type to be used in the
- * metamodel field declaration corresponding to the attribute's mapping.
- * Return null if the attribute's type is not {@link java.util.Map}.
- */
- String getMetamodelContainerFieldMapKeyTypeName();
-
- /**
- * Return the attribute's type name for the metamodel.
- */
- String getMetamodelTypeName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentType2_0.java
deleted file mode 100644
index 6170a1bc7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/PersistentType2_0.java
+++ /dev/null
@@ -1,37 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.PersistentType;
-
-/**
- * JPA 2.0 context persistent type.
- * <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 PersistentType2_0
- extends PersistentType, MetamodelSourceType
-{
- /**
- * Return the name of the persistent type's "declaring type".
- * Return <code>null</code> if the persistent type is a top-level type.
- * The declaring type may or may not be a persistent type.
- */
- String getDeclaringTypeName();
- String DECLARING_TYPE_NAME_PROPERTY = "declaringTypeName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SequenceGenerator2_0.java
deleted file mode 100644
index 2052a247d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SequenceGenerator2_0.java
+++ /dev/null
@@ -1,53 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.SequenceGenerator;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 SequenceGenerator2_0
- extends SequenceGenerator
-{
- // ********** catalog **********
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
-
- // ********** schema **********
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SingleRelationshipMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SingleRelationshipMapping2_0.java
deleted file mode 100644
index 2225d0fed1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/SingleRelationshipMapping2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context;
-
-import org.eclipse.jpt.core.context.SingleRelationshipMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 SingleRelationshipMapping2_0
- extends SingleRelationshipMapping
-{
- DerivedIdentity2_0 getDerivedIdentity();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaAssociationOverrideRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaAssociationOverrideRelationshipReference2_0.java
deleted file mode 100644
index 31b4387b98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaAssociationOverrideRelationshipReference2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.AssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-
-/**
- * An <code>AssociationOverrideRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy}
- * <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 RelationshipMapping
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaAssociationOverrideRelationshipReference2_0
- extends AssociationOverrideRelationshipReference2_0, JavaJpaContextNode
-{
- JavaAssociationOverride getAssociationOverride();
-
- JavaJoinTableInAssociationOverrideJoiningStrategy2_0 getJoinTableJoiningStrategy();
-
- void initialize(AssociationOverrideAnnotation associationOverride);
-
- void update(AssociationOverrideAnnotation associationOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheable2_0.java
deleted file mode 100644
index a6883ac14d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheable2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaCacheable2_0
- extends JavaJpaContextNode, Cacheable2_0
-
-{
- /**
- * Initialize model without throwing any events
- */
- void initialize(JavaResourcePersistentType jrpt);
-
- /**
- * Update model, throwing events as necessary
- */
- void update(JavaResourcePersistentType jrpt);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheableHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheableHolder2_0.java
deleted file mode 100644
index c72bfc55b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCacheableHolder2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaCacheableHolder2_0
- extends CacheableHolder2_0, JavaJpaContextNode
-{
- JavaCacheable2_0 getCacheable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCascade2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCascade2_0.java
deleted file mode 100644
index b16cbe4cdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCascade2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaCascade;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaCascade2_0
- extends JavaCascade, Cascade2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionMapping2_0.java
deleted file mode 100644
index 3241504a04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionMapping2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.jpa2.context.CollectionMapping2_0;
-
-/**
- * 1:m, m:m, element collection are all collection mappings.
- * <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 JavaCollectionMapping2_0
- extends CollectionMapping2_0, JavaAttributeMapping
-{
-
- JavaAttributeOverrideContainer getMapKeyAttributeOverrideContainer();
-
- /**
- * If the map key class is specified, this will return it fully qualified. If not
- * specified, it returns the default map key class, which is always fully qualified
- */
- String getFullyQualifiedMapKeyClass();
- String FULLY_QUALIFIED_MAP_KEY_CLASS_PROPERTY = "fullyQualifiedMapKeyClass"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionTable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionTable2_0.java
deleted file mode 100644
index 7c6920b37a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaCollectionTable2_0.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.core.jpa2.context.java;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaReferenceTable;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-
-/**
- * Java collection table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaCollectionTable2_0
- extends CollectionTable2_0, JavaReferenceTable
-{
- void initialize(CollectionTable2_0Annotation collectionTableAnnotation);
-
- void update(CollectionTable2_0Annotation collectionTableAnnotation);
-
- // ********** covariant overrides **********
-
- ListIterator<JavaJoinColumn> joinColumns();
-
- JavaJoinColumn getDefaultJoinColumn();
-
- ListIterator<JavaJoinColumn> specifiedJoinColumns();
-
- JavaJoinColumn addSpecifiedJoinColumn(int index);
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints();
-
- JavaUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaDerivedIdentity2_0.java
deleted file mode 100644
index 6e2ef6c6bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaDerivedIdentity2_0.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.core.jpa2.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaDerivedIdentity2_0
- extends DerivedIdentity2_0, JavaJpaContextNode
-{
- JavaSingleRelationshipMapping2_0 getMapping();
-
- void initialize();
-
- void update();
-
- void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaElementCollectionMapping2_0.java
deleted file mode 100644
index 85e9fbfcab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,49 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaElementCollectionMapping2_0
- extends JavaCollectionMapping2_0, ElementCollectionMapping2_0
-{
- JavaCollectionTable2_0 getCollectionTable();
-
- CollectionTable2_0Annotation getCollectionTableAnnotation();
-
- JavaColumn getValueColumn();
-
- JavaAttributeOverrideContainer getValueAttributeOverrideContainer();
-
- JavaAssociationOverrideContainer getValueAssociationOverrideContainer();
-
- /**
- * If the target class is specified, this will return it fully qualified. If not
- * specified, it returns the default target class, which is always fully qualified
- */
- String getFullyQualifiedTargetClass();
- String FULLY_QUALIFIED_TARGET_CLASS_PROPERTY = "fullyQualifiedTargetClass"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaEmbeddedMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaEmbeddedMapping2_0.java
deleted file mode 100644
index c908abc82b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaEmbeddedMapping2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.jpa2.context.EmbeddedMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaEmbeddedMapping2_0
- extends JavaEmbeddedMapping, EmbeddedMapping2_0
-{
- JavaAssociationOverrideContainer getAssociationOverrideContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index 4f0b2c0cb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaIdDerivedIdentityStrategy2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.IdDerivedIdentityStrategy2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaIdDerivedIdentityStrategy2_0
- extends JavaJpaContextNode, IdDerivedIdentityStrategy2_0
-{
- /**
- * Initialize model without throwing any events
- */
- void initialize();
-
- /**
- * Update model, throwing events as necessary
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaJoinTableInAssociationOverrideJoiningStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaJoinTableInAssociationOverrideJoiningStrategy2_0.java
deleted file mode 100644
index d1ad0f789b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaJoinTableInAssociationOverrideJoiningStrategy2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaJoinTableInAssociationOverrideJoiningStrategy2_0
- extends JavaJpaContextNode, JavaJoinTableJoiningStrategy
-{
-
- void initialize(AssociationOverride2_0Annotation associationOverride);
-
- void update(AssociationOverride2_0Annotation associationOverride);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToManyMapping2_0.java
deleted file mode 100644
index a80d5f8049..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToManyMapping2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToMany2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaManyToManyMapping2_0
- extends JavaManyToManyMapping, JavaRelationshipMapping2_0, ManyToManyMapping2_0, JavaCollectionMapping2_0
-{
- ManyToMany2_0Annotation getMappingAnnotation();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java
deleted file mode 100644
index b0f1037b31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneMapping2_0.java
+++ /dev/null
@@ -1,33 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ManyToOne2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaManyToOneMapping2_0
- extends JavaManyToOneMapping, ManyToOneMapping2_0, JavaSingleRelationshipMapping2_0
-{
- ManyToOne2_0Annotation getMappingAnnotation();
-
- JavaManyToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneRelationshipReference2_0.java
deleted file mode 100644
index 0fd1274088..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaManyToOneRelationshipReference2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneRelationshipReference2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaManyToOneRelationshipReference2_0
- extends
- JavaManyToOneRelationshipReference,
- ManyToOneRelationshipReference2_0,
- JavaJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaMapsIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index 7b1965abca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaMapsIdDerivedIdentityStrategy2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.MapsIdDerivedIdentityStrategy2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaMapsIdDerivedIdentityStrategy2_0
- extends JavaJpaContextNode, MapsIdDerivedIdentityStrategy2_0
-{
- /**
- * Initialize model without throwing any events
- */
- void initialize();
-
- /**
- * Update model, throwing events as necessary
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaNamedQuery2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaNamedQuery2_0.java
deleted file mode 100644
index cf8339bb30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaNamedQuery2_0.java
+++ /dev/null
@@ -1,27 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.jpa2.context.NamedQuery2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaNamedQuery2_0
- extends NamedQuery2_0, JavaNamedQuery
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyMapping2_0.java
deleted file mode 100644
index 8b4619892f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyMapping2_0.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToManyMapping2_0
- extends JavaOneToManyMapping, JavaRelationshipMapping2_0, OneToManyMapping2_0, JavaCollectionMapping2_0
-{
- OneToMany2_0Annotation getMappingAnnotation();
-
- JavaOneToManyRelationshipReference2_0 getRelationshipReference();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyRelationshipReference2_0.java
deleted file mode 100644
index 861384e3aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToManyRelationshipReference2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaOneToManyRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.OneToManyRelationshipReference2_0;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToManyRelationshipReference2_0
- extends
- JavaOneToManyRelationshipReference,
- JavaJoinColumnEnabledRelationshipReference,
- OneToManyRelationshipReference2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java
deleted file mode 100644
index d12722e284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneMapping2_0.java
+++ /dev/null
@@ -1,33 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToOneMapping2_0
- extends JavaOneToOneMapping, OneToOneMapping2_0, JavaSingleRelationshipMapping2_0
-{
- OneToOne2_0Annotation getMappingAnnotation();
-
- JavaOneToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneRelationshipReference2_0.java
deleted file mode 100644
index a4c26adfae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOneToOneRelationshipReference2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.OneToOneRelationshipReference2_0;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaOneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOneToOneRelationshipReference2_0
- extends
- JavaOneToOneRelationshipReference,
- OneToOneRelationshipReference2_0,
- JavaJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.java
deleted file mode 100644
index 6bfee02783..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderColumn2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOrderColumn2_0
- extends OrderColumn2_0, JavaNamedColumn
-{
- void initialize(JavaResourcePersistentAttribute resource);
-
- /**
- * Update the JavaColumn context model object to match the ColumnAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentAttribute resource);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.java
deleted file mode 100644
index d25afe6ccc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrderable2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaOrderable;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaOrderable2_0
- extends Orderable2_0, JavaOrderable
-{
- JavaOrderColumn2_0 getOrderColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovable2_0.java
deleted file mode 100644
index edf2e66848..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovable2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaOrphanRemovable2_0
- extends JavaJpaContextNode, OrphanRemovable2_0
-{
- /**
- * Initialize model without throwing any events
- */
- void initialize(JavaResourcePersistentAttribute jrpa);
-
- /**
- * Update model, throwing events as necessary
- */
- void update(JavaResourcePersistentAttribute jrpa);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovalHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovalHolder2_0.java
deleted file mode 100644
index fc498e0c2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaOrphanRemovalHolder2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaOrphanRemovalHolder2_0
- extends OrphanRemovalHolder2_0, JavaJpaContextNode
-{
- JavaOrphanRemovable2_0 getOrphanRemoval();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentAttribute2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentAttribute2_0.java
deleted file mode 100644
index 08b3465102..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentAttribute2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.PersistentAttribute2_0;
-
-/**
- * JPA 2.0 context Java persistent attribute (field or 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 2.3
- * @since 2.3
- */
-public interface JavaPersistentAttribute2_0
- extends JavaPersistentAttribute, PersistentAttribute2_0
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.java
deleted file mode 100644
index 4c26fd707c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaPersistentType2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.jpa2.context.PersistentType2_0;
-
-/**
- * JPA 2.0 context Java persistent type.
- * <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 JavaPersistentType2_0
- extends JavaPersistentType, PersistentType2_0
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaRelationshipMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaRelationshipMapping2_0.java
deleted file mode 100644
index 5195415c93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaRelationshipMapping2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaRelationshipMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.RelationshipMapping2_0Annotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaRelationshipMapping2_0
- extends JavaRelationshipMapping
-{
- RelationshipMapping2_0Annotation getMappingAnnotation();
-
- JavaCascade2_0 getCascade();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaSingleRelationshipMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaSingleRelationshipMapping2_0.java
deleted file mode 100644
index 2f348611bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/java/JavaSingleRelationshipMapping2_0.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.core.jpa2.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaSingleRelationshipMapping;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface JavaSingleRelationshipMapping2_0
- extends JavaSingleRelationshipMapping, JavaRelationshipMapping2_0, SingleRelationshipMapping2_0
-{
- JavaDerivedIdentity2_0 getDerivedIdentity();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmAssociationOverrideRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmAssociationOverrideRelationshipReference2_0.java
deleted file mode 100644
index ef4980ead3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmAssociationOverrideRelationshipReference2_0.java
+++ /dev/null
@@ -1,50 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.JoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.RelationshipMapping;
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.AssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- * An <code>AssociationOverrideRelationshipReference</code> is a type of
- * {@link RelationshipReference} that may utilize a
- * {@link JoinColumnJoiningStrategy}
- * <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 RelationshipMapping
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmAssociationOverrideRelationshipReference2_0
- extends
- OrmAssociationOverrideRelationshipReference,
- AssociationOverrideRelationshipReference2_0,
- XmlContextNode
-{
- OrmAssociationOverride getAssociationOverride();
-
- OrmJoinTableInAssociationOverrideJoiningStrategy2_0 getJoinTableJoiningStrategy();
-
- void update(XmlAssociationOverride xao);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheable2_0.java
deleted file mode 100644
index 3a3729a990..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheable2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmCacheable2_0
- extends XmlContextNode, Cacheable2_0
-{
- /**
- * Update model, throwing events as necessary
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheableHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheableHolder2_0.java
deleted file mode 100644
index 1619265ce8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCacheableHolder2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmCacheableHolder2_0
- extends CacheableHolder2_0, XmlContextNode
-{
- OrmCacheable2_0 getCacheable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCascade2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCascade2_0.java
deleted file mode 100644
index e63364e198..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCascade2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmCascade;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmCascade2_0
- extends OrmCascade, Cascade2_0
-{
- void initializeFrom(Cascade2_0 oldCascade);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionMapping2_0.java
deleted file mode 100644
index ae312b8842..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.CollectionMapping2_0;
-
-/**
- * 1:m, m:m, element collection are all collection mappings.
- * <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 OrmCollectionMapping2_0
- extends CollectionMapping2_0, OrmAttributeMapping
-{
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionTable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionTable2_0.java
deleted file mode 100644
index 38264e3537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmCollectionTable2_0.java
+++ /dev/null
@@ -1,51 +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.core.jpa2.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmReferenceTable;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0;
-
-/**
- * orm.xml collection table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmCollectionTable2_0
- extends CollectionTable2_0, OrmReferenceTable
-{
- void update();
-
- void initializeFrom(CollectionTable2_0 oldCollectionTable);
-
- // ********** covariant overrides **********
-
- ListIterator<OrmJoinColumn> joinColumns();
-
- OrmJoinColumn getDefaultJoinColumn();
-
- ListIterator<OrmJoinColumn> specifiedJoinColumns();
-
- OrmJoinColumn addSpecifiedJoinColumn(int index);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints();
-
- OrmUniqueConstraint addUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmDerivedIdentity2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmDerivedIdentity2_0.java
deleted file mode 100644
index 7302582a0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmDerivedIdentity2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.DerivedIdentity2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmDerivedIdentity2_0
- extends DerivedIdentity2_0, XmlContextNode
-{
- OrmSingleRelationshipMapping2_0 getMapping();
-
- OrmMapsIdDerivedIdentityStrategy2_0 getMapsIdDerivedIdentityStrategy();
-
- OrmIdDerivedIdentityStrategy2_0 getIdDerivedIdentityStrategy();
-
- void initializeFrom(OrmDerivedIdentity2_0 oldDerivedIdentity);
-
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmElementCollectionMapping2_0.java
deleted file mode 100644
index c91e4b4283..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,42 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmElementCollectionMapping2_0
- extends OrmCollectionMapping2_0, ElementCollectionMapping2_0
-{
- OrmCollectionTable2_0 getCollectionTable();
-
- XmlElementCollection getResourceAttributeMapping();
-
- OrmColumn getValueColumn();
-
- OrmAttributeOverrideContainer getValueAttributeOverrideContainer();
-
- OrmAssociationOverrideContainer getValueAssociationOverrideContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmEmbeddedMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmEmbeddedMapping2_0.java
deleted file mode 100644
index 30876cc70f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmEmbeddedMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.jpa2.context.EmbeddedMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmEmbeddedMapping2_0
- extends OrmEmbeddedMapping, EmbeddedMapping2_0
-{
- OrmAssociationOverrideContainer getAssociationOverrideContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index ec1cf88bfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmIdDerivedIdentityStrategy2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.IdDerivedIdentityStrategy2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmIdDerivedIdentityStrategy2_0
- extends XmlContextNode, IdDerivedIdentityStrategy2_0
-{
- OrmSingleRelationshipMapping2_0 getMapping();
-
- void initializeFrom(OrmIdDerivedIdentityStrategy2_0 oldStrategy);
-
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmJoinTableInAssociationOverrideJoiningStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmJoinTableInAssociationOverrideJoiningStrategy2_0.java
deleted file mode 100644
index dcbf259614..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmJoinTableInAssociationOverrideJoiningStrategy2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableJoiningStrategy;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmJoinTableInAssociationOverrideJoiningStrategy2_0
- extends XmlContextNode, OrmJoinTableJoiningStrategy
-{
- void update(XmlAssociationOverride resourceAssociationOverride);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToManyMapping2_0.java
deleted file mode 100644
index 2cc2068121..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToManyMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.ManyToManyMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmManyToManyMapping2_0
- extends OrmManyToManyMapping, ManyToManyMapping2_0
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneMapping2_0.java
deleted file mode 100644
index 0efc564d9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmManyToOneMapping2_0
- extends OrmManyToOneMapping, ManyToOneMapping2_0, OrmSingleRelationshipMapping2_0
-{
- OrmManyToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneRelationshipReference2_0.java
deleted file mode 100644
index d40f199651..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmManyToOneRelationshipReference2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneRelationshipReference2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmManyToOneRelationshipReference2_0
- extends
- OrmManyToOneRelationshipReference,
- ManyToOneRelationshipReference2_0,
- OrmJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmMapsIdDerivedIdentityStrategy2_0.java
deleted file mode 100644
index 48b2535863..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmMapsIdDerivedIdentityStrategy2_0.java
+++ /dev/null
@@ -1,33 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.MapsIdDerivedIdentityStrategy2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmMapsIdDerivedIdentityStrategy2_0
- extends XmlContextNode, MapsIdDerivedIdentityStrategy2_0
-{
- void initializeFrom(OrmMapsIdDerivedIdentityStrategy2_0 oldStrategy);
-
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmNamedQuery2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmNamedQuery2_0.java
deleted file mode 100644
index 5ce46d2e71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmNamedQuery2_0.java
+++ /dev/null
@@ -1,27 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.jpa2.context.NamedQuery2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmNamedQuery2_0
- extends OrmNamedQuery, NamedQuery2_0
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyMapping2_0.java
deleted file mode 100644
index b3e1159d39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyMapping2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOneToManyMapping2_0
- extends OrmOneToManyMapping, OneToManyMapping2_0
-{
- OrmOneToManyRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyRelationshipReference2_0.java
deleted file mode 100644
index 820ad16a3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToManyRelationshipReference2_0.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.OneToManyRelationshipReference2_0;
-
-/**
- * Represents the {@link RelationshipReference} of an {@link OrmOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOneToManyRelationshipReference2_0
- extends
- OrmOneToManyRelationshipReference,
- OrmJoinColumnEnabledRelationshipReference,
- OneToManyRelationshipReference2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneMapping2_0.java
deleted file mode 100644
index f193471638..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOneToOneMapping2_0
- extends OrmOneToOneMapping, OneToOneMapping2_0, OrmSingleRelationshipMapping2_0
-{
- OrmOneToOneRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneRelationshipReference2_0.java
deleted file mode 100644
index b3a5611f93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOneToOneRelationshipReference2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinTableEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.OneToOneRelationshipReference2_0;
-
-/**
- * Represents the {@link RelationshipReference} of a {@link JavaOneToOneMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrmOneToOneRelationshipReference2_0
- extends
- OrmOneToOneRelationshipReference,
- OneToOneRelationshipReference2_0,
- OrmJoinTableEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.java
deleted file mode 100644
index 02b875ec8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderColumn2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOrderColumn2_0
- extends OrderColumn2_0, OrmNamedColumn
-{
- void initialize(XmlOrderable_2_0 orderable);
-
- /**
- * Update the OrmOrderColumn2_0 context model object to match the XmlOrderable2_0
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(XmlOrderable_2_0 orderable);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.java
deleted file mode 100644
index ed33af4b6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrderable2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmOrderable;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOrderable2_0
- extends Orderable2_0, OrmOrderable
-{
- OrmAttributeMapping getParent();
-
- OrmOrderColumn2_0 getOrderColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovable2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovable2_0.java
deleted file mode 100644
index 5cf44f6555..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovable2_0.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOrphanRemovable2_0
- extends XmlContextNode, OrphanRemovable2_0
-{
- /**
- * Update model, throwing events as necessary
- */
- void update();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovalHolder2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovalHolder2_0.java
deleted file mode 100644
index 130df31d81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmOrphanRemovalHolder2_0.java
+++ /dev/null
@@ -1,29 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmOrphanRemovalHolder2_0
- extends OrphanRemovalHolder2_0, XmlContextNode
-{
- OrmOrphanRemovable2_0 getOrphanRemoval();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistenceUnitDefaults2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistenceUnitDefaults2_0.java
deleted file mode 100644
index 9d6fff8ace..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistenceUnitDefaults2_0.java
+++ /dev/null
@@ -1,37 +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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.jpa2.context.MappingFilePersistenceUnitDefaults2_0;
-
-/**
- * Context <code>orm.xml</code> persistence unit defaults.
- * Context model corresponding to the
- * XML resource model {@link XmlPersistenceUnitDefaults},
- * which corresponds to the <code>persistence-unit-defaults</code> element
- * in the <code>orm.xml</code> file.
- * <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 OrmPersistenceUnitDefaults2_0
- extends MappingFilePersistenceUnitDefaults2_0, OrmPersistenceUnitDefaults
-{
- boolean isDelimitedIdentifiers();
- void setDelimitedIdentifiers(boolean value);
- String DELIMITED_IDENTIFIERS_PROPERTY = "delimitedIdentifiers"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentAttribute2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentAttribute2_0.java
deleted file mode 100644
index dc145e929e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentAttribute2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.PersistentAttribute2_0;
-
-/**
- * JPA 2.0 context orm persistent attribute (field or 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 2.3
- * @since 2.3
- */
-public interface OrmPersistentAttribute2_0
- extends OrmPersistentAttribute, PersistentAttribute2_0
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentType2_0.java
deleted file mode 100644
index 16447aee9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmPersistentType2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.PersistentType2_0;
-
-/**
- * JPA 2.0 context <code>orm.xml</code> persistent type.
- * <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 OrmPersistentType2_0
- extends OrmPersistentType, PersistentType2_0
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSequenceGenerator2_0.java
deleted file mode 100644
index c7deb1a29d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSequenceGenerator2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.jpa2.context.SequenceGenerator2_0;
-
-/**
- * JPA 2.0 context <code>orm.xml</code> sequence generator.
- * <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 OrmSequenceGenerator2_0
- extends SequenceGenerator2_0, OrmSequenceGenerator
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSingleRelationshipMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSingleRelationshipMapping2_0.java
deleted file mode 100644
index e92f61ab9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmSingleRelationshipMapping2_0.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmSingleRelationshipMapping;
-import org.eclipse.jpt.core.jpa2.context.SingleRelationshipMapping2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmSingleRelationshipMapping2_0
- extends OrmSingleRelationshipMapping, SingleRelationshipMapping2_0
-{
- public OrmDerivedIdentity2_0 getDerivedIdentity();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.java
deleted file mode 100644
index bfc292a2e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/orm/OrmXml2_0ContextNodeFactory.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.core.jpa2.context.orm;
-
-import org.eclipse.jpt.core.context.Orderable;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmNamedColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface OrmXml2_0ContextNodeFactory
- extends OrmXmlContextNodeFactory
-{
- // ********** ORM Context Model **********
-
- //overloaded because the 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(
- OrmEmbeddedMapping2_0 parent,
- OrmAssociationOverrideContainer.Owner owner);
-
- OrmDerivedIdentity2_0 buildOrmDerivedIdentity(
- OrmSingleRelationshipMapping2_0 parent, XmlSingleRelationshipMapping_2_0 resource);
-
- OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(
- OrmPersistentAttribute parent, XmlElementCollection resourceMapping);
-
- XmlElementCollection buildVirtualXmlElementCollection2_0(
- OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping);
-
- OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource);
-
- OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource);
-
- OrmOrderable2_0 buildOrmOrderable(OrmAttributeMapping parent, Orderable.Owner owner);
-
- OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmNamedColumn.Owner owner);
-
- OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, XmlCollectionTable resource);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.java
deleted file mode 100644
index f7bcddf4dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/Persistence2_0.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.core.jpa2.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.jpa2.MetamodelSynchronizer;
-
-/**
- * The <code>persistence</code> element in the JPA 2.0 <code>persistence.xml</code> file.
- * <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 Persistence2_0
- extends Persistence, MetamodelSynchronizer
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java
deleted file mode 100644
index bc407cc1eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceUnit2_0.java
+++ /dev/null
@@ -1,127 +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.core.jpa2.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.jpa2.MetamodelSynchronizer;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.ValidationMode;
-
-/**
- * JPA 2.0 <code>persistence-unit</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.3
- * @since 2.3
- */
-public interface PersistenceUnit2_0
- extends PersistenceUnit, MetamodelSynchronizer
-{
- // ********** shared cache mode **********
-
- /**
- * Return the persistence unit's shared cache mode,
- * whether specified or defaulted.
- */
- SharedCacheMode getSharedCacheMode();
-
- /**
- * String constant associated with changes to the persistence unit's
- * specified shared cache mode
- */
- String SPECIFIED_SHARED_CACHE_MODE_PROPERTY = "specifiedSharedCacheMode"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's specified shared cache mode.
- */
- SharedCacheMode getSpecifiedSharedCacheMode();
-
- /**
- * Set the persistence unit's specified shared cache mode.
- */
- void setSpecifiedSharedCacheMode(SharedCacheMode sharedCacheMode);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default shared cache mode (not typically changed).
- */
- String DEFAULT_SHARED_CACHE_MODE_PROPERTY = "defaultSharedCacheMode"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's default shared cache mode.
- */
- SharedCacheMode getDefaultSharedCacheMode();
-
- boolean calculateDefaultCacheable();
-
- // ********** validation mode **********
-
- /**
- * Return the persistence unit's validation mode,
- * whether specified or defaulted.
- */
- ValidationMode getValidationMode();
-
- /**
- * String constant associated with changes to the persistence unit's
- * specified validation mode
- */
- String SPECIFIED_VALIDATION_MODE_PROPERTY = "specifiedValidationMode"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's specified validation mode.
- */
- ValidationMode getSpecifiedValidationMode();
-
- /**
- * Set the persistence unit's specified validation mode.
- */
- void setSpecifiedValidationMode(ValidationMode validationMode);
-
- /**
- * String constant associated with changes to the persistence unit's
- * default validation mode (not typically changed).
- */
- String DEFAULT_VALIDATION_MODE_PROPERTY = "defaultValidationMode"; //$NON-NLS-1$
-
- /**
- * Return the persistence unit's default validation mode.
- */
- ValidationMode getDefaultValidationMode();
-
- ValidationMode DEFAULT_VALIDATION_MODE = ValidationMode.AUTO;
-
- // ********** properties **********
-
- PersistenceUnitProperties getConnection();
-
- PersistenceUnitProperties getOptions();
-
- // ********** ORM persistence unit defaults **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * default "delimited identifiers" flag.
- */
- String DEFAULT_DELIMITED_IDENTIFIERS_PROPERTY = "defaultDelimitedIdentifiers"; //$NON-NLS-1$
-
- /**
- * Return the default "delimited identifiers" flag from the first persistence unit defaults
- * found in the persistence unit's list of mapping files.
- */
- boolean getDefaultDelimitedIdentifiers();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.java
deleted file mode 100644
index 28815f82ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/PersistenceXml2_0.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.core.jpa2.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.core.jpa2.MetamodelSynchronizer;
-
-/**
- * JPA 2.0 <code>persistence.xml</code> file.
- * <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 PersistenceXml2_0
- extends PersistenceXml, MetamodelSynchronizer
-{
- // nothing yet...
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java
deleted file mode 100644
index 0b9223ce62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/connection/JpaConnection2_0.java
+++ /dev/null
@@ -1,59 +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.core.jpa2.context.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaConnection2_0
- extends PersistenceUnitProperties
-{
- String getDefaultDriver();
- String getDriver();
- void setDriver(String newDriver);
- static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_JDBC_DRIVER = "javax.persistence.jdbc.driver"; //$NON-NLS-1$
- static final String DEFAULT_JDBC_DRIVER = ""; //$NON-NLS-1$
-
- String getDefaultUrl();
- String getUrl();
- void setUrl(String newUrl);
- static final String URL_PROPERTY = "url"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_JDBC_URL = "javax.persistence.jdbc.url"; //$NON-NLS-1$
- static final String DEFAULT_JDBC_URL = ""; //$NON-NLS-1$
-
- String getDefaultUser();
- String getUser();
- void setUser(String newUser);
- static final String USER_PROPERTY = "user"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_JDBC_USER = "javax.persistence.jdbc.user"; //$NON-NLS-1$
- static final String DEFAULT_JDBC_USER = ""; //$NON-NLS-1$
-
- String getDefaultPassword();
- String getPassword();
- void setPassword(String newPassword);
- static final String PASSWORD_PROPERTY = "password"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_JDBC_PASSWORD = "javax.persistence.jdbc.password"; //$NON-NLS-1$
- static final String DEFAULT_JDBC_PASSWORD = ""; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java
deleted file mode 100644
index 469a7b2f41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/JpaOptions2_0.java
+++ /dev/null
@@ -1,67 +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.core.jpa2.context.persistence.options;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaOptions2_0
- extends PersistenceUnitProperties
-{
- Integer getDefaultLockTimeout();
- Integer getLockTimeout();
- void setLockTimeout(Integer newLockTimeout);
- static final String LOCK_TIMEOUT_PROPERTY = "lockTimeout"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_LOCK_TIMEOUT = "javax.persistence.lock.timeout"; //$NON-NLS-1$
- static final Integer DEFAULT_LOCK_TIMEOUT = Integer.valueOf(5);
-
- Integer getDefaultQueryTimeout();
- Integer getQueryTimeout();
- void setQueryTimeout(Integer newQueryTimeout);
- static final String QUERY_TIMEOUT_PROPERTY = "queryTimeout"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_QUERY_TIMEOUT = "javax.persistence.query.timeout"; //$NON-NLS-1$
- static final Integer DEFAULT_QUERY_TIMEOUT = Integer.valueOf(5);
-
- String getDefaultValidationGroupPrePersist();
- String getValidationGroupPrePersist();
- void setValidationGroupPrePersist(String newValidationGroupPrePersist);
- static final String VALIDATION_GROUP_PRE_PERSIST_PROPERTY = "validationGroupPrePersist"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST = "javax.persistence.validation.group.pre-persist"; //$NON-NLS-1$
- static final String DEFAULT_VALIDATION_GROUP_PRE_PERSIST = "Default"; //$NON-NLS-1$
-
- String getDefaultValidationGroupPreUpdate();
- String getValidationGroupPreUpdate();
- void setValidationGroupPreUpdate(String newValidationGroupPreUpdate);
- static final String VALIDATION_GROUP_PRE_UPDATE_PROPERTY = "validationGroupPreUpdate"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE = "javax.persistence.validation.group.pre-update"; //$NON-NLS-1$
- static final String DEFAULT_VALIDATION_GROUP_PRE_UPDATE = "Default"; //$NON-NLS-1$
-
- String getDefaultValidationGroupPreRemove();
- String getValidationGroupPreRemove();
- void setValidationGroupPreRemove(String newValidationGroupPreRemove);
- static final String VALIDATION_GROUP_PRE_REMOVE_PROPERTY = "validationGroupPreRemove"; //$NON-NLS-1$
- // Property key
- static final String PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE = "javax.persistence.validation.group.pre-remove"; //$NON-NLS-1$
- static final String DEFAULT_VALIDATION_GROUP_PRE_REMOVE = ""; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/SharedCacheMode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/SharedCacheMode.java
deleted file mode 100644
index 0ea73f0d07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/SharedCacheMode.java
+++ /dev/null
@@ -1,72 +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.core.jpa2.context.persistence.options;
-
-import org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public enum SharedCacheMode
-{
- ALL,
- NONE,
- ENABLE_SELECTIVE,
- DISABLE_SELECTIVE,
- UNSPECIFIED;
-
-
- public static SharedCacheMode fromXmlResourceModel(XmlPersistenceUnitCachingType_2_0 sharedCacheMode) {
- if (sharedCacheMode == null) {
- return null;
- }
- switch (sharedCacheMode) {
- case ALL:
- return ALL;
- case NONE:
- return NONE;
- case ENABLE_SELECTIVE:
- return ENABLE_SELECTIVE;
- case DISABLE_SELECTIVE:
- return DISABLE_SELECTIVE;
- case UNSPECIFIED:
- return UNSPECIFIED;
- default:
- throw new IllegalArgumentException("unknown validation mode: " + sharedCacheMode); //$NON-NLS-1$
- }
- }
-
- public static XmlPersistenceUnitCachingType_2_0 toXmlResourceModel(SharedCacheMode sharedCacheMode) {
- if (sharedCacheMode == null) {
- return null;
- }
- switch (sharedCacheMode) {
- case ALL:
- return XmlPersistenceUnitCachingType_2_0.ALL;
- case NONE:
- return XmlPersistenceUnitCachingType_2_0.NONE;
- case ENABLE_SELECTIVE:
- return XmlPersistenceUnitCachingType_2_0.ENABLE_SELECTIVE;
- case DISABLE_SELECTIVE:
- return XmlPersistenceUnitCachingType_2_0.DISABLE_SELECTIVE;
- case UNSPECIFIED:
- return XmlPersistenceUnitCachingType_2_0.UNSPECIFIED;
- default:
- throw new IllegalArgumentException("unknown shared cache mode: " + sharedCacheMode); //$NON-NLS-1$
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/ValidationMode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/ValidationMode.java
deleted file mode 100644
index d3b08c63e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/context/persistence/options/ValidationMode.java
+++ /dev/null
@@ -1,63 +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.core.jpa2.context.persistence.options;
-
-import org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_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.
- *
- * @version 2.3
- * @since 2.3
- */
-public enum ValidationMode
-{
- AUTO(XmlPersistenceUnitValidationModeType_2_0.AUTO),
- CALLBACK(XmlPersistenceUnitValidationModeType_2_0.CALLBACK),
- NONE(XmlPersistenceUnitValidationModeType_2_0.NONE);
-
- private XmlPersistenceUnitValidationModeType_2_0 xmlEnumValue;
-
- ValidationMode(XmlPersistenceUnitValidationModeType_2_0 xmlEnumValue) {
- if (xmlEnumValue == null) {
- throw new NullPointerException();
- }
- this.xmlEnumValue = xmlEnumValue;
- }
-
- public XmlPersistenceUnitValidationModeType_2_0 getXmlEnumValue() {
- return this.xmlEnumValue;
- }
-
-
- // ********** static methods **********
-
- public static ValidationMode fromXmlResourceModel(XmlPersistenceUnitValidationModeType_2_0 xmlValidationMode) {
- return (xmlValidationMode == null) ? null : fromXmlResourceModel_(xmlValidationMode);
- }
-
- private static ValidationMode fromXmlResourceModel_(XmlPersistenceUnitValidationModeType_2_0 xmlValidationMode) {
- for (ValidationMode validationMode : ValidationMode.values()) {
- if (validationMode.getXmlEnumValue().equals(xmlValidationMode)) {
- return validationMode;
- }
- }
- return null;
- }
-
- public static XmlPersistenceUnitValidationModeType_2_0 toXmlResourceModel(ValidationMode validationMode) {
- return (validationMode == null) ? null : validationMode.getXmlEnumValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Access2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Access2_0Annotation.java
deleted file mode 100644
index ca47cf6614..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Access2_0Annotation.java
+++ /dev/null
@@ -1,55 +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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.AccessType;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.Access
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 Access2_0Annotation
- extends Annotation
-{
-
- String ANNOTATION_NAME = JPA2_0.ACCESS;
-
- /**
- * Corresponds to the 'value' element of the Access annotation.
- * Returns null if the element does not exist in Java.
- */
- AccessType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Access annotation.
- * Set to null to remove the element.
- */
- void setValue(AccessType access);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Access annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/AssociationOverride2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/AssociationOverride2_0Annotation.java
deleted file mode 100644
index 35e61f5c78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/AssociationOverride2_0Annotation.java
+++ /dev/null
@@ -1,51 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JoinTableAnnotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.AssociationOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 AssociationOverride2_0Annotation
- extends AssociationOverrideAnnotation
-{
-
- /**
- * Corresponds to the 'joinTable' element of the AssociationOverride annotation.
- * Return null if the element does not exist in Java.
- */
- JoinTableAnnotation getJoinTable();
- String JOIN_TABLE_PROPERTY = "joinTable"; //$NON-NLS-1$
-
- JoinTableAnnotation getNonNullJoinTable();
-
- /**
- * Add the 'joinTable' element to the AssociationOverride annotation.
- */
- JoinTableAnnotation addJoinTable();
-
- /**
- * Remove the 'joinTable' element from the AssociationOverride annotation.
- */
- void removeJoinTable();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Cacheable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Cacheable2_0Annotation.java
deleted file mode 100644
index a5ad1823a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/Cacheable2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.Cacheable
- * <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 Cacheable2_0Annotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA2_0.CACHEABLE;
-
- /**
- * Corresponds to the 'value' element of the Cacheable 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 Cacheable 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 Cacheable annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/CollectionTable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/CollectionTable2_0Annotation.java
deleted file mode 100644
index 1e785f6855..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/CollectionTable2_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.ReferenceTableAnnotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.CollectionTable
- * <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 CollectionTable2_0Annotation
- extends ReferenceTableAnnotation
-{
- String ANNOTATION_NAME = JPA2_0.COLLECTION_TABLE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ElementCollection2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ElementCollection2_0Annotation.java
deleted file mode 100644
index e850473da4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ElementCollection2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.ElementCollection
- * <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 ElementCollection2_0Annotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA2_0.ELEMENT_COLLECTION;
-
- /**
- * Corresponds to the 'targetClass' element of the element collection
- * annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ElementCollection(targetClass=Employee.class)
- * </pre>
- * will return "Employee"
- */
- String getTargetClass();
- String TARGET_CLASS_PROPERTY = "targetClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'targetClass' element of the element collection
- * annotation.
- * Set to null to remove the element.
- */
- void setTargetClass(String targetClass);
-
- /**
- * Return the {@link TextRange} for the 'targetClass' element. If the element
- * does not exist return the {@link TextRange} for the element collection annotation.
- */
- TextRange getTargetClassTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified target class name as resolved by the AST's bindings.
- * <pre>
- * &#64;ElementCollection(targetClass=Employee.class)
- * </pre>
- * will return "model.Employee" if there is an import for model.Employee.
- * @return
- */
- String getFullyQualifiedTargetClassName();
- String FULLY_QUALIFIED_TARGET_CLASS_NAME_PROPERTY = "fullyQualifiedTargetClassName"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the 'fetch' element of the element collection 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 element collection 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 element collection annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/GeneratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/GeneratedAnnotation.java
deleted file mode 100644
index 382a0635ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/GeneratedAnnotation.java
+++ /dev/null
@@ -1,117 +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.core.jpa2.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.resource.java.Annotation;
-
-/**
- * Corresponds to the Java 6 annotation
- * <code>javax.annotation.Generated</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.3
- * @since 2.3
- */
-public interface GeneratedAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = "javax.annotation.Generated"; // requires JRE 1.6 //$NON-NLS-1$
- String VALUE_ELEMENT_NAME = "value"; //$NON-NLS-1$
- String DATE_ELEMENT_NAME = "date"; //$NON-NLS-1$
- String COMMENTS_ELEMENT_NAME = "comments"; //$NON-NLS-1$
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- * Return <code>null</code> if the element does not exist in the annotation.
- */
- ListIterator<String> values();
- String VALUES_LIST = "values"; //$NON-NLS-1$
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- int valuesSize();
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- String getValue(int index);
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- void addValue(String value);
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- void addValue(int index, String value);
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- void moveValue(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- void removeValue(String value);
-
- /**
- * Corresponds to the <code>value<code> element of the <code>Generated</code>
- * annotation.
- */
- void removeValue(int index);
-
- /**
- * Corresponds to the <code>date</code> element of the <code>Generated</code>
- * annotation.
- * Return <code>null</code> if the element does not exist in the annotation.
- */
- String getDate();
- String DATE_PROPERTY = "date"; //$NON-NLS-1$
-
- /**
- * Corresponds to the <code>date</code> element of the <code>Generated</code>
- * annotation.
- * Set to <code>null</code> to remove the element.
- */
- void setDate(String date);
-
- /**
- * Corresponds to the <code>comments</code> element of the <code>Generated</code>
- * annotation.
- * Return <code>null</code> if the element does not exist in the annotation.
- */
- String getComments();
- String COMMENTS_PROPERTY = "comments"; //$NON-NLS-1$
-
- /**
- * Corresponds to the <code>comments</code> element of the <code>Generated</code>
- * annotation.
- * Set to <code>null</code> to remove the element.
- */
- void setComments(String comments);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java
deleted file mode 100644
index ebd061471b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JPA2_0.java
+++ /dev/null
@@ -1,147 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.JPA;
-
-/**
- * JPA 2.0 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 2.3
- * @since 2.3
- */
-@SuppressWarnings("nls")
-public interface JPA2_0
-{
- // JPA package
- String PACKAGE = "javax.persistence";
- String PACKAGE_ = PACKAGE + '.';
-
-
- // ********** API **********
-
- // JPA 2.0 annotations
- String ACCESS = PACKAGE_ + "Access";
- String ACCESS__VALUE = "value";
-
- // ASSOCIATION_OVERRIDE
- String ASSOCIATION_OVERRIDE__JOIN_TABLE = "joinTable";
-
- String CACHEABLE = PACKAGE_ + "Cacheable";
- String CACHEABLE__VALUE = "value";
-
- String CASCADE_TYPE__DETACH = JPA.CASCADE_TYPE_ + "DETACH";
-
- String COLLECTION_TABLE = PACKAGE_ + "CollectionTable";
- String COLLECTION_TABLE__NAME = "name";
- String COLLECTION_TABLE__SCHEMA = "schema";
- String COLLECTION_TABLE__CATALOG = "catalog";
- String COLLECTION_TABLE__JOIN_COLUMNS = "joinColumns";
- String COLLECTION_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
-
- String ELEMENT_COLLECTION = PACKAGE_ + "ElementCollection";
- String ELEMENT_COLLECTION__FETCH = "fetch";
- String ELEMENT_COLLECTION__TARGET_CLASS = "targetClass";
-
- String MAP_KEY_CLASS = PACKAGE_ + "MapKeyClass";
- String MAP_KEY_CLASS__VALUE = "value";
-
- String MAP_KEY_COLUMN = PACKAGE_ + "MapKeyColumn";
- String MAP_KEY_COLUMN__NAME = "name";
- String MAP_KEY_COLUMN__UNIQUE = "unique";
- String MAP_KEY_COLUMN__NULLABLE = "nullable";
- String MAP_KEY_COLUMN__INSERTABLE = "insertable";
- String MAP_KEY_COLUMN__UPDATABLE = "updatable";
- String MAP_KEY_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String MAP_KEY_COLUMN__TABLE = "table";
- String MAP_KEY_COLUMN__LENGTH = "length";
- String MAP_KEY_COLUMN__PRECISION = "precision";
- String MAP_KEY_COLUMN__SCALE = "scale";
-
- String MAP_KEY_ENUMERATED = PACKAGE_ + "MapKeyEnumerated";
- String MAP_KEY_ENUMERATED__VALUE = "value";
-
- String MAP_KEY_JOIN_COLUMN = PACKAGE_ + "MapKeyJoinColumn";
- String MAP_KEY_JOIN_COLUMN__NAME = "name";
- String MAP_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String MAP_KEY_JOIN_COLUMN__UNIQUE = "unique";
- String MAP_KEY_JOIN_COLUMN__NULLABLE = "nullable";
- String MAP_KEY_JOIN_COLUMN__INSERTABLE = "insertable";
- String MAP_KEY_JOIN_COLUMN__UPDATABLE = "updatable";
- String MAP_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String MAP_KEY_JOIN_COLUMN__TABLE = "table";
-
- String MAP_KEY_JOIN_COLUMNS = PACKAGE_ + "MapKeyJoinColumns";
- String MAP_KEY_JOIN_COLUMNS__VALUE = "value";
-
- String MAP_KEY_TEMPORAL = PACKAGE_ + "MapKeyTemporal";
- String MAP_KEY_TEMPORAL__VALUE = "value";
-
- String MAPS_ID = PACKAGE_ + "MapsId";
- String MAPS_ID__VALUE = "value";
-
- // NAMED_QUERY
- String NAMED_QUERY__LOCK_MODE = "lockMode";
-
- // ONE_TO_MANY
- String ONE_TO_MANY__ORPHAN_REMOVAL = "orphanRemoval";
-
- // ONE_TO_ONE
- String ONE_TO_ONE__ORPHAN_REMOVAL = "orphanRemoval";
-
- String ORDER_COLUMN = PACKAGE_ + "OrderColumn";
- String ORDER_COLUMN__NAME = "name";
- String ORDER_COLUMN__NULLABLE = "nullable";
- String ORDER_COLUMN__INSERTABLE = "insertable";
- String ORDER_COLUMN__UPDATABLE = "updatable";
- String ORDER_COLUMN__COLUMN_DEFINITION = "columnDefinition";
-
- // SEQUENCE_GENERATOR
- String SEQUENCE_GENERATOR__CATALOG = "catalog";
- String SEQUENCE_GENERATOR__SCHEMA = "schema";
-
-
- // JPA 2.0 enums
- String ACCESS_TYPE = PACKAGE_ + "AccessType";
- String ACCESS_TYPE_ = ACCESS_TYPE + '.';
- String ACCESS_TYPE__FIELD = ACCESS_TYPE_ + "FIELD";
- String ACCESS_TYPE__PROPERTY = ACCESS_TYPE_ + "PROPERTY";
-
- String LOCK_MODE_TYPE = PACKAGE_ + "LockModeType";
- String LOCK_MODE_TYPE_ = LOCK_MODE_TYPE + '.';
- String LOCK_MODE_TYPE__READ = LOCK_MODE_TYPE_ + "READ";
- String LOCK_MODE_TYPE__WRITE = LOCK_MODE_TYPE_ + "WRITE";
- String LOCK_MODE_TYPE__OPTIMISTIC = LOCK_MODE_TYPE_ + "OPTIMISTIC";
- String LOCK_MODE_TYPE__OPTIMISTIC_FORCE_INCREMENT = LOCK_MODE_TYPE_ + "OPTIMISTIC_FORCE_INCREMENT";
- String LOCK_MODE_TYPE__PESSIMISTIC_READ = LOCK_MODE_TYPE_ + "PESSIMISTIC_READ";
- String LOCK_MODE_TYPE__PESSIMISTIC_WRITE = LOCK_MODE_TYPE_ + "PESSIMISTIC_WRITE";
- String LOCK_MODE_TYPE__PESSIMISTIC_FORCE_INCREMENT = LOCK_MODE_TYPE_ + "PESSIMISTIC_FORCE_INCREMENT";
- String LOCK_MODE_TYPE__NONE = LOCK_MODE_TYPE_ + "NONE";
-
- // JPA 2.0 metamodel
- String METAMODEL_PACKAGE = PACKAGE_ + "metamodel";
- String METAMODEL_PACKAGE_ = METAMODEL_PACKAGE + '.';
-
- String STATIC_METAMODEL = METAMODEL_PACKAGE_ + "StaticMetamodel";
- String STATIC_METAMODEL__VALUE = "value";
-
- String SINGULAR_ATTRIBUTE = METAMODEL_PACKAGE_ + "SingularAttribute";
-
- String COLLECTION_ATTRIBUTE = METAMODEL_PACKAGE_ + "CollectionAttribute";
- String LIST_ATTRIBUTE = METAMODEL_PACKAGE_ + "ListAttribute";
- String MAP_ATTRIBUTE = METAMODEL_PACKAGE_ + "MapAttribute";
- String SET_ATTRIBUTE = METAMODEL_PACKAGE_ + "SetAttribute";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JavaResourcePersistentType2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JavaResourcePersistentType2_0.java
deleted file mode 100644
index b00ba0b4c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/JavaResourcePersistentType2_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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * JPA 2.0 Java source code or binary persistent type.
- * <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 JavaResourcePersistentType2_0
- extends JavaResourcePersistentType
-{
-
- // ********** metamodel **********
-
- /**
- * Return the <code>javax.annotation.Generated</code> annotation.
- */
- GeneratedAnnotation getGeneratedAnnotation();
-
- /**
- * Return whether the type is a metamodel top-level type generated in the
- * specified source folder.
- */
- boolean isGeneratedMetamodelTopLevelType(IPackageFragmentRoot sourceFolder);
-
- /**
- * Return whether the type is a generated metamodel top-level type.
- * The type is generated and either it or one of its nested types is a
- * metamodel type.
- */
- boolean isGeneratedMetamodelTopLevelType();
-
- /**
- * Return whether the type is a metamodel type.
- */
- boolean isMetamodel();
-
- /**
- * The value used to tag a generated type:
- * <pre>
- * &#64;javax.annotation.Generated(value="Dali", date="2009-11-23T13:56:06.171-0500")
- * </pre>
- */
- String METAMODEL_GENERATED_ANNOTATION_VALUE = "Dali"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/LockModeType_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/LockModeType_2_0.java
deleted file mode 100644
index c03bb3b07a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/LockModeType_2_0.java
+++ /dev/null
@@ -1,72 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-
-/**
- * Corresponds to the JPA 2.0 enum
- * javax.persistence.LockModeType
- * <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 enum LockModeType_2_0 {
-
- READ(JPA2_0.LOCK_MODE_TYPE__READ),
- WRITE(JPA2_0.LOCK_MODE_TYPE__WRITE),
- OPTIMISTIC(JPA2_0.LOCK_MODE_TYPE__OPTIMISTIC),
- OPTIMISTIC_FORCE_INCREMENT(JPA2_0.LOCK_MODE_TYPE__OPTIMISTIC_FORCE_INCREMENT),
- PESSIMISTIC_READ(JPA2_0.LOCK_MODE_TYPE__PESSIMISTIC_READ),
- PESSIMISTIC_WRITE(JPA2_0.LOCK_MODE_TYPE__PESSIMISTIC_WRITE),
- PESSIMISTIC_FORCE_INCREMENT(JPA2_0.LOCK_MODE_TYPE__PESSIMISTIC_FORCE_INCREMENT),
- NONE(JPA2_0.LOCK_MODE_TYPE__NONE);
-
-
- private String javaAnnotationValue;
-
- LockModeType_2_0(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static LockModeType_2_0 fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static LockModeType_2_0 fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (LockModeType_2_0 lockModeType : LockModeType_2_0.values()) {
- if (lockModeType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return lockModeType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(LockModeType_2_0 lockModeType) {
- return (lockModeType == null) ? null : lockModeType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToMany2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToMany2_0Annotation.java
deleted file mode 100644
index 0ed9d313a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToMany2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToMany2_0Annotation
- extends ManyToManyAnnotation, RelationshipMapping2_0Annotation
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToOne2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToOne2_0Annotation.java
deleted file mode 100644
index 10acfe788f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/ManyToOne2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ManyToOne2_0Annotation
- extends ManyToOneAnnotation, RelationshipMapping2_0Annotation
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyClass2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyClass2_0Annotation.java
deleted file mode 100644
index 94d11ad6a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyClass2_0Annotation.java
+++ /dev/null
@@ -1,69 +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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.MapKeyClass
- * <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 MapKeyClass2_0Annotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_CLASS;
-
- /**
- * Corresponds to the 'value' element of the MapKeyClass annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;MapKeyClass(value=Employee.class)
- * </pre>
- * will return "Employee"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the MapKeyClass annotation.
- * Set to null to remove the element.
- * This will also remove the MapKeyClass annotation itself.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the IdClass annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified MapKeyClass name as resolved by the AST's bindings.
- * <pre>
- * &#64;IdClass(Employee.class)
- * </pre>
- * will return "model.Employee" if there is an import for model.Employee.
- */
- String getFullyQualifiedClassName();
- String FULLY_QUALIFIED_CLASS_NAME_PROPERTY = "fullyQualifiedClassName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyColumn2_0Annotation.java
deleted file mode 100644
index e552856ef0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyColumn2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.MapKeyColumn
- * <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 MapKeyColumn2_0Annotation
- extends ColumnAnnotation
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_COLUMN;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyEnumerated2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyEnumerated2_0Annotation.java
deleted file mode 100644
index 592a145dae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyEnumerated2_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.EnumeratedAnnotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.MapKeyEnumerated
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapKeyEnumerated2_0Annotation
- extends EnumeratedAnnotation
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_ENUMERATED;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumn2_0Annotation.java
deleted file mode 100644
index db2a43e815..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumn2_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.BaseJoinColumnAnnotation;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.MapKeyJoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapKeyJoinColumn2_0Annotation
- extends BaseJoinColumnAnnotation
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_JOIN_COLUMN;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumns2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumns2_0Annotation.java
deleted file mode 100644
index 7937a8ce0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyJoinColumns2_0Annotation.java
+++ /dev/null
@@ -1,33 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.ContainerAnnotation;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.MapKeyJoinColumns
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapKeyJoinColumns2_0Annotation
- extends ContainerAnnotation<NestableMapKeyJoinColumnAnnotation>
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_JOIN_COLUMNS;
-
- String MAP_KEY_JOIN_COLUMNS_LIST = "mapKeyJoinColumns"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyTemporal2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyTemporal2_0Annotation.java
deleted file mode 100644
index bc7396a353..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapKeyTemporal2_0Annotation.java
+++ /dev/null
@@ -1,32 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.MapKeyTemporal
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapKeyTemporal2_0Annotation
- extends TemporalAnnotation
-{
- String ANNOTATION_NAME = JPA2_0.MAP_KEY_TEMPORAL;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapsId2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapsId2_0Annotation.java
deleted file mode 100644
index 6e34f37dcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/MapsId2_0Annotation.java
+++ /dev/null
@@ -1,59 +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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.MapsId
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 MapsId2_0Annotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA2_0.MAPS_ID;
-
- /**
- * Corresponds to the 'value' element of the MapsId annotation.
- * Returns 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 MapsId annotation.
- * Set to null to remove the element.
- */
- void setValue(String newValue);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the MapsId 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.core/src/org/eclipse/jpt/core/jpa2/resource/java/NamedQuery2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NamedQuery2_0Annotation.java
deleted file mode 100644
index 73bb8aa536..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NamedQuery2_0Annotation.java
+++ /dev/null
@@ -1,59 +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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.NamedQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NamedQuery2_0Annotation
- extends NamedQueryAnnotation
-{
- // ********** lockMode **********
- /**
- * Corresponds to the 'lockMode' element of the NamedQuery annotation.
- * Return null if the element does not exist in Java.
- */
- LockModeType_2_0 getLockMode();
- String LOCK_MODE_PROPERTY = "lockMode"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'lockMode' element of the NamedQuery annotation.
- * Set to null to remove the element. If no other elements exist
- * the NamedQuery annotation will be removed as well.
- */
- void setLockMode(LockModeType_2_0 lockMode);
-
- /**
- * Return the {@link TextRange} for the 'lockMode' element. If the element
- * does not exist return the {@link TextRange} for the NamedQuery annotation.
- */
- TextRange getLockModeTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'lockMode' element.
- * Return false if the element does not exist.
- */
- boolean lockModeTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NestableMapKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NestableMapKeyJoinColumnAnnotation.java
deleted file mode 100644
index a099578e8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/NestableMapKeyJoinColumnAnnotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.MapKeyJoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableMapKeyJoinColumnAnnotation
- extends MapKeyJoinColumn2_0Annotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToMany2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToMany2_0Annotation.java
deleted file mode 100644
index 856ddece4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToMany2_0Annotation.java
+++ /dev/null
@@ -1,26 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToMany2_0Annotation
- extends OneToManyAnnotation, OrphanRemovable2_0Annotation, RelationshipMapping2_0Annotation
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToOne2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToOne2_0Annotation.java
deleted file mode 100644
index 769a5243bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OneToOne2_0Annotation.java
+++ /dev/null
@@ -1,26 +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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OneToOne2_0Annotation
- extends OneToOneAnnotation, OrphanRemovable2_0Annotation, RelationshipMapping2_0Annotation
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrderColumn2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrderColumn2_0Annotation.java
deleted file mode 100644
index ae46d2adbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrderColumn2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.NamedColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.OrderColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrderColumn2_0Annotation
- extends NamedColumnAnnotation
-{
-
- String ANNOTATION_NAME = JPA2_0.ORDER_COLUMN;
-
- /**
- * Corresponds to the 'nullable' element of the OrderColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNullable();
- String NULLABLE_PROPERTY = "nullable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nullable' element of the OrderColumn annotation.
- * Set to null to remove the element.
- */
- void setNullable(Boolean nullable);
-
- /**
- * Return the {@link TextRange} for the 'nullable' element. If the element
- * does not exist return the {@link TextRange} for the OrderColumn annotation.
- */
- TextRange getNullableTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'insertable' element of the OrderColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getInsertable();
- String INSERTABLE_PROPERTY = "insertable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'insertable' element of the OrderColumn annotation.
- * Set to null to remove the element.
- */
- void setInsertable(Boolean insertable);
-
- /**
- * Return the {@link TextRange} for the 'insertable' element. If the element
- * does not exist return the {@link TextRange} for the OrderColumn annotation.
- */
- TextRange getInsertableTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'updatable' element of the OrderColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getUpdatable();
- String UPDATABLE_PROPERTY = "updatable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'updatable' element of the OrderColumn annotation.
- * Set to null to remove the element.
- */
- void setUpdatable(Boolean updatable);
-
- /**
- * Return the {@link TextRange} for the 'updatable' element. If the element
- * does not exist return the {@link TextRange} for the OrderColumn annotation.
- */
- TextRange getUpdatableTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrphanRemovable2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrphanRemovable2_0Annotation.java
deleted file mode 100644
index c9a9e786f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/OrphanRemovable2_0Annotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OrphanRemovable2_0Annotation
-{
- // ********** orphan removal **********
- /**
- * Corresponds to the orphanRemoval element of the OneToMany annotation.
- * Returns null if the orphanRemoval element does not exist in java.
- */
- Boolean getOrphanRemoval();
- String ORPHAN_REMOVAL_PROPERTY = "orphanRemoval"; //$NON-NLS-1$
-
- /**
- * Corresponds to the orphanRemoval element of the OneToMany annotation.
- * Set to null to remove the orphanRemoval element.
- */
- void setOrphanRemoval(Boolean orphanRemoval);
-
- /**
- * Return the {@link TextRange} for the orphanRemoval element. If the orphanRemoval element
- * does not exist return the {@link TextRange} for the OneToMany annotation.
- */
- TextRange getOrphanRemovalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/RelationshipMapping2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/RelationshipMapping2_0Annotation.java
deleted file mode 100644
index 7afcf1c3ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/RelationshipMapping2_0Annotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.RelationshipMappingAnnotation;
-
-/**
- * Common protocol among 2.0
- * javax.persistence.ManyToOne
- * javax.persistence.ManyToMany
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 RelationshipMapping2_0Annotation
- extends RelationshipMappingAnnotation
-{
-
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadeDetach();
- String CASCADE_DETACH_PROPERTY = "cascadeDetach"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadeDetach(boolean detach);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/SequenceGenerator2_0Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/SequenceGenerator2_0Annotation.java
deleted file mode 100644
index 84aa0622bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/SequenceGenerator2_0Annotation.java
+++ /dev/null
@@ -1,88 +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.core.jpa2.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * javax.persistence.SequenceGenerator
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 SequenceGenerator2_0Annotation
- extends SequenceGeneratorAnnotation
-{
- // ********** catalog **********
- /**
- * Corresponds to the 'catalog' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getCatalog();
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'catalog' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setCatalog(String catalog);
-
- /**
- * Return the {@link TextRange} for the 'catalog' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getCatalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'catalog' element.
- * Return false if the element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
-
- // ********** schema **********
-
- /**
- * Corresponds to the 'schema' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getSchema();
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'schema' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setSchema(String schema);
-
- /**
- * Return the {@link TextRange} for the 'schema' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getSchemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'schema' element.
- * Return false if the element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/StaticMetamodelAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/StaticMetamodelAnnotation.java
deleted file mode 100644
index fdb3c2771a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/jpa2/resource/java/StaticMetamodelAnnotation.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.core.jpa2.resource.java;
-
-import org.eclipse.jpt.core.resource.java.Annotation;
-
-/**
- * Corresponds to the JPA 2.0 annotation
- * <code>javax.persistence.metamodel.StaticMetamodel</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.3
- * @since 2.3
- */
-public interface StaticMetamodelAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA2_0.STATIC_METAMODEL;
-
- /**
- * Corresponds to the <code>value</code> element of the <code>StaticMetamodel</code> annotation.
- * Return <code>null</code> if the element does not exist in Java.
- * Return the portion of the value preceding <code>".class"</code>.
- * <pre>
- * &#64;StaticMetamodel(value=Employee.class)
- * </pre>
- * will return <code>"Employee"</code>.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the <code>value</code> element of the <code>StaticMetamodel</code> annotation.
- * Set to <code>null</code> to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the <code>StaticMetamodel</code>'s fully-qualified class name as resolved by
- * the AST's bindings.
- * <pre>
- * &#64;StaticMetamodel(Employee.class)
- * </pre>
- * will return <code>"model.Employee"</code> if there is an import for <code>model.Employee</code>.
- */
- String getFullyQualifiedClassName();
- String FULLY_QUALIFIED_CLASS_NAME_PROPERTY = "fullyQualifiedClassName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractXmlResourceProvider.java
deleted file mode 100644
index 803764e6b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/AbstractXmlResourceProvider.java
+++ /dev/null
@@ -1,371 +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.core.resource;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.List;
-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.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-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.URIConverter;
-import org.eclipse.jem.util.emf.workbench.FlexibleProjectResourceSet;
-import org.eclipse.jem.util.emf.workbench.ProjectResourceSet;
-import org.eclipse.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
-import org.eclipse.wst.common.componentcore.internal.impl.WTPResourceFactoryRegistry;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateInputProvider;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidator;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorImpl;
-import org.eclipse.wst.common.internal.emfworkbench.validateedit.ResourceStateValidatorPresenter;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 abstract class AbstractXmlResourceProvider
- implements JpaXmlResourceProvider, ResourceStateInputProvider, ResourceStateValidator
-{
- protected IProject project;
-
- protected URI fileUri;
-
- protected JpaXmlResource resource;
-
- protected IContentType contentType;
-
- protected final ResourceAdapter resourceAdapter = new ResourceAdapter();
-
- protected final ListenerList<JpaXmlResourceProviderListener> listenerList = new ListenerList<JpaXmlResourceProviderListener>(JpaXmlResourceProviderListener.class);
-
- protected ResourceStateValidator stateValidator;
-
-
- /**
- * Create a new AbstractResourceModelProvider for the given project and
- * resourcePath. The resourcePath may be either a) an absolute platform
- * resource path (e.g. "MyProject/src/META-INF/foobar.xml") or b) a relative
- * deploy path (e.g. "META-INF/foobar.xml".) In either case,
- * {@link #buildFileUri(IPath)} will attempt to build an absolutely pathed
- * URI for the given path.
- */
- public AbstractXmlResourceProvider(IProject project, IPath resourcePath, IContentType contentType) {
- super();
- this.project = project;
- this.fileUri = buildFileUri(resourcePath);
- this.contentType = contentType;
- }
-
- protected URI buildFileUri(IPath resourcePath) {
- URI resourceUri = null;
-
- if (resourcePath.isAbsolute()) {
- resourceUri = URI.createPlatformResourceURI(resourcePath.toString(), false);
- }
- else {
- resourceUri = getModuleURI(URI.createURI(resourcePath.toString()));
- }
-
- URIConverter uriConverter = getResourceSet().getURIConverter();
- return uriConverter.normalize(resourceUri);
- }
-
- /**
- * Return the resource, if it exists. If no file exists for this resource,
- * this will return a stub resource. You must call #createResource() to
- * create the file on the file system.
- */
- public JpaXmlResource getXmlResource() {
- if (this.resource == null) {
- JpaXmlResource newResource = (JpaXmlResource) WorkbenchResourceHelper.getOrCreateResource(this.fileUri, getResourceSet());
- //EMF caches resources based on URI. If the resource has changed content types (say the schema was changed
- //from orm to eclipselink-orm), then the resource will be of the wrong type and we need to create a new one.
- if (newResource.getContentType().equals(this.contentType)) {
- this.resource = newResource;
- }
- else {
- this.createResourceAndLoad();
- }
- }
- return this.resource;
- }
-
- protected JpaXmlResource createResourceAndLoad() {
- this.resource = createResource();
- this.loadResource();
- return this.resource;
- }
-
- protected JpaXmlResource createResource() {
- Resource.Factory resourceFactory =
- WTPResourceFactoryRegistry.INSTANCE.getFactory(this.fileUri, this.contentType.getDefaultDescription());
- return (JpaXmlResource) ((FlexibleProjectResourceSet) getResourceSet()).createResource(this.fileUri, resourceFactory);
- }
-
- protected void loadResource() {
- try {
- this.resource.load(((FlexibleProjectResourceSet) getResourceSet()).getLoadOptions());
- }
- catch (IOException e) {
- JptCorePlugin.log(e);
- }
- }
-
- protected void createResourceAndUnderlyingFile(Object config) {
- this.resource = createResource();
- if (this.resource.fileExists()) { //always possible that the file already exists when the jpa facet is added
- loadResource();
- }
- else {
- populateRoot(config);
- try {
- this.resource.saveIfNecessary(); //this writes out the file
- }
- catch (Exception e) {
- JptCorePlugin.log(e);
- }
- }
- }
-
- /**
- * This will actually create the underlying file and the JpaXmlResource that corresponds to it.
- * It also populates the root of the file.
- * @param config - A configuration object used to specify options for creation of the resource
- */
- public JpaXmlResource createFileAndResource(final Object config) throws CoreException {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) {
- createResourceAndUnderlyingFile(config);
- }
- };
- workspace.run(runnable, this.project, IWorkspace.AVOID_UPDATE, null);
- return this.resource;
- }
-
- protected URI getModuleURI(URI uri) {
- URI moduleuri = ModuleURIUtil.fullyQualifyURI(this.project);
- IPath requestPath = new Path(moduleuri.path()).append(new Path(uri.path()));
- URI resourceURI = URI.createURI(PlatformURLModuleConnection.MODULE_PROTOCOL + requestPath.toString());
- return resourceURI;
- }
-
- /**
- * Used to optionally fill in the root information of a resource if it does not
- * exist as a file
- */
- protected void populateRoot(Object config) {
- //TODO potentially call resource.populateRoot() instead of the resourceProvider doing this
- }
-
-
- /**
- * minimize the scope of the suppressed warnings
- */
- protected EList<EObject> getResourceContents() {
- return this.resource.getContents();
- }
-
- public void addListener(JpaXmlResourceProviderListener listener) {
- if (this.listenerList.isEmpty()) {
- engageResource();
- }
- this.listenerList.add(listener);
- }
-
- public void removeListener(JpaXmlResourceProviderListener listener) {
- this.listenerList.remove(listener);
- if (this.listenerList.isEmpty()) {
- disengageResource();
- }
- }
-
- private void engageResource() {
- if (this.resource != null) {
- this.resource.eAdapters().add(this.resourceAdapter);
- }
- }
-
- private void disengageResource() {
- if (this.resource != null) {
- this.resource.eAdapters().remove(this.resourceAdapter);
- }
- }
-
- protected ProjectResourceSet getResourceSet() {
- return (ProjectResourceSet) WorkbenchResourceHelperBase.getResourceSet(project);
- }
-
- public IProject getProject() {
- return this.project;
- }
-
- protected void resourceIsLoadedChanged(Resource aResource, boolean oldValue, boolean newValue) {
- if ( ! this.listenerList.isEmpty()) {
- int eventType= newValue ? JpaXmlResourceProviderEvent.RESOURCE_LOADED : JpaXmlResourceProviderEvent.RESOURCE_UNLOADED;
- JpaXmlResourceProviderEvent evt = new JpaXmlResourceProviderEvent(this, eventType);
- notifyListeners(evt);
- }
- }
-
- protected void notifyListeners(JpaXmlResourceProviderEvent event) {
- NotifyRunner notifier = new NotifyRunner(event);
- for (JpaXmlResourceProviderListener listener : this.listenerList.getListeners()) {
- notifier.setListener(listener);
- SafeRunner.run(notifier);
- }
- }
-
- public IStatus validateEdit(Object context) {
- IWorkspace work = ResourcesPlugin.getWorkspace();
- IFile file = WorkbenchResourceHelper.getFile(this.resource);
- if (file != null) {
- IFile[] files = { file };
- if (context == null) {
- context = IWorkspace.VALIDATE_PROMPT;
- }
- return work.validateEdit(files, context);
- }
- return Status.OK_STATUS;
- }
-
- // **************** ResourceStateValidator impl ****************************
-
- public ResourceStateValidator getStateValidator() {
- if (this.stateValidator == null) {
- this.stateValidator = createStateValidator();
- }
- return this.stateValidator;
- }
-
- private ResourceStateValidator createStateValidator() {
- return new ResourceStateValidatorImpl(this);
- }
-
- public void checkActivation(ResourceStateValidatorPresenter presenter) throws CoreException {
- getStateValidator().checkActivation(presenter);
- }
-
- public void lostActivation(ResourceStateValidatorPresenter presenter) throws CoreException {
- getStateValidator().lostActivation(presenter);
- }
-
- public IStatus validateState(ResourceStateValidatorPresenter presenter) throws CoreException {
- if (presenter == null) {
- return Status.OK_STATUS;
- }
- return getStateValidator().validateState(presenter);
- }
-
- public boolean checkSave(ResourceStateValidatorPresenter presenter) throws CoreException {
- return getStateValidator().checkSave(presenter);
- }
-
- public boolean checkReadOnly() {
- return getStateValidator().checkReadOnly();
- }
-
-
- // **************** ResourceStateInputProvider impl ************************
-
- public boolean isDirty() {
- return this.resource.isModified();
- }
-
- @SuppressWarnings("unchecked")
- public List getNonResourceFiles() {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List getNonResourceInconsistentFiles() {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List getResources() {
- return Collections.singletonList(getXmlResource());
- }
-
- @SuppressWarnings("unchecked")
- public void cacheNonResourceValidateState(List roNonResourceFiles) {
- // do nothing
- }
-
-
- // **************** member classes *****************************************
-
- protected class ResourceAdapter extends AdapterImpl {
- @Override
- public void notifyChanged(Notification notification) {
- if ( notification.getEventType() == Notification.SET && notification.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) {
- resourceIsLoadedChanged((Resource) notification.getNotifier(), notification.getOldBooleanValue(), notification.getNewBooleanValue());
- }
- }
- }
-
-
- public static class NotifyRunner implements ISafeRunnable
- {
- private final JpaXmlResourceProviderEvent event;
-
- private JpaXmlResourceProviderListener listener;
-
-
- public NotifyRunner(JpaXmlResourceProviderEvent event) {
- Assert.isNotNull(event);
- this.event = event;
- }
-
-
- public void setListener(JpaXmlResourceProviderListener listener) {
- this.listener = listener;
- }
-
- public void run() throws Exception {
- if (listener != null) {
- listener.modelChanged(event);
- }
- }
-
- public void handleException(Throwable exception) {
- JptCorePlugin.log(exception);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProvider.java
deleted file mode 100644
index 9f0ca0d38f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProvider.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.core.resource;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaXmlResourceProvider
-{
- JpaXmlResource getXmlResource();
-
- IStatus validateEdit(Object context);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderEvent.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderEvent.java
deleted file mode 100644
index afeb867c0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderEvent.java
+++ /dev/null
@@ -1,48 +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.core.resource;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 class JpaXmlResourceProviderEvent
-{
- public final static int RESOURCE_LOADED = 0x1;
-
- public final static int RESOURCE_UNLOADED = 0x2;
-
-
- private JpaXmlResourceProvider modelProvider;
-
- private int type;
-
-
- public JpaXmlResourceProviderEvent(JpaXmlResourceProvider modelProvider, int eventType) {
- super();
- this.modelProvider = modelProvider;
- this.type = eventType;
- }
-
-
- public JpaXmlResourceProvider getModelProvider() {
- return modelProvider;
- }
-
- public int getType() {
- return type;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderListener.java
deleted file mode 100644
index 07f4d14134..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/JpaXmlResourceProviderListener.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.core.resource;
-
-import java.util.EventListener;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaXmlResourceProviderListener
- extends EventListener
-{
- public void modelChanged(JpaXmlResourceProviderEvent event);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java
deleted file mode 100644
index e139450a10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java
+++ /dev/null
@@ -1,67 +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.core.resource.java;
-
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-
-/**
- * Corresponds to the JPA 2.0 enum
- * javax.persistence.AccessType
- * <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.0
- */
-// TODO move to jpa2 package? currently intertwined with 1.0 code...
-public enum AccessType {
-
- FIELD(JPA2_0.ACCESS_TYPE__FIELD),
- PROPERTY(JPA2_0.ACCESS_TYPE__PROPERTY);
-
-
- private String javaAnnotationValue;
-
- AccessType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static AccessType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static AccessType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (AccessType accessType : AccessType.values()) {
- if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return accessType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(AccessType accessType) {
- return (accessType == null) ? null : accessType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
deleted file mode 100644
index b28b635021..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java
+++ /dev/null
@@ -1,55 +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.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 2.3
- * @since 2.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".
- * @see JPA
- */
- 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();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java
deleted file mode 100644
index be4b5ab325..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java
+++ /dev/null
@@ -1,90 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Common behavior for all annotation "containers".
- * This interface is used mainly in
- * {@link org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools}.
- * <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 AnnotationContainer<T extends NestableAnnotation>
-{
- /**
- * Return the corresponding JDT DOM annotation from the specified
- * AST compilation unit. Used as a starting point when traversing the AST.
- */
- org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot);
-
- /**
- * Return the name of the container annotation's element that is used
- * to indicate the nested annotations (typically "value").
- * Used when traversing the AST.
- */
- String getElementName();
-
- /**
- * Return the name of the nested annotations held by the container.
- * Used when traversing the AST.
- */
- String getNestedAnnotationName();
-
- /**
- * Return the nested annotations held by the container.
- */
- Iterable<T> getNestedAnnotations();
-
- /**
- * Return the number of nested annotations held by the container.
- */
- int getNestedAnnotationsSize();
-
- /**
- * Add a nested annotation to the container
- * without firing change notification.
- */
- T addNestedAnnotation();
-
- /**
- * The specified nested annotation was added to the container at the
- * specified index; notify interested parties.
- */
- void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation);
-
- /**
- * Move the nested annotation at the specified source index in the
- * container to the specified target index without firing change notification.
- * Return the moved nested annotation.
- */
- T moveNestedAnnotation(int targetIndex, int sourceIndex);
-
- /**
- * Remove the nested annotation at the specified index from the
- * container without firing change notification.
- */
- T removeNestedAnnotation(int index);
-
- /**
- * Remove the nested annotations starting at the specified index from the
- * container; notify interested parties.
- */
- void syncRemoveNestedAnnotations(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java
deleted file mode 100644
index fe2149d80e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.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.core.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.utility.jdt.Member;
-
-/**
- * Used to build Annotations discovered in the Java source code.
- * To provide new AnnotationDefinitions, create a new JpaPlatform
- * by implementing JpaPlatform and/or extending GenericJpaPlatform.
- *
- * @see Annotation
- * @see org.eclipse.jpt.core.JpaPlatform
- * @see org.eclipse.jpt.core.internal.GenericJpaPlatform
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.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 member.
- */
- Annotation buildAnnotation(JavaResourcePersistentMember parent, Member member);
-
- /**
- * Build and return an annotation for the specified JDT annotation
- * on the specified member.
- */
- Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation);
-
- /**
- * Build and return a "null" annotation for the specified member.
- * 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(JavaResourcePersistentMember parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
deleted file mode 100644
index b4de2adaa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,70 +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.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AssociationOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface AssociationOverrideAnnotation
- extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDE;
-
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<JoinColumnAnnotation> joinColumns();
- String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- int joinColumnsSize();
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- JoinColumnAnnotation joinColumnAt(int index);
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- JoinColumnAnnotation addJoinColumn(int index);
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- void moveJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'joinColumns' element of the AssociationOverride annotation.
- */
- void removeJoinColumn(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java
deleted file mode 100644
index ecdfe84760..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AssociationOverrides
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface AssociationOverridesAnnotation
- extends ContainerAnnotation<NestableAssociationOverrideAnnotation>
-{
- String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDES;
-
- String ASSOCIATION_OVERRIDES_LIST = "associationOverides"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
deleted file mode 100644
index 85dbcb2e96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,50 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AttributeOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface AttributeOverrideAnnotation
- extends OverrideAnnotation
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDE;
-
-
- /**
- * Corresponds to the 'column' element of the AttributeOverride annotation.
- * Return null if the element does not exist in Java.
- */
- ColumnAnnotation getColumn();
- String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
-
- ColumnAnnotation getNonNullColumn();
-
- /**
- * Add the 'column' element to the AttributeOverride annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the 'column' element from the AttributeOverride annotation.
- */
- void removeColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java
deleted file mode 100644
index 526208e885..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AttributeOverrides
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface AttributeOverridesAnnotation
- extends ContainerAnnotation<NestableAttributeOverrideAnnotation>
-{
- String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDES;
-
- String ATTRIBUTE_OVERRIDES_LIST = "attributeOverrides"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
deleted file mode 100644
index 677417c3e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java
+++ /dev/null
@@ -1,137 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface BaseColumnAnnotation
- extends NamedColumnAnnotation
-{
- /**
- * Corresponds to the 'unique' element of the *Column annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getUnique();
- String UNIQUE_PROPERTY = "unique"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'unique' element of the *Column annotation.
- * Set to null to remove the element.
- */
- void setUnique(Boolean unique);
-
- /**
- * Return the {@link TextRange} for the 'unique' element. If the element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getUniqueTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'nullable' element of the *Column annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getNullable();
- String NULLABLE_PROPERTY = "nullable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'nullable' element of the *Column annotation.
- * Set to null to remove the element.
- */
- void setNullable(Boolean nullable);
-
- /**
- * Return the {@link TextRange} for the 'nullable' element. If the element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getNullableTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'insertable' element of the *Column annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getInsertable();
- String INSERTABLE_PROPERTY = "insertable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'insertable' element of the *Column annotation.
- * Set to null to remove the element.
- */
- void setInsertable(Boolean insertable);
-
- /**
- * Return the {@link TextRange} for the 'insertable' element. If the element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getInsertableTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'updatable' element of the *Column annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getUpdatable();
- String UPDATABLE_PROPERTY = "updatable"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'updatable' element of the *Column annotation.
- * Set to null to remove the element.
- */
- void setUpdatable(Boolean updatable);
-
- /**
- * Return the {@link TextRange} for the 'updatable' element. If the element
- * does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getUpdatableTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'table' element of the *Column 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 *Column 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 *Column 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);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java
deleted file mode 100644
index e2afac33e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among
- * javax.persistence.JoinColumn
- * javax.persistence.MapKeyJoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 BaseJoinColumnAnnotation
- extends BaseColumnAnnotation
-{
-
- /**
- * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getReferencedColumnName();
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation.
- * Set to null to remove the element.
- */
- void setReferencedColumnName(String referencedColumnName);
-
- /**
- * Return the {@link TextRange} for the 'referencedColumnName' element. If element
- * does not exist return the {@link TextRange} for the JoinColumn annotation.
- */
- TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'referencedColumnName' element.
- * Return false if the element does not exist.
- */
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseNamedQueryAnnotation.java
deleted file mode 100644
index 0ba120a7a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseNamedQueryAnnotation.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.core.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among:
- * javax.persistence.NamedQuery
- * javax.persistence.NamedNativeQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 BaseNamedQueryAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'name' element of the *Query 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 *Query annotation.
- * Set to null to remove the element.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If element
- * does not exist return the {@link TextRange} for the *Query annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'query' element of the *Query annotation.
- * Return null if the element does not exist in Java.
- */
- String getQuery();
- String QUERY_PROPERTY = "query"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'query' element of the *Query annotation.
- * Set to null to remove the element.
- */
- void setQuery(String query);
-
- /**
- * Return the {@link TextRange} for the 'query' element. If element
- * does not exist return the {@link TextRange} for the *Query annotation.
- */
- TextRange getQueryTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<QueryHintAnnotation> hints();
- String HINTS_LIST = "hints"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- int hintsSize();
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- QueryHintAnnotation hintAt(int index);
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- int indexOfHint(QueryHintAnnotation hint);
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- QueryHintAnnotation addHint(int index);
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- void moveHint(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'hints' element of the *Query annotation.
- */
- void removeHint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java
deleted file mode 100644
index a59881c4ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java
+++ /dev/null
@@ -1,156 +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.core.resource.java;
-
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among:
- * javax.persistence.Table
- * javax.persistence.JoinTable
- * javax.persistence.SecondaryTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 BaseTableAnnotation
- extends Annotation
-{
-
- /**
- * Return true if the table annotation exists in Java, false if it does not.
- */
- boolean isSpecified();
-
- /**
- * Corresponds to the 'name' element of the *Table 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 *Table 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 *Table annotation.
- */
- 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);
-
-
- /**
- * Corresponds to the 'schema' element of the *Table annotation.
- * Return null if the element does not exist in Java.
- */
- String getSchema();
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'schema' element of the *Table annotation.
- * Set to null to remove the element.
- */
- void setSchema(String schema);
-
- /**
- * Return the {@link TextRange} for the 'schema' element. If the element
- * does not exist return the {@link TextRange} for the *Table annotation.
- */
- TextRange getSchemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'schema' element.
- * Return false if the element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'catalog' element of the *Table annotation.
- * Return null if the element does not exist in Java.
- */
- String getCatalog();
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'catalog' element of the *Table annotation.
- * Set to null to remove the element.
- */
- void setCatalog(String catalog);
-
- /**
- * Return the {@link TextRange} for the 'catalog' element. If the element
- * does not exist return the {@link TextRange} for the *Table annotation.
- */
- TextRange getCatalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'catalog' element.
- * Return false if the element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- int uniqueConstraintsSize();
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- UniqueConstraintAnnotation uniqueConstraintAt(int index);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- UniqueConstraintAnnotation addUniqueConstraint(int index);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the *Table annotation.
- */
- void removeUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java
deleted file mode 100644
index 4222b6342c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java
+++ /dev/null
@@ -1,72 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Basic
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface BasicAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.BASIC;
-
- /**
- * Corresponds to the 'fetch' element of the Basic 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 Basic 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 Basic annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'optional' element of the Basic 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 Basic 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 Basic annotation.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java
deleted file mode 100644
index 3b20066fb7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java
+++ /dev/null
@@ -1,106 +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.core.resource.java;
-
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-/**
- * Corresponds to the JPA 1.0/2.0 enum
- * javax.persistence.CascadeType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum CascadeType {
-
- ALL(JPA.CASCADE_TYPE__ALL),
- PERSIST(JPA.CASCADE_TYPE__PERSIST),
- MERGE(JPA.CASCADE_TYPE__MERGE),
- REMOVE(JPA.CASCADE_TYPE__REMOVE),
- REFRESH(JPA.CASCADE_TYPE__REFRESH),
- DETACH(JPA2_0.CASCADE_TYPE__DETACH); //added in JPA 2.0
-
-
- private String javaAnnotationValue;
-
- CascadeType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CascadeType[] fromJavaAnnotationValues(Object[] javaAnnotationValues) {
- if (javaAnnotationValues == null) {
- return EMPTY_CASCADE_TYPE_ARRAY;
- }
- if (javaAnnotationValues.length == 0) {
- return EMPTY_CASCADE_TYPE_ARRAY;
- }
- //nulls will exist if there is a typo in one of the enums
- javaAnnotationValues = ArrayTools.removeAllOccurrences(javaAnnotationValues, null);
- int len = javaAnnotationValues.length;
- CascadeType[] cascadeTypes = new CascadeType[len];
- for (int i = 0; i < len; i++) {
- cascadeTypes[i] = fromJavaAnnotationValue(javaAnnotationValues[i]);
- }
- return cascadeTypes;
- }
- private static final CascadeType[] EMPTY_CASCADE_TYPE_ARRAY = new CascadeType[0];
-
- public static CascadeType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CascadeType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CascadeType cascadeType : CascadeType.values()) {
- if (cascadeType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cascadeType;
- }
- }
- return null;
- }
-
- public static String[] toJavaAnnotationValues(CascadeType[] cascadeTypes) {
- if (cascadeTypes == null) {
- return EMPTY_STRING_ARRAY;
- }
- int len = cascadeTypes.length;
- if (len == 0) {
- return EMPTY_STRING_ARRAY;
- }
-
- String[] javaAnnotationValues = new String[len];
- for (int i = 0; i < len; i++) {
- javaAnnotationValues[i] = toJavaAnnotationValue(cascadeTypes[i]);
- }
- return javaAnnotationValues;
- }
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
- public static String toJavaAnnotationValue(CascadeType cascadeType) {
- return (cascadeType == null) ? null : cascadeType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
deleted file mode 100644
index 6d53f84b05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java
+++ /dev/null
@@ -1,92 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface ColumnAnnotation
- extends BaseColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.COLUMN;
-
- /**
- * Corresponds to the 'length' element of the Column annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getLength();
- String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'length' element of the Column annotation.
- * Set to null to remove the element.
- */
- void setLength(Integer length);
-
- /**
- * Return the {@link TextRange} for the 'length' element. If element
- * does not exist return the {@link TextRange} for the Column annotation.
- */
- TextRange getLengthTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'precision' element of the Column annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getPrecision();
- String PRECISION_PROPERTY = "precision"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'precision' element of the Column annotation.
- * Set to null to remove the element.
- */
- void setPrecision(Integer precision);
-
- /**
- * Return the {@link TextRange} for the 'precision' element. If element
- * does not exist return the {@link TextRange} for the Column annotation.
- */
- TextRange getPrecisionTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'scale' element of the Column annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getScale();
- String SCALE_PROPERTY = "scale"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'scale' element of the Column annotation.
- * Set to null to remove the element.
- */
- void setScale(Integer scale);
-
- /**
- * Return the {@link TextRange} for the 'scale' element. If element
- * does not exist return the {@link TextRange} for the Column annotation.
- */
- TextRange getScaleTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java
deleted file mode 100644
index 8d4a8bd32a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.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.core.resource.java;
-
-/**
- * Common behavior for all "container" 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.
- *
- * @version 2.2
- * @since 2.0
- */
-public interface ContainerAnnotation<T extends NestableAnnotation>
- extends Annotation, AnnotationContainer<T>
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
deleted file mode 100644
index 45dad351c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java
+++ /dev/null
@@ -1,57 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.DiscriminatorColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface DiscriminatorColumnAnnotation
- extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_COLUMN;
-
- /**
- * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- DiscriminatorType getDiscriminatorType();
- String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation.
- * Set the to null to remove the element.
- */
- void setDiscriminatorType(DiscriminatorType discriminatorType);
-
-
- /**
- * Corresponds to the 'length' element of the DiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getLength();
- String LENGTH_PROPERTY = "length"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'length' element of the DiscriminatorColumn annotation.
- * Set the to null to remove the element.
- */
- void setLength(Integer length);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java
deleted file mode 100644
index 379ad27a49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.DiscriminatorType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum DiscriminatorType {
-
- STRING(JPA.DISCRIMINATOR_TYPE__STRING),
- CHAR(JPA.DISCRIMINATOR_TYPE__CHAR),
- INTEGER(JPA.DISCRIMINATOR_TYPE__INTEGER);
-
-
- private String javaAnnotationValue;
-
- DiscriminatorType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static DiscriminatorType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static DiscriminatorType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (DiscriminatorType discriminatorType : DiscriminatorType.values()) {
- if (discriminatorType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return discriminatorType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(DiscriminatorType discriminatorType) {
- return (discriminatorType == null) ? null : discriminatorType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java
deleted file mode 100644
index 1daa24a3af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java
+++ /dev/null
@@ -1,51 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.DiscriminatorValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface DiscriminatorValueAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.DISCRIMINATOR_VALUE;
-
- /**
- * Corresponds to the 'value' element of the DiscriminatorValue annotation.
- * Return null if the element does not exist in the annotation.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the DiscriminatorValue annotation.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the DiscriminatorValue annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java
deleted file mode 100644
index 6b36ce5e83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.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.2
- * @since 2.0
- */
-public interface EmbeddableAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.EMBEDDABLE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java
deleted file mode 100644
index 09d32adfa6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Embedded
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface EmbeddedAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.EMBEDDED;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java
deleted file mode 100644
index 2530c9e452..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.EmbeddedId
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface EmbeddedIdAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.EMBEDDED_ID;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java
deleted file mode 100644
index 6a243112cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.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.2
- * @since 2.0
- */
-public interface EntityAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.ENTITY;
-
- /**
- * Corresponds to the 'name' element of the Entity 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 Entity 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 Entity annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java
deleted file mode 100644
index 5220dd3317..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java
+++ /dev/null
@@ -1,64 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.EnumType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum EnumType {
-
- ORDINAL(JPA.ENUM_TYPE__ORDINAL),
- STRING(JPA.ENUM_TYPE__STRING);
-
-
- private String javaAnnotationValue;
-
- EnumType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static EnumType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static EnumType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (EnumType enumType : EnumType.values()) {
- if (enumType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return enumType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(EnumType enumType) {
- return (enumType == null) ? null : enumType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java
deleted file mode 100644
index 7b7ab85bd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Enumerated
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface EnumeratedAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.ENUMERATED;
-
- /**
- * Corresponds to the 'value' element of the Enumerated annotation.
- * Return null if the element does not exist in Java.
- */
- EnumType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Enumerated annotation.
- * Set to null to remove the element.
- */
- void setValue(EnumType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Enumerated annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java
deleted file mode 100644
index c9bc5cb6c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java
+++ /dev/null
@@ -1,64 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.FetchType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum FetchType {
-
- EAGER(JPA.FETCH_TYPE__EAGER),
- LAZY(JPA.FETCH_TYPE__LAZY);
-
-
- private String javaAnnotationValue;
-
- FetchType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static FetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static FetchType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (FetchType fetchType : FetchType.values()) {
- if (fetchType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return fetchType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(FetchType fetchType) {
- return (fetchType == null) ? null : fetchType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java
deleted file mode 100644
index 5c5b95f80f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.GeneratedValue
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface GeneratedValueAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.GENERATED_VALUE;
-
- /**
- * Corresponds to the 'strategy' element of the GeneratedValue annotation.
- * Return null if the element does not exist in Java.
- */
- GenerationType getStrategy();
- String STRATEGY_PROPERTY = "strategy"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'strategy' element of the GeneratedValue annotation.
- * Set to null to remove the element.
- */
- void setStrategy(GenerationType strategy);
-
- /**
- * Return the {@link TextRange} for the 'strategy' element. If the element
- * does not exist return the {@link TextRange} for the GeneratedValue annotation.
- */
- TextRange getStrategyTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'generator' element of the GeneratedValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getGenerator();
- String GENERATOR_PROPERTY = "generator"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'generator' element of the GeneratedValue annotation.
- * Set to null to remove the element.
- */
- void setGenerator(String generator);
-
- /**
- * Return the {@link TextRange} for the 'generator' element. If the element
- * does not exist return the {@link TextRange} for the GeneratedValue annotation.
- */
- TextRange getGeneratorTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'generator' element.
- * Return false if the element does not exist.
- */
- boolean generatorTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java
deleted file mode 100644
index 8977b6f7fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java
+++ /dev/null
@@ -1,66 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.GenerationType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum GenerationType {
-
- TABLE(JPA.GENERATION_TYPE__TABLE),
- SEQUENCE(JPA.GENERATION_TYPE__SEQUENCE),
- IDENTITY(JPA.GENERATION_TYPE__IDENTITY),
- AUTO(JPA.GENERATION_TYPE__AUTO);
-
-
- private String javaAnnotationValue;
-
- GenerationType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static GenerationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static GenerationType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (GenerationType generationType : GenerationType.values()) {
- if (generationType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return generationType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(GenerationType generationType) {
- return (generationType == null) ? null : generationType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java
deleted file mode 100644
index c7ae630342..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java
+++ /dev/null
@@ -1,95 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among
- * javax.persistence.SequenceGenerator
- * javax.persistence.TableGenerator
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface GeneratorAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'name' element of the *Generator 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 *Generator annotation.
- * Set to null to remove the element. If no other elements exist
- * the *Generator annotation will be removed as well.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the *Generator annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'initialValue' element of the *Generator annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getInitialValue();
- String INITIAL_VALUE_PROPERTY = "initialValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'initialValue' element of the *Generator annotation.
- * Set to null to remove the element. If no other elements exist
- * the *Generator annotation will be removed as well.
- */
- void setInitialValue(Integer initialValue);
-
- /**
- * Return the {@link TextRange} for the 'initialValue' element. If the element
- * does not exist return the {@link TextRange} for the *Generator annotation.
- */
- TextRange getInitialValueTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'allocationSize' element of the *Generator annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getAllocationSize();
- String ALLOCATION_SIZE_PROPERTY = "allocationSize"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'allocationSize' element of the *Generator annotation.
- * Set to null to remove the element. If no other elements exist
- * the *Generator annotation will be removed as well.
- */
- void setAllocationSize(Integer allocationSize);
-
- /**
- * Return the {@link TextRange} for the 'allocationSize' element. If the element
- * does not exist return the {@link TextRange} for the *Generator annotation.
- */
- TextRange getAllocationSizeTextRange(CompilationUnit astRoot);
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java
deleted file mode 100644
index 65ce3fca29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Id
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface IdAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.ID;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java
deleted file mode 100644
index f03c447656..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java
+++ /dev/null
@@ -1,68 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * This interface corresponds to the JPA annotation
- * javax.persistence.IdClass
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface IdClassAnnotation
- extends Annotation
-{
- final String ANNOTATION_NAME = JPA.ID_CLASS;
-
- /**
- * Corresponds to the 'value' element of the IdClass annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;IdClass(value=Employee.class)
- * </pre>
- * will return "Employee"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the IdClass annotation.
- * Set to null to remove the element.
- * This will also remove the IdClass annotation itself.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the IdClass annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified IdClass name as resolved by the AST's bindings.
- * <pre>
- * &#64;IdClass(Employee.class)
- * </pre>
- * will return "model.Employee" if there is an import for model.Employee.
- */
- String getFullyQualifiedClassName();
- String FULLY_QUALIFIED_CLASS_NAME_PROPERTY = "fullyQualifiedClassName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java
deleted file mode 100644
index b5e2a8db52..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Inheritance
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface InheritanceAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.INHERITANCE;
-
- /**
- * Corresponds to the 'strategy' element of the Inheritance annotation.
- * Return null if the element does not exist in Java.
- */
- InheritanceType getStrategy();
- String STRATEGY_PROPERTY = "strategy"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'strategy' element of the Inheritance annotation.
- * Set to null to remove the element.
- */
- void setStrategy(InheritanceType strategy);
-
- /**
- * Return the {@link TextRange} for the 'strategy' element. If the element
- * does not exist return the {@link TextRange} for the Inheritance annotation.
- */
- TextRange getStrategyTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java
deleted file mode 100644
index 5d6b984989..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.InheritanceType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum InheritanceType {
-
- SINGLE_TABLE(JPA.INHERITANCE_TYPE__SINGLE_TABLE),
- JOINED(JPA.INHERITANCE_TYPE__JOINED),
- TABLE_PER_CLASS(JPA.INHERITANCE_TYPE__TABLE_PER_CLASS);
-
-
- private String javaAnnotationValue;
-
- InheritanceType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static InheritanceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static InheritanceType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (InheritanceType inheritanceType : InheritanceType.values()) {
- if (inheritanceType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return inheritanceType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(InheritanceType inheritanceType) {
- return (inheritanceType == null) ? null : inheritanceType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
deleted file mode 100644
index 39bf5be75a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java
+++ /dev/null
@@ -1,303 +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.core.resource.java;
-
-/**
- * JPA 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 2.3
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public interface JPA {
-
- // JPA package
- String PACKAGE = "javax.persistence";
- String PACKAGE_ = PACKAGE + '.';
-
-
- // ********** API **********
-
- // JPA annotations
- String ASSOCIATION_OVERRIDE = PACKAGE_ + "AssociationOverride";
- String ASSOCIATION_OVERRIDE__NAME = "name";
- String ASSOCIATION_OVERRIDE__JOIN_COLUMNS = "joinColumns";
- String ASSOCIATION_OVERRIDES = PACKAGE_ + "AssociationOverrides";
- String ASSOCIATION_OVERRIDES__VALUE = "value";
- String ATTRIBUTE_OVERRIDE = PACKAGE_ + "AttributeOverride";
- String ATTRIBUTE_OVERRIDE__NAME = "name";
- String ATTRIBUTE_OVERRIDE__COLUMN = "column";
- String ATTRIBUTE_OVERRIDES = PACKAGE_ + "AttributeOverrides";
- String ATTRIBUTE_OVERRIDES__VALUE = "value";
- String BASIC = PACKAGE_ + "Basic";
- String BASIC__FETCH = "fetch";
- String BASIC__OPTIONAL = "optional";
- String COLUMN = PACKAGE_ + "Column";
- String COLUMN__NAME = "name";
- String COLUMN__UNIQUE = "unique";
- String COLUMN__NULLABLE = "nullable";
- String COLUMN__INSERTABLE = "insertable";
- String COLUMN__UPDATABLE = "updatable";
- String COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String COLUMN__TABLE = "table";
- String COLUMN__LENGTH = "length";
- String COLUMN__PRECISION = "precision";
- String COLUMN__SCALE = "scale";
- String COLUMN_RESULT = PACKAGE_ + "ColumnResult";
- String COLUMN_RESULT__NAME = "name";
- String DISCRIMINATOR_COLUMN = PACKAGE_ + "DiscriminatorColumn";
- String DISCRIMINATOR_COLUMN__NAME = "name";
- String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType";
- String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String DISCRIMINATOR_COLUMN__LENGTH = "length";
- String DISCRIMINATOR_VALUE = PACKAGE_ + "DiscriminatorValue";
- String DISCRIMINATOR_VALUE__VALUE = "value";
- String EMBEDDABLE = PACKAGE_ + "Embeddable";
- String EMBEDDED = PACKAGE_ + "Embedded";
- String EMBEDDED_ID = PACKAGE_ + "EmbeddedId";
- String ENTITY = PACKAGE_ + "Entity";
- String ENTITY__NAME = "name";
- String ENTITY_LISTENERS = PACKAGE_ + "EntityListeners";
- String ENTITY_LISTENERS__VALUE = "value";
- String ENTITY_RESULT = PACKAGE_ + "EntityResult";
- String ENTITY_RESULT__ENTITY_CLASS = "entityClass";
- String ENTITY_RESULT__FIELDS = "fields";
- String ENTITY_RESULT__DISCRIMINATOR_COLUMN = "discriminatorColumn";
- String ENUMERATED = PACKAGE_ + "Enumerated";
- String ENUMERATED__VALUE = "value";
- String EXCLUDE_DEFAULT_LISTENERS = PACKAGE_ + "ExcludeDefaultListeners";
- String EXCLUDE_SUPERCLASS_LISTENERS = PACKAGE_ + "ExcludeSuperclassListeners";
- String FIELD_RESULT = PACKAGE_ + "FieldResult";
- String FIELD_RESULT__NAME = "name";
- String FIELD_RESULT__COLUMN = "column";
- String FLUSH_MODE = PACKAGE_ + "FlushMode";
- String FLUSH_MODE__VALUE = "value";
- String GENERATED_VALUE = PACKAGE_ + "GeneratedValue";
- String GENERATED_VALUE__STRATEGY = "strategy";
- String GENERATED_VALUE__GENERATOR = "generator";
- String ID = PACKAGE_ + "Id";
- String ID_CLASS = PACKAGE_ + "IdClass";
- String ID_CLASS__VALUE = "value";
- String INHERITANCE = PACKAGE_ + "Inheritance";
- String INHERITANCE__STRATEGY = "strategy";
- String JOIN_COLUMN = PACKAGE_ + "JoinColumn";
- String JOIN_COLUMN__NAME = "name";
- String JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String JOIN_COLUMN__UNIQUE = "unique";
- String JOIN_COLUMN__NULLABLE = "nullable";
- String JOIN_COLUMN__INSERTABLE = "insertable";
- String JOIN_COLUMN__UPDATABLE = "updatable";
- String JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String JOIN_COLUMN__TABLE = "table";
- String JOIN_COLUMNS = PACKAGE_ + "JoinColumns";
- String JOIN_COLUMNS__VALUE = "value";
- String JOIN_TABLE = PACKAGE_ + "JoinTable";
- String JOIN_TABLE__NAME = "name";
- String JOIN_TABLE__CATALOG = "catalog";
- String JOIN_TABLE__SCHEMA = "schema";
- String JOIN_TABLE__JOIN_COLUMNS = "joinColumns";
- String JOIN_TABLE__INVERSE_JOIN_COLUMNS = "inverseJoinColumns";
- String JOIN_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String LOB = PACKAGE_ + "Lob";
- String MANY_TO_MANY = PACKAGE_ + "ManyToMany";
- String MANY_TO_MANY__TARGET_ENTITY = "targetEntity";
- String MANY_TO_MANY__CASCADE = "cascade";
- String MANY_TO_MANY__FETCH = "fetch";
- String MANY_TO_MANY__MAPPED_BY = "mappedBy";
- String MANY_TO_ONE = PACKAGE_ + "ManyToOne";
- String MANY_TO_ONE__TARGET_ENTITY = "targetEntity";
- String MANY_TO_ONE__CASCADE = "cascade";
- String MANY_TO_ONE__FETCH = "fetch";
- String MANY_TO_ONE__OPTIONAL = "optional";
- String MAP_KEY = PACKAGE_ + "MapKey";
- String MAP_KEY__NAME = "name";
- String MAPPED_SUPERCLASS = PACKAGE_ + "MappedSuperclass";
- String NAMED_NATIVE_QUERIES = PACKAGE_ + "NamedNativeQueries";
- String NAMED_NATIVE_QUERIES__VALUE = "value";
- String NAMED_NATIVE_QUERY = PACKAGE_ + "NamedNativeQuery";
- String NAMED_NATIVE_QUERY__NAME = "name";
- String NAMED_NATIVE_QUERY__QUERY = "query";
- String NAMED_NATIVE_QUERY__HINTS = "hints";
- String NAMED_NATIVE_QUERY__RESULT_CLASS = "resultClass";
- String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "resultSetMapping";
- String NAMED_QUERIES = PACKAGE_ + "NamedQueries";
- String NAMED_QUERIES__VALUE = "value";
- String NAMED_QUERY = PACKAGE_ + "NamedQuery";
- String NAMED_QUERY__NAME = "name";
- String NAMED_QUERY__QUERY = "query";
- String NAMED_QUERY__HINTS = "hints";
- String ONE_TO_MANY = PACKAGE_ + "OneToMany";
- String ONE_TO_MANY__TARGET_ENTITY = "targetEntity";
- String ONE_TO_MANY__CASCADE = "cascade";
- String ONE_TO_MANY__FETCH = "fetch";
- String ONE_TO_MANY__MAPPED_BY = "mappedBy";
- String ONE_TO_ONE = PACKAGE_ + "OneToOne";
- String ONE_TO_ONE__TARGET_ENTITY = "targetEntity";
- String ONE_TO_ONE__CASCADE = "cascade";
- String ONE_TO_ONE__FETCH = "fetch";
- String ONE_TO_ONE__OPTIONAL = "optional";
- String ONE_TO_ONE__MAPPED_BY = "mappedBy";
- String ORDER_BY = PACKAGE_ + "OrderBy";
- String ORDER_BY__VALUE = "value";
- String PERSISTENCE_CONTEXT = PACKAGE_ + "PersistenceContext";
- String PERSISTENCE_CONTEXT__NAME = "name";
- String PERSISTENCE_CONTEXT__UNIT_NAME = "unitName";
- String PERSISTENCE_CONTEXT__TYPE = "type";
- String PERSISTENCE_CONTEXTS = PACKAGE_ + "PersistenceContexts";
- String PERSISTENCE_CONTEXTS__VALUE = "value";
- String PERSISTENCE_UNIT = PACKAGE_ + "XmlPersistenceUnit";
- String PERSISTENCE_UNIT__NAME = "name";
- String PERSISTENCE_UNIT__UNIT_NAME = "unitName";
- String PERSISTENCE_UNITS = PACKAGE_ + "PersistenceUnits";
- String PERSISTENCE_UNITS__VALUE = "value";
- String POST_LOAD = PACKAGE_ + "PostLoad";
- String POST_PERSIST = PACKAGE_ + "PostPersist";
- String POST_REMOVE = PACKAGE_ + "PostRemove";
- String POST_UPDATE = PACKAGE_ + "PostUpdate";
- String PRE_PERSIST = PACKAGE_ + "PrePersist";
- String PRE_REMOVE = PACKAGE_ + "PreRemove";
- String PRE_UPDATE = PACKAGE_ + "PreUpdate";
- String PRIMARY_KEY_JOIN_COLUMN = PACKAGE_ + "PrimaryKeyJoinColumn";
- String PRIMARY_KEY_JOIN_COLUMN__NAME = "name";
- String PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName";
- String PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String PRIMARY_KEY_JOIN_COLUMNS = PACKAGE_ + "PrimaryKeyJoinColumns";
- String PRIMARY_KEY_JOIN_COLUMNS__VALUE = "value";
- String QUERY_HINT = PACKAGE_ + "QueryHint";
- String QUERY_HINT__NAME = "name";
- String QUERY_HINT__VALUE = "value";
- String SECONDARY_TABLE = PACKAGE_ + "SecondaryTable";
- String SECONDARY_TABLE__NAME = "name";
- String SECONDARY_TABLE__CATALOG = "catalog";
- String SECONDARY_TABLE__SCHEMA = "schema";
- String SECONDARY_TABLE__PK_JOIN_COLUMNS = "pkJoinColumns";
- String SECONDARY_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String SECONDARY_TABLES = PACKAGE_ + "SecondaryTables";
- String SECONDARY_TABLES__VALUE = "value";
- String SEQUENCE_GENERATOR = PACKAGE_ + "SequenceGenerator";
- String SEQUENCE_GENERATOR__NAME = "name";
- String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequenceName";
- String SEQUENCE_GENERATOR__INITIAL_VALUE = "initialValue";
- String SEQUENCE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String SQL_RESULT_SET_MAPPING = PACKAGE_ + "SqlResultSetMapping";
- String SQL_RESULT_SET_MAPPING__NAME = "name";
- String SQL_RESULT_SET_MAPPING__ENTITIES = "entities";
- String SQL_RESULT_SET_MAPPING__COLUMNS = "columns";
- String TABLE = PACKAGE_ + "Table";
- String TABLE__NAME = "name";
- String TABLE__CATALOG = "catalog";
- String TABLE__SCHEMA = "schema";
- String TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TABLE_GENERATOR = PACKAGE_ + "TableGenerator";
- String TABLE_GENERATOR__NAME = "name";
- String TABLE_GENERATOR__TABLE = "table";
- String TABLE_GENERATOR__CATALOG = "catalog";
- String TABLE_GENERATOR__SCHEMA = "schema";
- String TABLE_GENERATOR__PK_COLUMN_NAME = "pkColumnName";
- String TABLE_GENERATOR__VALUE_COLUMN_NAME = "valueColumnName";
- String TABLE_GENERATOR__PK_COLUMN_VALUE = "pkColumnValue";
- String TABLE_GENERATOR__INITIAL_VALUE = "initialValue";
- String TABLE_GENERATOR__ALLOCATION_SIZE = "allocationSize";
- String TABLE_GENERATOR__UNIQUE_CONSTRAINTS = "uniqueConstraints";
- String TEMPORAL = PACKAGE_ + "Temporal";
- String TEMPORAL__VALUE = "value";
- String TRANSIENT = PACKAGE_ + "Transient";
- String UNIQUE_CONSTRAINT = PACKAGE_ + "UniqueConstraint";
- String UNIQUE_CONSTRAINT__COLUMN_NAMES = "columnNames";
- String VERSION = PACKAGE_ + "Version";
-
- // JPA enums
- String CASCADE_TYPE = PACKAGE_ + "CascadeType";
- String CASCADE_TYPE_ = CASCADE_TYPE + '.';
- String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL";
- String CASCADE_TYPE__MERGE = CASCADE_TYPE_ + "MERGE";
- String CASCADE_TYPE__PERSIST = CASCADE_TYPE_ + "PERSIST";
- String CASCADE_TYPE__REFRESH = CASCADE_TYPE_ + "REFRESH";
- String CASCADE_TYPE__REMOVE = CASCADE_TYPE_ + "REMOVE";
-
- String DISCRIMINATOR_TYPE = PACKAGE_ + "DiscriminatorType";
- String DISCRIMINATOR_TYPE_ = DISCRIMINATOR_TYPE + '.';
- String DISCRIMINATOR_TYPE__CHAR = DISCRIMINATOR_TYPE_ + "CHAR";
- String DISCRIMINATOR_TYPE__INTEGER = DISCRIMINATOR_TYPE_ + "INTEGER";
- String DISCRIMINATOR_TYPE__STRING = DISCRIMINATOR_TYPE_ + "STRING";
-
- String ENUM_TYPE = PACKAGE_ + "EnumType";
- String ENUM_TYPE_ = ENUM_TYPE + '.';
- String ENUM_TYPE__ORDINAL = ENUM_TYPE_ + "ORDINAL";
- String ENUM_TYPE__STRING = ENUM_TYPE_ + "STRING";
-
- String FETCH_TYPE = PACKAGE_ + "FetchType";
- String FETCH_TYPE_ = FETCH_TYPE + '.';
- String FETCH_TYPE__EAGER = FETCH_TYPE_ + "EAGER";
- String FETCH_TYPE__LAZY = FETCH_TYPE_ + "LAZY";
-
- String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType";
- String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + '.';
- String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO";
- String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT";
-
- String GENERATION_TYPE = PACKAGE_ + "GenerationType";
- String GENERATION_TYPE_ = GENERATION_TYPE + '.';
- String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO";
- String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY";
- String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE";
- String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE";
-
- String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType";
- String INHERITANCE_TYPE_ = INHERITANCE_TYPE + '.';
- String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED";
- String INHERITANCE_TYPE__SINGLE_TABLE = INHERITANCE_TYPE_ + "SINGLE_TABLE";
- String INHERITANCE_TYPE__TABLE_PER_CLASS = INHERITANCE_TYPE_ + "TABLE_PER_CLASS";
-
- String PERSISTENCE_CONTEXT_TYPE = PACKAGE_ + "PersistenceContextType";
- String PERSISTENCE_CONTEXT_TYPE_ = PERSISTENCE_CONTEXT_TYPE + '.';
- String PERSISTENCE_CONTEXT_TYPE__EXTENDED = PERSISTENCE_CONTEXT_TYPE_ + "EXTENDED";
- String PERSISTENCE_CONTEXT_TYPE__TRANSACTION = PERSISTENCE_CONTEXT_TYPE_ + "TRANSACTION";
-
- String TEMPORAL_TYPE = PACKAGE_ + "TemporalType";
- String TEMPORAL_TYPE_ = TEMPORAL_TYPE + '.';
- String TEMPORAL_TYPE__DATE = TEMPORAL_TYPE_ + "DATE";
- String TEMPORAL_TYPE__TIME = TEMPORAL_TYPE_ + "TIME";
- String TEMPORAL_TYPE__TIMESTAMP = TEMPORAL_TYPE_ + "TIMESTAMP";
-
- // JPA interfaces
- String ENTITY_MANAGER = PACKAGE_ + "EntityManager";
- String ENTITY_MANAGER_FACTORY = PACKAGE_ + "EntityManagerFactory";
- String ENTITY_TRANSACTION = PACKAGE_ + "EntityTransaction";
- String INSTRUMENTABLE_CLASS_LOADER = PACKAGE_ + "InstrumentableClassLoader";
- String QUERY = PACKAGE_ + "Query";
-
- // JPA classes
- String PERSISTENCE = PACKAGE_ + "XmlPersistence";
-
- // JPA exceptions
- String NON_UNIQUE_RESULT_EXCEPTION = PACKAGE_ + "NonUniqueResultException";
- String OBJECT_NOT_FOUND_EXCEPTION = PACKAGE_ + "ObjectNotFoundException";
- String PERSISTENCE_EXCEPTION = PACKAGE_ + "PersistenceException";
-
-
- // ********** SPI **********
-
- // JPA SPI package
- String SPI_PACKAGE = PACKAGE_ + "spi";
- String SPI_PACKAGE_ = SPI_PACKAGE + '.';
-
- // JPA SPI interfaces
- String ENTITY_MANAGER_FACTORY_PROVIDER = SPI_PACKAGE_ + "EntityManagerFactoryProvider";
- String PERSISTENCE_INFO = SPI_PACKAGE_ + "PersistenceInfo";
- String PERSISTENCE_PROVIDER = SPI_PACKAGE_ + "PersistenceProvider";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java
deleted file mode 100644
index 68b71ae59d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java
+++ /dev/null
@@ -1,33 +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.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 2.2
- * @since 2.2
- */
-public interface JavaResourceClassFile
- extends JavaResourceNode
-{
- /**
- * Return the class file's persistent type.
- */
- JavaResourcePersistentType getPersistentType();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java
deleted file mode 100644
index 356e047384..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.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.core.resource.java;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.jdt.AnnotationEditFormatter;
-import org.eclipse.jpt.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 2.3
- * @since 2.2
- */
-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();
-
- /**
- * 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java
deleted file mode 100644
index 552a88b168..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.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.core.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.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 2.3
- * @since 2.0
- */
-public interface JavaResourceNode
- extends Model
-{
-
- /**
- * 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, JpaResourceModel {
-
- /**
- * Return the root's Java resource persistent types.
- */
- Iterator<JavaResourcePersistentType> persistentTypes();
- String PERSISTENT_TYPES_COLLECTION = "persistentTypes"; //$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.
- */
- JpaAnnotationProvider getAnnotationProvider();
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java
deleted file mode 100644
index 1a2d4d7f8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java
+++ /dev/null
@@ -1,46 +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.core.resource.java;
-
-import java.util.Iterator;
-
-/**
- * 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 "persistable" types.
- */
- Iterator<JavaResourceClassFile> classFiles();
- String CLASS_FILES_COLLECTION = "classFiles"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment's class files.
- */
- int classFilesSize();
-
- /**
- * Return the package fragment's Java persistent types.
- * Return only the files that are annotated with JPA annotations.
- */
- Iterator<JavaResourcePersistentType> persistedTypes();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java
deleted file mode 100644
index 6b9db9c0db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.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.core.resource.java;
-
-import java.util.Iterator;
-
-/**
- * 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.
- */
- Iterator<JavaResourcePackageFragment> packageFragments();
- String PACKAGE_FRAGMENTS_COLLECTION = "packageFragments"; //$NON-NLS-1$
-
- /**
- * Return the size of the package fragment root's package fragments.
- */
- int packageFragmentsSize();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java
deleted file mode 100644
index f06e950603..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java
+++ /dev/null
@@ -1,139 +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.core.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.MethodSignature;
-
-/**
- * Java source code or binary persistent attribute (field or property)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-//TODO handle:
-// @Basic
-// private String foo, bar;
-public interface JavaResourcePersistentAttribute
- extends JavaResourcePersistentMember
-{
- /**
- * The Java resource persistent attribute's name does not change.
- */
- String getName();
-
- /**
- * Return a null annotation for the specified annotation name.
- * Return null if the specified annotation name is null.
- * The corresponding AnnotationDefinition must implement #buildNullAnnotation()
- * {@link AnnotationDefinition#buildNullAnnotation(JavaResourcePersistentMember,
- * org.eclipse.jpt.core.utility.jdt.Member)}
- */
- Annotation buildNullAnnotation(String annotationName);
-
- /**
- * Whether the Java resource persistent attribute is a field does not change.
- */
- boolean isField();
-
- /**
- * Whether the Java resource persistent attribute is a property does not change.
- */
- boolean isProperty();
-
- /**
- * Return the access type explicitly specified by the javax.persistence.Access annotation.
- * Return null if the Access annotation is not present.
- * For JPA 1.0 this is always going to return null; Access annotation is not supported in 1.0.
- */
- AccessType getSpecifiedAccess();
-
- /**
- * 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();
-
- /**
- * Return whether the Java resource persistent attribute is for the specified
- * method.
- */
- boolean isFor(MethodSignature methodSignature, int occurrence);
-
- /**
- * @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 the names of the attribute type's superclasses.
- */
- ListIterator<String> typeSuperclassNames();
- String TYPE_SUPERCLASS_NAMES_LIST = "typeSuperclassNames"; //$NON-NLS-1$
-
- /**
- * Return the names of the attribute type's interfaces.
- */
- Iterator<String> typeInterfaceNames();
- 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.
- */
- ListIterator<String> typeTypeArgumentNames();
- String TYPE_TYPE_ARGUMENT_NAMES_LIST = "typeTypeArgumentNames"; //$NON-NLS-1$
-
- int typeTypeArgumentNamesSize();
-
- String getTypeTypeArgumentName(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java
deleted file mode 100644
index ca6208055c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java
+++ /dev/null
@@ -1,156 +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.core.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * 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 2.3
- * @since 2.0
- */
-public interface JavaResourcePersistentMember
- extends JavaResourceNode
-{
- // ********** annotations **********
-
- /**
- * String associated with changes to the "annotations" collection
- */
- String ANNOTATIONS_COLLECTION = "annotations"; //$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.
- */
- Iterator<Annotation> annotations();
-
- /**
- * Return the number of annotations.
- */
- int annotationsSize();
-
- /**
- * 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, return only the nestable annotations specified within
- * the container annotation.
- */
- // TODO tie the singular and plural annotations together so we can generate
- // a validation error when both are specified
- Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * 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, String containerAnnotationName);
-
- /**
- * Move the nestable annotation found in the specified container
- * annotation at the specified source index to the specified target index.
- */
- void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName);
-
- /**
- * 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 this does the same as
- * {@link #removeAnnotation(String)}
- */
- void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName);
-
- /**
- * 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);
-
-
- // ********** queries **********
-
- /**
- * Return whether the underlying JDT member is persistable according to
- * the JPA spec.
- */
- boolean isPersistable();
- String PERSISTABLE_PROPERTY = "persistable"; //$NON-NLS-1$
-
- /**
- * Return whether the underlying JDT member is currently annotated with any recognized
- * annotations.
- */
- boolean isAnnotated();
-
- /**
- * Return whether the Java resource persistent member is for the specified
- * member.
- */
- boolean isFor(String memberName, int occurrence);
-
- /**
- * Return the text range for the member's name.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-
- // ********** behavior **********
-
- /**
- * Resolve type information that could be dependent on changes elsewhere
- * in the workspace.
- */
- void resolveTypes(CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
deleted file mode 100644
index 14db8475e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java
+++ /dev/null
@@ -1,152 +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.core.resource.java;
-
-import java.util.Iterator;
-
-/**
- * Java source code or binary persistent type.
- * <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.0
- */
-public interface JavaResourcePersistentType
- extends JavaResourcePersistentMember
-{
- /**
- * Return the unqualified (short) type name.
- */
- String 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 fully qualified name of the type's superclass.
- */
- String getSuperclassQualifiedName();
- String SUPERCLASS_QUALIFIED_NAME_PROPERTY = "superclassQualifiedName"; //$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 abstract.
- */
- boolean isAbstract();
- String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$
-
- /**
- * Return the type's access type ("field" or "property").
- */
- AccessType getAccess();
- String ACCESS_PROPERTY = "access"; //$NON-NLS-1$
-
- /**
- * Return whether the type is annotated with any annotations that determine whether and
- * how the type is persisted
- */
- boolean isMapped();
-
- /**
- * Return whether the type has any attributes that have JPA annotations
- * on them (which can be used to infer the type's access type).
- */
- boolean hasAnyAnnotatedAttributes();
-
-
- // ********** types **********
-
- /**
- * Return the immediately nested types (children).
- */
- Iterator<JavaResourcePersistentType> types();
- String TYPES_COLLECTION = "types"; //$NON-NLS-1$
-
- /**
- * Return all the types; the type itself, its children, its grandchildren,
- * etc.
- */
- Iterator<JavaResourcePersistentType> allTypes();
-
- /**
- * Return the immediately nested persistable types.
- */
- Iterator<JavaResourcePersistentType> persistableTypes();
-
-
- // ********** fields **********
-
- /**
- * Return the type's fields.
- */
- Iterator<JavaResourcePersistentAttribute> fields();
- String FIELDS_COLLECTION = "fields"; //$NON-NLS-1$
-
- /**
- * Return the type's persistable fields.
- */
- Iterator<JavaResourcePersistentAttribute> persistableFields();
-
- /**
- * A convenience method that returns the persistableFields that also
- * have the Access annotation with a value of FIELD
- */
- Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess();
-
-
- // ********** methods **********
-
- /**
- * Return the type's methods. This returns *all* methods from the JDT Type
- */
- Iterator<JavaResourcePersistentAttribute> methods();
- String METHODS_COLLECTION = "methods"; //$NON-NLS-1$
-
- /**
- * Return the type's persistable properties. This returns only the getter methods
- * that match the JavaBeans criteria for JPA, hence the name properties instead of methods
- */
- Iterator<JavaResourcePersistentAttribute> persistableProperties();
-
- /**
- * A convenience method that returns the persistableProperties that also
- * have the Access annotation with a value of PROPERTY
- */
- Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess();
-
-
- // ********** attributes **********
-
- /**
- * Return the type's persistable fields and properties.
- */
- Iterator<JavaResourcePersistentAttribute> persistableAttributes();
-
- /**
- * Return the persistable properties and/or fields given the non-null specified access type
- */
- Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java
deleted file mode 100644
index 46822d0961..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.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.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 JavaResourcePersistentTypeCache
- extends JavaResourceNode.Root
-{
-
- /**
- * Return the size of the cache's persistent types.
- */
- int persistentTypesSize();
-
- /**
- * Add a Java resource persistent type for the specified JDT type to the
- * cache. Return the new type.
- */
- JavaResourcePersistentType addPersistentType(IType jdtType);
-
- /**
- * Remove all the persistent types associated with the specified JAR file.
- * Return whether any persistent types were removed.
- */
- boolean removePersistentTypes(IFile jarFile);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
deleted file mode 100644
index 807ae5da45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java
+++ /dev/null
@@ -1,30 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.JoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JoinColumnAnnotation
- extends BaseJoinColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMN;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java
deleted file mode 100644
index a3b93720f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.JoinColumns
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JoinColumnsAnnotation
- extends ContainerAnnotation<NestableJoinColumnAnnotation>
-{
- String ANNOTATION_NAME = JPA.JOIN_COLUMNS;
-
- String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java
deleted file mode 100644
index b484b2adf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java
+++ /dev/null
@@ -1,69 +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.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.JoinTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface JoinTableAnnotation
- extends ReferenceTableAnnotation
-{
- String ANNOTATION_NAME = JPA.JOIN_TABLE;
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<JoinColumnAnnotation> inverseJoinColumns();
- String INVERSE_JOIN_COLUMNS_LIST = "inverseJoinColumns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- int inverseJoinColumnsSize();
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- JoinColumnAnnotation inverseJoinColumnAt(int index);
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn);
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- JoinColumnAnnotation addInverseJoinColumn(int index);
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- void moveInverseJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation.
- */
- void removeInverseJoinColumn(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java
deleted file mode 100644
index 958be2a3b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Lob
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface LobAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.LOB;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
deleted file mode 100644
index cca866898a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.ManyToMany
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface ManyToManyAnnotation
- extends OwnableRelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.MANY_TO_MANY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java
deleted file mode 100644
index bed6b6baeb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.ManyToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface ManyToOneAnnotation
- extends RelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.MANY_TO_ONE;
-
- /**
- * Corresponds to the optional element of the ManyToOne annotation.
- * Returns null if the optional element does not exist in java.
- */
- Boolean getOptional();
-
- /**
- * Corresponds to the optional element of the ManyToOne annotation.
- * Set to null to remove the optional element.
- */
- void setOptional(Boolean optional);
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
- /**
- * Return the {@link TextRange} for the optional element. If the optional element
- * does not exist return the {@link TextRange} for the ManyToOne annotation.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java
deleted file mode 100644
index 2ee414cdd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.MapKey
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface MapKeyAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.MAP_KEY;
-
- /**
- * Corresponds to the 'name' element of the MapKey annotation.
- * Returns 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 MapKey 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 MapKey annotation.
- */
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java
deleted file mode 100644
index 4b207148c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.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.2
- * @since 2.0
- */
-public interface MappedSuperclassAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.MAPPED_SUPERCLASS;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java
deleted file mode 100644
index 05354cbd5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java
+++ /dev/null
@@ -1,84 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among
- * javax.persistence.Column
- * javax.persistence.JoinColumn
- * javax.persistence.DiscriminatorColumn
- * javax.persistence.PrimaryKeyJoinColumn.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedColumnAnnotation
- extends Annotation
-{
- /**
- * Return true if the annotation exists in Java, false if it does not.
- */
- boolean isSpecified();
-
- /**
- * Corresponds to the 'name' element of the *Column 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 *Column 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 *Column annotation.
- */
- 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);
-
-
- /**
- * Corresponds to the 'columnDefinition' element of the *Column annotation.
- * Return null if the element does not exist in Java.
- */
- String getColumnDefinition();
- String COLUMN_DEFINITION_PROPERTY = "columnDefinition"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'columnDefinition' element of the *Column annotation.
- * Set to null to remove the element.
- */
- void setColumnDefinition(String columnDefinition);
-
- /**
- * Return the {@link TextRange} for the 'columnDefinition' element. If the
- * element does not exist return the {@link TextRange} for the *Column annotation.
- */
- TextRange getColumnDefinitionTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java
deleted file mode 100644
index d352ce9d92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedNativeQueries
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedNativeQueriesAnnotation
- extends ContainerAnnotation<NestableNamedNativeQueryAnnotation>
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERIES;
-
- String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueries"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java
deleted file mode 100644
index 9909ffb09b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,76 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedNativeQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedNativeQueryAnnotation
- extends BaseNamedQueryAnnotation
-{
- String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERY;
-
- /**
- * Corresponds to the 'resultClass' element of the NamedNativeQuery annotation.
- * Return null if the element does not exist in Java.
- */
- String getResultClass();
- String RESULT_CLASS_PROPERTY = "resultClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'resultClass' element of the NamedNativeQuery annotation.
- * Set to null to remove the element.
- */
- void setResultClass(String resultClass);
-
- /**
- * Return the {@link TextRange} for the 'resultClass' element. If element
- * does not exist return the {@link TextRange} for the NamedNativeQuery annotation.
- */
- TextRange getResultClassTextRange(CompilationUnit astRoot);
-
- String getFullyQualifiedResultClassName();
- String FULLY_QUALIFIED_RESULT_CLASS_NAME_PROPERTY = "fullyQualifiedResultClassName"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the 'resultSetMapping' element of the NamedNativeQuery annotation.
- * Return null if the element does not exist in Java.
- */
- String getResultSetMapping();
- String RESULT_SET_MAPPING_PROPERTY = "resultSetMapping"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'resultSetMapping' element of the NamedNativeQuery annotation.
- * Set to null to remove the element.
- */
- void setResultSetMapping(String resultSetMapping);
-
- /**
- * Return the {@link TextRange} for the 'resultSetMapping' element. If element
- * does not exist return the {@link TextRange} for the NamedNativeQuery annotation.
- */
- TextRange getResultSetMappingTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java
deleted file mode 100644
index 9f2ac815a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedQueries
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedQueriesAnnotation
- extends ContainerAnnotation<NestableNamedQueryAnnotation>
-{
- String ANNOTATION_NAME = JPA.NAMED_QUERIES;
-
- String NAMED_QUERIES_LIST = "namedQueries"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java
deleted file mode 100644
index 9b681de731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface NamedQueryAnnotation
- extends NestableNamedQueryAnnotation
-{
- String ANNOTATION_NAME = JPA.NAMED_QUERY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java
deleted file mode 100644
index 57dbfc5ec3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.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.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 2.0
- * @since 2.0
- */
-public interface NestableAnnotation
- extends Annotation
-{
- // currently using this when the NestableAnnotation is moved from
- // stand-alone to nested or from nested to stand-alone;
- // not the greatest, since you have to make sure to call all setter methods
- void initializeFrom(NestableAnnotation oldAnnotation);
-
- /**
- * 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java
deleted file mode 100644
index aa0adcd4b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AssociationOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableAssociationOverrideAnnotation
- extends AssociationOverrideAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java
deleted file mode 100644
index f9a8f66a09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.AttributeOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableAttributeOverrideAnnotation
- extends AttributeOverrideAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableColumnAnnotation.java
deleted file mode 100644
index 51371b9807..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableColumnAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Column
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableColumnAnnotation
- extends NestableAnnotation, ColumnAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java
deleted file mode 100644
index 7f692a3596..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.JoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableJoinColumnAnnotation
- extends JoinColumnAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinTableAnnotation.java
deleted file mode 100644
index 63f0eeb201..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinTableAnnotation.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.core.resource.java;
-
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.JoinTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableJoinTableAnnotation
- extends NestableAnnotation, JoinTableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java
deleted file mode 100644
index 9d34627909..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedNativeQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableNamedNativeQueryAnnotation
- extends NamedNativeQueryAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java
deleted file mode 100644
index 734129a329..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.NamedQuery
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableNamedQueryAnnotation
- extends BaseNamedQueryAnnotation, NestableAnnotation
-{
- // combines two annotation
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index 5790b99ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.PrimaryKeyJoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestablePrimaryKeyJoinColumnAnnotation
- extends PrimaryKeyJoinColumnAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java
deleted file mode 100644
index 61058a2b27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.QueryHint
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableQueryHintAnnotation
- extends QueryHintAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java
deleted file mode 100644
index 11a9854adb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.SecondaryTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableSecondaryTableAnnotation
- extends SecondaryTableAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java
deleted file mode 100644
index 5cf8f2dbbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.UniqueConstraint
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 NestableUniqueConstraintAnnotation
- extends UniqueConstraintAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
deleted file mode 100644
index 4d4c5919d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.OneToMany
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OneToManyAnnotation
- extends OwnableRelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_MANY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java
deleted file mode 100644
index 8333b4bd7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.OneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OneToOneAnnotation
- extends OwnableRelationshipMappingAnnotation
-{
- String ANNOTATION_NAME = JPA.ONE_TO_ONE;
-
- /**
- * Corresponds to the 'optional' element of the OneToOne 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 OneToOne 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 OneToOne annotation.
- */
- TextRange getOptionalTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java
deleted file mode 100644
index 0c1f60ed14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.OrderBy
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OrderByAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.ORDER_BY;
-
- /**
- * Corresponds to the 'value' element of the OrderBy annotation.
- * Return null if the element does not exist in the annotation.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the OrderBy annotation.
- * Setting the element to null will not remove the OrderBy annotation.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the OrderBy annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java
deleted file mode 100644
index c62cb84e79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol for
- * javax.persistence.AttributeOverride
- * javax.persistence.AssociationOverride
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface OverrideAnnotation
- extends Annotation
-{
-
- /**
- * Corresponds to the 'name' element of the override annotations.
- * 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 override annotations.
- * Set to null to remove the element.
- */
- void setName(String name);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If element
- * does not exist return the {@link TextRange} for the override annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'name' element.
- * Return false if the element does not exist in Java.
- */
- boolean nameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java
deleted file mode 100644
index 8c2ff8f3c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,59 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Represents a relationship mapping annotation that may have the 'mappedBy'
- * element:
- * javax.persistence.ManyToMany
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 OwnableRelationshipMappingAnnotation
- extends RelationshipMappingAnnotation
-{
- /**
- * Corresponds to the 'mappedBy' element of the annotation.
- * Return null if the element does not exist in Java.
- */
- String getMappedBy();
- String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'mappedBy' element of the annotation.
- * Set to null to remove the element.
- */
- void setMappedBy(String mappedBy);
-
- /**
- * Return the {@link TextRange} for the 'mappedBy' element. If the element
- * does not exist return the {@link TextRange} for the annotation.
- */
- TextRange getMappedByTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'mappedBy' element.
- * Return false if the element does not exist.
- */
- boolean mappedByTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
deleted file mode 100644
index a625c75ac4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java
+++ /dev/null
@@ -1,58 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.PrimaryKeyJoinColumn
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface PrimaryKeyJoinColumnAnnotation
- extends NamedColumnAnnotation
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMN;
-
- /**
- * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getReferencedColumnName();
- String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation.
- * Set the to null to remove the element.
- */
- void setReferencedColumnName(String referencedColumnName);
-
- /**
- * Return the {@link TextRange} for the 'referencedColumnName' element.
- * If the element does not exist return the {@link TextRange} for the PrimaryKeyJoinColumn annotation.
- */
- TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'referencedColumnName' element.
- * Return false if the element does not exist.
- */
- boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java
deleted file mode 100644
index 563ed5f012..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.PrimaryKeyJoinColumns
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface PrimaryKeyJoinColumnsAnnotation
- extends ContainerAnnotation<NestablePrimaryKeyJoinColumnAnnotation>
-{
- String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMNS;
-
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumns"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java
deleted file mode 100644
index aecaca10ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java
+++ /dev/null
@@ -1,72 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.QueryHint
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface QueryHintAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.QUERY_HINT;
-
- /**
- * Corresponds to the 'name' element of the QueryHint annotation.
- * Return null if the element does not exist in the annotation
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the QueryHint annotation.
- * Setting to null will 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 QueryHint annotation.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'value' element of the QueryHint annotation.
- * Return null if the element does not exist in the annotation
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the QueryHint annotation.
- * Setting to null will 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 QueryHint annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java
deleted file mode 100644
index 51030e2fca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java
+++ /dev/null
@@ -1,69 +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.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the JPA annotations
- * javax.persistence.JoinTable
- * javax.persistence.CollectionTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 ReferenceTableAnnotation
- extends BaseTableAnnotation
-{
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<JoinColumnAnnotation> joinColumns();
- String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- int joinColumnsSize();
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- JoinColumnAnnotation joinColumnAt(int index);
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- int indexOfJoinColumn(JoinColumnAnnotation joinColumn);
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- JoinColumnAnnotation addJoinColumn(int index);
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- void moveJoinColumn(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'joinColumns' element of the JoinTable annotation.
- */
- void removeJoinColumn(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java
deleted file mode 100644
index 556f402161..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java
+++ /dev/null
@@ -1,153 +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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common protocol among
- * javax.persistence.ManyToOne
- * javax.persistence.ManyToMany
- * javax.persistence.OneToMany
- * javax.persistence.OneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface RelationshipMappingAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'targetEntity' element of the relationship mapping
- * annotations.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </pre>
- * will return "Employee"
- */
- String getTargetEntity();
- String TARGET_ENTITY_PROPERTY = "targetEntity"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'targetEntity' element of the relationship mapping
- * annotations.
- * Set to null to remove the element.
- */
- void setTargetEntity(String targetEntity);
-
- /**
- * Return the {@link TextRange} for the 'targetEntity' element. If the element
- * does not exist return the {@link TextRange} for the relationship mapping annotation.
- */
- TextRange getTargetEntityTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified target entity class name as resolved by the AST's bindings.
- * <pre>
- * &#64;ManyToMany(targetEntity=Employee.class)
- * </pre>
- * will return "model.Employee" if there is an import for model.Employee.
- * @return
- */
- String getFullyQualifiedTargetEntityClassName();
- String FULLY_QUALIFIED_TARGET_ENTITY_CLASS_NAME_PROPERTY = "fullyQualifiedTargetEntityClassName"; //$NON-NLS-1$
-
-
- /**
- * Corresponds to the 'fetch' element of the relationship mapping annotations.
- * 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 relationship annotations.
- * 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 relationship mapping annotation.
- */
- TextRange getFetchTextRange(CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadeAll();
- String CASCADE_ALL_PROPERTY = "cascadeAll"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadeAll(boolean all);
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadeMerge();
- String CASCADE_MERGE_PROPERTY = "cascadeMerge"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadeMerge(boolean merge);
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadePersist();
- String CASCADE_PERSIST_PROPERTY = "cascadePersist"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadePersist(boolean persist);
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadeRefresh();
- String CASCADE_REFRESH_PROPERTY = "cascadeRefresh"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadeRefresh(boolean refresh);
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- boolean isCascadeRemove();
- String CASCADE_REMOVE_PROPERTY = "cascadeRemove"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'cascade' element of the relationship annotations.
- */
- void setCascadeRemove(boolean remove);
-
- /**
- * Return the {@link TextRange} for the 'cascade' element. If the element
- * does not exist return the {@link TextRange} for the relationship mapping annotation.
- */
- TextRange getCascadeTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java
deleted file mode 100644
index f4d12c330d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java
+++ /dev/null
@@ -1,69 +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.core.resource.java;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.SecondaryTable
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface SecondaryTableAnnotation
- extends BaseTableAnnotation
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLE;
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns();
- String PK_JOIN_COLUMNS_LIST = "pkJoinColumns"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- int pkJoinColumnsSize();
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index);
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn);
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index);
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- void removePkJoinColumn(int index);
-
- /**
- * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation.
- */
- void movePkJoinColumn(int targetIndex, int sourceIndex);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java
deleted file mode 100644
index 9428050512..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java
+++ /dev/null
@@ -1,31 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.SecondaryTables
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface SecondaryTablesAnnotation
- extends ContainerAnnotation<NestableSecondaryTableAnnotation>
-{
- String ANNOTATION_NAME = JPA.SECONDARY_TABLES;
-
- String SECONDARY_TABLES_LIST = "secondaryTables"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java
deleted file mode 100644
index 89f52d1088..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.SequenceGenerator
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface SequenceGeneratorAnnotation
- extends GeneratorAnnotation
-{
- String ANNOTATION_NAME = JPA.SEQUENCE_GENERATOR;
-
- /**
- * Corresponds to the 'sequenceName' element of the *Generator annotation.
- * Return null if the element does not exist in Java.
- */
- String getSequenceName();
- String SEQUENCE_NAME_PROPERTY = "sequenceName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'sequenceName' element of the *Generator annotation.
- * Set to null to remove the element. If no other elements exist
- * the *Generator annotation will be removed as well.
- */
- void setSequenceName(String sequenceName);
-
- /**
- * Return the {@link TextRange} for the 'sequenceName' element. If the element
- * does not exist return the {@link TextRange} for the SequenceGenerator annotation.
- */
- TextRange getSequenceNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'sequenceName' element.
- * Return false if the element does not exist.
- */
- boolean sequenceNameTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java
deleted file mode 100644
index fc48fcd0ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Table
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface TableAnnotation
- extends BaseTableAnnotation
-{
- String ANNOTATION_NAME = JPA.TABLE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
deleted file mode 100644
index 673896a66f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java
+++ /dev/null
@@ -1,234 +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.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.TableGenerator
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface TableGeneratorAnnotation
- extends GeneratorAnnotation
-{
- String ANNOTATION_NAME = JPA.TABLE_GENERATOR;
-
- /**
- * Corresponds to the 'table' element of the TableGenerator 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 TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setTable(String table);
-
- /**
- * Return the {@link TextRange} for the 'table' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator 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);
-
-
- /**
- * Corresponds to the 'schema' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getSchema();
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'schema' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setSchema(String schema);
-
- /**
- * Return the {@link TextRange} for the 'schema' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getSchemaTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'schema' element.
- * Return false if the element does not exist.
- */
- boolean schemaTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'catalog' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getCatalog();
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'catalog' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setCatalog(String catalog);
-
- /**
- * Return the {@link TextRange} for the 'catalog' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getCatalogTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'catalog' element.
- * Return false if the element does not exist.
- */
- boolean catalogTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'pkColumnName' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getPkColumnName();
- String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'pkColumnName' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnName(String pkColumnName);
-
- /**
- * Return the {@link TextRange} for the 'pkColumnName' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getPkColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'pkColumnName' element.
- * Return false if the element does not exist.
- */
- boolean pkColumnNameTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'valueColumnName' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getValueColumnName();
- String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'valueColumnName' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setValueColumnName(String valueColumnName);
-
- /**
- * Return the {@link TextRange} for the 'valueColumnName' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getValueColumnNameTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'valueColumnName' element.
- * Return false if the element does not exist.
- */
- boolean valueColumnNameTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- String getPkColumnValue();
- String PK_COLUMN_VALUE_PROPERTY = "pkColumnValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation.
- * Set to null to remove the element. If no other elements exist
- * the TableGenerator annotation will be removed as well.
- */
- void setPkColumnValue(String pkColumnValue);
-
- /**
- * Return the {@link TextRange} for the 'pkColumnValue' element. If the element
- * does not exist return the {@link TextRange} for the TableGenerator annotation.
- */
- TextRange getPkColumnValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return whether the specified position touches the 'pkColumnValue' element.
- * Return false if the element does not exist.
- */
- boolean pkColumnValueTouches(int pos, CompilationUnit astRoot);
-
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- * Return null if the element does not exist in Java.
- */
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints();
- String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- */
- int uniqueConstraintsSize();
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- */
- UniqueConstraintAnnotation uniqueConstraintAt(int index);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- */
- int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- */
- UniqueConstraintAnnotation addUniqueConstraint(int index);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- */
- void moveUniqueConstraint(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation.
- * If no other elements exist the TableGenerator annotation will be removed as well.
- */
- void removeUniqueConstraint(int index);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java
deleted file mode 100644
index c2a7ecfd91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.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.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Temporal
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface TemporalAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.TEMPORAL;
-
- /**
- * Corresponds to the 'value' element of the Temporal annotation.
- * Return null if the element does not exist in Java.
- */
- TemporalType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Temporal annotation.
- * Set to null to remove the element.
- */
- void setValue(TemporalType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Temporal annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java
deleted file mode 100644
index 1a0f652d74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.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.core.resource.java;
-
-/**
- * Corresponds to the JPA enum
- * javax.persistence.TemporalType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public enum TemporalType {
-
- DATE(JPA.TEMPORAL_TYPE__DATE),
- TIME(JPA.TEMPORAL_TYPE__TIME),
- TIMESTAMP(JPA.TEMPORAL_TYPE__TIMESTAMP);
-
-
- private String javaAnnotationValue;
-
- TemporalType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static TemporalType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static TemporalType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (TemporalType temporalType : TemporalType.values()) {
- if (temporalType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return temporalType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(TemporalType temporalType) {
- return (temporalType == null) ? null : temporalType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java
deleted file mode 100644
index e7f7df717f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Transient
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface TransientAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.TRANSIENT;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java
deleted file mode 100644
index 0d8bb17914..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java
+++ /dev/null
@@ -1,76 +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.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.UniqueConstraint
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface UniqueConstraintAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.UNIQUE_CONSTRAINT;
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- * Return null if the element does not exist in the annotation.
- */
- ListIterator<String> columnNames();
- String COLUMN_NAMES_LIST = "columnNames"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- int columnNamesSize();
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- void addColumnName(String columnName);
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- void addColumnName(int index, String columnName);
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- void moveColumnName(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- void removeColumnName(String columnName);
-
- /**
- * Corresponds to the 'columnNames' element of the UniqueConstraint annotation.
- */
- void removeColumnName(int index);
-
- /**
- * Return whether the specified position touches the 'columnNames' element.
- * Return false if the element does not exist.
- */
- boolean columnNamesTouches(int pos, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java
deleted file mode 100644
index 852f065664..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java
+++ /dev/null
@@ -1,29 +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.core.resource.java;
-
-/**
- * Corresponds to the JPA annotation
- * javax.persistence.Version
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.0
- */
-public interface VersionAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = JPA.VERSION;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
deleted file mode 100644
index 13ffd5a378..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
+++ /dev/null
@@ -1,280 +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.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.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract 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.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlAttributeMapping
- extends AbstractJpaEObject
- implements XmlAttributeMapping
-{
- /**
- * 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 AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlAttributeMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_ATTRIBUTE_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder_Access()
- * @model
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS, oldAccess, access));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlAttributeMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping#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, OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS:
- return getAccess();
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__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 OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__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 OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__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(" (access: ");
- result.append(access);
- result.append(", name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** validation ***********
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- // ********** translators **********
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlAttributeMapping_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlColumn.java
deleted file mode 100644
index 9c98d0305b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlColumn.java
+++ /dev/null
@@ -1,500 +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.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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Abstract Column</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.core.resource.orm.AbstractXmlColumn#getInsertable <em>Insertable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getNullable <em>Nullable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUnique <em>Unique</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUpdatable <em>Updatable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlColumn extends AbstractXmlNamedColumn
-{
- /**
- * The default value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected static final Boolean INSERTABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected Boolean insertable = INSERTABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected static final Boolean NULLABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected Boolean nullable = NULLABLE_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 default value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected static final Boolean UPDATABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected Boolean updatable = UPDATABLE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insertable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insertable</em>' attribute.
- * @see #setInsertable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn_Insertable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getInsertable()
- {
- return insertable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getInsertable <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insertable</em>' attribute.
- * @see #getInsertable()
- * @generated
- */
- public void setInsertable(Boolean newInsertable)
- {
- Boolean oldInsertable = insertable;
- insertable = newInsertable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE, oldInsertable, insertable));
- }
-
- /**
- * Returns the value of the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Nullable</em>' attribute.
- * @see #setNullable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn_Nullable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getNullable()
- {
- return nullable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getNullable <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Nullable</em>' attribute.
- * @see #getNullable()
- * @generated
- */
- public void setNullable(Boolean newNullable)
- {
- Boolean oldNullable = nullable;
- nullable = newNullable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE, oldNullable, nullable));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getAbstractXmlColumn_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.core.resource.orm.AbstractXmlColumn#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, OrmPackage.ABSTRACT_XML_COLUMN__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.core.resource.orm.OrmPackage#getAbstractXmlColumn_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.core.resource.orm.AbstractXmlColumn#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, OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE, oldUnique, unique));
- }
-
- /**
- * Returns the value of the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Updatable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Updatable</em>' attribute.
- * @see #setUpdatable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn_Updatable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUpdatable()
- {
- return updatable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUpdatable <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Updatable</em>' attribute.
- * @see #getUpdatable()
- * @generated
- */
- public void setUpdatable(Boolean newUpdatable)
- {
- Boolean oldUpdatable = updatable;
- updatable = newUpdatable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE, oldUpdatable, updatable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE:
- return getInsertable();
- case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE:
- return getNullable();
- case OrmPackage.ABSTRACT_XML_COLUMN__TABLE:
- return getTable();
- case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE:
- return getUnique();
- case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE:
- return getUpdatable();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE:
- setInsertable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE:
- setNullable((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE:
- setUnique((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE:
- setUpdatable((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE:
- setInsertable(INSERTABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE:
- setNullable(NULLABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE:
- setUnique(UNIQUE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE:
- setUpdatable(UPDATABLE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_COLUMN__INSERTABLE:
- return INSERTABLE_EDEFAULT == null ? insertable != null : !INSERTABLE_EDEFAULT.equals(insertable);
- case OrmPackage.ABSTRACT_XML_COLUMN__NULLABLE:
- return NULLABLE_EDEFAULT == null ? nullable != null : !NULLABLE_EDEFAULT.equals(nullable);
- case OrmPackage.ABSTRACT_XML_COLUMN__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.ABSTRACT_XML_COLUMN__UNIQUE:
- return UNIQUE_EDEFAULT == null ? unique != null : !UNIQUE_EDEFAULT.equals(unique);
- case OrmPackage.ABSTRACT_XML_COLUMN__UPDATABLE:
- return UPDATABLE_EDEFAULT == null ? updatable != null : !UPDATABLE_EDEFAULT.equals(updatable);
- }
- 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(" (insertable: ");
- result.append(insertable);
- result.append(", nullable: ");
- result.append(nullable);
- result.append(", table: ");
- result.append(table);
- result.append(", unique: ");
- result.append(unique);
- result.append(", updatable: ");
- result.append(updatable);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getTableTextRange() {
- return getAttributeTextRange(JPA.TABLE);
- }
-
- // ********** translators **********
-
- protected static Translator buildUniqueTranslator() {
- return new BooleanTranslator(JPA.UNIQUE, OrmPackage.eINSTANCE.getAbstractXmlColumn_Unique(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildNullableTranslator() {
- return new BooleanTranslator(JPA.NULLABLE, OrmPackage.eINSTANCE.getAbstractXmlColumn_Nullable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInsertableTranslator() {
- return new BooleanTranslator(JPA.INSERTABLE, OrmPackage.eINSTANCE.getAbstractXmlColumn_Insertable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUpdatableTranslator() {
- return new BooleanTranslator(JPA.UPDATABLE, OrmPackage.eINSTANCE.getAbstractXmlColumn_Updatable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(JPA.TABLE, OrmPackage.eINSTANCE.getAbstractXmlColumn_Table(), Translator.DOM_ATTRIBUTE);
- }
-
-} // AbstractXmlAbstractColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlEmbedded.java
deleted file mode 100644
index fa4a518aa7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlEmbedded.java
+++ /dev/null
@@ -1,220 +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.core.resource.orm;
-
-import java.util.Collection;
-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.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Base Xml Embedded</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.core.resource.orm.OrmPackage#getAbstractXmlEmbedded()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlEmbedded extends AbstractXmlAttributeMapping implements XmlAttributeOverrideContainer
-{
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlEmbedded()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_EMBEDDED;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).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 OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- }
- 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 OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- 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 == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return OrmPackage.ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- protected static Translator buildAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA.ATTRIBUTE_OVERRIDE, OrmPackage.eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlMultiRelationshipMapping.java
deleted file mode 100644
index 5444fc9c44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlMultiRelationshipMapping.java
+++ /dev/null
@@ -1,1086 +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.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.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.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Multi Relationship 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlMultiRelationshipMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlMultiRelationshipMapping extends AbstractXmlRelationshipMapping implements XmlMappedByMapping, XmlJoinTableMapping, XmlOrderable, XmlMultiRelationshipMapping_2_0
-{
- /**
- * The default value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected static final String MAPPED_BY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected String mappedBy = MAPPED_BY_EDEFAULT;
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
- /**
- * The cached value of the '{@link #getOrderColumn() <em>Order Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderColumn()
- * @generated
- * @ordered
- */
- protected XmlOrderColumn orderColumn;
- /**
- * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected static final String ORDER_BY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected String orderBy = ORDER_BY_EDEFAULT;
- /**
- * The cached value of the '{@link #getMapKeyAttributeOverrides() <em>Map Key Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> mapKeyAttributeOverrides;
- /**
- * The cached value of the '{@link #getMapKeyClass() <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyClass()
- * @generated
- * @ordered
- */
- protected XmlClassReference mapKeyClass;
- /**
- * 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 TemporalType MAP_KEY_TEMPORAL_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMapKeyTemporal() <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType mapKeyTemporal = MAP_KEY_TEMPORAL_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 EnumType MAP_KEY_ENUMERATED_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMapKeyEnumerated() <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType mapKeyEnumerated = MAP_KEY_ENUMERATED_EDEFAULT;
- /**
- * The cached value of the '{@link #getMapKeyColumn() <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn mapKeyColumn;
- /**
- * The cached value of the '{@link #getMapKeyJoinColumns() <em>Map Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> mapKeyJoinColumns;
- /**
- * The cached value of the '{@link #getMapKey() <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKey()
- * @generated
- * @ordered
- */
- protected MapKey mapKey;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlMultiRelationshipMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMappedBy()
- {
- return mappedBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- public void setMappedBy(String newMappedBy)
- {
- String oldMappedBy = mappedBy;
- mappedBy = newMappedBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</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>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order Column</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>Order Column</em>' containment reference.
- * @see #setOrderColumn(XmlOrderColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable_2_0_OrderColumn()
- * @model containment="true"
- * @generated
- */
- public XmlOrderColumn getOrderColumn()
- {
- return orderColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOrderColumn(XmlOrderColumn newOrderColumn, NotificationChain msgs)
- {
- XmlOrderColumn oldOrderColumn = orderColumn;
- orderColumn = newOrderColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN, oldOrderColumn, newOrderColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getOrderColumn <em>Order Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order Column</em>' containment reference.
- * @see #getOrderColumn()
- * @generated
- */
- public void setOrderColumn(XmlOrderColumn newOrderColumn)
- {
- if (newOrderColumn != orderColumn)
- {
- NotificationChain msgs = null;
- if (orderColumn != null)
- msgs = ((InternalEObject)orderColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN, null, msgs);
- if (newOrderColumn != null)
- msgs = ((InternalEObject)newOrderColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN, null, msgs);
- msgs = basicSetOrderColumn(newOrderColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN, newOrderColumn, newOrderColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable_OrderBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getOrderBy() {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- public void setOrderBy(String newOrderBy) {
- String oldOrderBy = orderBy;
- orderBy = newOrderBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key 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>Map Key Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides()
- {
- if (mapKeyAttributeOverrides == null)
- {
- mapKeyAttributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES);
- }
- return mapKeyAttributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Class</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>Map Key Class</em>' containment reference.
- * @see #setMapKeyClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_2_0_MapKeyClass()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getMapKeyClass()
- {
- return mapKeyClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKeyClass(XmlClassReference newMapKeyClass, NotificationChain msgs)
- {
- XmlClassReference oldMapKeyClass = mapKeyClass;
- mapKeyClass = newMapKeyClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS, oldMapKeyClass, newMapKeyClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKeyClass <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Class</em>' containment reference.
- * @see #getMapKeyClass()
- * @generated
- */
- public void setMapKeyClass(XmlClassReference newMapKeyClass)
- {
- if (newMapKeyClass != mapKeyClass)
- {
- NotificationChain msgs = null;
- if (mapKeyClass != null)
- msgs = ((InternalEObject)mapKeyClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS, null, msgs);
- if (newMapKeyClass != null)
- msgs = ((InternalEObject)newMapKeyClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS, null, msgs);
- msgs = basicSetMapKeyClass(newMapKeyClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS, newMapKeyClass, newMapKeyClass));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Temporal</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 Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setMapKeyTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_2_0_MapKeyTemporal()
- * @model
- * @generated
- */
- public TemporalType getMapKeyTemporal()
- {
- return mapKeyTemporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKeyTemporal <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getMapKeyTemporal()
- * @generated
- */
- public void setMapKeyTemporal(TemporalType newMapKeyTemporal)
- {
- TemporalType oldMapKeyTemporal = mapKeyTemporal;
- mapKeyTemporal = newMapKeyTemporal == null ? MAP_KEY_TEMPORAL_EDEFAULT : newMapKeyTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL, oldMapKeyTemporal, mapKeyTemporal));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Enumerated</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 Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setMapKeyEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated()
- * @model
- * @generated
- */
- public EnumType getMapKeyEnumerated()
- {
- return mapKeyEnumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKeyEnumerated <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getMapKeyEnumerated()
- * @generated
- */
- public void setMapKeyEnumerated(EnumType newMapKeyEnumerated)
- {
- EnumType oldMapKeyEnumerated = mapKeyEnumerated;
- mapKeyEnumerated = newMapKeyEnumerated == null ? MAP_KEY_ENUMERATED_EDEFAULT : newMapKeyEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED, oldMapKeyEnumerated, mapKeyEnumerated));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Column</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>Map Key Column</em>' containment reference.
- * @see #setMapKeyColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_2_0_MapKeyColumn()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getMapKeyColumn()
- {
- return mapKeyColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKeyColumn(XmlColumn newMapKeyColumn, NotificationChain msgs)
- {
- XmlColumn oldMapKeyColumn = mapKeyColumn;
- mapKeyColumn = newMapKeyColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN, oldMapKeyColumn, newMapKeyColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKeyColumn <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Column</em>' containment reference.
- * @see #getMapKeyColumn()
- * @generated
- */
- public void setMapKeyColumn(XmlColumn newMapKeyColumn)
- {
- if (newMapKeyColumn != mapKeyColumn)
- {
- NotificationChain msgs = null;
- if (mapKeyColumn != null)
- msgs = ((InternalEObject)mapKeyColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN, null, msgs);
- if (newMapKeyColumn != null)
- msgs = ((InternalEObject)newMapKeyColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN, null, msgs);
- msgs = basicSetMapKeyColumn(newMapKeyColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN, newMapKeyColumn, newMapKeyColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Join 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>Map Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getMapKeyJoinColumns()
- {
- if (mapKeyJoinColumns == null)
- {
- mapKeyJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS);
- }
- return mapKeyJoinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map 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>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlMultiRelationshipMapping_MapKey()
- * @model containment="true"
- * @generated
- */
- public MapKey getMapKey() {
- return mapKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKey(MapKey newMapKey, NotificationChain msgs)
- {
- MapKey oldMapKey = mapKey;
- mapKey = newMapKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY, oldMapKey, newMapKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- public void setMapKey(MapKey newMapKey) {
- if (newMapKey != mapKey)
- {
- NotificationChain msgs = null;
- if (mapKey != null)
- msgs = ((InternalEObject)mapKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN:
- return basicSetOrderColumn(null, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAttributeOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS:
- return basicSetMapKeyClass(null, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN:
- return basicSetMapKeyColumn(null, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getMapKeyJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY:
- return basicSetMapKey(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 OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN:
- return getOrderColumn();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY:
- return getOrderBy();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return getMapKeyAttributeOverrides();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS:
- return getMapKeyClass();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL:
- return getMapKeyTemporal();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED:
- return getMapKeyEnumerated();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN:
- return getMapKeyColumn();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS:
- return getMapKeyJoinColumns();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY:
- return getMapKey();
- }
- 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 OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN:
- setOrderColumn((XmlOrderColumn)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES:
- getMapKeyAttributeOverrides().clear();
- getMapKeyAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS:
- setMapKeyClass((XmlClassReference)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL:
- setMapKeyTemporal((TemporalType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED:
- setMapKeyEnumerated((EnumType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN:
- setMapKeyColumn((XmlColumn)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS:
- getMapKeyJoinColumns().clear();
- getMapKeyJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY:
- setMapKey((MapKey)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN:
- setOrderColumn((XmlOrderColumn)null);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES:
- getMapKeyAttributeOverrides().clear();
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS:
- setMapKeyClass((XmlClassReference)null);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL:
- setMapKeyTemporal(MAP_KEY_TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED:
- setMapKeyEnumerated(MAP_KEY_ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN:
- setMapKeyColumn((XmlColumn)null);
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS:
- getMapKeyJoinColumns().clear();
- return;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY:
- setMapKey((MapKey)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN:
- return orderColumn != null;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return mapKeyAttributeOverrides != null && !mapKeyAttributeOverrides.isEmpty();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS:
- return mapKeyClass != null;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL:
- return mapKeyTemporal != MAP_KEY_TEMPORAL_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED:
- return mapKeyEnumerated != MAP_KEY_ENUMERATED_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN:
- return mapKeyColumn != null;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS:
- return mapKeyJoinColumns != null && !mapKeyJoinColumns.isEmpty();
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY:
- return mapKey != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMappedByMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY: return OrmPackage.XML_MAPPED_BY_MAPPING__MAPPED_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinTableMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_JOIN_TABLE_MAPPING__JOIN_TABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN: return OrmV2_0Package.XML_ORDERABLE_20__ORDER_COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY: return OrmPackage.XML_ORDERABLE__ORDER_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAttributeOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES: return OrmV2_0Package.XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS: return OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL: return OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_TEMPORAL;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED: return OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN: return OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_COLUMN;
- case OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS: return OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_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 == XmlMappedByMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MAPPED_BY_MAPPING__MAPPED_BY: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinTableMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE_MAPPING__JOIN_TABLE: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ORDERABLE_20__ORDER_COLUMN: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ORDERABLE__ORDER_BY: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAttributeOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlMultiRelationshipMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS;
- case OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_TEMPORAL: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL;
- case OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED;
- case OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_COLUMN: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN;
- case OrmV2_0Package.XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_COLUMNS: return OrmPackage.ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS;
- 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(" (mappedBy: ");
- result.append(mappedBy);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(", mapKeyTemporal: ");
- result.append(mapKeyTemporal);
- result.append(", mapKeyEnumerated: ");
- result.append(mapKeyEnumerated);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMappedByTextRange() {
- return getAttributeTextRange(JPA.MAPPED_BY);
- }
-
- // ********** translators **********
-
- protected static Translator buildOrderByTranslator() {
- return new Translator(JPA.ORDER_BY, OrmPackage.eINSTANCE.getXmlOrderable_OrderBy());
- }
-
- protected static Translator buildMapKeyTranslator() {
- return MapKey.buildTranslator(JPA.MAP_KEY, OrmPackage.eINSTANCE.getAbstractXmlMultiRelationshipMapping_MapKey());
- }
-
- protected static Translator buildMapKeyTemporalTranslator() {
- return new Translator(JPA2_0.MAP_KEY_TEMPORAL, OrmV2_0Package.eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyTemporal());
- }
-
- protected static Translator buildMapKeyEnumeratedTranslator() {
- return new Translator(JPA2_0.MAP_KEY_ENUMERATED, OrmV2_0Package.eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated());
- }
-
- protected static Translator buildMapKeyClassTranslator() {
- return XmlClassReference.buildTranslator(JPA2_0.MAP_KEY_CLASS, OrmV2_0Package.eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyClass());
- }
-
- protected static Translator buildMapKeyColumnTranslator() {
- return XmlColumn.buildTranslator(JPA2_0.MAP_KEY_COLUMN, OrmV2_0Package.eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyColumn());
- }
-
- protected static Translator buildMapKeyJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA2_0.MAP_KEY_JOIN_COLUMN, OrmV2_0Package.eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns());
- }
-
- protected static Translator buildMappedByTranslator() {
- return new Translator(JPA.MAPPED_BY, OrmPackage.eINSTANCE.getXmlMappedByMapping_MappedBy(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMapKeyAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA2_0.MAP_KEY_ATTRIBUTE_OVERRIDE, OrmV2_0Package.eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableMapping_JoinTable());
- }
-
- protected static Translator buildOrderColumnTranslator() {
- return XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
deleted file mode 100644
index 1ac04f2459..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
+++ /dev/null
@@ -1,286 +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.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.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Named Column</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.core.resource.orm.AbstractXmlNamedColumn#getColumnDefinition <em>Column Definition</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @model kind="class" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public abstract class AbstractXmlNamedColumn extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getColumnDefinition() <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnDefinition()
- * @generated
- * @ordered
- */
- protected static final String COLUMN_DEFINITION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getColumnDefinition() <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnDefinition()
- * @generated
- * @ordered
- */
- protected String columnDefinition = COLUMN_DEFINITION_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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlNamedColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_NAMED_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Definition</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Definition</em>' attribute.
- * @see #setColumnDefinition(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn_ColumnDefinition()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getColumnDefinition()
- {
- return columnDefinition;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getColumnDefinition <em>Column Definition</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column Definition</em>' attribute.
- * @see #getColumnDefinition()
- * @generated
- */
- public void setColumnDefinition(String newColumnDefinition)
- {
- String oldColumnDefinition = columnDefinition;
- columnDefinition = newColumnDefinition;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION, oldColumnDefinition, columnDefinition));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn_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.core.resource.orm.AbstractXmlNamedColumn#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, OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- return getColumnDefinition();
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__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 OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- setColumnDefinition((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__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 OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- setColumnDefinition(COLUMN_DEFINITION_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION:
- return COLUMN_DEFINITION_EDEFAULT == null ? columnDefinition != null : !COLUMN_DEFINITION_EDEFAULT.equals(columnDefinition);
- case OrmPackage.ABSTRACT_XML_NAMED_COLUMN__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(" (columnDefinition: ");
- result.append(columnDefinition);
- 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(JPA.NAME, OrmPackage.eINSTANCE.getAbstractXmlNamedColumn_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildColumnDefinitionTranslator() {
- return new Translator(JPA.COLUMN_DEFINITION, OrmPackage.eINSTANCE.getAbstractXmlNamedColumn_ColumnDefinition(), Translator.DOM_ATTRIBUTE);
- }
-
-} // AbstractXmlNamedColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlReferenceTable.java
deleted file mode 100644
index 35e84859a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlReferenceTable.java
+++ /dev/null
@@ -1,222 +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.core.resource.orm;
-
-import java.util.Collection;
-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.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Reference 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.core.resource.orm.OrmPackage#getAbstractXmlReferenceTable()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlReferenceTable extends AbstractXmlTable implements XmlReferenceTable
-{
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlReferenceTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_REFERENCE_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlReferenceTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).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 OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS:
- return getJoinColumns();
- }
- 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 OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlReferenceTable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS: return OrmPackage.XML_REFERENCE_TABLE__JOIN_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 == XmlReferenceTable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_REFERENCE_TABLE__JOIN_COLUMNS: return OrmPackage.ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- protected static Translator buildJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA.JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlReferenceTable_JoinColumns());
- }
-
-} // AbstractXmlReferenceTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlRelationshipMapping.java
deleted file mode 100644
index 2f590a2bf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlRelationshipMapping.java
+++ /dev/null
@@ -1,382 +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.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.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Relationship 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getCascade <em>Cascade</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlRelationshipMapping extends AbstractXmlAttributeMapping
-{
- /**
- * The default value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected static final String TARGET_ENTITY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getTargetEntity() <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetEntity()
- * @generated
- * @ordered
- */
- protected String targetEntity = TARGET_ENTITY_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 FetchType FETCH_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected CascadeType cascade;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlRelationshipMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_RELATIONSHIP_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Entity</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Entity</em>' attribute.
- * @see #setTargetEntity(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping_TargetEntity()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetEntity() {
- return targetEntity;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Entity</em>' attribute.
- * @see #getTargetEntity()
- * @generated
- */
- public void setTargetEntity(String newTargetEntity) {
- String oldTargetEntity = targetEntity;
- targetEntity = newTargetEntity;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY, oldTargetEntity, targetEntity));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>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>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch() {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch) {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</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>Cascade</em>' containment reference.
- * @see #setCascade(CascadeType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping_Cascade()
- * @model containment="true"
- * @generated
- */
- public CascadeType getCascade() {
- return cascade;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCascade(CascadeType newCascade, NotificationChain msgs)
- {
- CascadeType oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE, oldCascade, newCascade);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getCascade <em>Cascade</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' containment reference.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(CascadeType newCascade) {
- if (newCascade != cascade)
- {
- NotificationChain msgs = null;
- if (cascade != null)
- msgs = ((InternalEObject)cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
- if (newCascade != null)
- msgs = ((InternalEObject)newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
- msgs = basicSetCascade(newCascade, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE, newCascade, newCascade));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE:
- return basicSetCascade(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 OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY:
- return getTargetEntity();
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH:
- return getFetch();
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE:
- return getCascade();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY:
- setTargetEntity((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE:
- setCascade((CascadeType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY:
- setTargetEntity(TARGET_ENTITY_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE:
- setCascade((CascadeType)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY:
- return TARGET_ENTITY_EDEFAULT == null ? targetEntity != null : !TARGET_ENTITY_EDEFAULT.equals(targetEntity);
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE:
- return cascade != null;
- }
- 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(" (targetEntity: ");
- result.append(targetEntity);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(')');
- return result.toString();
- }
-
- /**
- * Return the {@link TextRange} for the target-entity attribute.
- */
-
- public TextRange getTargetEntityTextRange() {
- return getAttributeTextRange(JPA.TARGET_ENTITY);
- }
-
-
- // ********** translators **********
-
- protected static Translator buildTargetEntityTranslator() {
- return new Translator(JPA.TARGET_ENTITY, OrmPackage.eINSTANCE.getAbstractXmlRelationshipMapping_TargetEntity(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildFetchTranslator() {
- return new Translator(JPA.FETCH, OrmPackage.eINSTANCE.getAbstractXmlRelationshipMapping_Fetch(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCascadeTranslator() {
- return CascadeType.buildTranslator(JPA.CASCADE, OrmPackage.eINSTANCE.getAbstractXmlRelationshipMapping_Cascade());
- }
-
-} // RelationshipMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlSingleRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlSingleRelationshipMapping.java
deleted file mode 100644
index b0c5572ed2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlSingleRelationshipMapping.java
+++ /dev/null
@@ -1,614 +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.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.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.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Single Relationship 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getOptional <em>Optional</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlSingleRelationshipMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlSingleRelationshipMapping extends AbstractXmlRelationshipMapping implements XmlJoinTableMapping, XmlJoinColumnsMapping, XmlSingleRelationshipMapping_2_0
-{
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
- /**
- * The default value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected static final Boolean ID_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getId() <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getId()
- * @generated
- * @ordered
- */
- protected Boolean id = ID_EDEFAULT;
- /**
- * The default value of the '{@link #getMapsId() <em>Maps Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapsId()
- * @generated
- * @ordered
- */
- protected static final String MAPS_ID_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMapsId() <em>Maps Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapsId()
- * @generated
- * @ordered
- */
- protected String mapsId = MAPS_ID_EDEFAULT;
- /**
- * The default value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected static final Boolean OPTIONAL_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected Boolean optional = OPTIONAL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlSingleRelationshipMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</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>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDerivedId_2_0_Id()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- public void setId(Boolean newId)
- {
- Boolean oldId = id;
- id = newId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID, oldId, id));
- }
-
- /**
- * Returns the value of the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Maps Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Maps Id</em>' attribute.
- * @see #setMapsId(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMapsId_2_0_MapsId()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapsId()
- {
- return mapsId;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getMapsId <em>Maps Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Maps Id</em>' attribute.
- * @see #getMapsId()
- * @generated
- */
- public void setMapsId(String newMapsId)
- {
- String oldMapsId = mapsId;
- mapsId = newMapsId;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID, oldMapsId, mapsId));
- }
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlSingleRelationshipMapping_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOptional() {
- return optional;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- public void setOptional(Boolean newOptional) {
- Boolean oldOptional = optional;
- optional = newOptional;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return basicSetJoinTable(null, msgs);
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).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 OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return getJoinTable();
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID:
- return getId();
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID:
- return getMapsId();
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL:
- return getOptional();
- }
- 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 OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID:
- setId((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID:
- setMapsId((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID:
- setId(ID_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID:
- setMapsId(MAPS_ID_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE:
- return joinTable != null;
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID:
- return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID:
- return MAPS_ID_EDEFAULT == null ? mapsId != null : !MAPS_ID_EDEFAULT.equals(mapsId);
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTableMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE: return OrmPackage.XML_JOIN_TABLE_MAPPING__JOIN_TABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinColumnsMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlDerivedId_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID: return OrmV2_0Package.XML_DERIVED_ID_20__ID;
- default: return -1;
- }
- }
- if (baseClass == XmlMapsId_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID: return OrmV2_0Package.XML_MAPS_ID_20__MAPS_ID;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping_2_0.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 == XmlJoinTableMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_TABLE_MAPPING__JOIN_TABLE: return OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinColumnsMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS: return OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlDerivedId_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_DERIVED_ID_20__ID: return OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID;
- default: return -1;
- }
- }
- if (baseClass == XmlMapsId_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_MAPS_ID_20__MAPS_ID: return OrmPackage.ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID;
- default: return -1;
- }
- }
- if (baseClass == XmlSingleRelationshipMapping_2_0.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(" (id: ");
- result.append(id);
- result.append(", mapsId: ");
- result.append(mapsId);
- result.append(", optional: ");
- result.append(optional);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** validation ***********
-
- public TextRange getMapsIdTextRange() {
- return getAttributeTextRange(JPA2_0.MAPS_ID);
- }
-
- public TextRange getIdTextRange() {
- return getAttributeTextRange(JPA2_0.ID);
- }
-
-
- // ********** translators **********
-
- protected static Translator buildOptionalTranslator() {
- return new Translator(JPA.OPTIONAL, OrmPackage.eINSTANCE.getAbstractXmlSingleRelationshipMapping_Optional(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMapsIdTranslator() {
- return new Translator(JPA2_0.MAPS_ID, OrmV2_0Package.eINSTANCE.getXmlMapsId_2_0_MapsId(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIdTranslator() {
- return new Translator(JPA2_0.ID, OrmV2_0Package.eINSTANCE.getXmlDerivedId_2_0_Id(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA.JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlJoinColumnsMapping_JoinColumns());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableMapping_JoinTable());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTable.java
deleted file mode 100644
index 2eeeaeb91c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTable.java
+++ /dev/null
@@ -1,439 +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.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.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.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Xml Base 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getUniqueConstraints <em>Unique Constraints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTable()
- * @model kind="class" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public abstract class AbstractXmlTable 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 #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 #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 cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUniqueConstraints()
- * @generated
- * @ordered
- */
- protected EList<XmlUniqueConstraint> uniqueConstraints;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_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.core.resource.orm.OrmPackage#getAbstractXmlTable_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.core.resource.orm.AbstractXmlTable#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, OrmPackage.ABSTRACT_XML_TABLE__NAME, oldName, name));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getAbstractXmlTable_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.core.resource.orm.AbstractXmlTable#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, OrmPackage.ABSTRACT_XML_TABLE__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getAbstractXmlTable_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.core.resource.orm.AbstractXmlTable#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, OrmPackage.ABSTRACT_XML_TABLE__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</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>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTable_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlUniqueConstraint> getUniqueConstraints()
- {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS);
- }
- return uniqueConstraints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS:
- return ((InternalEList<?>)getUniqueConstraints()).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 OrmPackage.ABSTRACT_XML_TABLE__NAME:
- return getName();
- case OrmPackage.ABSTRACT_XML_TABLE__CATALOG:
- return getCatalog();
- case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA:
- return getSchema();
- case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS:
- return getUniqueConstraints();
- }
- 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 OrmPackage.ABSTRACT_XML_TABLE__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- getUniqueConstraints().addAll((Collection<? extends XmlUniqueConstraint>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.ABSTRACT_XML_TABLE__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.ABSTRACT_XML_TABLE__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS:
- return uniqueConstraints != null && !uniqueConstraints.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(", catalog: ");
- result.append(catalog);
- result.append(", schema: ");
- result.append(schema);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- public TextRange getCatalogTextRange() {
- return getAttributeTextRange(JPA.CATALOG);
- }
-
- public TextRange getSchemaTextRange() {
- return getAttributeTextRange(JPA.SCHEMA);
- }
-
- // ********** translators **********
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getAbstractXmlTable_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(JPA.CATALOG, OrmPackage.eINSTANCE.getAbstractXmlTable_Catalog(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(JPA.SCHEMA, OrmPackage.eINSTANCE.getAbstractXmlTable_Schema(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUniqueConstraintTranslator() {
- return XmlUniqueConstraint.buildTranslator(JPA.UNIQUE_CONSTRAINT, OrmPackage.eINSTANCE.getAbstractXmlTable_UniqueConstraints());
- }
-
-} // AbstractXmlBaseTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
deleted file mode 100644
index 322b3eab36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
+++ /dev/null
@@ -1,521 +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.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.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Type 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.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractXmlTypeMapping extends AbstractJpaEObject implements XmlTypeMapping
-{
- /**
- * 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 AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * 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;
-
- /**
- * The default value of the '{@link #getMetadataComplete() <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMetadataComplete()
- * @generated
- * @ordered
- */
- protected static final Boolean METADATA_COMPLETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMetadataComplete() <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMetadataComplete()
- * @generated
- * @ordered
- */
- protected Boolean metadataComplete = METADATA_COMPLETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributes()
- * @generated
- * @ordered
- */
- protected Attributes attributes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractXmlTypeMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ABSTRACT_XML_TYPE_MAPPING;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlTypeMapping_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#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, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder_Access()
- * @model
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Metadata Complete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Metadata Complete</em>' attribute.
- * @see #setMetadataComplete(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_MetadataComplete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMetadataComplete()
- {
- return metadataComplete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Metadata Complete</em>' attribute.
- * @see #getMetadataComplete()
- * @generated
- */
- public void setMetadataComplete(Boolean newMetadataComplete)
- {
- Boolean oldMetadataComplete = metadataComplete;
- metadataComplete = newMetadataComplete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE, oldMetadataComplete, metadataComplete));
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</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>Attributes</em>' containment reference.
- * @see #setAttributes(Attributes)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_Attributes()
- * @model containment="true"
- * @generated
- */
- public Attributes getAttributes()
- {
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAttributes(Attributes newAttributes, NotificationChain msgs)
- {
- Attributes oldAttributes = attributes;
- attributes = newAttributes;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, oldAttributes, newAttributes);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping#getAttributes <em>Attributes</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attributes</em>' containment reference.
- * @see #getAttributes()
- * @generated
- */
- public void setAttributes(Attributes newAttributes)
- {
- if (newAttributes != attributes)
- {
- NotificationChain msgs = null;
- if (attributes != null)
- msgs = ((InternalEObject)attributes).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, null, msgs);
- if (newAttributes != null)
- msgs = ((InternalEObject)newAttributes).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, null, msgs);
- msgs = basicSetAttributes(newAttributes, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES, newAttributes, newAttributes));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return basicSetAttributes(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 OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return getAccess();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- return getClassName();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- return getMetadataComplete();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- return getDescription();
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return getAttributes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- setClassName((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- setMetadataComplete((Boolean)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- setAttributes((Attributes)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- setMetadataComplete(METADATA_COMPLETE_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- setAttributes((Attributes)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE:
- return METADATA_COMPLETE_EDEFAULT == null ? metadataComplete != null : !METADATA_COMPLETE_EDEFAULT.equals(metadataComplete);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES:
- return attributes != null;
- }
- 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(" (access: ");
- result.append(access);
- result.append(", className: ");
- result.append(className);
- result.append(", metadataComplete: ");
- result.append(metadataComplete);
- result.append(", description: ");
- result.append(description);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange getClassTextRange() {
- return getAttributeTextRange(JPA.CLASS);
- }
-
- public TextRange getAttributesTextRange() {
- return getAttributeTextRange(JPA.ATTRIBUTES);
- }
-
- // ********** translators **********
-
- protected static Translator buildClassTranslator() {
- return new Translator(JPA.CLASS, OrmPackage.eINSTANCE.getXmlTypeMapping_ClassName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMetadataCompleteTranslator() {
- return new Translator(JPA.METADATA_COMPLETE, OrmPackage.eINSTANCE.getXmlTypeMapping_MetadataComplete(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmPackage.eINSTANCE.getXmlTypeMapping_Description());
- }
-
- protected static Translator buildAttributesTranslator() {
- return Attributes.buildTranslator();
- }
-
-} // TypeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java
deleted file mode 100644
index aae4803e05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AccessType.java
+++ /dev/null
@@ -1,235 +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.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>Access 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @model
- * @generated
- */
-public enum AccessType implements Enumerator
-{
- /**
- * The '<em><b>PROPERTY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PROPERTY_VALUE
- * @generated
- * @ordered
- */
- PROPERTY(0, "PROPERTY", "PROPERTY"),
-
- /**
- * The '<em><b>FIELD</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #FIELD_VALUE
- * @generated
- * @ordered
- */
- FIELD(1, "FIELD", "FIELD");
-
- /**
- * The '<em><b>PROPERTY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PROPERTY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PROPERTY
- * @model
- * @generated
- * @ordered
- */
- public static final int PROPERTY_VALUE = 0;
-
- /**
- * The '<em><b>FIELD</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>FIELD</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #FIELD
- * @model
- * @generated
- * @ordered
- */
- public static final int FIELD_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Access Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final AccessType[] VALUES_ARRAY =
- new AccessType[]
- {
- PROPERTY,
- FIELD,
- };
-
- /**
- * A public read-only list of all the '<em><b>Access Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<AccessType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- AccessType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- AccessType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Access Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static AccessType get(int value)
- {
- switch (value)
- {
- case PROPERTY_VALUE: return PROPERTY;
- case FIELD_VALUE: return FIELD;
- }
- 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 AccessType(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;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java
deleted file mode 100644
index e40fea2e8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,792 +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.core.resource.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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.core.resource.orm.Attributes#getIds <em>Ids</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds <em>Embedded Ids</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getBasics <em>Basics</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getVersions <em>Versions</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes <em>Many To Ones</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys <em>One To Manys</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes <em>One To Ones</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys <em>Many To Manys</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds <em>Embeddeds</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.Attributes#getTransients <em>Transients</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @model kind="class"
- * @generated
- */
-public class Attributes extends AbstractJpaEObject implements XmlAttributes_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getElementCollections() <em>Element Collections</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getElementCollections()
- * @generated
- * @ordered
- */
- protected EList<XmlElementCollection> elementCollections;
-
- /**
- * The cached value of the '{@link #getIds() <em>Ids</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIds()
- * @generated
- * @ordered
- */
- protected EList<XmlId> ids;
-
- /**
- * The cached value of the '{@link #getEmbeddedIds() <em>Embedded Ids</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddedIds()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbeddedId> embeddedIds;
-
- /**
- * The cached value of the '{@link #getBasics() <em>Basics</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasics()
- * @generated
- * @ordered
- */
- protected EList<XmlBasic> basics;
-
- /**
- * The cached value of the '{@link #getVersions() <em>Versions</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersions()
- * @generated
- * @ordered
- */
- protected EList<XmlVersion> versions;
-
- /**
- * The cached value of the '{@link #getManyToOnes() <em>Many To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getManyToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlManyToOne> manyToOnes;
-
- /**
- * The cached value of the '{@link #getOneToManys() <em>One To Manys</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOneToManys()
- * @generated
- * @ordered
- */
- protected EList<XmlOneToMany> oneToManys;
-
- /**
- * The cached value of the '{@link #getOneToOnes() <em>One To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOneToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlOneToOne> oneToOnes;
-
- /**
- * The cached value of the '{@link #getManyToManys() <em>Many To Manys</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getManyToManys()
- * @generated
- * @ordered
- */
- protected EList<XmlManyToMany> manyToManys;
-
- /**
- * The cached value of the '{@link #getEmbeddeds() <em>Embeddeds</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddeds()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbedded> embeddeds;
-
- /**
- * The cached value of the '{@link #getTransients() <em>Transients</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransients()
- * @generated
- * @ordered
- */
- protected EList<XmlTransient> transients;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Attributes()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ATTRIBUTES;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributes_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.Attributes#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ATTRIBUTES__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Element Collections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlElementCollection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Element 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>Element Collections</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributes_2_0_ElementCollections()
- * @model containment="true"
- * @generated
- */
- public EList<XmlElementCollection> getElementCollections()
- {
- if (elementCollections == null)
- {
- elementCollections = new EObjectContainmentEList<XmlElementCollection>(XmlElementCollection.class, this, OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS);
- }
- return elementCollections;
- }
-
- /**
- * Returns the value of the '<em><b>Ids</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlId}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Ids</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>Ids</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Ids()
- * @model containment="true"
- * @generated
- */
- public EList<XmlId> getIds()
- {
- if (ids == null)
- {
- ids = new EObjectContainmentEList<XmlId>(XmlId.class, this, OrmPackage.ATTRIBUTES__IDS);
- }
- return ids;
- }
-
- /**
- * Returns the value of the '<em><b>Embedded Ids</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embedded Ids</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>Embedded Ids</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_EmbeddedIds()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbeddedId> getEmbeddedIds()
- {
- if (embeddedIds == null)
- {
- embeddedIds = new EObjectContainmentEList<XmlEmbeddedId>(XmlEmbeddedId.class, this, OrmPackage.ATTRIBUTES__EMBEDDED_IDS);
- }
- return embeddedIds;
- }
-
- /**
- * Returns the value of the '<em><b>Basics</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlBasic}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basics</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>Basics</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Basics()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasic> getBasics()
- {
- if (basics == null)
- {
- basics = new EObjectContainmentEList<XmlBasic>(XmlBasic.class, this, OrmPackage.ATTRIBUTES__BASICS);
- }
- return basics;
- }
-
- /**
- * Returns the value of the '<em><b>Versions</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlVersion}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Versions</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>Versions</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Versions()
- * @model containment="true"
- * @generated
- */
- public EList<XmlVersion> getVersions()
- {
- if (versions == null)
- {
- versions = new EObjectContainmentEList<XmlVersion>(XmlVersion.class, this, OrmPackage.ATTRIBUTES__VERSIONS);
- }
- return versions;
- }
-
- /**
- * Returns the value of the '<em><b>Many To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlManyToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Many 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>Many To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_ManyToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlManyToOne> getManyToOnes()
- {
- if (manyToOnes == null)
- {
- manyToOnes = new EObjectContainmentEList<XmlManyToOne>(XmlManyToOne.class, this, OrmPackage.ATTRIBUTES__MANY_TO_ONES);
- }
- return manyToOnes;
- }
-
- /**
- * Returns the value of the '<em><b>One To Manys</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlOneToMany}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>One To Manys</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>One To Manys</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_OneToManys()
- * @model containment="true"
- * @generated
- */
- public EList<XmlOneToMany> getOneToManys()
- {
- if (oneToManys == null)
- {
- oneToManys = new EObjectContainmentEList<XmlOneToMany>(XmlOneToMany.class, this, OrmPackage.ATTRIBUTES__ONE_TO_MANYS);
- }
- return oneToManys;
- }
-
- /**
- * Returns the value of the '<em><b>One To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlOneToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>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>One To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_OneToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlOneToOne> getOneToOnes()
- {
- if (oneToOnes == null)
- {
- oneToOnes = new EObjectContainmentEList<XmlOneToOne>(XmlOneToOne.class, this, OrmPackage.ATTRIBUTES__ONE_TO_ONES);
- }
- return oneToOnes;
- }
-
- /**
- * Returns the value of the '<em><b>Many To Manys</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlManyToMany}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Many To Manys</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>Many To Manys</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_ManyToManys()
- * @model containment="true"
- * @generated
- */
- public EList<XmlManyToMany> getManyToManys()
- {
- if (manyToManys == null)
- {
- manyToManys = new EObjectContainmentEList<XmlManyToMany>(XmlManyToMany.class, this, OrmPackage.ATTRIBUTES__MANY_TO_MANYS);
- }
- return manyToManys;
- }
-
- /**
- * Returns the value of the '<em><b>Embeddeds</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbedded}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embeddeds</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>Embeddeds</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Embeddeds()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbedded> getEmbeddeds()
- {
- if (embeddeds == null)
- {
- embeddeds = new EObjectContainmentEList<XmlEmbedded>(XmlEmbedded.class, this, OrmPackage.ATTRIBUTES__EMBEDDEDS);
- }
- return embeddeds;
- }
-
- /**
- * Returns the value of the '<em><b>Transients</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlTransient}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transients</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>Transients</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes_Transients()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTransient> getTransients()
- {
- if (transients == null)
- {
- transients = new EObjectContainmentEList<XmlTransient>(XmlTransient.class, this, OrmPackage.ATTRIBUTES__TRANSIENTS);
- }
- return transients;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS:
- return ((InternalEList<?>)getElementCollections()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__IDS:
- return ((InternalEList<?>)getIds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return ((InternalEList<?>)getEmbeddedIds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__BASICS:
- return ((InternalEList<?>)getBasics()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return ((InternalEList<?>)getVersions()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return ((InternalEList<?>)getManyToOnes()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return ((InternalEList<?>)getOneToManys()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return ((InternalEList<?>)getOneToOnes()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return ((InternalEList<?>)getManyToManys()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return ((InternalEList<?>)getEmbeddeds()).basicRemove(otherEnd, msgs);
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return ((InternalEList<?>)getTransients()).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 OrmPackage.ATTRIBUTES__DESCRIPTION:
- return getDescription();
- case OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS:
- return getElementCollections();
- case OrmPackage.ATTRIBUTES__IDS:
- return getIds();
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return getEmbeddedIds();
- case OrmPackage.ATTRIBUTES__BASICS:
- return getBasics();
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return getVersions();
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return getManyToOnes();
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return getOneToManys();
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return getOneToOnes();
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return getManyToManys();
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return getEmbeddeds();
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return getTransients();
- }
- 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 OrmPackage.ATTRIBUTES__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS:
- getElementCollections().clear();
- getElementCollections().addAll((Collection<? extends XmlElementCollection>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__IDS:
- getIds().clear();
- getIds().addAll((Collection<? extends XmlId>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- getEmbeddedIds().clear();
- getEmbeddedIds().addAll((Collection<? extends XmlEmbeddedId>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__BASICS:
- getBasics().clear();
- getBasics().addAll((Collection<? extends XmlBasic>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__VERSIONS:
- getVersions().clear();
- getVersions().addAll((Collection<? extends XmlVersion>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- getManyToOnes().clear();
- getManyToOnes().addAll((Collection<? extends XmlManyToOne>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- getOneToManys().clear();
- getOneToManys().addAll((Collection<? extends XmlOneToMany>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- getOneToOnes().clear();
- getOneToOnes().addAll((Collection<? extends XmlOneToOne>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- getManyToManys().clear();
- getManyToManys().addAll((Collection<? extends XmlManyToMany>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- getEmbeddeds().clear();
- getEmbeddeds().addAll((Collection<? extends XmlEmbedded>)newValue);
- return;
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- getTransients().clear();
- getTransients().addAll((Collection<? extends XmlTransient>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS:
- getElementCollections().clear();
- return;
- case OrmPackage.ATTRIBUTES__IDS:
- getIds().clear();
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- getEmbeddedIds().clear();
- return;
- case OrmPackage.ATTRIBUTES__BASICS:
- getBasics().clear();
- return;
- case OrmPackage.ATTRIBUTES__VERSIONS:
- getVersions().clear();
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- getManyToOnes().clear();
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- getOneToManys().clear();
- return;
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- getOneToOnes().clear();
- return;
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- getManyToManys().clear();
- return;
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- getEmbeddeds().clear();
- return;
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- getTransients().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ATTRIBUTES__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS:
- return elementCollections != null && !elementCollections.isEmpty();
- case OrmPackage.ATTRIBUTES__IDS:
- return ids != null && !ids.isEmpty();
- case OrmPackage.ATTRIBUTES__EMBEDDED_IDS:
- return embeddedIds != null && !embeddedIds.isEmpty();
- case OrmPackage.ATTRIBUTES__BASICS:
- return basics != null && !basics.isEmpty();
- case OrmPackage.ATTRIBUTES__VERSIONS:
- return versions != null && !versions.isEmpty();
- case OrmPackage.ATTRIBUTES__MANY_TO_ONES:
- return manyToOnes != null && !manyToOnes.isEmpty();
- case OrmPackage.ATTRIBUTES__ONE_TO_MANYS:
- return oneToManys != null && !oneToManys.isEmpty();
- case OrmPackage.ATTRIBUTES__ONE_TO_ONES:
- return oneToOnes != null && !oneToOnes.isEmpty();
- case OrmPackage.ATTRIBUTES__MANY_TO_MANYS:
- return manyToManys != null && !manyToManys.isEmpty();
- case OrmPackage.ATTRIBUTES__EMBEDDEDS:
- return embeddeds != null && !embeddeds.isEmpty();
- case OrmPackage.ATTRIBUTES__TRANSIENTS:
- return transients != null && !transients.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(" (description: ");
- result.append(description);
- result.append(')');
- return result.toString();
- }
-
- 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.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.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.getTransients().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- return attributeMappings;
- }
-
- private 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, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.ATTRIBUTES,
- OrmPackage.eINSTANCE.getXmlTypeMapping_Attributes());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- XmlId.buildTranslator(JPA.ID, OrmPackage.eINSTANCE.getAttributes_Ids()),
- XmlEmbeddedId.buildTranslator(JPA.EMBEDDED_ID, OrmPackage.eINSTANCE.getAttributes_EmbeddedIds()),
- XmlBasic.buildTranslator(JPA.BASIC, OrmPackage.eINSTANCE.getAttributes_Basics()),
- XmlVersion.buildTranslator(JPA.VERSION, OrmPackage.eINSTANCE.getAttributes_Versions()),
- XmlManyToOne.buildTranslator(JPA.MANY_TO_ONE, OrmPackage.eINSTANCE.getAttributes_ManyToOnes()),
- XmlOneToMany.buildTranslator(JPA.ONE_TO_MANY, OrmPackage.eINSTANCE.getAttributes_OneToManys()),
- XmlOneToOne.buildTranslator(JPA.ONE_TO_ONE, OrmPackage.eINSTANCE.getAttributes_OneToOnes()),
- XmlManyToMany.buildTranslator(JPA.MANY_TO_MANY, OrmPackage.eINSTANCE.getAttributes_ManyToManys()),
- XmlElementCollection.buildTranslator(JPA2_0.ELEMENT_COLLECTION, OrmV2_0Package.eINSTANCE.getXmlAttributes_2_0_ElementCollections()),
- XmlEmbedded.buildTranslator(JPA.EMBEDDED, OrmPackage.eINSTANCE.getAttributes_Embeddeds()),
- XmlTransient.buildTranslator(JPA.TRANSIENT, OrmPackage.eINSTANCE.getAttributes_Transients()),
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java
deleted file mode 100644
index ece75dd73a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/CascadeType.java
+++ /dev/null
@@ -1,586 +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.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.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Cascade Type</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.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @model kind="class"
- * @generated
- */
-public class CascadeType extends AbstractJpaEObject implements XmlCascadeType_2_0
-{
- /**
- * The default value of the '{@link #isCascadeDetach() <em>Cascade Detach</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeDetach()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_DETACH_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeDetach() <em>Cascade Detach</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeDetach()
- * @generated
- * @ordered
- */
- protected boolean cascadeDetach = CASCADE_DETACH_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeAll() <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeAll()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeAll() <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeAll()
- * @generated
- * @ordered
- */
- protected boolean cascadeAll = CASCADE_ALL_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_PERSIST_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected boolean cascadePersist = CASCADE_PERSIST_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeMerge() <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeMerge()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_MERGE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeMerge() <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeMerge()
- * @generated
- * @ordered
- */
- protected boolean cascadeMerge = CASCADE_MERGE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeRemove() <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRemove()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_REMOVE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeRemove() <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRemove()
- * @generated
- * @ordered
- */
- protected boolean cascadeRemove = CASCADE_REMOVE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isCascadeRefresh() <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRefresh()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_REFRESH_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadeRefresh() <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadeRefresh()
- * @generated
- * @ordered
- */
- protected boolean cascadeRefresh = CASCADE_REFRESH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected CascadeType()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.CASCADE_TYPE;
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Detach</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Detach</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 Detach</em>' attribute.
- * @see #setCascadeDetach(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlCascadeType_2_0_CascadeDetach()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeDetach()
- {
- return cascadeDetach;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeDetach <em>Cascade Detach</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Detach</em>' attribute.
- * @see #isCascadeDetach()
- * @generated
- */
- public void setCascadeDetach(boolean newCascadeDetach)
- {
- boolean oldCascadeDetach = cascadeDetach;
- cascadeDetach = newCascadeDetach;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_DETACH, oldCascadeDetach, cascadeDetach));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade 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>Cascade All</em>' attribute.
- * @see #setCascadeAll(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeAll()
- {
- return cascadeAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade All</em>' attribute.
- * @see #isCascadeAll()
- * @generated
- */
- public void setCascadeAll(boolean newCascadeAll)
- {
- boolean oldCascadeAll = cascadeAll;
- cascadeAll = newCascadeAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_ALL, oldCascadeAll, cascadeAll));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Persist</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 Persist</em>' attribute.
- * @see #setCascadePersist(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadePersist()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadePersist()
- {
- return cascadePersist;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Persist</em>' attribute.
- * @see #isCascadePersist()
- * @generated
- */
- public void setCascadePersist(boolean newCascadePersist)
- {
- boolean oldCascadePersist = cascadePersist;
- cascadePersist = newCascadePersist;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_PERSIST, oldCascadePersist, cascadePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Merge</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 Merge</em>' attribute.
- * @see #setCascadeMerge(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeMerge()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeMerge()
- {
- return cascadeMerge;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Merge</em>' attribute.
- * @see #isCascadeMerge()
- * @generated
- */
- public void setCascadeMerge(boolean newCascadeMerge)
- {
- boolean oldCascadeMerge = cascadeMerge;
- cascadeMerge = newCascadeMerge;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_MERGE, oldCascadeMerge, cascadeMerge));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Remove</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 Remove</em>' attribute.
- * @see #setCascadeRemove(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRemove()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeRemove()
- {
- return cascadeRemove;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Remove</em>' attribute.
- * @see #isCascadeRemove()
- * @generated
- */
- public void setCascadeRemove(boolean newCascadeRemove)
- {
- boolean oldCascadeRemove = cascadeRemove;
- cascadeRemove = newCascadeRemove;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_REMOVE, oldCascadeRemove, cascadeRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade 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>Cascade Refresh</em>' attribute.
- * @see #setCascadeRefresh(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType_CascadeRefresh()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadeRefresh()
- {
- return cascadeRefresh;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Refresh</em>' attribute.
- * @see #isCascadeRefresh()
- * @generated
- */
- public void setCascadeRefresh(boolean newCascadeRefresh)
- {
- boolean oldCascadeRefresh = cascadeRefresh;
- cascadeRefresh = newCascadeRefresh;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.CASCADE_TYPE__CASCADE_REFRESH, oldCascadeRefresh, cascadeRefresh));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE__CASCADE_DETACH:
- return isCascadeDetach();
- case OrmPackage.CASCADE_TYPE__CASCADE_ALL:
- return isCascadeAll();
- case OrmPackage.CASCADE_TYPE__CASCADE_PERSIST:
- return isCascadePersist();
- case OrmPackage.CASCADE_TYPE__CASCADE_MERGE:
- return isCascadeMerge();
- case OrmPackage.CASCADE_TYPE__CASCADE_REMOVE:
- return isCascadeRemove();
- case OrmPackage.CASCADE_TYPE__CASCADE_REFRESH:
- return isCascadeRefresh();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE__CASCADE_DETACH:
- setCascadeDetach((Boolean)newValue);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_ALL:
- setCascadeAll((Boolean)newValue);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_PERSIST:
- setCascadePersist((Boolean)newValue);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_MERGE:
- setCascadeMerge((Boolean)newValue);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_REMOVE:
- setCascadeRemove((Boolean)newValue);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_REFRESH:
- setCascadeRefresh((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE__CASCADE_DETACH:
- setCascadeDetach(CASCADE_DETACH_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_ALL:
- setCascadeAll(CASCADE_ALL_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_PERSIST:
- setCascadePersist(CASCADE_PERSIST_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_MERGE:
- setCascadeMerge(CASCADE_MERGE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_REMOVE:
- setCascadeRemove(CASCADE_REMOVE_EDEFAULT);
- return;
- case OrmPackage.CASCADE_TYPE__CASCADE_REFRESH:
- setCascadeRefresh(CASCADE_REFRESH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.CASCADE_TYPE__CASCADE_DETACH:
- return cascadeDetach != CASCADE_DETACH_EDEFAULT;
- case OrmPackage.CASCADE_TYPE__CASCADE_ALL:
- return cascadeAll != CASCADE_ALL_EDEFAULT;
- case OrmPackage.CASCADE_TYPE__CASCADE_PERSIST:
- return cascadePersist != CASCADE_PERSIST_EDEFAULT;
- case OrmPackage.CASCADE_TYPE__CASCADE_MERGE:
- return cascadeMerge != CASCADE_MERGE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE__CASCADE_REMOVE:
- return cascadeRemove != CASCADE_REMOVE_EDEFAULT;
- case OrmPackage.CASCADE_TYPE__CASCADE_REFRESH:
- return cascadeRefresh != CASCADE_REFRESH_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(" (cascadeDetach: ");
- result.append(cascadeDetach);
- result.append(", cascadeAll: ");
- result.append(cascadeAll);
- result.append(", cascadePersist: ");
- result.append(cascadePersist);
- result.append(", cascadeMerge: ");
- result.append(cascadeMerge);
- result.append(", cascadeRemove: ");
- result.append(cascadeRemove);
- result.append(", cascadeRefresh: ");
- result.append(cascadeRefresh);
- 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[] {
- buildCascadeAllTranslator(),
- buildCascadePersistTranslator(),
- buildCascadeMergeTranslator(),
- buildCascadeRemoveTranslator(),
- buildCascadeRefreshTranslator(),
- buildCascadeDetachTranslator()
- };
- }
-
- protected static Translator buildCascadeAllTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_ALL, OrmPackage.eINSTANCE.getCascadeType_CascadeAll());
- }
-
- protected static Translator buildCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_PERSIST, OrmPackage.eINSTANCE.getCascadeType_CascadePersist());
- }
-
- protected static Translator buildCascadeMergeTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_MERGE, OrmPackage.eINSTANCE.getCascadeType_CascadeMerge());
- }
-
- protected static Translator buildCascadeRemoveTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_REMOVE, OrmPackage.eINSTANCE.getCascadeType_CascadeRemove());
- }
-
- protected static Translator buildCascadeRefreshTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_REFRESH, OrmPackage.eINSTANCE.getCascadeType_CascadeRefresh());
- }
-
- protected static Translator buildCascadeDetachTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_DETACH, OrmV2_0Package.eINSTANCE.getXmlCascadeType_2_0_CascadeDetach());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java
deleted file mode 100644
index fe4b19999a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnMapping.java
+++ /dev/null
@@ -1,65 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface ColumnMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- XmlColumn getColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- void setColumn(XmlColumn value);
-
-} // ColumnMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java
deleted file mode 100644
index 336c564674..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/ColumnResult.java
+++ /dev/null
@@ -1,221 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Column Result</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.core.resource.orm.ColumnResult#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class ColumnResult 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 ColumnResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.COLUMN_RESULT;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getColumnResult_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult#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, OrmPackage.COLUMN_RESULT__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__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 OrmPackage.COLUMN_RESULT__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 OrmPackage.COLUMN_RESULT__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.COLUMN_RESULT__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(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getColumnResult_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // ColumnResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java
deleted file mode 100644
index ce4a9a30b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/DiscriminatorType.java
+++ /dev/null
@@ -1,262 +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.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>Discriminator 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @model
- * @generated
- */
-public enum DiscriminatorType implements Enumerator
-{
- /**
- * The '<em><b>STRING</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #STRING_VALUE
- * @generated
- * @ordered
- */
- STRING(0, "STRING", "STRING"),
-
- /**
- * The '<em><b>CHAR</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHAR_VALUE
- * @generated
- * @ordered
- */
- CHAR(1, "CHAR", "CHAR"),
-
- /**
- * The '<em><b>INTEGER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INTEGER_VALUE
- * @generated
- * @ordered
- */
- INTEGER(2, "INTEGER", "INTEGER");
-
- /**
- * The '<em><b>STRING</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>STRING</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #STRING
- * @model
- * @generated
- * @ordered
- */
- public static final int STRING_VALUE = 0;
-
- /**
- * The '<em><b>CHAR</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHAR</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHAR
- * @model
- * @generated
- * @ordered
- */
- public static final int CHAR_VALUE = 1;
-
- /**
- * The '<em><b>INTEGER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INTEGER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INTEGER
- * @model
- * @generated
- * @ordered
- */
- public static final int INTEGER_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Discriminator Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final DiscriminatorType[] VALUES_ARRAY =
- new DiscriminatorType[]
- {
- STRING,
- CHAR,
- INTEGER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Discriminator Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<DiscriminatorType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DiscriminatorType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DiscriminatorType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Discriminator Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DiscriminatorType get(int value)
- {
- switch (value)
- {
- case STRING_VALUE: return STRING;
- case CHAR_VALUE: return CHAR;
- case INTEGER_VALUE: return INTEGER;
- }
- 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 DiscriminatorType(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;
- }
-
-} //DiscriminatorType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java
deleted file mode 100644
index cb60fce4f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListener.java
+++ /dev/null
@@ -1,928 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Listener</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.core.resource.orm.EntityListener#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @model kind="class"
- * @generated
- */
-public class EntityListener extends AbstractJpaEObject implements XmlEventMethodContainer, XmlEntityListener_2_0
-{
- /**
- * The cached value of the '{@link #getPrePersist() <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrePersist()
- * @generated
- * @ordered
- */
- protected PrePersist prePersist;
-
- /**
- * The cached value of the '{@link #getPostPersist() <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostPersist()
- * @generated
- * @ordered
- */
- protected PostPersist postPersist;
-
- /**
- * The cached value of the '{@link #getPreRemove() <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreRemove()
- * @generated
- * @ordered
- */
- protected PreRemove preRemove;
-
- /**
- * The cached value of the '{@link #getPostRemove() <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostRemove()
- * @generated
- * @ordered
- */
- protected PostRemove postRemove;
-
- /**
- * The cached value of the '{@link #getPreUpdate() <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreUpdate()
- * @generated
- * @ordered
- */
- protected PreUpdate preUpdate;
-
- /**
- * The cached value of the '{@link #getPostUpdate() <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostUpdate()
- * @generated
- * @ordered
- */
- protected PostUpdate postUpdate;
-
- /**
- * The cached value of the '{@link #getPostLoad() <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostLoad()
- * @generated
- * @ordered
- */
- protected PostLoad postLoad;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * 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 EntityListener()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_LISTENER;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getEntityListener_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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, OrmPackage.ENTITY_LISTENER__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</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>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PrePersist()
- * @model containment="true"
- * @generated
- */
- public PrePersist getPrePersist()
- {
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrePersist(PrePersist newPrePersist, NotificationChain msgs)
- {
- PrePersist oldPrePersist = prePersist;
- prePersist = newPrePersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_PERSIST, oldPrePersist, newPrePersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- public void setPrePersist(PrePersist newPrePersist)
- {
- if (newPrePersist != prePersist)
- {
- NotificationChain msgs = null;
- if (prePersist != null)
- msgs = ((InternalEObject)prePersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_PERSIST, newPrePersist, newPrePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</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>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostPersist()
- * @model containment="true"
- * @generated
- */
- public PostPersist getPostPersist()
- {
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostPersist(PostPersist newPostPersist, NotificationChain msgs)
- {
- PostPersist oldPostPersist = postPersist;
- postPersist = newPostPersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_PERSIST, oldPostPersist, newPostPersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- public void setPostPersist(PostPersist newPostPersist)
- {
- if (newPostPersist != postPersist)
- {
- NotificationChain msgs = null;
- if (postPersist != null)
- msgs = ((InternalEObject)postPersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_PERSIST, newPostPersist, newPostPersist));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</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>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreRemove()
- * @model containment="true"
- * @generated
- */
- public PreRemove getPreRemove()
- {
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreRemove(PreRemove newPreRemove, NotificationChain msgs)
- {
- PreRemove oldPreRemove = preRemove;
- preRemove = newPreRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_REMOVE, oldPreRemove, newPreRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- public void setPreRemove(PreRemove newPreRemove)
- {
- if (newPreRemove != preRemove)
- {
- NotificationChain msgs = null;
- if (preRemove != null)
- msgs = ((InternalEObject)preRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_REMOVE, newPreRemove, newPreRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</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>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostRemove()
- * @model containment="true"
- * @generated
- */
- public PostRemove getPostRemove()
- {
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostRemove(PostRemove newPostRemove, NotificationChain msgs)
- {
- PostRemove oldPostRemove = postRemove;
- postRemove = newPostRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_REMOVE, oldPostRemove, newPostRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- public void setPostRemove(PostRemove newPostRemove)
- {
- if (newPostRemove != postRemove)
- {
- NotificationChain msgs = null;
- if (postRemove != null)
- msgs = ((InternalEObject)postRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_REMOVE, newPostRemove, newPostRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</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>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreUpdate()
- * @model containment="true"
- * @generated
- */
- public PreUpdate getPreUpdate()
- {
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreUpdate(PreUpdate newPreUpdate, NotificationChain msgs)
- {
- PreUpdate oldPreUpdate = preUpdate;
- preUpdate = newPreUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_UPDATE, oldPreUpdate, newPreUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- public void setPreUpdate(PreUpdate newPreUpdate)
- {
- if (newPreUpdate != preUpdate)
- {
- NotificationChain msgs = null;
- if (preUpdate != null)
- msgs = ((InternalEObject)preUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__PRE_UPDATE, newPreUpdate, newPreUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</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>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostUpdate()
- * @model containment="true"
- * @generated
- */
- public PostUpdate getPostUpdate()
- {
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostUpdate(PostUpdate newPostUpdate, NotificationChain msgs)
- {
- PostUpdate oldPostUpdate = postUpdate;
- postUpdate = newPostUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_UPDATE, oldPostUpdate, newPostUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- public void setPostUpdate(PostUpdate newPostUpdate)
- {
- if (newPostUpdate != postUpdate)
- {
- NotificationChain msgs = null;
- if (postUpdate != null)
- msgs = ((InternalEObject)postUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_UPDATE, newPostUpdate, newPostUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</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>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostLoad()
- * @model containment="true"
- * @generated
- */
- public PostLoad getPostLoad()
- {
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostLoad(PostLoad newPostLoad, NotificationChain msgs)
- {
- PostLoad oldPostLoad = postLoad;
- postLoad = newPostLoad;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_LOAD, oldPostLoad, newPostLoad);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- public void setPostLoad(PostLoad newPostLoad)
- {
- if (newPostLoad != postLoad)
- {
- NotificationChain msgs = null;
- if (postLoad != null)
- msgs = ((InternalEObject)postLoad).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.ENTITY_LISTENER__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityListener_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityListener#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_LISTENER__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return basicSetPostLoad(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 OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return getPostLoad();
- case OrmPackage.ENTITY_LISTENER__DESCRIPTION:
- return getDescription();
- case OrmPackage.ENTITY_LISTENER__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 OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- setPostLoad((PostLoad)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.ENTITY_LISTENER__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 OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- setPostLoad((PostLoad)null);
- return;
- case OrmPackage.ENTITY_LISTENER__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.ENTITY_LISTENER__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 OrmPackage.ENTITY_LISTENER__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.ENTITY_LISTENER__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.ENTITY_LISTENER__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.ENTITY_LISTENER__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.ENTITY_LISTENER__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.ENTITY_LISTENER__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.ENTITY_LISTENER__POST_LOAD:
- return postLoad != null;
- case OrmPackage.ENTITY_LISTENER__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.ENTITY_LISTENER__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 int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlEntityListener_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.ENTITY_LISTENER__DESCRIPTION: return OrmV2_0Package.XML_ENTITY_LISTENER_20__DESCRIPTION;
- 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 == XmlEntityListener_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ENTITY_LISTENER_20__DESCRIPTION: return OrmPackage.ENTITY_LISTENER__DESCRIPTION;
- 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(" (description: ");
- result.append(description);
- result.append(", className: ");
- result.append(className);
- 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[] {
- buildDescriptionTranslator(),
- buildClassTranslator(),
- PrePersist.buildTranslator(),
- PostPersist.buildTranslator(),
- PreRemove.buildTranslator(),
- PostRemove.buildTranslator(),
- PreUpdate.buildTranslator(),
- PostUpdate.buildTranslator(),
- PostLoad.buildTranslator()
- };
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlEntityListener_2_0_Description());
- }
-
- protected static Translator buildClassTranslator() {
- return new Translator(JPA.CLASS, OrmPackage.eINSTANCE.getEntityListener_ClassName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java
deleted file mode 100644
index c89369d684..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityListeners.java
+++ /dev/null
@@ -1,200 +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.core.resource.orm;
-
-import java.util.Collection;
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Listeners</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.core.resource.orm.EntityListeners#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityListeners extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EList<EntityListener> entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityListeners()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_LISTENERS;
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.EntityListener}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</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>Entity Listeners</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EList<EntityListener> getEntityListeners()
- {
- if (entityListeners == null)
- {
- entityListeners = new EObjectContainmentEList<EntityListener>(EntityListener.class, this, OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS);
- }
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return ((InternalEList<?>)getEntityListeners()).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 OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- 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 OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- getEntityListeners().clear();
- getEntityListeners().addAll((Collection<? extends EntityListener>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- getEntityListeners().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_LISTENERS__ENTITY_LISTENERS:
- return entityListeners != null && !entityListeners.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- EntityListener.buildTranslator(JPA.ENTITY_LISTENER, OrmPackage.eINSTANCE.getEntityListeners_EntityListeners())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java
deleted file mode 100644
index f8110fa681..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EntityResult.java
+++ /dev/null
@@ -1,363 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Entity Result</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.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults <em>Field Results</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class EntityResult extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected static final String DISCRIMINATOR_COLUMN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected String discriminatorColumn = DISCRIMINATOR_COLUMN_EDEFAULT;
-
- /**
- * The default value of the '{@link #getEntityClass() <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityClass()
- * @generated
- * @ordered
- */
- protected static final String ENTITY_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEntityClass() <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityClass()
- * @generated
- * @ordered
- */
- protected String entityClass = ENTITY_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getFieldResults() <em>Field Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFieldResults()
- * @generated
- * @ordered
- */
- protected EList<FieldResult> fieldResults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EntityResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.ENTITY_RESULT;
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Column</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Discriminator Column</em>' attribute.
- * @see #setDiscriminatorColumn(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_DiscriminatorColumn()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDiscriminatorColumn()
- {
- return discriminatorColumn;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Column</em>' attribute.
- * @see #getDiscriminatorColumn()
- * @generated
- */
- public void setDiscriminatorColumn(String newDiscriminatorColumn)
- {
- String oldDiscriminatorColumn = discriminatorColumn;
- discriminatorColumn = newDiscriminatorColumn;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, discriminatorColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity 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>Entity Class</em>' attribute.
- * @see #setEntityClass(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_EntityClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getEntityClass()
- {
- return entityClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Class</em>' attribute.
- * @see #getEntityClass()
- * @generated
- */
- public void setEntityClass(String newEntityClass)
- {
- String oldEntityClass = entityClass;
- entityClass = newEntityClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ENTITY_RESULT__ENTITY_CLASS, oldEntityClass, entityClass));
- }
-
- /**
- * Returns the value of the '<em><b>Field Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.FieldResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Field Results</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>Field Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult_FieldResults()
- * @model containment="true"
- * @generated
- */
- public EList<FieldResult> getFieldResults()
- {
- if (fieldResults == null)
- {
- fieldResults = new EObjectContainmentEList<FieldResult>(FieldResult.class, this, OrmPackage.ENTITY_RESULT__FIELD_RESULTS);
- }
- return fieldResults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return ((InternalEList<?>)getFieldResults()).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 OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- return getDiscriminatorColumn();
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- return getEntityClass();
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return getFieldResults();
- }
- 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 OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((String)newValue);
- return;
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- setEntityClass((String)newValue);
- return;
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- getFieldResults().clear();
- getFieldResults().addAll((Collection<? extends FieldResult>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn(DISCRIMINATOR_COLUMN_EDEFAULT);
- return;
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- setEntityClass(ENTITY_CLASS_EDEFAULT);
- return;
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- getFieldResults().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.ENTITY_RESULT__DISCRIMINATOR_COLUMN:
- return DISCRIMINATOR_COLUMN_EDEFAULT == null ? discriminatorColumn != null : !DISCRIMINATOR_COLUMN_EDEFAULT.equals(discriminatorColumn);
- case OrmPackage.ENTITY_RESULT__ENTITY_CLASS:
- return ENTITY_CLASS_EDEFAULT == null ? entityClass != null : !ENTITY_CLASS_EDEFAULT.equals(entityClass);
- case OrmPackage.ENTITY_RESULT__FIELD_RESULTS:
- return fieldResults != null && !fieldResults.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(" (discriminatorColumn: ");
- result.append(discriminatorColumn);
- result.append(", entityClass: ");
- result.append(entityClass);
- 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[] {
- buildEntityClassTranslator(),
- buildDiscriminatorColumnTranslator(),
- FieldResult.buildTranslator(JPA.FIELD_RESULT, OrmPackage.eINSTANCE.getEntityResult_FieldResults()),
- };
- }
-
- protected static Translator buildEntityClassTranslator() {
- return new Translator(JPA.ENTITY_CLASS, OrmPackage.eINSTANCE.getEntityResult_EntityClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDiscriminatorColumnTranslator() {
- return new Translator(JPA.DISCRIMINATOR_COLUMN, OrmPackage.eINSTANCE.getEntityResult_DiscriminatorColumn(), Translator.DOM_ATTRIBUTE);
- }
-} // EntityResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java
deleted file mode 100644
index 411b2ff4c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EnumType.java
+++ /dev/null
@@ -1,235 +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.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>Enum 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @model
- * @generated
- */
-public enum EnumType implements Enumerator
-{
- /**
- * The '<em><b>ORDINAL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ORDINAL_VALUE
- * @generated
- * @ordered
- */
- ORDINAL(0, "ORDINAL", "ORDINAL"),
-
- /**
- * The '<em><b>STRING</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #STRING_VALUE
- * @generated
- * @ordered
- */
- STRING(1, "STRING", "STRING");
-
- /**
- * The '<em><b>ORDINAL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ORDINAL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ORDINAL
- * @model
- * @generated
- * @ordered
- */
- public static final int ORDINAL_VALUE = 0;
-
- /**
- * The '<em><b>STRING</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>STRING</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #STRING
- * @model
- * @generated
- * @ordered
- */
- public static final int STRING_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Enum Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final EnumType[] VALUES_ARRAY =
- new EnumType[]
- {
- ORDINAL,
- STRING,
- };
-
- /**
- * A public read-only list of all the '<em><b>Enum Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<EnumType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- EnumType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- EnumType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Enum Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EnumType get(int value)
- {
- switch (value)
- {
- case ORDINAL_VALUE: return ORDINAL;
- case STRING_VALUE: return STRING;
- }
- 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 EnumType(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;
- }
-
-} //EnumType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java
deleted file mode 100644
index e81d2ce379..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/EventMethod.java
+++ /dev/null
@@ -1,285 +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.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.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Event Method</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.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class EventMethod extends AbstractJpaEObject implements XmlEventMethod_2_0
-{
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
- /**
- * The default value of the '{@link #getMethodName() <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethodName()
- * @generated
- * @ordered
- */
- protected static final String METHOD_NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMethodName() <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethodName()
- * @generated
- * @ordered
- */
- protected String methodName = METHOD_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EventMethod()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.EVENT_METHOD;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethod_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.EVENT_METHOD__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Method 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>Method Name</em>' attribute.
- * @see #setMethodName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod_MethodName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getMethodName() {
- return methodName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Method Name</em>' attribute.
- * @see #getMethodName()
- * @generated
- */
- public void setMethodName(String newMethodName) {
- String oldMethodName = methodName;
- methodName = newMethodName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.EVENT_METHOD__METHOD_NAME, oldMethodName, methodName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__DESCRIPTION:
- return getDescription();
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- return getMethodName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- setMethodName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- setMethodName(METHOD_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.EVENT_METHOD__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.EVENT_METHOD__METHOD_NAME:
- return METHOD_NAME_EDEFAULT == null ? methodName != null : !METHOD_NAME_EDEFAULT.equals(methodName);
- }
- 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(" (description: ");
- result.append(description);
- result.append(", methodName: ");
- result.append(methodName);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- protected static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildMethodNameTranslator(),
- buildDescriptionTranslator()
- };
- }
-
- protected static Translator buildMethodNameTranslator() {
- return new Translator(JPA.METHOD_NAME, OrmPackage.eINSTANCE.getEventMethod_MethodName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlEventMethod_2_0_Description());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java
deleted file mode 100644
index 54a7e7dccd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FetchType.java
+++ /dev/null
@@ -1,235 +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.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>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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @model
- * @generated
- */
-public enum FetchType implements Enumerator
-{
- /**
- * The '<em><b>LAZY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #LAZY_VALUE
- * @generated
- * @ordered
- */
- LAZY(0, "LAZY", "LAZY"),
-
- /**
- * The '<em><b>EAGER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EAGER_VALUE
- * @generated
- * @ordered
- */
- EAGER(1, "EAGER", "EAGER");
-
- /**
- * The '<em><b>LAZY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>LAZY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #LAZY
- * @model
- * @generated
- * @ordered
- */
- public static final int LAZY_VALUE = 0;
-
- /**
- * The '<em><b>EAGER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EAGER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EAGER
- * @model
- * @generated
- * @ordered
- */
- public static final int EAGER_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final FetchType[] VALUES_ARRAY =
- new FetchType[]
- {
- LAZY,
- EAGER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<FetchType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- FetchType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- FetchType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Fetch Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static FetchType get(int value)
- {
- switch (value)
- {
- case LAZY_VALUE: return LAZY;
- case EAGER_VALUE: return EAGER;
- }
- 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 FetchType(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;
- }
-
-} //FetchType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java
deleted file mode 100644
index 5824f42bf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/FieldResult.java
+++ /dev/null
@@ -1,294 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Field Result</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.core.resource.orm.FieldResult#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class FieldResult 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 #getColumn() <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected static final String COLUMN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected String column = COLUMN_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected FieldResult()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.FIELD_RESULT;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getFieldResult_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.FieldResult#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, OrmPackage.FIELD_RESULT__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column</em>' attribute.
- * @see #setColumn(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult_Column()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getColumn()
- {
- return column;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' attribute.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(String newColumn)
- {
- String oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.FIELD_RESULT__COLUMN, oldColumn, column));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- return getName();
- case OrmPackage.FIELD_RESULT__COLUMN:
- return getColumn();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.FIELD_RESULT__COLUMN:
- setColumn((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.FIELD_RESULT__COLUMN:
- setColumn(COLUMN_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.FIELD_RESULT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.FIELD_RESULT__COLUMN:
- return COLUMN_EDEFAULT == null ? column != null : !COLUMN_EDEFAULT.equals(column);
- }
- 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(", column: ");
- result.append(column);
- 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(),
- createColumnTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getFieldResult_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator createColumnTranslator() {
- return new Translator(JPA.COLUMN, OrmPackage.eINSTANCE.getFieldResult_Column(), Translator.DOM_ATTRIBUTE);
- }
-
-} // FieldResult
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java
deleted file mode 100644
index 64941d6e89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/GenerationType.java
+++ /dev/null
@@ -1,289 +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.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>Generation 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @model
- * @generated
- */
-public enum GenerationType implements Enumerator
-{
- /**
- * The '<em><b>TABLE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_VALUE
- * @generated
- * @ordered
- */
- TABLE(0, "TABLE", "TABLE"),
-
- /**
- * The '<em><b>SEQUENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEQUENCE_VALUE
- * @generated
- * @ordered
- */
- SEQUENCE(1, "SEQUENCE", "SEQUENCE"),
-
- /**
- * The '<em><b>IDENTITY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IDENTITY_VALUE
- * @generated
- * @ordered
- */
- IDENTITY(2, "IDENTITY", "IDENTITY"),
-
- /**
- * 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>TABLE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_VALUE = 0;
-
- /**
- * The '<em><b>SEQUENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEQUENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEQUENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int SEQUENCE_VALUE = 1;
-
- /**
- * The '<em><b>IDENTITY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IDENTITY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IDENTITY
- * @model
- * @generated
- * @ordered
- */
- public static final int IDENTITY_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>Generation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final GenerationType[] VALUES_ARRAY =
- new GenerationType[]
- {
- TABLE,
- SEQUENCE,
- IDENTITY,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Generation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<GenerationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- GenerationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- GenerationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Generation Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static GenerationType get(int value)
- {
- switch (value)
- {
- case TABLE_VALUE: return TABLE;
- case SEQUENCE_VALUE: return SEQUENCE;
- case IDENTITY_VALUE: return IDENTITY;
- 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 GenerationType(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;
- }
-
-} //GenerationType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java
deleted file mode 100644
index 783e9475b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Inheritance.java
+++ /dev/null
@@ -1,231 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Inheritance</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.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class Inheritance 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 InheritanceType STRATEGY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStrategy()
- * @generated
- * @ordered
- */
- protected InheritanceType strategy = STRATEGY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Inheritance()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.INHERITANCE;
- }
-
- /**
- * Returns the value of the '<em><b>Strategy</b></em>' attribute.
- * The default value is <code>"SINGLE_TABLE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.InheritanceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Strategy</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see #setStrategy(InheritanceType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance_Strategy()
- * @model default="SINGLE_TABLE"
- * @generated
- */
- public InheritanceType getStrategy()
- {
- return strategy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see #getStrategy()
- * @generated
- */
- public void setStrategy(InheritanceType newStrategy)
- {
- InheritanceType oldStrategy = strategy;
- strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.INHERITANCE__STRATEGY, oldStrategy, strategy));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- return getStrategy();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- setStrategy((InheritanceType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- setStrategy(STRATEGY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.INHERITANCE__STRATEGY:
- return strategy != STRATEGY_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(" (strategy: ");
- result.append(strategy);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getStrategyTextRange() {
- return getAttributeTextRange(JPA.STRATEGY);
- }
-
- // ********** 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[] {
- buildStrategyTranslator(),
- };
- }
-
- protected static Translator buildStrategyTranslator() {
- return new Translator(JPA.STRATEGY, OrmPackage.eINSTANCE.getInheritance_Strategy(), Translator.DOM_ATTRIBUTE);
- }
-
-} // Inheritance
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java
deleted file mode 100644
index 4d4f250d22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/InheritanceType.java
+++ /dev/null
@@ -1,260 +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.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>Inheritance 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @model
- * @generated
- */
-public enum InheritanceType 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>JOINED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JOINED_VALUE
- * @generated
- * @ordered
- */
- JOINED(1, "JOINED", "JOINED"),
-
- /**
- * The '<em><b>TABLE PER CLASS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_PER_CLASS_VALUE
- * @generated
- * @ordered
- */
- TABLE_PER_CLASS(2, "TABLE_PER_CLASS", "TABLE_PER_CLASS");
-
- /**
- * 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>JOINED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JOINED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JOINED
- * @model
- * @generated
- * @ordered
- */
- public static final int JOINED_VALUE = 1;
-
- /**
- * The '<em><b>TABLE PER CLASS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE PER CLASS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE_PER_CLASS
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_PER_CLASS_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Inheritance Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final InheritanceType[] VALUES_ARRAY =
- new InheritanceType[]
- {
- SINGLE_TABLE,
- JOINED,
- TABLE_PER_CLASS,
- };
-
- /**
- * A public read-only list of all the '<em><b>Inheritance Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<InheritanceType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- InheritanceType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- InheritanceType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Inheritance Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static InheritanceType get(int value)
- {
- switch (value)
- {
- case SINGLE_TABLE_VALUE: return SINGLE_TABLE;
- case JOINED_VALUE: return JOINED;
- case TABLE_PER_CLASS_VALUE: return TABLE_PER_CLASS;
- }
- 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 InheritanceType(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;
- }
-
-} //InheritanceType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/JPA.java
deleted file mode 100644
index d198d89571..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/JPA.java
+++ /dev/null
@@ -1,120 +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.core.resource.orm;
-
-@SuppressWarnings("nls")
-public interface JPA
-{
- String SCHEMA_NAMESPACE = "http://java.sun.com/xml/ns/persistence/orm";
- String SCHEMA_LOCATION = "http://java.sun.com/xml/ns/persistence/orm_1_0.xsd";
- String SCHEMA_VERSION = "1.0";
-
- String ACCESS = "access";
- String ALLOCATION_SIZE = "allocation-size";
- String ASSOCIATION_OVERRIDE = "association-override";
- String ATTRIBUTE_OVERRIDE = "attribute-override";
- String ATTRIBUTES = "attributes";
- String BASIC = "basic";
- String CASCADE = "cascade";
- String CASCADE_ALL = "cascade-all";
- String CASCADE_DETACH = "cascade-detach";
- String CASCADE_MERGE = "cascade-merge";
- String CASCADE_PERSIST = "cascade-persist";
- String CASCADE_REFRESH = "cascade-refresh";
- String CASCADE_REMOVE = "cascade-remove";
- String CATALOG = "catalog";
- String CLASS = "class";
- String COLUMN = "column";
- String COLUMN_DEFINITION= "column-definition";
- String COLUMN_NAME = "column-name";
- String COLUMN_RESULT = "column-result";
- String DESCRIPTION = "description";
- String DISCRIMINATOR_COLUMN = "discriminator-column";
- String DISCRIMINATOR_TYPE = "discriminator-type";
- String DISCRIMINATOR_VALUE = "discriminator-value";
- String EMBEDDABLE = "embeddable";
- String EMBEDDED = "embedded";
- String EMBEDDED_ID = "embedded-id";
- String ENTITY = "entity";
- String ENTITY_CLASS = "entity-class";
- String ENTITY_LISTENER = "entity-listener";
- String ENTITY_LISTENERS = "entity-listeners";
- String ENTITY_MAPPINGS = "entity-mappings";
- String ENTITY_RESULT = "entity-result";
- String ENUMERATED = "enumerated";
- String EXCLUDE_DEFAULT_LISTENERS = "exclude-default-listeners";
- String EXCLUDE_SUPERCLASS_LISTENERS = "exclude-superclass-listeners";
- String FETCH = "fetch";
- String FIELD_RESULT = "field-result";
- String GENERATED_VALUE = "generated-value";
- String GENERATOR = "generator";
- String HINT = "hint";
- String ID = "id";
- String ID_CLASS = "id-class";
- String INHERITANCE = "inheritance";
- String INITIAL_VALUE = "initial-value";
- String INSERTABLE = "insertable";
- String INVERSE_JOIN_COLUMN = "inverse-join-column";
- String JOIN_COLUMN = "join-column";
- String JOIN_TABLE = "join-table";
- String LENGTH = "length";
- String LOB = "lob";
- String MANY_TO_MANY = "many-to-many";
- String MANY_TO_ONE = "many-to-one";
- String MAP_KEY = "map-key";
- String MAPPED_BY = "mapped-by";
- String MAPPED_SUPERCLASS = "mapped-superclass";
- String METADATA_COMPLETE = "metadata-complete";
- String METHOD_NAME = "method-name";
- String NAME = "name";
- String NAMED_NATIVE_QUERY = "named-native-query";
- String NAMED_QUERY = "named-query";
- String NULLABLE = "nullable";
- String ONE_TO_MANY = "one-to-many";
- String ONE_TO_ONE = "one-to-one";
- String OPTIONAL = "optional";
- String ORDER_BY = "order-by";
- String PACKAGE = "package";
- String PERSISTENCE_UNIT_DEFAULTS = "persistence-unit-defaults";
- String PERSISTENCE_UNIT_METADATA = "persistence-unit-metadata";
- String PK_COLUMN_NAME = "pk-column-name";
- String PK_COLUMN_VALUE = "pk-column-value";
- String POST_LOAD = "post-load";
- String POST_PERSIST = "post-persist";
- String POST_REMOVE = "post-remove";
- String POST_UPDATE = "post-update";
- String PRE_PERSIST = "pre-persist";
- String PRE_REMOVE = "pre-remove";
- String PRE_UPDATE = "pre-update";
- String PRECISION= "precision";
- String PRIMARY_KEY_JOIN_COLUMN = "primary-key-join-column";
- String QUERY = "query";
- String REFERENCED_COLUMN_NAME = "referenced-column-name";
- String RESULT_CLASS = "result-class";
- String RESULT_SET_MAPPING = "result-set-mapping";
- String SCALE= "scale";
- String SCHEMA = "schema";
- String SECONDARY_TABLE = "secondary-table";
- String SEQUENCE_GENERATOR = "sequence-generator";
- String SEQUENCE_NAME = "sequence-name";
- String SQL_RESULT_SET_MAPPING = "sql-result-set-mapping";
- String STRATEGY = "strategy";
- String TABLE = "table";
- String TABLE_GENERATOR = "table-generator";
- String TARGET_ENTITY = "target-entity";
- String TEMPORAL = "temporal";
- String TRANSIENT = "transient";
- String UNIQUE = "unique";
- String UNIQUE_CONSTRAINT = "unique-constraint";
- String UPDATABLE = "updatable";
- String VALUE = "value";
- String VALUE_COLUMN_NAME = "value-column-name";
- String VERSION = "version";
- String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java
deleted file mode 100644
index 00c17b75e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/Lob.java
+++ /dev/null
@@ -1,56 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Lob</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.core.resource.orm.OrmPackage#getLob()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class Lob extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Lob()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.LOB;
- }
-
-} // Lob
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java
deleted file mode 100644
index 845a5cbfe1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/MapKey.java
+++ /dev/null
@@ -1,221 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Map Key</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.core.resource.orm.MapKey#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class MapKey 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 MapKey()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.MAP_KEY;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getMapKey_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.core.resource.orm.MapKey#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, OrmPackage.MAP_KEY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY__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 OrmPackage.MAP_KEY__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 OrmPackage.MAP_KEY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.MAP_KEY__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(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getMapKey_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // MapKey
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java
deleted file mode 100644
index f2a39a11bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmFactory.java
+++ /dev/null
@@ -1,970 +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.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.core.resource.orm.OrmPackage
- * @generated
- */
-public class OrmFactory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrmFactory init()
- {
- try
- {
- OrmFactory theOrmFactory = (OrmFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.orm.xmi");
- if (theOrmFactory != null)
- {
- return theOrmFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new OrmFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE: return (EObject)createXmlAssociationOverride();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE: return (EObject)createXmlAttributeOverride();
- case OrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case OrmPackage.XML_BASIC: return (EObject)createXmlBasic();
- case OrmPackage.CASCADE_TYPE: return (EObject)createCascadeType();
- case OrmPackage.XML_CLASS_REFERENCE: return (EObject)createXmlClassReference();
- case OrmPackage.XML_COLLECTION_TABLE: return (EObject)createXmlCollectionTable();
- case OrmPackage.XML_COLUMN: return (EObject)createXmlColumn();
- case OrmPackage.COLUMN_RESULT: return (EObject)createColumnResult();
- case OrmPackage.XML_DISCRIMINATOR_COLUMN: return (EObject)createXmlDiscriminatorColumn();
- case OrmPackage.XML_ELEMENT_COLLECTION: return (EObject)createXmlElementCollection();
- case OrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case OrmPackage.XML_EMBEDDED: return (EObject)createXmlEmbedded();
- case OrmPackage.XML_EMBEDDED_ID: return (EObject)createXmlEmbeddedId();
- case OrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case OrmPackage.ENTITY_LISTENER: return (EObject)createEntityListener();
- case OrmPackage.ENTITY_LISTENERS: return (EObject)createEntityListeners();
- case OrmPackage.XML_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case OrmPackage.ENTITY_RESULT: return (EObject)createEntityResult();
- case OrmPackage.FIELD_RESULT: return (EObject)createFieldResult();
- case OrmPackage.XML_GENERATED_VALUE: return (EObject)createXmlGeneratedValue();
- case OrmPackage.XML_ID: return (EObject)createXmlId();
- case OrmPackage.INHERITANCE: return (EObject)createInheritance();
- case OrmPackage.XML_JOIN_COLUMN: return (EObject)createXmlJoinColumn();
- case OrmPackage.XML_JOIN_TABLE: return (EObject)createXmlJoinTable();
- case OrmPackage.LOB: return (EObject)createLob();
- case OrmPackage.XML_MANY_TO_MANY: return (EObject)createXmlManyToMany();
- case OrmPackage.XML_MANY_TO_ONE: return (EObject)createXmlManyToOne();
- case OrmPackage.MAP_KEY: return (EObject)createMapKey();
- case OrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case OrmPackage.XML_NAMED_NATIVE_QUERY: return (EObject)createXmlNamedNativeQuery();
- case OrmPackage.XML_NAMED_QUERY: return (EObject)createXmlNamedQuery();
- case OrmPackage.XML_ONE_TO_MANY: return (EObject)createXmlOneToMany();
- case OrmPackage.XML_ONE_TO_ONE: return (EObject)createXmlOneToOne();
- case OrmPackage.XML_ORDER_COLUMN: return (EObject)createXmlOrderColumn();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- case OrmPackage.POST_LOAD: return (EObject)createPostLoad();
- case OrmPackage.POST_PERSIST: return (EObject)createPostPersist();
- case OrmPackage.POST_REMOVE: return (EObject)createPostRemove();
- case OrmPackage.POST_UPDATE: return (EObject)createPostUpdate();
- case OrmPackage.PRE_PERSIST: return (EObject)createPrePersist();
- case OrmPackage.PRE_REMOVE: return (EObject)createPreRemove();
- case OrmPackage.PRE_UPDATE: return (EObject)createPreUpdate();
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN: return (EObject)createXmlPrimaryKeyJoinColumn();
- case OrmPackage.XML_QUERY_HINT: return (EObject)createXmlQueryHint();
- case OrmPackage.XML_SECONDARY_TABLE: return (EObject)createXmlSecondaryTable();
- case OrmPackage.XML_SEQUENCE_GENERATOR: return (EObject)createXmlSequenceGenerator();
- case OrmPackage.SQL_RESULT_SET_MAPPING: return (EObject)createSqlResultSetMapping();
- case OrmPackage.XML_TABLE: return (EObject)createXmlTable();
- case OrmPackage.XML_TABLE_GENERATOR: return (EObject)createXmlTableGenerator();
- case OrmPackage.XML_TRANSIENT: return (EObject)createXmlTransient();
- case OrmPackage.XML_UNIQUE_CONSTRAINT: return (EObject)createXmlUniqueConstraint();
- case OrmPackage.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 OrmPackage.ACCESS_TYPE:
- return createAccessTypeFromString(eDataType, initialValue);
- case OrmPackage.DISCRIMINATOR_TYPE:
- return createDiscriminatorTypeFromString(eDataType, initialValue);
- case OrmPackage.ENUM_TYPE:
- return createEnumTypeFromString(eDataType, initialValue);
- case OrmPackage.FETCH_TYPE:
- return createFetchTypeFromString(eDataType, initialValue);
- case OrmPackage.GENERATION_TYPE:
- return createGenerationTypeFromString(eDataType, initialValue);
- case OrmPackage.INHERITANCE_TYPE:
- return createInheritanceTypeFromString(eDataType, initialValue);
- case OrmPackage.TEMPORAL_TYPE:
- return createTemporalTypeFromString(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 OrmPackage.ACCESS_TYPE:
- return convertAccessTypeToString(eDataType, instanceValue);
- case OrmPackage.DISCRIMINATOR_TYPE:
- return convertDiscriminatorTypeToString(eDataType, instanceValue);
- case OrmPackage.ENUM_TYPE:
- return convertEnumTypeToString(eDataType, instanceValue);
- case OrmPackage.FETCH_TYPE:
- return convertFetchTypeToString(eDataType, instanceValue);
- case OrmPackage.GENERATION_TYPE:
- return convertGenerationTypeToString(eDataType, instanceValue);
- case OrmPackage.INHERITANCE_TYPE:
- return convertInheritanceTypeToString(eDataType, instanceValue);
- case OrmPackage.TEMPORAL_TYPE:
- return convertTemporalTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAssociationOverride createXmlAssociationOverride()
- {
- XmlAssociationOverride xmlAssociationOverride = new XmlAssociationOverride();
- return xmlAssociationOverride;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAttributeOverride createXmlAttributeOverride()
- {
- XmlAttributeOverride xmlAttributeOverride = new XmlAttributeOverride();
- return xmlAttributeOverride;
- }
-
- /**
- * <!-- 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 CascadeType createCascadeType()
- {
- CascadeType cascadeType = new CascadeType();
- return cascadeType;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlClassReference createXmlClassReference()
- {
- XmlClassReference xmlClassReference = new XmlClassReference();
- return xmlClassReference;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCollectionTable createXmlCollectionTable()
- {
- XmlCollectionTable xmlCollectionTable = new XmlCollectionTable();
- return xmlCollectionTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlColumn createXmlColumn()
- {
- XmlColumn xmlColumn = new XmlColumn();
- return xmlColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ColumnResult createColumnResult()
- {
- ColumnResult columnResult = new ColumnResult();
- return columnResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlDiscriminatorColumn createXmlDiscriminatorColumn()
- {
- XmlDiscriminatorColumn xmlDiscriminatorColumn = new XmlDiscriminatorColumn();
- return xmlDiscriminatorColumn;
- }
-
- /**
- * <!-- 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 EntityListener createEntityListener()
- {
- EntityListener entityListener = new EntityListener();
- return entityListener;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityListeners createEntityListeners()
- {
- EntityListeners entityListeners = new EntityListeners();
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EntityResult createEntityResult()
- {
- EntityResult entityResult = new EntityResult();
- return entityResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public FieldResult createFieldResult()
- {
- FieldResult fieldResult = new FieldResult();
- return fieldResult;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlGeneratedValue createXmlGeneratedValue()
- {
- XmlGeneratedValue xmlGeneratedValue = new XmlGeneratedValue();
- return xmlGeneratedValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlId createXmlId()
- {
- XmlId xmlId = new XmlId();
- return xmlId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Inheritance createInheritance()
- {
- Inheritance inheritance = new Inheritance();
- return inheritance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinColumn createXmlJoinColumn()
- {
- XmlJoinColumn xmlJoinColumn = new XmlJoinColumn();
- return xmlJoinColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinTable createXmlJoinTable()
- {
- XmlJoinTable xmlJoinTable = new XmlJoinTable();
- return xmlJoinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Lob createLob()
- {
- Lob lob = new Lob();
- return lob;
- }
-
- /**
- * <!-- 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 MapKey createMapKey()
- {
- MapKey mapKey = new MapKey();
- return mapKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedNativeQuery createXmlNamedNativeQuery()
- {
- XmlNamedNativeQuery xmlNamedNativeQuery = new XmlNamedNativeQuery();
- return xmlNamedNativeQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedQuery createXmlNamedQuery()
- {
- XmlNamedQuery xmlNamedQuery = new XmlNamedQuery();
- return xmlNamedQuery;
- }
-
- /**
- * <!-- 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 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 PostLoad createPostLoad()
- {
- PostLoad postLoad = new PostLoad();
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostPersist createPostPersist()
- {
- PostPersist postPersist = new PostPersist();
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostRemove createPostRemove()
- {
- PostRemove postRemove = new PostRemove();
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PostUpdate createPostUpdate()
- {
- PostUpdate postUpdate = new PostUpdate();
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PrePersist createPrePersist()
- {
- PrePersist prePersist = new PrePersist();
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PreRemove createPreRemove()
- {
- PreRemove preRemove = new PreRemove();
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PreUpdate createPreUpdate()
- {
- PreUpdate preUpdate = new PreUpdate();
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPrimaryKeyJoinColumn createXmlPrimaryKeyJoinColumn()
- {
- XmlPrimaryKeyJoinColumn xmlPrimaryKeyJoinColumn = new XmlPrimaryKeyJoinColumn();
- return xmlPrimaryKeyJoinColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlQueryHint createXmlQueryHint()
- {
- XmlQueryHint xmlQueryHint = new XmlQueryHint();
- return xmlQueryHint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSecondaryTable createXmlSecondaryTable()
- {
- XmlSecondaryTable xmlSecondaryTable = new XmlSecondaryTable();
- return xmlSecondaryTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSequenceGenerator createXmlSequenceGenerator()
- {
- XmlSequenceGenerator xmlSequenceGenerator = new XmlSequenceGenerator();
- return xmlSequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public SqlResultSetMapping createSqlResultSetMapping()
- {
- SqlResultSetMapping sqlResultSetMapping = new SqlResultSetMapping();
- return sqlResultSetMapping;
- }
-
- /**
- * <!-- 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 XmlTransient createXmlTransient()
- {
- XmlTransient xmlTransient = new XmlTransient();
- return xmlTransient;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlUniqueConstraint createXmlUniqueConstraint()
- {
- XmlUniqueConstraint xmlUniqueConstraint = new XmlUniqueConstraint();
- return xmlUniqueConstraint;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersion createXmlVersion()
- {
- XmlVersion xmlVersion = new XmlVersion();
- return xmlVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public AccessType createAccessTypeFromString(EDataType eDataType, String initialValue)
- {
- AccessType result = AccessType.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 convertAccessTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DiscriminatorType createDiscriminatorTypeFromString(EDataType eDataType, String initialValue)
- {
- DiscriminatorType result = DiscriminatorType.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 convertDiscriminatorTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EnumType createEnumTypeFromString(EDataType eDataType, String initialValue)
- {
- EnumType result = EnumType.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 convertEnumTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public FetchType createFetchTypeFromString(EDataType eDataType, String initialValue)
- {
- FetchType result = FetchType.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 convertFetchTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public GenerationType createGenerationTypeFromString(EDataType eDataType, String initialValue)
- {
- GenerationType result = GenerationType.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 convertGenerationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public InheritanceType createInheritanceTypeFromString(EDataType eDataType, String initialValue)
- {
- InheritanceType result = InheritanceType.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 convertInheritanceTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public TemporalType createTemporalTypeFromString(EDataType eDataType, String initialValue)
- {
- TemporalType result = TemporalType.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 convertTemporalTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmPackage getOrmPackage()
- {
- return (OrmPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static OrmPackage getPackage()
- {
- return OrmPackage.eINSTANCE;
- }
-
-} //OrmFactory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java
deleted file mode 100644
index eb17feed91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmPackage.java
+++ /dev/null
@@ -1,12487 +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.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.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-
-/**
- * <!-- 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.core.resource.orm.OrmFactory
- * @model kind="package"
- * @generated
- */
-public class OrmPackage 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.orm.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.orm";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmPackage eINSTANCE = org.eclipse.jpt.core.resource.orm.OrmPackage.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder <em>Xml Access Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAccessHolder
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder()
- * @generated
- */
- public static final int XML_ACCESS_HOLDER = 10;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_HOLDER__ACCESS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Access Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_HOLDER_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 11;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTE_MAPPING_20__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 = OrmV2_0Package.XML_ATTRIBUTE_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTE_MAPPING_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING = 0;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS = 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 ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME = XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @generated
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN = 4;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION = 0;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN__NAME = 1;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Named Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn <em>Abstract Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn()
- * @generated
- */
- public static final int ABSTRACT_XML_COLUMN = 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 ABSTRACT_XML_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_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 ABSTRACT_XML_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN__INSERTABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN__NULLABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN__TABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN__UNIQUE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN__UPDATABLE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlEmbedded()
- * @generated
- */
- public static final int ABSTRACT_XML_EMBEDDED = 2;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_EMBEDDED__ACCESS = 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 ABSTRACT_XML_EMBEDDED__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Embedded</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_EMBEDDED_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping <em>Abstract Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING = 5;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING__ACCESS = 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 ABSTRACT_XML_RELATIONSHIP_MAPPING__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping <em>Abstract Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlMultiRelationshipMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING = 3;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ACCESS = ABSTRACT_XML_RELATIONSHIP_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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__NAME = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__TARGET_ENTITY = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__FETCH = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__CASCADE = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_COLUMN = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_TEMPORAL = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_COLUMN = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_JOIN_COLUMNS = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * 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 ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Multi Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping <em>Abstract Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlSingleRelationshipMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING = 6;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ACCESS = ABSTRACT_XML_RELATIONSHIP_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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__NAME = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__TARGET_ENTITY = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__FETCH = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE = ABSTRACT_XML_RELATIONSHIP_MAPPING__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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_TABLE = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__JOIN_COLUMNS = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__ID = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__MAPS_ID = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Single Relationship Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT = ABSTRACT_XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable <em>Abstract Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTable()
- * @generated
- */
- public static final int ABSTRACT_XML_TABLE = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TABLE__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TABLE__CATALOG = 1;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TABLE__SCHEMA = 2;
-
- /**
- * 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 ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS = 3;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TABLE_FEATURE_COUNT = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping()
- * @generated
- */
- public static final int XML_TYPE_MAPPING = 82;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @generated
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping <em>Xml Join Columns Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping()
- * @generated
- */
- public static final int XML_JOIN_COLUMNS_MAPPING = 45;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @generated
- */
- public static final int XML_ASSOCIATION_OVERRIDE = 12;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer <em>Xml Association Override Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer()
- * @generated
- */
- public static final int XML_ASSOCIATION_OVERRIDE_CONTAINER = 13;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer <em>Xml Attribute Override Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_CONTAINER = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Attributes
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @generated
- */
- public static final int ATTRIBUTES = 16;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 17;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @generated
- */
- public static final int CASCADE_TYPE = 18;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable <em>Abstract Xml Reference Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlReferenceTable()
- * @generated
- */
- public static final int ABSTRACT_XML_REFERENCE_TABLE = 7;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_REFERENCE_TABLE__NAME = ABSTRACT_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 ABSTRACT_XML_REFERENCE_TABLE__CATALOG = ABSTRACT_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 ABSTRACT_XML_REFERENCE_TABLE__SCHEMA = ABSTRACT_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 ABSTRACT_XML_REFERENCE_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_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 ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS = ABSTRACT_XML_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Reference Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_REFERENCE_TABLE_FEATURE_COUNT = ABSTRACT_XML_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_TYPE_MAPPING__ACCESS = XML_ACCESS_HOLDER__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_TYPE_MAPPING__CLASS_NAME = XML_ACCESS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * 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_TYPE_MAPPING__METADATA_COMPLETE = XML_ACCESS_HOLDER_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_TYPE_MAPPING__DESCRIPTION = XML_ACCESS_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * 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_TYPE_MAPPING__ATTRIBUTES = XML_ACCESS_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Type Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_FEATURE_COUNT = XML_ACCESS_HOLDER_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 ABSTRACT_XML_TYPE_MAPPING__ACCESS = XML_TYPE_MAPPING__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 ABSTRACT_XML_TYPE_MAPPING__CLASS_NAME = XML_TYPE_MAPPING__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 ABSTRACT_XML_TYPE_MAPPING__METADATA_COMPLETE = XML_TYPE_MAPPING__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 ABSTRACT_XML_TYPE_MAPPING__DESCRIPTION = XML_TYPE_MAPPING__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 ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES = XML_TYPE_MAPPING__ATTRIBUTES;
-
- /**
- * The number of structural features of the '<em>Abstract Xml Type Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOverride <em>Xml Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOverride()
- * @generated
- */
- public static final int XML_OVERRIDE = 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_OVERRIDE__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Override</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OVERRIDE_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_ASSOCIATION_OVERRIDE__NAME = XML_OVERRIDE__NAME;
-
- /**
- * 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_ASSOCIATION_OVERRIDE__JOIN_COLUMNS = XML_OVERRIDE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE__DESCRIPTION = XML_OVERRIDE_FEATURE_COUNT + 1;
-
- /**
- * 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_ASSOCIATION_OVERRIDE__JOIN_TABLE = XML_OVERRIDE_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Association Override</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_FEATURE_COUNT = XML_OVERRIDE_FEATURE_COUNT + 3;
-
- /**
- * 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_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Association Override Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_CONTAINER_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_ATTRIBUTE_OVERRIDE__NAME = XML_OVERRIDE__NAME;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE__DESCRIPTION = XML_OVERRIDE_FEATURE_COUNT + 0;
-
- /**
- * 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_ATTRIBUTE_OVERRIDE__COLUMN = XML_OVERRIDE_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_FEATURE_COUNT = XML_OVERRIDE_FEATURE_COUNT + 2;
-
- /**
- * 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_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_CONTAINER_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 ATTRIBUTES__DESCRIPTION = OrmV2_0Package.XML_ATTRIBUTES_20__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 = OrmV2_0Package.XML_ATTRIBUTES_20__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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 0;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 1;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 2;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 3;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 4;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 5;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 6;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 7;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 8;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 9;
-
- /**
- * 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 = OrmV2_0Package.XML_ATTRIBUTES_20_FEATURE_COUNT + 10;
-
- /**
- * 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 = 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__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Cascade Detach</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_DETACH = OrmV2_0Package.XML_CASCADE_TYPE_20__CASCADE_DETACH;
-
- /**
- * The feature id for the '<em><b>Cascade All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_ALL = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_PERSIST = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Cascade Merge</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_MERGE = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Cascade Remove</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_REMOVE = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Cascade Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE__CASCADE_REFRESH = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Cascade Type</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int CASCADE_TYPE_FEATURE_COUNT = OrmV2_0Package.XML_CASCADE_TYPE_20_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlClassReference <em>Xml Class Reference</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlClassReference
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlClassReference()
- * @generated
- */
- public static final int XML_CLASS_REFERENCE = 19;
-
- /**
- * 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_CLASS_REFERENCE__CLASS_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Class Reference</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLASS_REFERENCE_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE = 20;
-
- /**
- * 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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_TABLE__JOIN_COLUMNS;
-
- /**
- * 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 = ABSTRACT_XML_REFERENCE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @generated
- */
- public static final int XML_COLUMN = 21;
-
- /**
- * 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_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_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_COLUMN__NAME = ABSTRACT_XML_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__INSERTABLE = ABSTRACT_XML_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__NULLABLE = ABSTRACT_XML_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__TABLE = ABSTRACT_XML_COLUMN__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_COLUMN__UNIQUE = ABSTRACT_XML_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__UPDATABLE = ABSTRACT_XML_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__LENGTH = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__PRECISION = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN__SCALE = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @generated
- */
- public static final int COLUMN_MAPPING = 22;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_MAPPING__COLUMN = 0;
-
- /**
- * The number of structural features of the '<em>Column Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_MAPPING_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @generated
- */
- public static final int COLUMN_RESULT = 23;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_RESULT__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Column Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int COLUMN_RESULT_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final int XML_CONVERTIBLE_MAPPING = 24;
-
- /**
- * 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 = 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_CONVERTIBLE_MAPPING__TEMPORAL = 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_CONVERTIBLE_MAPPING__ENUMERATED = 2;
-
- /**
- * 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 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @generated
- */
- public static final int XML_DISCRIMINATOR_COLUMN = 25;
-
- /**
- * 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_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_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_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_NAMED_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_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Discriminator Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#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 = 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_ELEMENT_COLLECTION__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 = ABSTRACT_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__TEMPORAL = ABSTRACT_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__ENUMERATED = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 14;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 15;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 16;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 17;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 18;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#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 = ABSTRACT_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 = ABSTRACT_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 = ABSTRACT_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 = ABSTRACT_XML_EMBEDDED_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_EMBEDDED_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#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 = ABSTRACT_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_ID__NAME = ABSTRACT_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_ID__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
-
- /**
- * 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 = ABSTRACT_XML_EMBEDDED_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_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_ENTITY__SEQUENCE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_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_ENTITY__TABLE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 13;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 14;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 15;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 16;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 17;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 18;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 19;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 20;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 21;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 22;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 23;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 24;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 25;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 26;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer <em>Xml Event Method Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer()
- * @generated
- */
- public static final int XML_EVENT_METHOD_CONTAINER = 36;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__PRE_PERSIST = 0;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__POST_PERSIST = 1;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__PRE_REMOVE = 2;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__POST_REMOVE = 3;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__PRE_UPDATE = 4;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__POST_UPDATE = 5;
-
- /**
- * 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_EVENT_METHOD_CONTAINER__POST_LOAD = 6;
-
- /**
- * The number of structural features of the '<em>Xml Event Method Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EVENT_METHOD_CONTAINER_FEATURE_COUNT = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @generated
- */
- public static final int ENTITY_LISTENER = 31;
-
- /**
- * 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 ENTITY_LISTENER__PRE_PERSIST = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__POST_PERSIST = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__PRE_REMOVE = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__POST_REMOVE = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__PRE_UPDATE = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__POST_UPDATE = XML_EVENT_METHOD_CONTAINER__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 ENTITY_LISTENER__POST_LOAD = XML_EVENT_METHOD_CONTAINER__POST_LOAD;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__DESCRIPTION = XML_EVENT_METHOD_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER__CLASS_NAME = XML_EVENT_METHOD_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Entity Listener</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENER_FEATURE_COUNT = XML_EVENT_METHOD_CONTAINER_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @generated
- */
- public static final int ENTITY_LISTENERS = 32;
-
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENERS__ENTITY_LISTENERS = 0;
-
- /**
- * The number of structural features of the '<em>Entity Listeners</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_LISTENERS_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS = 33;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @generated
- */
- public static final int ENTITY_RESULT = 34;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @generated
- */
- public static final int EVENT_METHOD = 35;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @generated
- */
- public static final int FIELD_RESULT = 37;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @generated
- */
- public static final int XML_GENERATED_VALUE = 38;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @generated
- */
- public static final int XML_GENERATOR = 39;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer <em>Xml Generator Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratorContainer()
- * @generated
- */
- public static final int XML_GENERATOR_CONTAINER = 40;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 41;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @generated
- */
- public static final int INHERITANCE = 43;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @generated
- */
- public static final int XML_JOIN_COLUMN = 44;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final int XML_JOIN_TABLE = 46;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping <em>Xml Join Table Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping()
- * @generated
- */
- public static final int XML_JOIN_TABLE_MAPPING = 47;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getLob()
- * @generated
- */
- public static final int LOB = 48;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 49;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final int XML_MANY_TO_ONE = 50;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @generated
- */
- public static final int MAP_KEY = 51;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping <em>Xml Mapped By Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedByMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping()
- * @generated
- */
- public static final int XML_MAPPED_BY_MAPPING = 52;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 53;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @generated
- */
- public static final int XML_QUERY = 73;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @generated
- */
- public static final int XML_NAMED_NATIVE_QUERY = 54;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @generated
- */
- public static final int XML_NAMED_QUERY = 55;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping <em>Xml Null Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNullAttributeMapping()
- * @generated
- */
- public static final int XML_NULL_ATTRIBUTE_MAPPING = 56;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 57;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final int XML_ONE_TO_ONE = 58;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final int XML_ORDER_COLUMN = 60;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 62;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA = 63;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostLoad()
- * @generated
- */
- public static final int POST_LOAD = 65;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostPersist()
- * @generated
- */
- public static final int POST_PERSIST = 66;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostRemove()
- * @generated
- */
- public static final int POST_REMOVE = 67;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostUpdate()
- * @generated
- */
- public static final int POST_UPDATE = 68;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPrePersist()
- * @generated
- */
- public static final int PRE_PERSIST = 69;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreRemove()
- * @generated
- */
- public static final int PRE_REMOVE = 70;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreUpdate()
- * @generated
- */
- public static final int PRE_UPDATE = 71;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 72;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final int XML_QUERY_CONTAINER = 74;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 0;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_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_ENTITY_MAPPINGS__ACCESS = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_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_ENTITY_MAPPINGS__DESCRIPTION = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 3;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 4;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 5;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 6;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 7;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 8;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 9;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 10;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 11;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 12;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 13;
-
- /**
- * 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 = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 14;
-
- /**
- * The feature id for the '<em><b>Discriminator Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__DISCRIMINATOR_COLUMN = 0;
-
- /**
- * The feature id for the '<em><b>Entity Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__ENTITY_CLASS = 1;
-
- /**
- * The feature id for the '<em><b>Field Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT__FIELD_RESULTS = 2;
-
- /**
- * The number of structural features of the '<em>Entity Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ENTITY_RESULT_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int EVENT_METHOD__DESCRIPTION = OrmV2_0Package.XML_EVENT_METHOD_20__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int EVENT_METHOD__METHOD_NAME = OrmV2_0Package.XML_EVENT_METHOD_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Event Method</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int EVENT_METHOD_FEATURE_COUNT = OrmV2_0Package.XML_EVENT_METHOD_20_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 FIELD_RESULT__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Column</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int FIELD_RESULT__COLUMN = 1;
-
- /**
- * The number of structural features of the '<em>Field Result</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int FIELD_RESULT_FEATURE_COUNT = 2;
-
- /**
- * The feature id for the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE__GENERATOR = 0;
-
- /**
- * The feature id for the '<em><b>Strategy</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE__STRATEGY = 1;
-
- /**
- * The number of structural features of the '<em>Xml Generated Value</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATED_VALUE_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_GENERATOR__DESCRIPTION = OrmV2_0Package.XML_GENERATOR_20__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_GENERATOR__NAME = OrmV2_0Package.XML_GENERATOR_20_FEATURE_COUNT + 0;
-
- /**
- * 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_GENERATOR__INITIAL_VALUE = OrmV2_0Package.XML_GENERATOR_20_FEATURE_COUNT + 1;
-
- /**
- * 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_GENERATOR__ALLOCATION_SIZE = OrmV2_0Package.XML_GENERATOR_20_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR_FEATURE_COUNT = OrmV2_0Package.XML_GENERATOR_20_FEATURE_COUNT + 3;
-
- /**
- * 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_GENERATOR_CONTAINER__SEQUENCE_GENERATOR = 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_GENERATOR_CONTAINER__TABLE_GENERATOR = 1;
-
- /**
- * The number of structural features of the '<em>Xml Generator Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR_CONTAINER_FEATURE_COUNT = 2;
-
- /**
- * 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 = 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_ID__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer <em>Xml Id Class Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClassContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer()
- * @generated
- */
- public static final int XML_ID_CLASS_CONTAINER = 42;
-
- /**
- * 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_ID_CLASS_CONTAINER__ID_CLASS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id Class Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_CLASS_CONTAINER_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Strategy</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int INHERITANCE__STRATEGY = 0;
-
- /**
- * The number of structural features of the '<em>Inheritance</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int INHERITANCE_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_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_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_JOIN_COLUMN__NAME = ABSTRACT_XML_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__INSERTABLE = ABSTRACT_XML_COLUMN__INSERTABLE;
-
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__NULLABLE = ABSTRACT_XML_COLUMN__NULLABLE;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__TABLE = ABSTRACT_XML_COLUMN__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_JOIN_COLUMN__UNIQUE = ABSTRACT_XML_COLUMN__UNIQUE;
-
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__UPDATABLE = ABSTRACT_XML_COLUMN__UPDATABLE;
-
- /**
- * The feature id for the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * 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_COLUMNS_MAPPING__JOIN_COLUMNS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Columns Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_COLUMNS_MAPPING_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlReferenceTable <em>Xml Reference Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlReferenceTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlReferenceTable()
- * @generated
- */
- public static final int XML_REFERENCE_TABLE = 64;
-
- /**
- * 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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_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 = ABSTRACT_XML_REFERENCE_TABLE_FEATURE_COUNT + 1;
-
- /**
- * 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_JOIN_TABLE_MAPPING__JOIN_TABLE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Table Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_MAPPING_FEATURE_COUNT = 1;
-
- /**
- * The number of structural features of the '<em>Lob</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int LOB_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_MANY_TO_MANY__ACCESS = ABSTRACT_XML_MULTI_RELATIONSHIP_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_MANY_TO_MANY__NAME = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING_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_MANY_TO_ONE__ACCESS = ABSTRACT_XML_SINGLE_RELATIONSHIP_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_MANY_TO_ONE__NAME = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL;
-
- /**
- * 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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_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 MAP_KEY__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Map Key</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int MAP_KEY_FEATURE_COUNT = 1;
-
- /**
- * 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_MAPPED_BY_MAPPING__MAPPED_BY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped By Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_BY_MAPPING_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_MAPPED_SUPERCLASS__ACCESS = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING__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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY__DESCRIPTION = OrmV2_0Package.XML_QUERY_20__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_QUERY__NAME = OrmV2_0Package.XML_QUERY_20_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY__QUERY = OrmV2_0Package.XML_QUERY_20_FEATURE_COUNT + 1;
-
- /**
- * 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_QUERY__HINTS = OrmV2_0Package.XML_QUERY_20_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_FEATURE_COUNT = OrmV2_0Package.XML_QUERY_20_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__DESCRIPTION = XML_QUERY__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_NAMED_NATIVE_QUERY__NAME = XML_QUERY__NAME;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY__QUERY = XML_QUERY__QUERY;
-
- /**
- * 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_NATIVE_QUERY__HINTS = XML_QUERY__HINTS;
-
- /**
- * 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_NATIVE_QUERY__RESULT_CLASS = XML_QUERY_FEATURE_COUNT + 0;
-
- /**
- * 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_NATIVE_QUERY__RESULT_SET_MAPPING = XML_QUERY_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Named Native Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_NATIVE_QUERY_FEATURE_COUNT = XML_QUERY_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_NAMED_QUERY__DESCRIPTION = XML_QUERY__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_NAMED_QUERY__NAME = XML_QUERY__NAME;
-
- /**
- * The feature id for the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY__QUERY = XML_QUERY__QUERY;
-
- /**
- * 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_QUERY__HINTS = XML_QUERY__HINTS;
-
- /**
- * The feature id for the '<em><b>Lock Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY__LOCK_MODE = XML_QUERY_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY_FEATURE_COUNT = XML_QUERY_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_NULL_ATTRIBUTE_MAPPING__ACCESS = 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_NULL_ATTRIBUTE_MAPPING__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The number of structural features of the '<em>Xml Null Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NULL_ATTRIBUTE_MAPPING_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_ONE_TO_MANY__ACCESS = ABSTRACT_XML_MULTI_RELATIONSHIP_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_ONE_TO_MANY__NAME = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ATTRIBUTE_OVERRIDES;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_CLASS;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY_ENUMERATED;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_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_ONE_TO_ONE__NAME = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @generated
- */
- public static final int XML_QUERY_HINT = 75;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE = 76;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR = 77;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @generated
- */
- public static final int SQL_RESULT_SET_MAPPING = 78;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTable()
- * @generated
- */
- public static final int XML_TABLE = 79;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR = 80;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 81;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraint()
- * @generated
- */
- public static final int XML_UNIQUE_CONSTRAINT = 83;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 84;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable()
- * @generated
- */
- public static final int XML_ORDERABLE = 59;
-
- /**
- * 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_ORDERABLE__ORDER_COLUMN = OrmV2_0Package.XML_ORDERABLE_20__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_ORDERABLE__ORDER_BY = OrmV2_0Package.XML_ORDERABLE_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Orderable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDERABLE_FEATURE_COUNT = OrmV2_0Package.XML_ORDERABLE_20_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_ORDER_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_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 = ABSTRACT_XML_NAMED_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 = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_NAMED_COLUMN_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_PERSISTENCE_UNIT_DEFAULTS__ACCESS = XML_ACCESS_HOLDER__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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 4;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 5;
-
- /**
- * 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 = XML_ACCESS_HOLDER_FEATURE_COUNT + 6;
-
- /**
- * 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 = OrmV2_0Package.XML_PERSISTENCE_UNIT_METADATA_20__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 = OrmV2_0Package.XML_PERSISTENCE_UNIT_METADATA_20_FEATURE_COUNT + 0;
-
- /**
- * 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 = OrmV2_0Package.XML_PERSISTENCE_UNIT_METADATA_20_FEATURE_COUNT + 1;
-
- /**
- * 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 = OrmV2_0Package.XML_PERSISTENCE_UNIT_METADATA_20_FEATURE_COUNT + 2;
-
- /**
- * 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_REFERENCE_TABLE__JOIN_COLUMNS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Reference Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REFERENCE_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 POST_LOAD__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_LOAD__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Load</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_LOAD_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_PERSIST__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_PERSIST__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Persist</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_PERSIST_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_REMOVE__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_REMOVE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Remove</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_REMOVE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_UPDATE__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_UPDATE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Post Update</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int POST_UPDATE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_PERSIST__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_PERSIST__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Persist</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_PERSIST_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_REMOVE__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_REMOVE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Remove</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_REMOVE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_UPDATE__DESCRIPTION = EVENT_METHOD__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Method Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_UPDATE__METHOD_NAME = EVENT_METHOD__METHOD_NAME;
-
- /**
- * The number of structural features of the '<em>Pre Update</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int PRE_UPDATE_FEATURE_COUNT = EVENT_METHOD_FEATURE_COUNT + 0;
-
- /**
- * 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_PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_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_PRIMARY_KEY_JOIN_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key Join Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * 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_QUERY_CONTAINER__NAMED_QUERIES = 0;
-
- /**
- * 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_QUERY_CONTAINER__NAMED_NATIVE_QUERIES = 1;
-
- /**
- * 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 = 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_QUERY_HINT__DESCRIPTION = OrmV2_0Package.XML_QUERY_HINT_20__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_QUERY_HINT__NAME = OrmV2_0Package.XML_QUERY_HINT_20_FEATURE_COUNT + 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_QUERY_HINT__VALUE = OrmV2_0Package.XML_QUERY_HINT_20_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Query Hint</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_HINT_FEATURE_COUNT = OrmV2_0Package.XML_QUERY_HINT_20_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_SECONDARY_TABLE__NAME = ABSTRACT_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_SECONDARY_TABLE__CATALOG = ABSTRACT_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_SECONDARY_TABLE__SCHEMA = ABSTRACT_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_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_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 = ABSTRACT_XML_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 = ABSTRACT_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_SEQUENCE_GENERATOR__DESCRIPTION = XML_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_SEQUENCE_GENERATOR__NAME = XML_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_SEQUENCE_GENERATOR__INITIAL_VALUE = XML_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_SEQUENCE_GENERATOR__ALLOCATION_SIZE = XML_GENERATOR__ALLOCATION_SIZE;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__CATALOG = XML_GENERATOR_FEATURE_COUNT + 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_SEQUENCE_GENERATOR__SCHEMA = XML_GENERATOR_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR__SEQUENCE_NAME = XML_GENERATOR_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Sequence Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__DESCRIPTION = OrmV2_0Package.XML_SQL_RESULT_SET_MAPPING_20__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__NAME = OrmV2_0Package.XML_SQL_RESULT_SET_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Entity Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__ENTITY_RESULTS = OrmV2_0Package.XML_SQL_RESULT_SET_MAPPING_20_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Column Results</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING__COLUMN_RESULTS = OrmV2_0Package.XML_SQL_RESULT_SET_MAPPING_20_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Sql Result Set Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int SQL_RESULT_SET_MAPPING_FEATURE_COUNT = OrmV2_0Package.XML_SQL_RESULT_SET_MAPPING_20_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_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 = ABSTRACT_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 = ABSTRACT_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 = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS;
-
- /**
- * 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 = ABSTRACT_XML_TABLE_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_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 = XML_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 = XML_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 = XML_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 = XML_GENERATOR_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 1;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 2;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 3;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 4;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 5;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 6;
-
- /**
- * 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 = XML_GENERATOR_FEATURE_COUNT + 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_TRANSIENT__ACCESS = 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_TRANSIENT__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_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_UNIQUE_CONSTRAINT__NAME = OrmV2_0Package.XML_UNIQUE_CONSTRAINT_20__NAME;
-
- /**
- * 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_UNIQUE_CONSTRAINT__COLUMN_NAMES = OrmV2_0Package.XML_UNIQUE_CONSTRAINT_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Unique Constraint</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNIQUE_CONSTRAINT_FEATURE_COUNT = OrmV2_0Package.XML_UNIQUE_CONSTRAINT_20_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_VERSION__ACCESS = 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_VERSION__NAME = ABSTRACT_XML_ATTRIBUTE_MAPPING__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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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 = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @generated
- */
- public static final int ACCESS_TYPE = 85;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @generated
- */
- public static final int DISCRIMINATOR_TYPE = 86;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @generated
- */
- public static final int ENUM_TYPE = 87;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @generated
- */
- public static final int FETCH_TYPE = 88;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @generated
- */
- public static final int GENERATION_TYPE = 89;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @generated
- */
- public static final int INHERITANCE_TYPE = 90;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @generated
- */
- public static final int TEMPORAL_TYPE = 91;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlEmbeddedEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlMultiRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlNamedColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlSingleRelationshipMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractXmlTypeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAccessHolderEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverrideContainerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverrideContainerEClass = 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 cascadeTypeEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlClassReferenceEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass columnResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertibleMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlDiscriminatorColumnEClass = 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 entityListenerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityListenersEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass entityResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass eventMethodEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEventMethodContainerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass fieldResultEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratedValueEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGeneratorContainerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdClassContainerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass inheritanceEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinColumnsMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass lobEClass = 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 mapKeyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedByMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedNativeQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNullAttributeMappingEClass = 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 xmlOrderColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOverrideEClass = 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 abstractXmlReferenceTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReferenceTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postLoadEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postPersistEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postRemoveEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass postUpdateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass prePersistEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass preRemoveEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass preUpdateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKeyJoinColumnEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryContainerEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryHintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGeneratorEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass sqlResultSetMappingEClass = 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 xmlTransientEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeMappingEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUniqueConstraintEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderableEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum accessTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum discriminatorTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum enumTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum fetchTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum generationTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum inheritanceTypeEEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum temporalTypeEEnum = 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.core.resource.orm.OrmPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private OrmPackage()
- {
- super(eNS_URI, OrmFactory.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 OrmPackage#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 OrmPackage init()
- {
- if (isInited) return (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Obtain or create and register package
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- CommonPackage theCommonPackage = (CommonPackage)(EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) instanceof CommonPackage ? EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) : CommonPackage.eINSTANCE);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) instanceof OrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) : OrmV2_0Package.eINSTANCE);
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE);
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) instanceof PersistenceV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) : PersistenceV2_0Package.eINSTANCE);
-
- // Create package meta-data objects
- theOrmPackage.createPackageContents();
- theCommonPackage.createPackageContents();
- theOrmV2_0Package.createPackageContents();
- thePersistencePackage.createPackageContents();
- thePersistenceV2_0Package.createPackageContents();
-
- // Initialize created meta-data
- theOrmPackage.initializePackageContents();
- theCommonPackage.initializePackageContents();
- theOrmV2_0Package.initializePackageContents();
- thePersistencePackage.initializePackageContents();
- thePersistenceV2_0Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theOrmPackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(OrmPackage.eNS_URI, theOrmPackage);
- return theOrmPackage;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Attribute Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @generated
- */
- public EClass getAbstractXmlAttributeMapping()
- {
- return abstractXmlAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn <em>Abstract Xml Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn
- * @generated
- */
- public EClass getAbstractXmlColumn()
- {
- return abstractXmlColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getInsertable <em>Insertable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Insertable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getInsertable()
- * @see #getAbstractXmlColumn()
- * @generated
- */
- public EAttribute getAbstractXmlColumn_Insertable()
- {
- return (EAttribute)abstractXmlColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getNullable <em>Nullable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Nullable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getNullable()
- * @see #getAbstractXmlColumn()
- * @generated
- */
- public EAttribute getAbstractXmlColumn_Nullable()
- {
- return (EAttribute)abstractXmlColumnEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getTable()
- * @see #getAbstractXmlColumn()
- * @generated
- */
- public EAttribute getAbstractXmlColumn_Table()
- {
- return (EAttribute)abstractXmlColumnEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUnique <em>Unique</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Unique</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUnique()
- * @see #getAbstractXmlColumn()
- * @generated
- */
- public EAttribute getAbstractXmlColumn_Unique()
- {
- return (EAttribute)abstractXmlColumnEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUpdatable <em>Updatable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Updatable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn#getUpdatable()
- * @see #getAbstractXmlColumn()
- * @generated
- */
- public EAttribute getAbstractXmlColumn_Updatable()
- {
- return (EAttribute)abstractXmlColumnEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Embedded</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded
- * @generated
- */
- public EClass getAbstractXmlEmbedded()
- {
- return abstractXmlEmbeddedEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping <em>Abstract Xml Multi Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Multi Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping
- * @generated
- */
- public EClass getAbstractXmlMultiRelationshipMapping()
- {
- return abstractXmlMultiRelationshipMappingEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKey <em>Map Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping#getMapKey()
- * @see #getAbstractXmlMultiRelationshipMapping()
- * @generated
- */
- public EReference getAbstractXmlMultiRelationshipMapping_MapKey()
- {
- return (EReference)abstractXmlMultiRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Named Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @generated
- */
- public EClass getAbstractXmlNamedColumn()
- {
- return abstractXmlNamedColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getColumnDefinition <em>Column Definition</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Column Definition</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getColumnDefinition()
- * @see #getAbstractXmlNamedColumn()
- * @generated
- */
- public EAttribute getAbstractXmlNamedColumn_ColumnDefinition()
- {
- return (EAttribute)abstractXmlNamedColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn#getName()
- * @see #getAbstractXmlNamedColumn()
- * @generated
- */
- public EAttribute getAbstractXmlNamedColumn_Name()
- {
- return (EAttribute)abstractXmlNamedColumnEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping <em>Abstract Xml Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping
- * @generated
- */
- public EClass getAbstractXmlRelationshipMapping()
- {
- return abstractXmlRelationshipMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getTargetEntity <em>Target Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Target Entity</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getTargetEntity()
- * @see #getAbstractXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getAbstractXmlRelationshipMapping_TargetEntity()
- {
- return (EAttribute)abstractXmlRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getFetch <em>Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Fetch</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getFetch()
- * @see #getAbstractXmlRelationshipMapping()
- * @generated
- */
- public EAttribute getAbstractXmlRelationshipMapping_Fetch()
- {
- return (EAttribute)abstractXmlRelationshipMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getCascade <em>Cascade</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cascade</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping#getCascade()
- * @see #getAbstractXmlRelationshipMapping()
- * @generated
- */
- public EReference getAbstractXmlRelationshipMapping_Cascade()
- {
- return (EReference)abstractXmlRelationshipMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping <em>Abstract Xml Single Relationship Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Single Relationship Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping
- * @generated
- */
- public EClass getAbstractXmlSingleRelationshipMapping()
- {
- return abstractXmlSingleRelationshipMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getOptional <em>Optional</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Optional</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping#getOptional()
- * @see #getAbstractXmlSingleRelationshipMapping()
- * @generated
- */
- public EAttribute getAbstractXmlSingleRelationshipMapping_Optional()
- {
- return (EAttribute)abstractXmlSingleRelationshipMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable <em>Abstract Xml Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable
- * @generated
- */
- public EClass getAbstractXmlTable()
- {
- return abstractXmlTableEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getName()
- * @see #getAbstractXmlTable()
- * @generated
- */
- public EAttribute getAbstractXmlTable_Name()
- {
- return (EAttribute)abstractXmlTableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getCatalog()
- * @see #getAbstractXmlTable()
- * @generated
- */
- public EAttribute getAbstractXmlTable_Catalog()
- {
- return (EAttribute)abstractXmlTableEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getSchema()
- * @see #getAbstractXmlTable()
- * @generated
- */
- public EAttribute getAbstractXmlTable_Schema()
- {
- return (EAttribute)abstractXmlTableEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getUniqueConstraints <em>Unique Constraints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable#getUniqueConstraints()
- * @see #getAbstractXmlTable()
- * @generated
- */
- public EReference getAbstractXmlTable_UniqueConstraints()
- {
- return (EReference)abstractXmlTableEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Type Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @generated
- */
- public EClass getAbstractXmlTypeMapping()
- {
- return abstractXmlTypeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder <em>Xml Access Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Access Holder</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAccessHolder
- * @generated
- */
- public EClass getXmlAccessHolder()
- {
- return xmlAccessHolderEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder#getAccess <em>Access</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Access</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAccessHolder#getAccess()
- * @see #getXmlAccessHolder()
- * @generated
- */
- public EAttribute getXmlAccessHolder_Access()
- {
- return (EAttribute)xmlAccessHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlAttributeMapping
- * @generated
- */
- public EClass getXmlAttributeMapping()
- {
- return xmlAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName()
- * @see #getXmlAttributeMapping()
- * @generated
- */
- public EAttribute getXmlAttributeMapping_Name()
- {
- return (EAttribute)xmlAttributeMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Association Override</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @generated
- */
- public EClass getXmlAssociationOverride()
- {
- return xmlAssociationOverrideEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer <em>Xml Association Override Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Association Override Container</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer
- * @generated
- */
- public EClass getXmlAssociationOverrideContainer()
- {
- return xmlAssociationOverrideContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer#getAssociationOverrides <em>Association Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Association Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer#getAssociationOverrides()
- * @see #getXmlAssociationOverrideContainer()
- * @generated
- */
- public EReference getXmlAssociationOverrideContainer_AssociationOverrides()
- {
- return (EReference)xmlAssociationOverrideContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @generated
- */
- public EClass getXmlAttributeOverride()
- {
- return xmlAttributeOverrideEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn()
- * @see #getXmlAttributeOverride()
- * @generated
- */
- public EReference getXmlAttributeOverride_Column()
- {
- return (EReference)xmlAttributeOverrideEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer <em>Xml Attribute Override Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override Container</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer
- * @generated
- */
- public EClass getXmlAttributeOverrideContainer()
- {
- return xmlAttributeOverrideContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer#getAttributeOverrides <em>Attribute Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attribute Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer#getAttributeOverrides()
- * @see #getXmlAttributeOverrideContainer()
- * @generated
- */
- public EReference getXmlAttributeOverrideContainer_AttributeOverrides()
- {
- return (EReference)xmlAttributeOverrideContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.Attributes
- * @generated
- */
- public EClass getAttributes()
- {
- return attributesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getIds <em>Ids</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Ids</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getIds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Ids()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds <em>Embedded Ids</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embedded Ids</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddedIds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_EmbeddedIds()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getBasics <em>Basics</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basics</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getBasics()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Basics()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getVersions <em>Versions</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Versions</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getVersions()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Versions()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes <em>Many To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Many To Ones</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getManyToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_ManyToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys <em>One To Manys</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>One To Manys</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getOneToManys()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_OneToManys()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes <em>One To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>One To Ones</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getOneToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_OneToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys <em>Many To Manys</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Many To Manys</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getManyToManys()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_ManyToManys()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds <em>Embeddeds</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embeddeds</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getEmbeddeds()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Embeddeds()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.Attributes#getTransients <em>Transients</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Transients</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Attributes#getTransients()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Transients()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlBasic
- * @generated
- */
- public EClass getXmlBasic()
- {
- return xmlBasicEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Fetch</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Fetch()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Optional</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional()
- * @see #getXmlBasic()
- * @generated
- */
- public EAttribute getXmlBasic_Optional()
- {
- return (EAttribute)xmlBasicEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Cascade Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @generated
- */
- public EClass getCascadeType()
- {
- return cascadeTypeEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll <em>Cascade All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade All</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeAll()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeAll()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist <em>Cascade Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadePersist()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadePersist()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge <em>Cascade Merge</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Merge</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeMerge()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeMerge()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove <em>Cascade Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRemove()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeRemove()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh <em>Cascade Refresh</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Refresh</em>'.
- * @see org.eclipse.jpt.core.resource.orm.CascadeType#isCascadeRefresh()
- * @see #getCascadeType()
- * @generated
- */
- public EAttribute getCascadeType_CascadeRefresh()
- {
- return (EAttribute)cascadeTypeEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlClassReference <em>Xml Class Reference</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Class Reference</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlClassReference
- * @generated
- */
- public EClass getXmlClassReference()
- {
- return xmlClassReferenceEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlClassReference#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.core.resource.orm.XmlClassReference#getClassName()
- * @see #getXmlClassReference()
- * @generated
- */
- public EAttribute getXmlClassReference_ClassName()
- {
- return (EAttribute)xmlClassReferenceEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlCollectionTable
- * @generated
- */
- public EClass getXmlCollectionTable()
- {
- return xmlCollectionTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @generated
- */
- public EClass getXmlColumn()
- {
- return xmlColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Length</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getLength()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Length()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Precision</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Precision()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Scale</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn#getScale()
- * @see #getXmlColumn()
- * @generated
- */
- public EAttribute getXmlColumn_Scale()
- {
- return (EAttribute)xmlColumnEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Column Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @generated
- */
- public EClass getColumnMapping()
- {
- return columnMappingEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping#getColumn()
- * @see #getColumnMapping()
- * @generated
- */
- public EReference getColumnMapping_Column()
- {
- return (EReference)columnMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Column Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @generated
- */
- public EClass getColumnResult()
- {
- return columnResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.ColumnResult#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult#getName()
- * @see #getColumnResult()
- * @generated
- */
- public EAttribute getColumnResult_Name()
- {
- return (EAttribute)columnResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlConvertibleMapping
- * @generated
- */
- public EClass getXmlConvertibleMapping()
- {
- return xmlConvertibleMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#isLob <em>Lob</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Lob</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#isLob()
- * @see #getXmlConvertibleMapping()
- * @generated
- */
- public EAttribute getXmlConvertibleMapping_Lob()
- {
- return (EAttribute)xmlConvertibleMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getTemporal <em>Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getTemporal()
- * @see #getXmlConvertibleMapping()
- * @generated
- */
- public EAttribute getXmlConvertibleMapping_Temporal()
- {
- return (EAttribute)xmlConvertibleMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getEnumerated <em>Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Enumerated</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getEnumerated()
- * @see #getXmlConvertibleMapping()
- * @generated
- */
- public EAttribute getXmlConvertibleMapping_Enumerated()
- {
- return (EAttribute)xmlConvertibleMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @generated
- */
- public EClass getXmlDiscriminatorColumn()
- {
- return xmlDiscriminatorColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType()
- * @see #getXmlDiscriminatorColumn()
- * @generated
- */
- public EAttribute getXmlDiscriminatorColumn_DiscriminatorType()
- {
- return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Length</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength()
- * @see #getXmlDiscriminatorColumn()
- * @generated
- */
- public EAttribute getXmlDiscriminatorColumn_Length()
- {
- return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlElementCollection
- * @generated
- */
- public EClass getXmlElementCollection()
- {
- return xmlElementCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlEmbeddable
- * @generated
- */
- public EClass getXmlEmbeddable()
- {
- return xmlEmbeddableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlEmbedded
- * @generated
- */
- public EClass getXmlEmbedded()
- {
- return xmlEmbeddedEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlEmbeddedId
- * @generated
- */
- public EClass getXmlEmbeddedId()
- {
- return xmlEmbeddedIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlEntity
- * @generated
- */
- public EClass getXmlEntity()
- {
- return xmlEntityEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getName()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_Name()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getTable()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_Table()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables <em>Secondary Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Secondary Tables</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SecondaryTables()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Inheritance</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_Inheritance()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_DiscriminatorValue()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_DiscriminatorColumn()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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.core.resource.orm.XmlEntity#getSqlResultSetMappings()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_SqlResultSetMappings()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_EntityListeners()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(10);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Listener</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @generated
- */
- public EClass getEntityListener()
- {
- return entityListenerEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityListener#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.core.resource.orm.EntityListener#getClassName()
- * @see #getEntityListener()
- * @generated
- */
- public EAttribute getEntityListener_ClassName()
- {
- return (EAttribute)entityListenerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @generated
- */
- public EClass getEntityListeners()
- {
- return entityListenersEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.EntityListeners#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners#getEntityListeners()
- * @see #getEntityListeners()
- * @generated
- */
- public EReference getEntityListeners_EntityListeners()
- {
- return (EReference)entityListenersEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlEntityMappings
- * @generated
- */
- public EClass getXmlEntityMappings()
- {
- return xmlEntityMappingsEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Description()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Persistence Unit Metadata</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_PersistenceUnitMetadata()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Package</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Package()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Schema()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EAttribute getXmlEntityMappings_Catalog()
- {
- return (EAttribute)xmlEntityMappingsEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators <em>Sequence Generators</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sequence Generators</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_SequenceGenerators()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators <em>Table Generators</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Table Generators</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_TableGenerators()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#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.core.resource.orm.XmlEntityMappings#getSqlResultSetMappings()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_SqlResultSetMappings()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses <em>Mapped Superclasses</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Mapped Superclasses</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_MappedSuperclasses()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities <em>Entities</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entities</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_Entities()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables <em>Embeddables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Embeddables</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables()
- * @see #getXmlEntityMappings()
- * @generated
- */
- public EReference getXmlEntityMappings_Embeddables()
- {
- return (EReference)xmlEntityMappingsEClass.getEStructuralFeatures().get(10);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Entity Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @generated
- */
- public EClass getEntityResult()
- {
- return entityResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn <em>Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Discriminator Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getDiscriminatorColumn()
- * @see #getEntityResult()
- * @generated
- */
- public EAttribute getEntityResult_DiscriminatorColumn()
- {
- return (EAttribute)entityResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass <em>Entity Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Entity Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getEntityClass()
- * @see #getEntityResult()
- * @generated
- */
- public EAttribute getEntityResult_EntityClass()
- {
- return (EAttribute)entityResultEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults <em>Field Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Field Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EntityResult#getFieldResults()
- * @see #getEntityResult()
- * @generated
- */
- public EReference getEntityResult_FieldResults()
- {
- return (EReference)entityResultEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Event Method</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @generated
- */
- public EClass getEventMethod()
- {
- return eventMethodEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName <em>Method Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Method Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EventMethod#getMethodName()
- * @see #getEventMethod()
- * @generated
- */
- public EAttribute getEventMethod_MethodName()
- {
- return (EAttribute)eventMethodEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer <em>Xml Event Method Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Event Method Container</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer
- * @generated
- */
- public EClass getXmlEventMethodContainer()
- {
- return xmlEventMethodContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPrePersist()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PrePersist()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostPersist()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PostPersist()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreRemove()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PreRemove()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostRemove()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PostRemove()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreUpdate()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PreUpdate()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostUpdate()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PostUpdate()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostLoad()
- * @see #getXmlEventMethodContainer()
- * @generated
- */
- public EReference getXmlEventMethodContainer_PostLoad()
- {
- return (EReference)xmlEventMethodContainerEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Field Result</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @generated
- */
- public EClass getFieldResult()
- {
- return fieldResultEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult#getName()
- * @see #getFieldResult()
- * @generated
- */
- public EAttribute getFieldResult_Name()
- {
- return (EAttribute)fieldResultEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.FieldResult#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FieldResult#getColumn()
- * @see #getFieldResult()
- * @generated
- */
- public EAttribute getFieldResult_Column()
- {
- return (EAttribute)fieldResultEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generated Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @generated
- */
- public EClass getXmlGeneratedValue()
- {
- return xmlGeneratedValueEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator()
- * @see #getXmlGeneratedValue()
- * @generated
- */
- public EAttribute getXmlGeneratedValue_Generator()
- {
- return (EAttribute)xmlGeneratedValueEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Strategy</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy()
- * @see #getXmlGeneratedValue()
- * @generated
- */
- public EAttribute getXmlGeneratedValue_Strategy()
- {
- return (EAttribute)xmlGeneratedValueEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @generated
- */
- public EClass getXmlGenerator()
- {
- return xmlGeneratorEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getName()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_Name()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Initial Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_InitialValue()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Allocation Size</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize()
- * @see #getXmlGenerator()
- * @generated
- */
- public EAttribute getXmlGenerator_AllocationSize()
- {
- return (EAttribute)xmlGeneratorEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer <em>Xml Generator Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generator Container</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer
- * @generated
- */
- public EClass getXmlGeneratorContainer()
- {
- return xmlGeneratorContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getSequenceGenerator <em>Sequence Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Sequence Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getSequenceGenerator()
- * @see #getXmlGeneratorContainer()
- * @generated
- */
- public EReference getXmlGeneratorContainer_SequenceGenerator()
- {
- return (EReference)xmlGeneratorContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getTableGenerator <em>Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Table Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getTableGenerator()
- * @see #getXmlGeneratorContainer()
- * @generated
- */
- public EReference getXmlGeneratorContainer_TableGenerator()
- {
- return (EReference)xmlGeneratorContainerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlId
- * @generated
- */
- public EClass getXmlId()
- {
- return xmlIdEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlId#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.core.resource.orm.XmlId#getGeneratedValue()
- * @see #getXmlId()
- * @generated
- */
- public EReference getXmlId_GeneratedValue()
- {
- return (EReference)xmlIdEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer <em>Xml Id Class Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id Class Container</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClassContainer
- * @generated
- */
- public EClass getXmlIdClassContainer()
- {
- return xmlIdClassContainerEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer#getIdClass <em>Id Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Id Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClassContainer#getIdClass()
- * @see #getXmlIdClassContainer()
- * @generated
- */
- public EReference getXmlIdClassContainer_IdClass()
- {
- return (EReference)xmlIdClassContainerEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Inheritance</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @generated
- */
- public EClass getInheritance()
- {
- return inheritanceEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy <em>Strategy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Strategy</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Inheritance#getStrategy()
- * @see #getInheritance()
- * @generated
- */
- public EAttribute getInheritance_Strategy()
- {
- return (EAttribute)inheritanceEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @generated
- */
- public EClass getXmlJoinColumn()
- {
- return xmlJoinColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Referenced Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName()
- * @see #getXmlJoinColumn()
- * @generated
- */
- public EAttribute getXmlJoinColumn_ReferencedColumnName()
- {
- return (EAttribute)xmlJoinColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping <em>Xml Join Columns Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Columns Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping
- * @generated
- */
- public EClass getXmlJoinColumnsMapping()
- {
- return xmlJoinColumnsMappingEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping#getJoinColumns()
- * @see #getXmlJoinColumnsMapping()
- * @generated
- */
- public EReference getXmlJoinColumnsMapping_JoinColumns()
- {
- return (EReference)xmlJoinColumnsMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlJoinTable
- * @generated
- */
- public EClass getXmlJoinTable()
- {
- return xmlJoinTableEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns <em>Inverse Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Inverse Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns()
- * @see #getXmlJoinTable()
- * @generated
- */
- public EReference getXmlJoinTable_InverseJoinColumns()
- {
- return (EReference)xmlJoinTableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping <em>Xml Join Table Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping
- * @generated
- */
- public EClass getXmlJoinTableMapping()
- {
- return xmlJoinTableMappingEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping#getJoinTable <em>Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Join Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping#getJoinTable()
- * @see #getXmlJoinTableMapping()
- * @generated
- */
- public EReference getXmlJoinTableMapping_JoinTable()
- {
- return (EReference)xmlJoinTableMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Lob</em>'.
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @generated
- */
- public EClass getLob()
- {
- return lobEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlManyToMany
- * @generated
- */
- public EClass getXmlManyToMany()
- {
- return xmlManyToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlManyToOne
- * @generated
- */
- public EClass getXmlManyToOne()
- {
- return xmlManyToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Map Key</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @generated
- */
- public EClass getMapKey()
- {
- return mapKeyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.MapKey#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.MapKey#getName()
- * @see #getMapKey()
- * @generated
- */
- public EAttribute getMapKey_Name()
- {
- return (EAttribute)mapKeyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping <em>Xml Mapped By Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped By Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedByMapping
- * @generated
- */
- public EClass getXmlMappedByMapping()
- {
- return xmlMappedByMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping#getMappedBy <em>Mapped By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mapped By</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedByMapping#getMappedBy()
- * @see #getXmlMappedByMapping()
- * @generated
- */
- public EAttribute getXmlMappedByMapping_MappedBy()
- {
- return (EAttribute)xmlMappedByMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass()
- {
- return xmlMappedSuperclassEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_EntityListeners()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Native Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @generated
- */
- public EClass getXmlNamedNativeQuery()
- {
- return xmlNamedNativeQueryEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#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.core.resource.orm.XmlNamedNativeQuery#getResultClass()
- * @see #getXmlNamedNativeQuery()
- * @generated
- */
- public EAttribute getXmlNamedNativeQuery_ResultClass()
- {
- return (EAttribute)xmlNamedNativeQueryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#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.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping()
- * @see #getXmlNamedNativeQuery()
- * @generated
- */
- public EAttribute getXmlNamedNativeQuery_ResultSetMapping()
- {
- return (EAttribute)xmlNamedNativeQueryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @generated
- */
- public EClass getXmlNamedQuery()
- {
- return xmlNamedQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping <em>Xml Null Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Null Attribute Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping
- * @generated
- */
- public EClass getXmlNullAttributeMapping()
- {
- return xmlNullAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlOneToMany
- * @generated
- */
- public EClass getXmlOneToMany()
- {
- return xmlOneToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlOneToOne
- * @generated
- */
- public EClass getXmlOneToOne()
- {
- return xmlOneToOneEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns()
- * @see #getXmlOneToOne()
- * @generated
- */
- public EReference getXmlOneToOne_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlOneToOneEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlOrderColumn
- * @generated
- */
- public EClass getXmlOrderColumn()
- {
- return xmlOrderColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOverride <em>Xml Override</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Override</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOverride
- * @generated
- */
- public EClass getXmlOverride()
- {
- return xmlOverrideEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlOverride#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOverride#getName()
- * @see #getXmlOverride()
- * @generated
- */
- public EAttribute getXmlOverride_Name()
- {
- return (EAttribute)xmlOverrideEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlPersistenceUnitDefaults
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults()
- {
- return xmlPersistenceUnitDefaultsEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Schema()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_Catalog()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_CascadePersist()
- {
- return (EAttribute)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners()
- * @see #getXmlPersistenceUnitDefaults()
- * @generated
- */
- public EReference getXmlPersistenceUnitDefaults_EntityListeners()
- {
- return (EReference)xmlPersistenceUnitDefaultsEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlPersistenceUnitMetadata
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata()
- {
- return xmlPersistenceUnitMetadataEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Xml Mapping Metadata Complete</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete()
- {
- return (EAttribute)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Persistence Unit Defaults</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EReference getXmlPersistenceUnitMetadata_PersistenceUnitDefaults()
- {
- return (EReference)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable <em>Abstract Xml Reference Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Xml Reference Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable
- * @generated
- */
- public EClass getAbstractXmlReferenceTable()
- {
- return abstractXmlReferenceTableEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlReferenceTable <em>Xml Reference Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Reference Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlReferenceTable
- * @generated
- */
- public EClass getXmlReferenceTable()
- {
- return xmlReferenceTableEClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlReferenceTable#getJoinColumns <em>Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlReferenceTable#getJoinColumns()
- * @see #getXmlReferenceTable()
- * @generated
- */
- public EReference getXmlReferenceTable_JoinColumns()
- {
- return (EReference)xmlReferenceTableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Load</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @generated
- */
- public EClass getPostLoad()
- {
- return postLoadEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @generated
- */
- public EClass getPostPersist()
- {
- return postPersistEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @generated
- */
- public EClass getPostRemove()
- {
- return postRemoveEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Post Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @generated
- */
- public EClass getPostUpdate()
- {
- return postUpdateEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Persist</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @generated
- */
- public EClass getPrePersist()
- {
- return prePersistEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Remove</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @generated
- */
- public EClass getPreRemove()
- {
- return preRemoveEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Pre Update</em>'.
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @generated
- */
- public EClass getPreUpdate()
- {
- return preUpdateEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key Join Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @generated
- */
- public EClass getXmlPrimaryKeyJoinColumn()
- {
- return xmlPrimaryKeyJoinColumnEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Referenced Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName()
- * @see #getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public EAttribute getXmlPrimaryKeyJoinColumn_ReferencedColumnName()
- {
- return (EAttribute)xmlPrimaryKeyJoinColumnEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @generated
- */
- public EClass getXmlQuery()
- {
- return xmlQueryEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery#getName()
- * @see #getXmlQuery()
- * @generated
- */
- public EAttribute getXmlQuery_Name()
- {
- return (EAttribute)xmlQueryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Query</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery()
- * @see #getXmlQuery()
- * @generated
- */
- public EAttribute getXmlQuery_Query()
- {
- return (EAttribute)xmlQueryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#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.core.resource.orm.XmlQuery#getHints()
- * @see #getXmlQuery()
- * @generated
- */
- public EReference getXmlQuery_Hints()
- {
- return (EReference)xmlQueryEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlQueryContainer
- * @generated
- */
- public EClass getXmlQueryContainer()
- {
- return xmlQueryContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedQueries <em>Named Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedQueries()
- * @see #getXmlQueryContainer()
- * @generated
- */
- public EReference getXmlQueryContainer_NamedQueries()
- {
- return (EReference)xmlQueryContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedNativeQueries <em>Named Native Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Native Queries</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedNativeQueries()
- * @see #getXmlQueryContainer()
- * @generated
- */
- public EReference getXmlQueryContainer_NamedNativeQueries()
- {
- return (EReference)xmlQueryContainerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Hint</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @generated
- */
- public EClass getXmlQueryHint()
- {
- return xmlQueryHintEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint#getName()
- * @see #getXmlQueryHint()
- * @generated
- */
- public EAttribute getXmlQueryHint_Name()
- {
- return (EAttribute)xmlQueryHintEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue()
- * @see #getXmlQueryHint()
- * @generated
- */
- public EAttribute getXmlQueryHint_Value()
- {
- return (EAttribute)xmlQueryHintEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlSecondaryTable
- * @generated
- */
- public EClass getXmlSecondaryTable()
- {
- return xmlSecondaryTableEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Primary Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns()
- * @see #getXmlSecondaryTable()
- * @generated
- */
- public EReference getXmlSecondaryTable_PrimaryKeyJoinColumns()
- {
- return (EReference)xmlSecondaryTableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sequence Generator</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @generated
- */
- public EClass getXmlSequenceGenerator()
- {
- return xmlSequenceGeneratorEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Sequence Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName()
- * @see #getXmlSequenceGenerator()
- * @generated
- */
- public EAttribute getXmlSequenceGenerator_SequenceName()
- {
- return (EAttribute)xmlSequenceGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Sql Result Set Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @generated
- */
- public EClass getSqlResultSetMapping()
- {
- return sqlResultSetMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EAttribute getSqlResultSetMapping_Name()
- {
- return (EAttribute)sqlResultSetMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults <em>Entity Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Entity Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EReference getSqlResultSetMapping_EntityResults()
- {
- return (EReference)sqlResultSetMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults <em>Column Results</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Column Results</em>'.
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults()
- * @see #getSqlResultSetMapping()
- * @generated
- */
- public EReference getSqlResultSetMapping_ColumnResults()
- {
- return (EReference)sqlResultSetMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlTable
- * @generated
- */
- public EClass getXmlTable()
- {
- return xmlTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlTableGenerator
- * @generated
- */
- public EClass getXmlTableGenerator()
- {
- return xmlTableGeneratorEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getTable()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Table()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Catalog()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_Schema()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Pk Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_PkColumnName()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value Column Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_ValueColumnName()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Pk Column Value</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EAttribute getXmlTableGenerator_PkColumnValue()
- {
- return (EAttribute)xmlTableGeneratorEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints <em>Unique Constraints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints()
- * @see #getXmlTableGenerator()
- * @generated
- */
- public EReference getXmlTableGenerator_UniqueConstraints()
- {
- return (EReference)xmlTableGeneratorEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlTransient
- * @generated
- */
- public EClass getXmlTransient()
- {
- return xmlTransientEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Mapping</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping
- * @generated
- */
- public EClass getXmlTypeMapping()
- {
- return xmlTypeMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#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.core.resource.orm.XmlTypeMapping#getClassName()
- * @see #getXmlTypeMapping()
- * @generated
- */
- public EAttribute getXmlTypeMapping_ClassName()
- {
- return (EAttribute)xmlTypeMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Metadata Complete</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getMetadataComplete()
- * @see #getXmlTypeMapping()
- * @generated
- */
- public EAttribute getXmlTypeMapping_MetadataComplete()
- {
- return (EAttribute)xmlTypeMappingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getDescription()
- * @see #getXmlTypeMapping()
- * @generated
- */
- public EAttribute getXmlTypeMapping_Description()
- {
- return (EAttribute)xmlTypeMappingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getAttributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Attributes</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getAttributes()
- * @see #getXmlTypeMapping()
- * @generated
- */
- public EReference getXmlTypeMapping_Attributes()
- {
- return (EReference)xmlTypeMappingEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Unique Constraint</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint
- * @generated
- */
- public EClass getXmlUniqueConstraint()
- {
- return xmlUniqueConstraintEClass;
- }
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint#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.core.resource.orm.XmlUniqueConstraint#getColumnNames()
- * @see #getXmlUniqueConstraint()
- * @generated
- */
- public EAttribute getXmlUniqueConstraint_ColumnNames()
- {
- return (EAttribute)xmlUniqueConstraintEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.XmlVersion
- * @generated
- */
- public EClass getXmlVersion()
- {
- return xmlVersionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Orderable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderable
- * @generated
- */
- public EClass getXmlOrderable()
- {
- return xmlOrderableEClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.XmlOrderable#getOrderBy <em>Order By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Order By</em>'.
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderable#getOrderBy()
- * @see #getXmlOrderable()
- * @generated
- */
- public EAttribute getXmlOrderable_OrderBy()
- {
- return (EAttribute)xmlOrderableEClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Access Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @generated
- */
- public EEnum getAccessType()
- {
- return accessTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Discriminator Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @generated
- */
- public EEnum getDiscriminatorType()
- {
- return discriminatorTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Enum Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @generated
- */
- public EEnum getEnumType()
- {
- return enumTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Fetch Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @generated
- */
- public EEnum getFetchType()
- {
- return fetchTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Generation Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @generated
- */
- public EEnum getGenerationType()
- {
- return generationTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Inheritance Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @generated
- */
- public EEnum getInheritanceType()
- {
- return inheritanceTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Temporal Type</em>'.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @generated
- */
- public EEnum getTemporalType()
- {
- return temporalTypeEEnum;
- }
-
- /**
- * 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 OrmFactory getOrmFactory()
- {
- return (OrmFactory)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
- abstractXmlAttributeMappingEClass = createEClass(ABSTRACT_XML_ATTRIBUTE_MAPPING);
-
- abstractXmlColumnEClass = createEClass(ABSTRACT_XML_COLUMN);
- createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__INSERTABLE);
- createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__NULLABLE);
- createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__TABLE);
- createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UNIQUE);
- createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UPDATABLE);
-
- abstractXmlEmbeddedEClass = createEClass(ABSTRACT_XML_EMBEDDED);
-
- abstractXmlMultiRelationshipMappingEClass = createEClass(ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING);
- createEReference(abstractXmlMultiRelationshipMappingEClass, ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY);
-
- abstractXmlNamedColumnEClass = createEClass(ABSTRACT_XML_NAMED_COLUMN);
- createEAttribute(abstractXmlNamedColumnEClass, ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION);
- createEAttribute(abstractXmlNamedColumnEClass, ABSTRACT_XML_NAMED_COLUMN__NAME);
-
- abstractXmlRelationshipMappingEClass = createEClass(ABSTRACT_XML_RELATIONSHIP_MAPPING);
- createEAttribute(abstractXmlRelationshipMappingEClass, ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY);
- createEAttribute(abstractXmlRelationshipMappingEClass, ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH);
- createEReference(abstractXmlRelationshipMappingEClass, ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE);
-
- abstractXmlSingleRelationshipMappingEClass = createEClass(ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING);
- createEAttribute(abstractXmlSingleRelationshipMappingEClass, ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL);
-
- abstractXmlReferenceTableEClass = createEClass(ABSTRACT_XML_REFERENCE_TABLE);
-
- abstractXmlTableEClass = createEClass(ABSTRACT_XML_TABLE);
- createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__NAME);
- createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__CATALOG);
- createEAttribute(abstractXmlTableEClass, ABSTRACT_XML_TABLE__SCHEMA);
- createEReference(abstractXmlTableEClass, ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS);
-
- abstractXmlTypeMappingEClass = createEClass(ABSTRACT_XML_TYPE_MAPPING);
-
- xmlAccessHolderEClass = createEClass(XML_ACCESS_HOLDER);
- createEAttribute(xmlAccessHolderEClass, XML_ACCESS_HOLDER__ACCESS);
-
- xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING);
- createEAttribute(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__NAME);
-
- xmlAssociationOverrideEClass = createEClass(XML_ASSOCIATION_OVERRIDE);
-
- xmlAssociationOverrideContainerEClass = createEClass(XML_ASSOCIATION_OVERRIDE_CONTAINER);
- createEReference(xmlAssociationOverrideContainerEClass, XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES);
-
- xmlAttributeOverrideEClass = createEClass(XML_ATTRIBUTE_OVERRIDE);
- createEReference(xmlAttributeOverrideEClass, XML_ATTRIBUTE_OVERRIDE__COLUMN);
-
- xmlAttributeOverrideContainerEClass = createEClass(XML_ATTRIBUTE_OVERRIDE_CONTAINER);
- createEReference(xmlAttributeOverrideContainerEClass, XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES);
-
- attributesEClass = createEClass(ATTRIBUTES);
- createEReference(attributesEClass, ATTRIBUTES__IDS);
- createEReference(attributesEClass, ATTRIBUTES__EMBEDDED_IDS);
- createEReference(attributesEClass, ATTRIBUTES__BASICS);
- createEReference(attributesEClass, ATTRIBUTES__VERSIONS);
- createEReference(attributesEClass, ATTRIBUTES__MANY_TO_ONES);
- createEReference(attributesEClass, ATTRIBUTES__ONE_TO_MANYS);
- createEReference(attributesEClass, ATTRIBUTES__ONE_TO_ONES);
- createEReference(attributesEClass, ATTRIBUTES__MANY_TO_MANYS);
- createEReference(attributesEClass, ATTRIBUTES__EMBEDDEDS);
- createEReference(attributesEClass, ATTRIBUTES__TRANSIENTS);
-
- xmlBasicEClass = createEClass(XML_BASIC);
- createEAttribute(xmlBasicEClass, XML_BASIC__FETCH);
- createEAttribute(xmlBasicEClass, XML_BASIC__OPTIONAL);
-
- cascadeTypeEClass = createEClass(CASCADE_TYPE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_ALL);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_PERSIST);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_MERGE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_REMOVE);
- createEAttribute(cascadeTypeEClass, CASCADE_TYPE__CASCADE_REFRESH);
-
- xmlClassReferenceEClass = createEClass(XML_CLASS_REFERENCE);
- createEAttribute(xmlClassReferenceEClass, XML_CLASS_REFERENCE__CLASS_NAME);
-
- xmlCollectionTableEClass = createEClass(XML_COLLECTION_TABLE);
-
- xmlColumnEClass = createEClass(XML_COLUMN);
- createEAttribute(xmlColumnEClass, XML_COLUMN__LENGTH);
- createEAttribute(xmlColumnEClass, XML_COLUMN__PRECISION);
- createEAttribute(xmlColumnEClass, XML_COLUMN__SCALE);
-
- columnMappingEClass = createEClass(COLUMN_MAPPING);
- createEReference(columnMappingEClass, COLUMN_MAPPING__COLUMN);
-
- columnResultEClass = createEClass(COLUMN_RESULT);
- createEAttribute(columnResultEClass, COLUMN_RESULT__NAME);
-
- xmlConvertibleMappingEClass = createEClass(XML_CONVERTIBLE_MAPPING);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__LOB);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__TEMPORAL);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__ENUMERATED);
-
- xmlDiscriminatorColumnEClass = createEClass(XML_DISCRIMINATOR_COLUMN);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE);
- createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__LENGTH);
-
- xmlElementCollectionEClass = createEClass(XML_ELEMENT_COLLECTION);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
-
- xmlEmbeddedEClass = createEClass(XML_EMBEDDED);
-
- xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID);
-
- xmlEntityEClass = createEClass(XML_ENTITY);
- createEAttribute(xmlEntityEClass, XML_ENTITY__NAME);
- createEReference(xmlEntityEClass, XML_ENTITY__TABLE);
- createEReference(xmlEntityEClass, XML_ENTITY__SECONDARY_TABLES);
- createEReference(xmlEntityEClass, XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS);
- createEReference(xmlEntityEClass, XML_ENTITY__INHERITANCE);
- createEAttribute(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_VALUE);
- createEReference(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_COLUMN);
- createEReference(xmlEntityEClass, XML_ENTITY__SQL_RESULT_SET_MAPPINGS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlEntityEClass, XML_ENTITY__ENTITY_LISTENERS);
-
- entityListenerEClass = createEClass(ENTITY_LISTENER);
- createEAttribute(entityListenerEClass, ENTITY_LISTENER__CLASS_NAME);
-
- entityListenersEClass = createEClass(ENTITY_LISTENERS);
- createEReference(entityListenersEClass, ENTITY_LISTENERS__ENTITY_LISTENERS);
-
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__DESCRIPTION);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__PACKAGE);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SCHEMA);
- createEAttribute(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__CATALOG);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__TABLE_GENERATORS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__ENTITIES);
- createEReference(xmlEntityMappingsEClass, XML_ENTITY_MAPPINGS__EMBEDDABLES);
-
- entityResultEClass = createEClass(ENTITY_RESULT);
- createEAttribute(entityResultEClass, ENTITY_RESULT__DISCRIMINATOR_COLUMN);
- createEAttribute(entityResultEClass, ENTITY_RESULT__ENTITY_CLASS);
- createEReference(entityResultEClass, ENTITY_RESULT__FIELD_RESULTS);
-
- eventMethodEClass = createEClass(EVENT_METHOD);
- createEAttribute(eventMethodEClass, EVENT_METHOD__METHOD_NAME);
-
- xmlEventMethodContainerEClass = createEClass(XML_EVENT_METHOD_CONTAINER);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__PRE_PERSIST);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__POST_PERSIST);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__PRE_REMOVE);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__POST_REMOVE);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__PRE_UPDATE);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__POST_UPDATE);
- createEReference(xmlEventMethodContainerEClass, XML_EVENT_METHOD_CONTAINER__POST_LOAD);
-
- fieldResultEClass = createEClass(FIELD_RESULT);
- createEAttribute(fieldResultEClass, FIELD_RESULT__NAME);
- createEAttribute(fieldResultEClass, FIELD_RESULT__COLUMN);
-
- xmlGeneratedValueEClass = createEClass(XML_GENERATED_VALUE);
- createEAttribute(xmlGeneratedValueEClass, XML_GENERATED_VALUE__GENERATOR);
- createEAttribute(xmlGeneratedValueEClass, XML_GENERATED_VALUE__STRATEGY);
-
- xmlGeneratorEClass = createEClass(XML_GENERATOR);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__NAME);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__INITIAL_VALUE);
- createEAttribute(xmlGeneratorEClass, XML_GENERATOR__ALLOCATION_SIZE);
-
- xmlGeneratorContainerEClass = createEClass(XML_GENERATOR_CONTAINER);
- createEReference(xmlGeneratorContainerEClass, XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR);
- createEReference(xmlGeneratorContainerEClass, XML_GENERATOR_CONTAINER__TABLE_GENERATOR);
-
- xmlIdEClass = createEClass(XML_ID);
- createEReference(xmlIdEClass, XML_ID__GENERATED_VALUE);
-
- xmlIdClassContainerEClass = createEClass(XML_ID_CLASS_CONTAINER);
- createEReference(xmlIdClassContainerEClass, XML_ID_CLASS_CONTAINER__ID_CLASS);
-
- inheritanceEClass = createEClass(INHERITANCE);
- createEAttribute(inheritanceEClass, INHERITANCE__STRATEGY);
-
- xmlJoinColumnEClass = createEClass(XML_JOIN_COLUMN);
- createEAttribute(xmlJoinColumnEClass, XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
-
- xmlJoinColumnsMappingEClass = createEClass(XML_JOIN_COLUMNS_MAPPING);
- createEReference(xmlJoinColumnsMappingEClass, XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS);
-
- xmlJoinTableEClass = createEClass(XML_JOIN_TABLE);
- createEReference(xmlJoinTableEClass, XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
-
- xmlJoinTableMappingEClass = createEClass(XML_JOIN_TABLE_MAPPING);
- createEReference(xmlJoinTableMappingEClass, XML_JOIN_TABLE_MAPPING__JOIN_TABLE);
-
- lobEClass = createEClass(LOB);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- mapKeyEClass = createEClass(MAP_KEY);
- createEAttribute(mapKeyEClass, MAP_KEY__NAME);
-
- xmlMappedByMappingEClass = createEClass(XML_MAPPED_BY_MAPPING);
- createEAttribute(xmlMappedByMappingEClass, XML_MAPPED_BY_MAPPING__MAPPED_BY);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS);
-
- xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY);
- createEAttribute(xmlNamedNativeQueryEClass, XML_NAMED_NATIVE_QUERY__RESULT_CLASS);
- createEAttribute(xmlNamedNativeQueryEClass, XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING);
-
- xmlNamedQueryEClass = createEClass(XML_NAMED_QUERY);
-
- xmlNullAttributeMappingEClass = createEClass(XML_NULL_ATTRIBUTE_MAPPING);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
- createEReference(xmlOneToOneEClass, XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlOrderableEClass = createEClass(XML_ORDERABLE);
- createEAttribute(xmlOrderableEClass, XML_ORDERABLE__ORDER_BY);
-
- xmlOrderColumnEClass = createEClass(XML_ORDER_COLUMN);
-
- xmlOverrideEClass = createEClass(XML_OVERRIDE);
- createEAttribute(xmlOverrideEClass, XML_OVERRIDE__NAME);
-
- xmlPersistenceUnitDefaultsEClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG);
- createEAttribute(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST);
- createEReference(xmlPersistenceUnitDefaultsEClass, XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS);
-
- xmlPersistenceUnitMetadataEClass = createEClass(XML_PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE);
- createEReference(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS);
-
- xmlReferenceTableEClass = createEClass(XML_REFERENCE_TABLE);
- createEReference(xmlReferenceTableEClass, XML_REFERENCE_TABLE__JOIN_COLUMNS);
-
- postLoadEClass = createEClass(POST_LOAD);
-
- postPersistEClass = createEClass(POST_PERSIST);
-
- postRemoveEClass = createEClass(POST_REMOVE);
-
- postUpdateEClass = createEClass(POST_UPDATE);
-
- prePersistEClass = createEClass(PRE_PERSIST);
-
- preRemoveEClass = createEClass(PRE_REMOVE);
-
- preUpdateEClass = createEClass(PRE_UPDATE);
-
- xmlPrimaryKeyJoinColumnEClass = createEClass(XML_PRIMARY_KEY_JOIN_COLUMN);
- createEAttribute(xmlPrimaryKeyJoinColumnEClass, XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME);
-
- xmlQueryEClass = createEClass(XML_QUERY);
- createEAttribute(xmlQueryEClass, XML_QUERY__NAME);
- createEAttribute(xmlQueryEClass, XML_QUERY__QUERY);
- createEReference(xmlQueryEClass, XML_QUERY__HINTS);
-
- xmlQueryContainerEClass = createEClass(XML_QUERY_CONTAINER);
- createEReference(xmlQueryContainerEClass, XML_QUERY_CONTAINER__NAMED_QUERIES);
- createEReference(xmlQueryContainerEClass, XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES);
-
- xmlQueryHintEClass = createEClass(XML_QUERY_HINT);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__NAME);
- createEAttribute(xmlQueryHintEClass, XML_QUERY_HINT__VALUE);
-
- xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE);
- createEReference(xmlSecondaryTableEClass, XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS);
-
- xmlSequenceGeneratorEClass = createEClass(XML_SEQUENCE_GENERATOR);
- createEAttribute(xmlSequenceGeneratorEClass, XML_SEQUENCE_GENERATOR__SEQUENCE_NAME);
-
- sqlResultSetMappingEClass = createEClass(SQL_RESULT_SET_MAPPING);
- createEAttribute(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__NAME);
- createEReference(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__ENTITY_RESULTS);
- createEReference(sqlResultSetMappingEClass, SQL_RESULT_SET_MAPPING__COLUMN_RESULTS);
-
- xmlTableEClass = createEClass(XML_TABLE);
-
- xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__TABLE);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__CATALOG);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__SCHEMA);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__PK_COLUMN_NAME);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__VALUE_COLUMN_NAME);
- createEAttribute(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__PK_COLUMN_VALUE);
- createEReference(xmlTableGeneratorEClass, XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
-
- xmlTransientEClass = createEClass(XML_TRANSIENT);
-
- xmlTypeMappingEClass = createEClass(XML_TYPE_MAPPING);
- createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__CLASS_NAME);
- createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__METADATA_COMPLETE);
- createEAttribute(xmlTypeMappingEClass, XML_TYPE_MAPPING__DESCRIPTION);
- createEReference(xmlTypeMappingEClass, XML_TYPE_MAPPING__ATTRIBUTES);
-
- xmlUniqueConstraintEClass = createEClass(XML_UNIQUE_CONSTRAINT);
- createEAttribute(xmlUniqueConstraintEClass, XML_UNIQUE_CONSTRAINT__COLUMN_NAMES);
-
- xmlVersionEClass = createEClass(XML_VERSION);
-
- // Create enums
- accessTypeEEnum = createEEnum(ACCESS_TYPE);
- discriminatorTypeEEnum = createEEnum(DISCRIMINATOR_TYPE);
- enumTypeEEnum = createEEnum(ENUM_TYPE);
- fetchTypeEEnum = createEEnum(FETCH_TYPE);
- generationTypeEEnum = createEEnum(GENERATION_TYPE);
- inheritanceTypeEEnum = createEEnum(INHERITANCE_TYPE);
- temporalTypeEEnum = createEEnum(TEMPORAL_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
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
-
- // Add subpackages
- getESubpackages().add(theOrmV2_0Package);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- abstractXmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- abstractXmlColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- abstractXmlEmbeddedEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- abstractXmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeOverrideContainer());
- abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getAbstractXmlRelationshipMapping());
- abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getXmlMappedByMapping());
- abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getXmlJoinTableMapping());
- abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getXmlOrderable());
- abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(theOrmV2_0Package.getXmlMultiRelationshipMapping_2_0());
- abstractXmlRelationshipMappingEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- abstractXmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getAbstractXmlRelationshipMapping());
- abstractXmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getXmlJoinTableMapping());
- abstractXmlSingleRelationshipMappingEClass.getESuperTypes().add(this.getXmlJoinColumnsMapping());
- abstractXmlSingleRelationshipMappingEClass.getESuperTypes().add(theOrmV2_0Package.getXmlSingleRelationshipMapping_2_0());
- abstractXmlReferenceTableEClass.getESuperTypes().add(this.getAbstractXmlTable());
- abstractXmlReferenceTableEClass.getESuperTypes().add(this.getXmlReferenceTable());
- abstractXmlTypeMappingEClass.getESuperTypes().add(this.getXmlTypeMapping());
- xmlAttributeMappingEClass.getESuperTypes().add(theOrmV2_0Package.getXmlAttributeMapping_2_0());
- xmlAssociationOverrideEClass.getESuperTypes().add(this.getXmlOverride());
- xmlAssociationOverrideEClass.getESuperTypes().add(this.getXmlJoinColumnsMapping());
- xmlAssociationOverrideEClass.getESuperTypes().add(theOrmV2_0Package.getXmlAssociationOverride_2_0());
- xmlAttributeOverrideEClass.getESuperTypes().add(this.getXmlOverride());
- xmlAttributeOverrideEClass.getESuperTypes().add(theOrmV2_0Package.getXmlAttributeOverride_2_0());
- attributesEClass.getESuperTypes().add(theOrmV2_0Package.getXmlAttributes_2_0());
- xmlBasicEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlBasicEClass.getESuperTypes().add(this.getColumnMapping());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- cascadeTypeEClass.getESuperTypes().add(theOrmV2_0Package.getXmlCascadeType_2_0());
- xmlCollectionTableEClass.getESuperTypes().add(this.getAbstractXmlReferenceTable());
- xmlCollectionTableEClass.getESuperTypes().add(theOrmV2_0Package.getXmlCollectionTable_2_0());
- xmlColumnEClass.getESuperTypes().add(this.getAbstractXmlColumn());
- xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlElementCollectionEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlElementCollectionEClass.getESuperTypes().add(theOrmV2_0Package.getXmlElementCollection_2_0());
- xmlEmbeddableEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEmbeddedEClass.getESuperTypes().add(this.getAbstractXmlEmbedded());
- xmlEmbeddedEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEmbedded_2_0());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getAbstractXmlEmbedded());
- xmlEntityEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlEntityEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlGeneratorContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlEventMethodContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlAttributeOverrideContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlAssociationOverrideContainer());
- xmlEntityEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEntity_2_0());
- xmlEntityEClass.getESuperTypes().add(this.getXmlIdClassContainer());
- entityListenerEClass.getESuperTypes().add(this.getXmlEventMethodContainer());
- entityListenerEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEntityListener_2_0());
- xmlEntityMappingsEClass.getESuperTypes().add(theCommonPackage.getAbstractJpaRootEObject());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlAccessHolder());
- eventMethodEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEventMethod_2_0());
- xmlGeneratorEClass.getESuperTypes().add(theOrmV2_0Package.getXmlGenerator_2_0());
- xmlIdEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getColumnMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlGeneratorContainer());
- xmlJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlColumn());
- xmlJoinTableEClass.getESuperTypes().add(this.getAbstractXmlReferenceTable());
- xmlManyToManyEClass.getESuperTypes().add(this.getAbstractXmlMultiRelationshipMapping());
- xmlManyToManyEClass.getESuperTypes().add(theOrmV2_0Package.getXmlManyToMany_2_0());
- xmlManyToOneEClass.getESuperTypes().add(this.getAbstractXmlSingleRelationshipMapping());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlIdClassContainer());
- xmlNamedNativeQueryEClass.getESuperTypes().add(this.getXmlQuery());
- xmlNamedQueryEClass.getESuperTypes().add(this.getXmlQuery());
- xmlNamedQueryEClass.getESuperTypes().add(theOrmV2_0Package.getXmlNamedQuery_2_0());
- xmlNullAttributeMappingEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlOneToManyEClass.getESuperTypes().add(this.getAbstractXmlMultiRelationshipMapping());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlJoinColumnsMapping());
- xmlOneToManyEClass.getESuperTypes().add(theOrmV2_0Package.getXmlOneToMany_2_0());
- xmlOneToOneEClass.getESuperTypes().add(this.getAbstractXmlSingleRelationshipMapping());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlMappedByMapping());
- xmlOneToOneEClass.getESuperTypes().add(theOrmV2_0Package.getXmlOneToOne_2_0());
- xmlOrderableEClass.getESuperTypes().add(theOrmV2_0Package.getXmlOrderable_2_0());
- xmlOrderColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlOrderColumnEClass.getESuperTypes().add(theOrmV2_0Package.getXmlOrderColumn_2_0());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(this.getXmlAccessHolder());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theOrmV2_0Package.getXmlPersistenceUnitDefaults_2_0());
- xmlPersistenceUnitMetadataEClass.getESuperTypes().add(theOrmV2_0Package.getXmlPersistenceUnitMetadata_2_0());
- postLoadEClass.getESuperTypes().add(this.getEventMethod());
- postPersistEClass.getESuperTypes().add(this.getEventMethod());
- postRemoveEClass.getESuperTypes().add(this.getEventMethod());
- postUpdateEClass.getESuperTypes().add(this.getEventMethod());
- prePersistEClass.getESuperTypes().add(this.getEventMethod());
- preRemoveEClass.getESuperTypes().add(this.getEventMethod());
- preUpdateEClass.getESuperTypes().add(this.getEventMethod());
- xmlPrimaryKeyJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn());
- xmlQueryEClass.getESuperTypes().add(theOrmV2_0Package.getXmlQuery_2_0());
- xmlQueryHintEClass.getESuperTypes().add(theOrmV2_0Package.getXmlQueryHint_2_0());
- xmlSecondaryTableEClass.getESuperTypes().add(this.getAbstractXmlTable());
- xmlSequenceGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlSequenceGeneratorEClass.getESuperTypes().add(theOrmV2_0Package.getXmlSequenceGenerator_2_0());
- sqlResultSetMappingEClass.getESuperTypes().add(theOrmV2_0Package.getXmlSqlResultSetMapping_2_0());
- xmlTableEClass.getESuperTypes().add(this.getAbstractXmlTable());
- xmlTableGeneratorEClass.getESuperTypes().add(this.getXmlGenerator());
- xmlTransientEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlTypeMappingEClass.getESuperTypes().add(this.getXmlAccessHolder());
- xmlUniqueConstraintEClass.getESuperTypes().add(theOrmV2_0Package.getXmlUniqueConstraint_2_0());
- xmlVersionEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(this.getColumnMapping());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
-
- // Initialize classes and features; add operations and parameters
- initEClass(abstractXmlAttributeMappingEClass, AbstractXmlAttributeMapping.class, "AbstractXmlAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(abstractXmlColumnEClass, AbstractXmlColumn.class, "AbstractXmlColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlColumn_Insertable(), theXMLTypePackage.getBooleanObject(), "insertable", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlColumn_Nullable(), theXMLTypePackage.getBooleanObject(), "nullable", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlColumn_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlColumn_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlColumn_Updatable(), theXMLTypePackage.getBooleanObject(), "updatable", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlEmbeddedEClass, AbstractXmlEmbedded.class, "AbstractXmlEmbedded", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(abstractXmlMultiRelationshipMappingEClass, AbstractXmlMultiRelationshipMapping.class, "AbstractXmlMultiRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAbstractXmlMultiRelationshipMapping_MapKey(), this.getMapKey(), null, "mapKey", null, 0, 1, AbstractXmlMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlNamedColumnEClass, AbstractXmlNamedColumn.class, "AbstractXmlNamedColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlNamedColumn_ColumnDefinition(), theXMLTypePackage.getString(), "columnDefinition", null, 0, 1, AbstractXmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlNamedColumn_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, AbstractXmlNamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlRelationshipMappingEClass, AbstractXmlRelationshipMapping.class, "AbstractXmlRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlRelationshipMapping_TargetEntity(), theXMLTypePackage.getString(), "targetEntity", null, 0, 1, AbstractXmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlRelationshipMapping_Fetch(), this.getFetchType(), "fetch", "LAZY", 0, 1, AbstractXmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAbstractXmlRelationshipMapping_Cascade(), this.getCascadeType(), null, "cascade", null, 0, 1, AbstractXmlRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlSingleRelationshipMappingEClass, AbstractXmlSingleRelationshipMapping.class, "AbstractXmlSingleRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlSingleRelationshipMapping_Optional(), theXMLTypePackage.getBooleanObject(), "optional", null, 0, 1, AbstractXmlSingleRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlReferenceTableEClass, AbstractXmlReferenceTable.class, "AbstractXmlReferenceTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(abstractXmlTableEClass, AbstractXmlTable.class, "AbstractXmlTable", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getAbstractXmlTable_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTable_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractXmlTable_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, AbstractXmlTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAbstractXmlTable_UniqueConstraints(), this.getXmlUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, AbstractXmlTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractXmlTypeMappingEClass, AbstractXmlTypeMapping.class, "AbstractXmlTypeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAccessHolderEClass, XmlAccessHolder.class, "XmlAccessHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAccessHolder_Access(), this.getAccessType(), "access", null, 0, 1, XmlAccessHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAttributeMapping_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlAttributeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAssociationOverrideEClass, XmlAssociationOverride.class, "XmlAssociationOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAssociationOverrideContainerEClass, XmlAssociationOverrideContainer.class, "XmlAssociationOverrideContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAssociationOverrideContainer_AssociationOverrides(), this.getXmlAssociationOverride(), null, "associationOverrides", null, 0, -1, XmlAssociationOverrideContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeOverrideEClass, XmlAttributeOverride.class, "XmlAttributeOverride", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAttributeOverride_Column(), this.getXmlColumn(), null, "column", null, 1, 1, XmlAttributeOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeOverrideContainerEClass, XmlAttributeOverrideContainer.class, "XmlAttributeOverrideContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAttributeOverrideContainer_AttributeOverrides(), this.getXmlAttributeOverride(), null, "attributeOverrides", null, 0, -1, XmlAttributeOverrideContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAttributes_Ids(), this.getXmlId(), null, "ids", 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_EmbeddedIds(), this.getXmlEmbeddedId(), null, "embeddedIds", 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_Basics(), this.getXmlBasic(), null, "basics", 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_Versions(), this.getXmlVersion(), null, "versions", 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_ManyToOnes(), this.getXmlManyToOne(), null, "manyToOnes", 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_OneToManys(), this.getXmlOneToMany(), null, "oneToManys", 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_OneToOnes(), this.getXmlOneToOne(), null, "oneToOnes", 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_ManyToManys(), this.getXmlManyToMany(), null, "manyToManys", 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_Embeddeds(), this.getXmlEmbedded(), null, "embeddeds", 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_Transients(), this.getXmlTransient(), null, "transients", 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);
- initEAttribute(getXmlBasic_Fetch(), this.getFetchType(), "fetch", "LAZY", 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_Optional(), theXMLTypePackage.getBooleanObject(), "optional", null, 0, 1, XmlBasic.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(cascadeTypeEClass, CascadeType.class, "CascadeType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getCascadeType_CascadeAll(), theXMLTypePackage.getBoolean(), "cascadeAll", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadePersist(), theXMLTypePackage.getBoolean(), "cascadePersist", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeMerge(), theXMLTypePackage.getBoolean(), "cascadeMerge", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeRemove(), theXMLTypePackage.getBoolean(), "cascadeRemove", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getCascadeType_CascadeRefresh(), theXMLTypePackage.getBoolean(), "cascadeRefresh", null, 0, 1, CascadeType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlClassReferenceEClass, XmlClassReference.class, "XmlClassReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlClassReference_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, XmlClassReference.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(xmlColumnEClass, XmlColumn.class, "XmlColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlColumn_Precision(), theXMLTypePackage.getIntObject(), "precision", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlColumn_Scale(), theXMLTypePackage.getIntObject(), "scale", null, 0, 1, XmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(columnMappingEClass, ColumnMapping.class, "ColumnMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getColumnMapping_Column(), this.getXmlColumn(), null, "column", null, 0, 1, ColumnMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(columnResultEClass, ColumnResult.class, "ColumnResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getColumnResult_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, ColumnResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConvertibleMappingEClass, XmlConvertibleMapping.class, "XmlConvertibleMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConvertibleMapping_Lob(), theXMLTypePackage.getBoolean(), "lob", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlConvertibleMapping_Temporal(), this.getTemporalType(), "temporal", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlConvertibleMapping_Enumerated(), this.getEnumType(), "enumerated", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlDiscriminatorColumnEClass, XmlDiscriminatorColumn.class, "XmlDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlDiscriminatorColumn_DiscriminatorType(), this.getDiscriminatorType(), "discriminatorType", "STRING", 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlDiscriminatorColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, 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);
-
- 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);
- initEAttribute(getXmlEntity_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_Table(), this.getXmlTable(), null, "table", 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_SecondaryTables(), this.getXmlSecondaryTable(), null, "secondaryTables", 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_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", 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_Inheritance(), this.getInheritance(), null, "inheritance", 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_DiscriminatorValue(), theXMLTypePackage.getString(), "discriminatorValue", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_DiscriminatorColumn(), this.getXmlDiscriminatorColumn(), null, "discriminatorColumn", 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_SqlResultSetMappings(), this.getSqlResultSetMapping(), null, "sqlResultSetMappings", 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_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityListenerEClass, EntityListener.class, "EntityListener", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEntityListener_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityListenersEClass, EntityListeners.class, "EntityListeners", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getEntityListeners_EntityListeners(), this.getEntityListener(), null, "entityListeners", null, 0, -1, EntityListeners.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEntityMappings_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_PersistenceUnitMetadata(), this.getXmlPersistenceUnitMetadata(), null, "persistenceUnitMetadata", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Package(), theXMLTypePackage.getString(), "package", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntityMappings_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_SequenceGenerators(), this.getXmlSequenceGenerator(), null, "sequenceGenerators", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_TableGenerators(), this.getXmlTableGenerator(), null, "tableGenerators", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_SqlResultSetMappings(), this.getSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_MappedSuperclasses(), this.getXmlMappedSuperclass(), null, "mappedSuperclasses", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_Entities(), this.getXmlEntity(), null, "entities", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_Embeddables(), this.getXmlEmbeddable(), null, "embeddables", null, 0, -1, XmlEntityMappings.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(entityResultEClass, EntityResult.class, "EntityResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEntityResult_DiscriminatorColumn(), theXMLTypePackage.getString(), "discriminatorColumn", null, 0, 1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getEntityResult_EntityClass(), theXMLTypePackage.getString(), "entityClass", null, 1, 1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getEntityResult_FieldResults(), this.getFieldResult(), null, "fieldResults", null, 0, -1, EntityResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(eventMethodEClass, EventMethod.class, "EventMethod", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getEventMethod_MethodName(), theXMLTypePackage.getString(), "methodName", null, 1, 1, EventMethod.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEventMethodContainerEClass, XmlEventMethodContainer.class, "XmlEventMethodContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEventMethodContainer_PrePersist(), this.getPrePersist(), null, "prePersist", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PostPersist(), this.getPostPersist(), null, "postPersist", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PreRemove(), this.getPreRemove(), null, "preRemove", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PostRemove(), this.getPostRemove(), null, "postRemove", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PreUpdate(), this.getPreUpdate(), null, "preUpdate", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PostUpdate(), this.getPostUpdate(), null, "postUpdate", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEventMethodContainer_PostLoad(), this.getPostLoad(), null, "postLoad", null, 0, 1, XmlEventMethodContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(fieldResultEClass, FieldResult.class, "FieldResult", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getFieldResult_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, FieldResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getFieldResult_Column(), theXMLTypePackage.getString(), "column", null, 1, 1, FieldResult.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGeneratedValueEClass, XmlGeneratedValue.class, "XmlGeneratedValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlGeneratedValue_Generator(), theXMLTypePackage.getString(), "generator", null, 0, 1, XmlGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGeneratedValue_Strategy(), this.getGenerationType(), "strategy", "TABLE", 0, 1, XmlGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGeneratorEClass, XmlGenerator.class, "XmlGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlGenerator_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGenerator_InitialValue(), theXMLTypePackage.getIntObject(), "initialValue", null, 0, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlGenerator_AllocationSize(), theXMLTypePackage.getIntObject(), "allocationSize", null, 0, 1, XmlGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGeneratorContainerEClass, XmlGeneratorContainer.class, "XmlGeneratorContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlGeneratorContainer_SequenceGenerator(), this.getXmlSequenceGenerator(), null, "sequenceGenerator", null, 0, 1, XmlGeneratorContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlGeneratorContainer_TableGenerator(), this.getXmlTableGenerator(), null, "tableGenerator", null, 0, 1, XmlGeneratorContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIdEClass, XmlId.class, "XmlId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_GeneratedValue(), this.getXmlGeneratedValue(), null, "generatedValue", null, 0, 1, XmlId.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIdClassContainerEClass, XmlIdClassContainer.class, "XmlIdClassContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlIdClassContainer_IdClass(), this.getXmlClassReference(), null, "idClass", null, 0, 1, XmlIdClassContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(inheritanceEClass, Inheritance.class, "Inheritance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getInheritance_Strategy(), this.getInheritanceType(), "strategy", "SINGLE_TABLE", 0, 1, Inheritance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinColumnEClass, XmlJoinColumn.class, "XmlJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinColumn_ReferencedColumnName(), theXMLTypePackage.getString(), "referencedColumnName", null, 0, 1, XmlJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinColumnsMappingEClass, XmlJoinColumnsMapping.class, "XmlJoinColumnsMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlJoinColumnsMapping_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlJoinColumnsMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlJoinTable_InverseJoinColumns(), this.getXmlJoinColumn(), null, "inverseJoinColumns", null, 0, -1, XmlJoinTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTableMappingEClass, XmlJoinTableMapping.class, "XmlJoinTableMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlJoinTableMapping_JoinTable(), this.getXmlJoinTable(), null, "joinTable", null, 0, 1, XmlJoinTableMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(lobEClass, Lob.class, "Lob", !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(mapKeyEClass, MapKey.class, "MapKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getMapKey_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, MapKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedByMappingEClass, XmlMappedByMapping.class, "XmlMappedByMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMappedByMapping_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlMappedByMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMappedSuperclass_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedNativeQuery_ResultClass(), theXMLTypePackage.getString(), "resultClass", null, 0, 1, XmlNamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedNativeQuery_ResultSetMapping(), theXMLTypePackage.getString(), "resultSetMapping", null, 0, 1, XmlNamedNativeQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedQueryEClass, XmlNamedQuery.class, "XmlNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNullAttributeMappingEClass, XmlNullAttributeMapping.class, "XmlNullAttributeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- 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);
- initEReference(getXmlOneToOne_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, XmlOneToOne.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrderableEClass, XmlOrderable.class, "XmlOrderable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOrderable_OrderBy(), theXMLTypePackage.getString(), "orderBy", null, 0, 1, XmlOrderable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrderColumnEClass, XmlOrderColumn.class, "XmlOrderColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOverrideEClass, XmlOverride.class, "XmlOverride", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOverride_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlOverride.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitDefaultsEClass, XmlPersistenceUnitDefaults.class, "XmlPersistenceUnitDefaults", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitDefaults_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_CascadePersist(), theXMLTypePackage.getBoolean(), "cascadePersist", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnitDefaults_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlPersistenceUnitDefaults.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitMetadataEClass, XmlPersistenceUnitMetadata.class, "XmlPersistenceUnitMetadata", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete(), theXMLTypePackage.getBoolean(), "xmlMappingMetadataComplete", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnitMetadata_PersistenceUnitDefaults(), this.getXmlPersistenceUnitDefaults(), null, "persistenceUnitDefaults", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReferenceTableEClass, XmlReferenceTable.class, "XmlReferenceTable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlReferenceTable_JoinColumns(), this.getXmlJoinColumn(), null, "joinColumns", null, 0, -1, XmlReferenceTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(postLoadEClass, PostLoad.class, "PostLoad", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postPersistEClass, PostPersist.class, "PostPersist", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postRemoveEClass, PostRemove.class, "PostRemove", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(postUpdateEClass, PostUpdate.class, "PostUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(prePersistEClass, PrePersist.class, "PrePersist", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(preRemoveEClass, PreRemove.class, "PreRemove", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(preUpdateEClass, PreUpdate.class, "PreUpdate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKeyJoinColumnEClass, XmlPrimaryKeyJoinColumn.class, "XmlPrimaryKeyJoinColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKeyJoinColumn_ReferencedColumnName(), theXMLTypePackage.getString(), "referencedColumnName", null, 0, 1, XmlPrimaryKeyJoinColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryEClass, XmlQuery.class, "XmlQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQuery_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQuery_Query(), theXMLTypePackage.getString(), "query", null, 1, 1, XmlQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlQuery_Hints(), this.getXmlQueryHint(), null, "hints", null, 0, -1, XmlQuery.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_NamedQueries(), this.getXmlNamedQuery(), null, "namedQueries", null, 0, -1, XmlQueryContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlQueryContainer_NamedNativeQueries(), this.getXmlNamedNativeQuery(), null, "namedNativeQueries", 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(xmlQueryHintEClass, XmlQueryHint.class, "XmlQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQueryHint_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryHint_Value(), theXMLTypePackage.getString(), "value", null, 1, 1, XmlQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSecondaryTableEClass, XmlSecondaryTable.class, "XmlSecondaryTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlSecondaryTable_PrimaryKeyJoinColumns(), this.getXmlPrimaryKeyJoinColumn(), null, "primaryKeyJoinColumns", null, 0, -1, XmlSecondaryTable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSequenceGeneratorEClass, XmlSequenceGenerator.class, "XmlSequenceGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSequenceGenerator_SequenceName(), theXMLTypePackage.getString(), "sequenceName", null, 0, 1, XmlSequenceGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(sqlResultSetMappingEClass, SqlResultSetMapping.class, "SqlResultSetMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getSqlResultSetMapping_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSqlResultSetMapping_EntityResults(), this.getEntityResult(), null, "entityResults", null, 0, -1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getSqlResultSetMapping_ColumnResults(), this.getColumnResult(), null, "columnResults", null, 0, -1, SqlResultSetMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- 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);
- initEAttribute(getXmlTableGenerator_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_PkColumnName(), theXMLTypePackage.getString(), "pkColumnName", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_ValueColumnName(), theXMLTypePackage.getString(), "valueColumnName", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTableGenerator_PkColumnValue(), theXMLTypePackage.getString(), "pkColumnValue", null, 0, 1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlTableGenerator_UniqueConstraints(), this.getXmlUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, XmlTableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTypeMappingEClass, XmlTypeMapping.class, "XmlTypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTypeMapping_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTypeMapping_MetadataComplete(), theXMLTypePackage.getBooleanObject(), "metadataComplete", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTypeMapping_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlTypeMapping_Attributes(), this.getAttributes(), null, "attributes", null, 0, 1, XmlTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlUniqueConstraintEClass, XmlUniqueConstraint.class, "XmlUniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlUniqueConstraint_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 1, -1, XmlUniqueConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(accessTypeEEnum, AccessType.class, "AccessType");
- addEEnumLiteral(accessTypeEEnum, AccessType.PROPERTY);
- addEEnumLiteral(accessTypeEEnum, AccessType.FIELD);
-
- initEEnum(discriminatorTypeEEnum, DiscriminatorType.class, "DiscriminatorType");
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.STRING);
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.CHAR);
- addEEnumLiteral(discriminatorTypeEEnum, DiscriminatorType.INTEGER);
-
- initEEnum(enumTypeEEnum, EnumType.class, "EnumType");
- addEEnumLiteral(enumTypeEEnum, EnumType.ORDINAL);
- addEEnumLiteral(enumTypeEEnum, EnumType.STRING);
-
- initEEnum(fetchTypeEEnum, FetchType.class, "FetchType");
- addEEnumLiteral(fetchTypeEEnum, FetchType.LAZY);
- addEEnumLiteral(fetchTypeEEnum, FetchType.EAGER);
-
- initEEnum(generationTypeEEnum, GenerationType.class, "GenerationType");
- addEEnumLiteral(generationTypeEEnum, GenerationType.TABLE);
- addEEnumLiteral(generationTypeEEnum, GenerationType.SEQUENCE);
- addEEnumLiteral(generationTypeEEnum, GenerationType.IDENTITY);
- addEEnumLiteral(generationTypeEEnum, GenerationType.AUTO);
-
- initEEnum(inheritanceTypeEEnum, InheritanceType.class, "InheritanceType");
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.SINGLE_TABLE);
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.JOINED);
- addEEnumLiteral(inheritanceTypeEEnum, InheritanceType.TABLE_PER_CLASS);
-
- initEEnum(temporalTypeEEnum, TemporalType.class, "TemporalType");
- addEEnumLiteral(temporalTypeEEnum, TemporalType.DATE);
- addEEnumLiteral(temporalTypeEEnum, TemporalType.TIME);
- addEEnumLiteral(temporalTypeEEnum, TemporalType.TIMESTAMP);
-
- // 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.core.resource.orm.AbstractXmlAttributeMapping <em>Abstract Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlAttributeMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_ATTRIBUTE_MAPPING = eINSTANCE.getAbstractXmlAttributeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlColumn <em>Abstract Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlColumn()
- * @generated
- */
- public static final EClass ABSTRACT_XML_COLUMN = eINSTANCE.getAbstractXmlColumn();
-
- /**
- * The meta object literal for the '<em><b>Insertable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_COLUMN__INSERTABLE = eINSTANCE.getAbstractXmlColumn_Insertable();
-
- /**
- * The meta object literal for the '<em><b>Nullable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_COLUMN__NULLABLE = eINSTANCE.getAbstractXmlColumn_Nullable();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_COLUMN__TABLE = eINSTANCE.getAbstractXmlColumn_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 ABSTRACT_XML_COLUMN__UNIQUE = eINSTANCE.getAbstractXmlColumn_Unique();
-
- /**
- * The meta object literal for the '<em><b>Updatable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_COLUMN__UPDATABLE = eINSTANCE.getAbstractXmlColumn_Updatable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlEmbedded()
- * @generated
- */
- public static final EClass ABSTRACT_XML_EMBEDDED = eINSTANCE.getAbstractXmlEmbedded();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping <em>Abstract Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlMultiRelationshipMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING = eINSTANCE.getAbstractXmlMultiRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Map Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING__MAP_KEY = eINSTANCE.getAbstractXmlMultiRelationshipMapping_MapKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn <em>Abstract Xml Named Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlNamedColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn()
- * @generated
- */
- public static final EClass ABSTRACT_XML_NAMED_COLUMN = eINSTANCE.getAbstractXmlNamedColumn();
-
- /**
- * The meta object literal for the '<em><b>Column Definition</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION = eINSTANCE.getAbstractXmlNamedColumn_ColumnDefinition();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_NAMED_COLUMN__NAME = eINSTANCE.getAbstractXmlNamedColumn_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping <em>Abstract Xml Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_RELATIONSHIP_MAPPING = eINSTANCE.getAbstractXmlRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Target Entity</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_RELATIONSHIP_MAPPING__TARGET_ENTITY = eINSTANCE.getAbstractXmlRelationshipMapping_TargetEntity();
-
- /**
- * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getAbstractXmlRelationshipMapping_Fetch();
-
- /**
- * The meta object literal for the '<em><b>Cascade</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ABSTRACT_XML_RELATIONSHIP_MAPPING__CASCADE = eINSTANCE.getAbstractXmlRelationshipMapping_Cascade();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping <em>Abstract Xml Single Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlSingleRelationshipMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlSingleRelationshipMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING = eINSTANCE.getAbstractXmlSingleRelationshipMapping();
-
- /**
- * The meta object literal for the '<em><b>Optional</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING__OPTIONAL = eINSTANCE.getAbstractXmlSingleRelationshipMapping_Optional();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTable <em>Abstract Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTable()
- * @generated
- */
- public static final EClass ABSTRACT_XML_TABLE = eINSTANCE.getAbstractXmlTable();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TABLE__NAME = eINSTANCE.getAbstractXmlTable_Name();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TABLE__CATALOG = eINSTANCE.getAbstractXmlTable_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ABSTRACT_XML_TABLE__SCHEMA = eINSTANCE.getAbstractXmlTable_Schema();
-
- /**
- * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS = eINSTANCE.getAbstractXmlTable_UniqueConstraints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping()
- * @generated
- */
- public static final EClass ABSTRACT_XML_TYPE_MAPPING = eINSTANCE.getAbstractXmlTypeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder <em>Xml Access Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAccessHolder
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder()
- * @generated
- */
- public static final EClass XML_ACCESS_HOLDER = eINSTANCE.getXmlAccessHolder();
-
- /**
- * The meta object literal for the '<em><b>Access</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ACCESS_HOLDER__ACCESS = eINSTANCE.getXmlAccessHolder_Access();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping();
-
- /**
- * 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_ATTRIBUTE_MAPPING__NAME = eINSTANCE.getXmlAttributeMapping_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @generated
- */
- public static final EClass XML_ASSOCIATION_OVERRIDE = eINSTANCE.getXmlAssociationOverride();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer <em>Xml Association Override Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer()
- * @generated
- */
- public static final EClass XML_ASSOCIATION_OVERRIDE_CONTAINER = eINSTANCE.getXmlAssociationOverrideContainer();
-
- /**
- * The meta object literal for the '<em><b>Association Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES = eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE = eINSTANCE.getXmlAttributeOverride();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTE_OVERRIDE__COLUMN = eINSTANCE.getXmlAttributeOverride_Column();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer <em>Xml Attribute Override Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE_CONTAINER = eINSTANCE.getXmlAttributeOverrideContainer();
-
- /**
- * The meta object literal for the '<em><b>Attribute Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Attributes
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAttributes()
- * @generated
- */
- public static final EClass ATTRIBUTES = eINSTANCE.getAttributes();
-
- /**
- * The meta object literal for the '<em><b>Ids</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__IDS = eINSTANCE.getAttributes_Ids();
-
- /**
- * The meta object literal for the '<em><b>Embedded Ids</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__EMBEDDED_IDS = eINSTANCE.getAttributes_EmbeddedIds();
-
- /**
- * The meta object literal for the '<em><b>Basics</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASICS = eINSTANCE.getAttributes_Basics();
-
- /**
- * The meta object literal for the '<em><b>Versions</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__VERSIONS = eINSTANCE.getAttributes_Versions();
-
- /**
- * The meta object literal for the '<em><b>Many To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__MANY_TO_ONES = eINSTANCE.getAttributes_ManyToOnes();
-
- /**
- * The meta object literal for the '<em><b>One To Manys</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__ONE_TO_MANYS = eINSTANCE.getAttributes_OneToManys();
-
- /**
- * The meta object literal for the '<em><b>One To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__ONE_TO_ONES = eINSTANCE.getAttributes_OneToOnes();
-
- /**
- * The meta object literal for the '<em><b>Many To Manys</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__MANY_TO_MANYS = eINSTANCE.getAttributes_ManyToManys();
-
- /**
- * The meta object literal for the '<em><b>Embeddeds</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__EMBEDDEDS = eINSTANCE.getAttributes_Embeddeds();
-
- /**
- * The meta object literal for the '<em><b>Transients</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__TRANSIENTS = eINSTANCE.getAttributes_Transients();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @generated
- */
- public static final EClass XML_BASIC = eINSTANCE.getXmlBasic();
-
- /**
- * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__FETCH = eINSTANCE.getXmlBasic_Fetch();
-
- /**
- * The meta object literal for the '<em><b>Optional</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC__OPTIONAL = eINSTANCE.getXmlBasic_Optional();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.CascadeType <em>Cascade Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.CascadeType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getCascadeType()
- * @generated
- */
- public static final EClass CASCADE_TYPE = eINSTANCE.getCascadeType();
-
- /**
- * The meta object literal for the '<em><b>Cascade All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_ALL = eINSTANCE.getCascadeType_CascadeAll();
-
- /**
- * The meta object literal for the '<em><b>Cascade Persist</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_PERSIST = eINSTANCE.getCascadeType_CascadePersist();
-
- /**
- * The meta object literal for the '<em><b>Cascade Merge</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_MERGE = eINSTANCE.getCascadeType_CascadeMerge();
-
- /**
- * The meta object literal for the '<em><b>Cascade Remove</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_REMOVE = eINSTANCE.getCascadeType_CascadeRemove();
-
- /**
- * The meta object literal for the '<em><b>Cascade Refresh</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute CASCADE_TYPE__CASCADE_REFRESH = eINSTANCE.getCascadeType_CascadeRefresh();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlClassReference <em>Xml Class Reference</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlClassReference
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlClassReference()
- * @generated
- */
- public static final EClass XML_CLASS_REFERENCE = eINSTANCE.getXmlClassReference();
-
- /**
- * 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_CLASS_REFERENCE__CLASS_NAME = eINSTANCE.getXmlClassReference_ClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE = eINSTANCE.getXmlCollectionTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn <em>Xml Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @generated
- */
- public static final EClass XML_COLUMN = eINSTANCE.getXmlColumn();
-
- /**
- * The meta object literal for the '<em><b>Length</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__LENGTH = eINSTANCE.getXmlColumn_Length();
-
- /**
- * The meta object literal for the '<em><b>Precision</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__PRECISION = eINSTANCE.getXmlColumn_Precision();
-
- /**
- * The meta object literal for the '<em><b>Scale</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLUMN__SCALE = eINSTANCE.getXmlColumn_Scale();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.ColumnMapping <em>Column Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping()
- * @generated
- */
- public static final EClass COLUMN_MAPPING = eINSTANCE.getColumnMapping();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference COLUMN_MAPPING__COLUMN = eINSTANCE.getColumnMapping_Column();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.ColumnResult <em>Column Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.ColumnResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnResult()
- * @generated
- */
- public static final EClass COLUMN_RESULT = eINSTANCE.getColumnResult();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute COLUMN_RESULT__NAME = eINSTANCE.getColumnResult_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final EClass XML_CONVERTIBLE_MAPPING = eINSTANCE.getXmlConvertibleMapping();
-
- /**
- * The meta object literal for the '<em><b>Lob</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTIBLE_MAPPING__LOB = eINSTANCE.getXmlConvertibleMapping_Lob();
-
- /**
- * The meta object literal for the '<em><b>Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTIBLE_MAPPING__TEMPORAL = eINSTANCE.getXmlConvertibleMapping_Temporal();
-
- /**
- * The meta object literal for the '<em><b>Enumerated</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTIBLE_MAPPING__ENUMERATED = eINSTANCE.getXmlConvertibleMapping_Enumerated();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn <em>Xml Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @generated
- */
- public static final EClass XML_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlDiscriminatorColumn();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorType();
-
- /**
- * The meta object literal for the '<em><b>Length</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_DISCRIMINATOR_COLUMN__LENGTH = eINSTANCE.getXmlDiscriminatorColumn_Length();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION = eINSTANCE.getXmlElementCollection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE = eINSTANCE.getXmlEmbeddable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final EClass XML_EMBEDDED = eINSTANCE.getXmlEmbedded();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID = eINSTANCE.getXmlEmbeddedId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @generated
- */
- public static final EClass XML_ENTITY = eINSTANCE.getXmlEntity();
-
- /**
- * 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_ENTITY__NAME = eINSTANCE.getXmlEntity_Name();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__TABLE = eINSTANCE.getXmlEntity_Table();
-
- /**
- * The meta object literal for the '<em><b>Secondary Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__SECONDARY_TABLES = eINSTANCE.getXmlEntity_SecondaryTables();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlEntity_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '<em><b>Inheritance</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__INHERITANCE = eINSTANCE.getXmlEntity_Inheritance();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__DISCRIMINATOR_VALUE = eINSTANCE.getXmlEntity_DiscriminatorValue();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__DISCRIMINATOR_COLUMN = eINSTANCE.getXmlEntity_DiscriminatorColumn();
-
- /**
- * 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_ENTITY__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlEntity_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlEntity_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlEntity_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ENTITY_LISTENERS = eINSTANCE.getXmlEntity_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityListener <em>Entity Listener</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListener
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListener()
- * @generated
- */
- public static final EClass ENTITY_LISTENER = eINSTANCE.getEntityListener();
-
- /**
- * 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 ENTITY_LISTENER__CLASS_NAME = eINSTANCE.getEntityListener_ClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityListeners <em>Entity Listeners</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityListeners
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityListeners()
- * @generated
- */
- public static final EClass ENTITY_LISTENERS = eINSTANCE.getEntityListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_LISTENERS__ENTITY_LISTENERS = eINSTANCE.getEntityListeners_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS = eINSTANCE.getXmlEntityMappings();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__DESCRIPTION = eINSTANCE.getXmlEntityMappings_Description();
-
- /**
- * The meta object literal for the '<em><b>Persistence Unit Metadata</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlEntityMappings_PersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Package</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_MAPPINGS__PACKAGE = eINSTANCE.getXmlEntityMappings_Package();
-
- /**
- * 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_ENTITY_MAPPINGS__SCHEMA = eINSTANCE.getXmlEntityMappings_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_ENTITY_MAPPINGS__CATALOG = eINSTANCE.getXmlEntityMappings_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Sequence Generators</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS = eINSTANCE.getXmlEntityMappings_SequenceGenerators();
-
- /**
- * The meta object literal for the '<em><b>Table Generators</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__TABLE_GENERATORS = eINSTANCE.getXmlEntityMappings_TableGenerators();
-
- /**
- * 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_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlEntityMappings_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Mapped Superclasses</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES = eINSTANCE.getXmlEntityMappings_MappedSuperclasses();
-
- /**
- * The meta object literal for the '<em><b>Entities</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__ENTITIES = eINSTANCE.getXmlEntityMappings_Entities();
-
- /**
- * The meta object literal for the '<em><b>Embeddables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS__EMBEDDABLES = eINSTANCE.getXmlEntityMappings_Embeddables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EntityResult <em>Entity Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EntityResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEntityResult()
- * @generated
- */
- public static final EClass ENTITY_RESULT = eINSTANCE.getEntityResult();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Column</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ENTITY_RESULT__DISCRIMINATOR_COLUMN = eINSTANCE.getEntityResult_DiscriminatorColumn();
-
- /**
- * The meta object literal for the '<em><b>Entity Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute ENTITY_RESULT__ENTITY_CLASS = eINSTANCE.getEntityResult_EntityClass();
-
- /**
- * The meta object literal for the '<em><b>Field Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ENTITY_RESULT__FIELD_RESULTS = eINSTANCE.getEntityResult_FieldResults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EventMethod <em>Event Method</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EventMethod
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEventMethod()
- * @generated
- */
- public static final EClass EVENT_METHOD = eINSTANCE.getEventMethod();
-
- /**
- * The meta object literal for the '<em><b>Method Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute EVENT_METHOD__METHOD_NAME = eINSTANCE.getEventMethod_MethodName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer <em>Xml Event Method Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer()
- * @generated
- */
- public static final EClass XML_EVENT_METHOD_CONTAINER = eINSTANCE.getXmlEventMethodContainer();
-
- /**
- * The meta object literal for the '<em><b>Pre Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__PRE_PERSIST = eINSTANCE.getXmlEventMethodContainer_PrePersist();
-
- /**
- * The meta object literal for the '<em><b>Post Persist</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__POST_PERSIST = eINSTANCE.getXmlEventMethodContainer_PostPersist();
-
- /**
- * The meta object literal for the '<em><b>Pre Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__PRE_REMOVE = eINSTANCE.getXmlEventMethodContainer_PreRemove();
-
- /**
- * The meta object literal for the '<em><b>Post Remove</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__POST_REMOVE = eINSTANCE.getXmlEventMethodContainer_PostRemove();
-
- /**
- * The meta object literal for the '<em><b>Pre Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__PRE_UPDATE = eINSTANCE.getXmlEventMethodContainer_PreUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Update</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__POST_UPDATE = eINSTANCE.getXmlEventMethodContainer_PostUpdate();
-
- /**
- * The meta object literal for the '<em><b>Post Load</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EVENT_METHOD_CONTAINER__POST_LOAD = eINSTANCE.getXmlEventMethodContainer_PostLoad();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.FieldResult <em>Field Result</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FieldResult
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFieldResult()
- * @generated
- */
- public static final EClass FIELD_RESULT = eINSTANCE.getFieldResult();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute FIELD_RESULT__NAME = eINSTANCE.getFieldResult_Name();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute FIELD_RESULT__COLUMN = eINSTANCE.getFieldResult_Column();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratedValue
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @generated
- */
- public static final EClass XML_GENERATED_VALUE = eINSTANCE.getXmlGeneratedValue();
-
- /**
- * The meta object literal for the '<em><b>Generator</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATED_VALUE__GENERATOR = eINSTANCE.getXmlGeneratedValue_Generator();
-
- /**
- * The meta object literal for the '<em><b>Strategy</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATED_VALUE__STRATEGY = eINSTANCE.getXmlGeneratedValue_Strategy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator <em>Xml Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @generated
- */
- public static final EClass XML_GENERATOR = eINSTANCE.getXmlGenerator();
-
- /**
- * 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_GENERATOR__NAME = eINSTANCE.getXmlGenerator_Name();
-
- /**
- * The meta object literal for the '<em><b>Initial Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR__INITIAL_VALUE = eINSTANCE.getXmlGenerator_InitialValue();
-
- /**
- * The meta object literal for the '<em><b>Allocation Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR__ALLOCATION_SIZE = eINSTANCE.getXmlGenerator_AllocationSize();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer <em>Xml Generator Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratorContainer()
- * @generated
- */
- public static final EClass XML_GENERATOR_CONTAINER = eINSTANCE.getXmlGeneratorContainer();
-
- /**
- * The meta object literal for the '<em><b>Sequence Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR = eINSTANCE.getXmlGeneratorContainer_SequenceGenerator();
-
- /**
- * The meta object literal for the '<em><b>Table Generator</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_GENERATOR_CONTAINER__TABLE_GENERATOR = eINSTANCE.getXmlGeneratorContainer_TableGenerator();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlId
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @generated
- */
- public static final EClass XML_ID = eINSTANCE.getXmlId();
-
- /**
- * 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_ID__GENERATED_VALUE = eINSTANCE.getXmlId_GeneratedValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer <em>Xml Id Class Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlIdClassContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer()
- * @generated
- */
- public static final EClass XML_ID_CLASS_CONTAINER = eINSTANCE.getXmlIdClassContainer();
-
- /**
- * The meta object literal for the '<em><b>Id Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID_CLASS_CONTAINER__ID_CLASS = eINSTANCE.getXmlIdClassContainer_IdClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Inheritance <em>Inheritance</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Inheritance
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritance()
- * @generated
- */
- public static final EClass INHERITANCE = eINSTANCE.getInheritance();
-
- /**
- * The meta object literal for the '<em><b>Strategy</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute INHERITANCE__STRATEGY = eINSTANCE.getInheritance_Strategy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @generated
- */
- public static final EClass XML_JOIN_COLUMN = eINSTANCE.getXmlJoinColumn();
-
- /**
- * The meta object literal for the '<em><b>Referenced Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME = eINSTANCE.getXmlJoinColumn_ReferencedColumnName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping <em>Xml Join Columns Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping()
- * @generated
- */
- public static final EClass XML_JOIN_COLUMNS_MAPPING = eINSTANCE.getXmlJoinColumnsMapping();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS = eINSTANCE.getXmlJoinColumnsMapping_JoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE = eINSTANCE.getXmlJoinTable();
-
- /**
- * The meta object literal for the '<em><b>Inverse Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = eINSTANCE.getXmlJoinTable_InverseJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping <em>Xml Join Table Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE_MAPPING = eINSTANCE.getXmlJoinTableMapping();
-
- /**
- * The meta object literal for the '<em><b>Join Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_JOIN_TABLE_MAPPING__JOIN_TABLE = eINSTANCE.getXmlJoinTableMapping_JoinTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.Lob <em>Lob</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.Lob
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getLob()
- * @generated
- */
- public static final EClass LOB = eINSTANCE.getLob();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE = eINSTANCE.getXmlManyToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.MapKey <em>Map Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.MapKey
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getMapKey()
- * @generated
- */
- public static final EClass MAP_KEY = eINSTANCE.getMapKey();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute MAP_KEY__NAME = eINSTANCE.getMapKey_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping <em>Xml Mapped By Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedByMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping()
- * @generated
- */
- public static final EClass XML_MAPPED_BY_MAPPING = eINSTANCE.getXmlMappedByMapping();
-
- /**
- * The meta object literal for the '<em><b>Mapped By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_BY_MAPPING__MAPPED_BY = eINSTANCE.getXmlMappedByMapping_MappedBy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = eINSTANCE.getXmlMappedSuperclass_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @generated
- */
- public static final EClass XML_NAMED_NATIVE_QUERY = eINSTANCE.getXmlNamedNativeQuery();
-
- /**
- * 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_NATIVE_QUERY__RESULT_CLASS = eINSTANCE.getXmlNamedNativeQuery_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_NATIVE_QUERY__RESULT_SET_MAPPING = eINSTANCE.getXmlNamedNativeQuery_ResultSetMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNamedQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @generated
- */
- public static final EClass XML_NAMED_QUERY = eINSTANCE.getXmlNamedQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping <em>Xml Null Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNullAttributeMapping()
- * @generated
- */
- public static final EClass XML_NULL_ATTRIBUTE_MAPPING = eINSTANCE.getXmlNullAttributeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY = eINSTANCE.getXmlOneToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE = eINSTANCE.getXmlOneToOne();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlOneToOne_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final EClass XML_ORDER_COLUMN = eINSTANCE.getXmlOrderColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOverride <em>Xml Override</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOverride
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOverride()
- * @generated
- */
- public static final EClass XML_OVERRIDE = eINSTANCE.getXmlOverride();
-
- /**
- * 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_OVERRIDE__NAME = eINSTANCE.getXmlOverride_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitDefaults();
-
- /**
- * 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_PERSISTENCE_UNIT_DEFAULTS__SCHEMA = eINSTANCE.getXmlPersistenceUnitDefaults_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_PERSISTENCE_UNIT_DEFAULTS__CATALOG = eINSTANCE.getXmlPersistenceUnitDefaults_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Cascade Persist</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = eINSTANCE.getXmlPersistenceUnitDefaults_CascadePersist();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS = eINSTANCE.getXmlPersistenceUnitDefaults_EntityListeners();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlPersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = eINSTANCE.getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete();
-
- /**
- * The meta object literal for the '<em><b>Persistence Unit Defaults</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable <em>Abstract Xml Reference Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AbstractXmlReferenceTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAbstractXmlReferenceTable()
- * @generated
- */
- public static final EClass ABSTRACT_XML_REFERENCE_TABLE = eINSTANCE.getAbstractXmlReferenceTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlReferenceTable <em>Xml Reference Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlReferenceTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlReferenceTable()
- * @generated
- */
- public static final EClass XML_REFERENCE_TABLE = eINSTANCE.getXmlReferenceTable();
-
- /**
- * The meta object literal for the '<em><b>Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_REFERENCE_TABLE__JOIN_COLUMNS = eINSTANCE.getXmlReferenceTable_JoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostLoad <em>Post Load</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostLoad
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostLoad()
- * @generated
- */
- public static final EClass POST_LOAD = eINSTANCE.getPostLoad();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostPersist <em>Post Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostPersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostPersist()
- * @generated
- */
- public static final EClass POST_PERSIST = eINSTANCE.getPostPersist();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostRemove <em>Post Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostRemove()
- * @generated
- */
- public static final EClass POST_REMOVE = eINSTANCE.getPostRemove();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PostUpdate <em>Post Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PostUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPostUpdate()
- * @generated
- */
- public static final EClass POST_UPDATE = eINSTANCE.getPostUpdate();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PrePersist <em>Pre Persist</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PrePersist
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPrePersist()
- * @generated
- */
- public static final EClass PRE_PERSIST = eINSTANCE.getPrePersist();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PreRemove <em>Pre Remove</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreRemove
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreRemove()
- * @generated
- */
- public static final EClass PRE_REMOVE = eINSTANCE.getPreRemove();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.PreUpdate <em>Pre Update</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.PreUpdate
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getPreUpdate()
- * @generated
- */
- public static final EClass PRE_UPDATE = eINSTANCE.getPreUpdate();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_JOIN_COLUMN = eINSTANCE.getXmlPrimaryKeyJoinColumn();
-
- /**
- * The meta object literal for the '<em><b>Referenced Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = eINSTANCE.getXmlPrimaryKeyJoinColumn_ReferencedColumnName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery <em>Xml Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQuery
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @generated
- */
- public static final EClass XML_QUERY = eINSTANCE.getXmlQuery();
-
- /**
- * 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_QUERY__NAME = eINSTANCE.getXmlQuery_Name();
-
- /**
- * The meta object literal for the '<em><b>Query</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY__QUERY = eINSTANCE.getXmlQuery_Query();
-
- /**
- * 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_QUERY__HINTS = eINSTANCE.getXmlQuery_Hints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final EClass XML_QUERY_CONTAINER = eINSTANCE.getXmlQueryContainer();
-
- /**
- * The meta object literal for the '<em><b>Named Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_QUERY_CONTAINER__NAMED_QUERIES = eINSTANCE.getXmlQueryContainer_NamedQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Native Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES = eINSTANCE.getXmlQueryContainer_NamedNativeQueries();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlQueryHint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @generated
- */
- public static final EClass XML_QUERY_HINT = eINSTANCE.getXmlQueryHint();
-
- /**
- * 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_QUERY_HINT__NAME = eINSTANCE.getXmlQueryHint_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_QUERY_HINT__VALUE = eINSTANCE.getXmlQueryHint_Value();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE = eINSTANCE.getXmlSecondaryTable();
-
- /**
- * The meta object literal for the '<em><b>Primary Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = eINSTANCE.getXmlSecondaryTable_PrimaryKeyJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @generated
- */
- public static final EClass XML_SEQUENCE_GENERATOR = eINSTANCE.getXmlSequenceGenerator();
-
- /**
- * The meta object literal for the '<em><b>Sequence Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SEQUENCE_GENERATOR__SEQUENCE_NAME = eINSTANCE.getXmlSequenceGenerator_SequenceName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.SqlResultSetMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @generated
- */
- public static final EClass SQL_RESULT_SET_MAPPING = eINSTANCE.getSqlResultSetMapping();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute SQL_RESULT_SET_MAPPING__NAME = eINSTANCE.getSqlResultSetMapping_Name();
-
- /**
- * The meta object literal for the '<em><b>Entity Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference SQL_RESULT_SET_MAPPING__ENTITY_RESULTS = eINSTANCE.getSqlResultSetMapping_EntityResults();
-
- /**
- * The meta object literal for the '<em><b>Column Results</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference SQL_RESULT_SET_MAPPING__COLUMN_RESULTS = eINSTANCE.getSqlResultSetMapping_ColumnResults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTable()
- * @generated
- */
- public static final EClass XML_TABLE = eINSTANCE.getXmlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator();
-
- /**
- * 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_TABLE_GENERATOR__TABLE = eINSTANCE.getXmlTableGenerator_Table();
-
- /**
- * 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_TABLE_GENERATOR__CATALOG = eINSTANCE.getXmlTableGenerator_Catalog();
-
- /**
- * 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_TABLE_GENERATOR__SCHEMA = eINSTANCE.getXmlTableGenerator_Schema();
-
- /**
- * The meta object literal for the '<em><b>Pk Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__PK_COLUMN_NAME = eINSTANCE.getXmlTableGenerator_PkColumnName();
-
- /**
- * The meta object literal for the '<em><b>Value Column Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = eINSTANCE.getXmlTableGenerator_ValueColumnName();
-
- /**
- * The meta object literal for the '<em><b>Pk Column Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR__PK_COLUMN_VALUE = eINSTANCE.getXmlTableGenerator_PkColumnValue();
-
- /**
- * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = eINSTANCE.getXmlTableGenerator_UniqueConstraints();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTransient()
- * @generated
- */
- public static final EClass XML_TRANSIENT = eINSTANCE.getXmlTransient();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlTypeMapping
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping()
- * @generated
- */
- public static final EClass XML_TYPE_MAPPING = eINSTANCE.getXmlTypeMapping();
-
- /**
- * 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_TYPE_MAPPING__CLASS_NAME = eINSTANCE.getXmlTypeMapping_ClassName();
-
- /**
- * The meta object literal for the '<em><b>Metadata Complete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_MAPPING__METADATA_COMPLETE = eINSTANCE.getXmlTypeMapping_MetadataComplete();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_MAPPING__DESCRIPTION = eINSTANCE.getXmlTypeMapping_Description();
-
- /**
- * The meta object literal for the '<em><b>Attributes</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_TYPE_MAPPING__ATTRIBUTES = eINSTANCE.getXmlTypeMapping_Attributes();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraint()
- * @generated
- */
- public static final EClass XML_UNIQUE_CONSTRAINT = eINSTANCE.getXmlUniqueConstraint();
-
- /**
- * 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_UNIQUE_CONSTRAINT__COLUMN_NAMES = eINSTANCE.getXmlUniqueConstraint_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @generated
- */
- public static final EClass XML_VERSION = eINSTANCE.getXmlVersion();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.XmlOrderable
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable()
- * @generated
- */
- public static final EClass XML_ORDERABLE = eINSTANCE.getXmlOrderable();
-
- /**
- * The meta object literal for the '<em><b>Order By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDERABLE__ORDER_BY = eINSTANCE.getXmlOrderable_OrderBy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.AccessType <em>Access Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getAccessType()
- * @generated
- */
- public static final EEnum ACCESS_TYPE = eINSTANCE.getAccessType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getDiscriminatorType()
- * @generated
- */
- public static final EEnum DISCRIMINATOR_TYPE = eINSTANCE.getDiscriminatorType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.EnumType <em>Enum Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getEnumType()
- * @generated
- */
- public static final EEnum ENUM_TYPE = eINSTANCE.getEnumType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.FetchType <em>Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getFetchType()
- * @generated
- */
- public static final EEnum FETCH_TYPE = eINSTANCE.getFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.GenerationType <em>Generation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getGenerationType()
- * @generated
- */
- public static final EEnum GENERATION_TYPE = eINSTANCE.getGenerationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.InheritanceType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getInheritanceType()
- * @generated
- */
- public static final EEnum INHERITANCE_TYPE = eINSTANCE.getInheritanceType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @generated
- */
- public static final EEnum TEMPORAL_TYPE = eINSTANCE.getTemporalType();
-
- }
-
-} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmXmlResourceFactory.java
deleted file mode 100644
index 60986dc7e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/OrmXmlResourceFactory.java
+++ /dev/null
@@ -1,47 +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.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-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.
- */
-public class OrmXmlResourceFactory
- extends TranslatorResourceFactory
-{
- public OrmXmlResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public OrmXmlResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public OrmXmlResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new JpaXmlResource(uri, renderer, JptCorePlugin.ORM_XML_CONTENT_TYPE, XmlEntityMappings.getRootTranslator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java
deleted file mode 100644
index 5e68add1bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostLoad.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Post Load</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.core.resource.orm.OrmPackage#getPostLoad()
- * @model kind="class"
- * @generated
- */
-public class PostLoad extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostLoad()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_LOAD;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.POST_LOAD,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PostLoad());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java
deleted file mode 100644
index fe88de4709..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostPersist.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Post Persist</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.core.resource.orm.OrmPackage#getPostPersist()
- * @model kind="class"
- * @generated
- */
-public class PostPersist extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostPersist()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_PERSIST;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.POST_PERSIST,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PostPersist());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java
deleted file mode 100644
index 09d39749bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostRemove.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Post Remove</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.core.resource.orm.OrmPackage#getPostRemove()
- * @model kind="class"
- * @generated
- */
-public class PostRemove extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostRemove()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_REMOVE;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.POST_REMOVE,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PostRemove());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java
deleted file mode 100644
index 3474b25af1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PostUpdate.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Post Update</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.core.resource.orm.OrmPackage#getPostUpdate()
- * @model kind="class"
- * @generated
- */
-public class PostUpdate extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PostUpdate()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.POST_UPDATE;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.POST_UPDATE,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PostUpdate());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java
deleted file mode 100644
index 9d7362dd4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PrePersist.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Pre Persist</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.core.resource.orm.OrmPackage#getPrePersist()
- * @model kind="class"
- * @generated
- */
-public class PrePersist extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PrePersist()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_PERSIST;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.PRE_PERSIST,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PrePersist());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java
deleted file mode 100644
index 68dd63f7f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreRemove.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Pre Remove</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.core.resource.orm.OrmPackage#getPreRemove()
- * @model kind="class"
- * @generated
- */
-public class PreRemove extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PreRemove()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_REMOVE;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.PRE_REMOVE,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PreRemove());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java
deleted file mode 100644
index e0b42fbb42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/PreUpdate.java
+++ /dev/null
@@ -1,68 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>Pre Update</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.core.resource.orm.OrmPackage#getPreUpdate()
- * @model kind="class"
- * @generated
- */
-public class PreUpdate extends EventMethod
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected PreUpdate()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.PRE_UPDATE;
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- JPA.PRE_UPDATE,
- OrmPackage.eINSTANCE.getXmlEventMethodContainer_PreUpdate());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java
deleted file mode 100644
index 17ae570d42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/SqlResultSetMapping.java
+++ /dev/null
@@ -1,418 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Sql Result Set 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getEntityResults <em>Entity Results</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getColumnResults <em>Column Results</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping()
- * @model kind="class"
- * @generated
- */
-public class SqlResultSetMapping extends AbstractJpaEObject implements XmlSqlResultSetMapping_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 cached value of the '{@link #getEntityResults() <em>Entity Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityResults()
- * @generated
- * @ordered
- */
- protected EList<EntityResult> entityResults;
-
- /**
- * The cached value of the '{@link #getColumnResults() <em>Column Results</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnResults()
- * @generated
- * @ordered
- */
- protected EList<ColumnResult> columnResults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected SqlResultSetMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.SQL_RESULT_SET_MAPPING;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSqlResultSetMapping_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SQL_RESULT_SET_MAPPING__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getSqlResultSetMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping#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, OrmPackage.SQL_RESULT_SET_MAPPING__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.EntityResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Results</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>Entity Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping_EntityResults()
- * @model containment="true"
- * @generated
- */
- public EList<EntityResult> getEntityResults()
- {
- if (entityResults == null)
- {
- entityResults = new EObjectContainmentEList<EntityResult>(EntityResult.class, this, OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS);
- }
- return entityResults;
- }
-
- /**
- * Returns the value of the '<em><b>Column Results</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.ColumnResult}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Results</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>Column Results</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getSqlResultSetMapping_ColumnResults()
- * @model containment="true"
- * @generated
- */
- public EList<ColumnResult> getColumnResults()
- {
- if (columnResults == null)
- {
- columnResults = new EObjectContainmentEList<ColumnResult>(ColumnResult.class, this, OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS);
- }
- return columnResults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return ((InternalEList<?>)getEntityResults()).basicRemove(otherEnd, msgs);
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return ((InternalEList<?>)getColumnResults()).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 OrmPackage.SQL_RESULT_SET_MAPPING__DESCRIPTION:
- return getDescription();
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- return getName();
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return getEntityResults();
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return getColumnResults();
- }
- 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 OrmPackage.SQL_RESULT_SET_MAPPING__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- getEntityResults().clear();
- getEntityResults().addAll((Collection<? extends EntityResult>)newValue);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- getColumnResults().clear();
- getColumnResults().addAll((Collection<? extends ColumnResult>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- getEntityResults().clear();
- return;
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- getColumnResults().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.SQL_RESULT_SET_MAPPING__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.SQL_RESULT_SET_MAPPING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.SQL_RESULT_SET_MAPPING__ENTITY_RESULTS:
- return entityResults != null && !entityResults.isEmpty();
- case OrmPackage.SQL_RESULT_SET_MAPPING__COLUMN_RESULTS:
- return columnResults != null && !columnResults.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(" (description: ");
- result.append(description);
- 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(),
- buildDescriptionTranslator(),
- buildEntityResultTranslator(),
- buildColumnResultTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getSqlResultSetMapping_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlSqlResultSetMapping_2_0_Description());
- }
-
- protected static Translator buildEntityResultTranslator() {
- return EntityResult.buildTranslator(JPA.ENTITY_RESULT, OrmPackage.eINSTANCE.getSqlResultSetMapping_EntityResults());
- }
-
- protected static Translator buildColumnResultTranslator() {
- return ColumnResult.buildTranslator(JPA.COLUMN_RESULT, OrmPackage.eINSTANCE.getSqlResultSetMapping_ColumnResults());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java
deleted file mode 100644
index 7b9b8dd6d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/TemporalType.java
+++ /dev/null
@@ -1,262 +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.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>Temporal 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getTemporalType()
- * @model
- * @generated
- */
-public enum TemporalType implements Enumerator
-{
- /**
- * The '<em><b>DATE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DATE_VALUE
- * @generated
- * @ordered
- */
- DATE(0, "DATE", "DATE"),
-
- /**
- * The '<em><b>TIME</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TIME_VALUE
- * @generated
- * @ordered
- */
- TIME(1, "TIME", "TIME"),
-
- /**
- * The '<em><b>TIMESTAMP</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TIMESTAMP_VALUE
- * @generated
- * @ordered
- */
- TIMESTAMP(2, "TIMESTAMP", "TIMESTAMP");
-
- /**
- * The '<em><b>DATE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DATE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DATE
- * @model
- * @generated
- * @ordered
- */
- public static final int DATE_VALUE = 0;
-
- /**
- * The '<em><b>TIME</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIME</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TIME
- * @model
- * @generated
- * @ordered
- */
- public static final int TIME_VALUE = 1;
-
- /**
- * The '<em><b>TIMESTAMP</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TIMESTAMP</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TIMESTAMP
- * @model
- * @generated
- * @ordered
- */
- public static final int TIMESTAMP_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Temporal Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final TemporalType[] VALUES_ARRAY =
- new TemporalType[]
- {
- DATE,
- TIME,
- TIMESTAMP,
- };
-
- /**
- * A public read-only list of all the '<em><b>Temporal Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<TemporalType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- TemporalType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- TemporalType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Temporal Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static TemporalType get(int value)
- {
- switch (value)
- {
- case DATE_VALUE: return DATE;
- case TIME_VALUE: return TIME;
- case TIMESTAMP_VALUE: return TIMESTAMP;
- }
- 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 TemporalType(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;
- }
-
-} //TemporalType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAccessHolder.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAccessHolder.java
deleted file mode 100644
index b35703aa6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAccessHolder.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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Access 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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder#getAccess <em>Access</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAccessHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder_Access()
- * @model
- * @generated
- */
- AccessType getAccess();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAccessHolder#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- void setAccess(AccessType value);
-
-} // XmlAccessHolder
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
deleted file mode 100644
index c5a0332d93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
+++ /dev/null
@@ -1,501 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Association Override 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.core.resource.orm.OrmPackage#getXmlAssociationOverride()
- * @model kind="class"
- * @generated
- */
-public class XmlAssociationOverride extends AbstractJpaEObject implements XmlOverride, XmlJoinColumnsMapping, XmlAssociationOverride_2_0
-{
- /**
- * 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 cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getJoinTable() <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinTable()
- * @generated
- * @ordered
- */
- protected XmlJoinTable joinTable;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAssociationOverride()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ASSOCIATION_OVERRIDE;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</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>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverride_2_0_JoinTable()
- * @model containment="true"
- * @generated
- */
- public XmlJoinTable getJoinTable()
- {
- return joinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetJoinTable(XmlJoinTable newJoinTable, NotificationChain msgs)
- {
- XmlJoinTable oldJoinTable = joinTable;
- joinTable = newJoinTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE, oldJoinTable, newJoinTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- public void setJoinTable(XmlJoinTable newJoinTable)
- {
- if (newJoinTable != joinTable)
- {
- NotificationChain msgs = null;
- if (joinTable != null)
- msgs = ((InternalEObject)joinTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE, null, msgs);
- if (newJoinTable != null)
- msgs = ((InternalEObject)newJoinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE, null, msgs);
- msgs = basicSetJoinTable(newJoinTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE, newJoinTable, newJoinTable));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAssociationOverride#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, OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE:
- return basicSetJoinTable(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 OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- return getName();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE:
- return getJoinTable();
- }
- 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 OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE:
- setJoinTable((XmlJoinTable)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE:
- setJoinTable((XmlJoinTable)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE:
- return joinTable != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinColumnsMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS: return OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverride_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION: return OrmV2_0Package.XML_ASSOCIATION_OVERRIDE_20__DESCRIPTION;
- case OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE: return OrmV2_0Package.XML_ASSOCIATION_OVERRIDE_20__JOIN_TABLE;
- 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 == XmlJoinColumnsMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverride_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ASSOCIATION_OVERRIDE_20__DESCRIPTION: return OrmPackage.XML_ASSOCIATION_OVERRIDE__DESCRIPTION;
- case OrmV2_0Package.XML_ASSOCIATION_OVERRIDE_20__JOIN_TABLE: return OrmPackage.XML_ASSOCIATION_OVERRIDE__JOIN_TABLE;
- 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(" (name: ");
- result.append(name);
- result.append(", description: ");
- result.append(description);
- 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(),
- buildDescriptionTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlOverride_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlAssociationOverride_2_0_Description());
- }
-
- protected static Translator buildJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA.JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlJoinColumnsMapping_JoinColumns());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmV2_0Package.eINSTANCE.getXmlAssociationOverride_2_0_JoinTable());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideContainer.java
deleted file mode 100644
index b66f596d25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverrideContainer.java
+++ /dev/null
@@ -1,57 +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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Association Override Container</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.core.resource.orm.XmlAssociationOverrideContainer#getAssociationOverrides <em>Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAssociationOverrideContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAssociationOverride> getAssociationOverrides();
-
-} // XmlAssociationOverrideContainer
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java
deleted file mode 100644
index 2e8d3c1a38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeMapping.java
+++ /dev/null
@@ -1,70 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAttributeMapping extends XmlAttributeMapping_2_0
-{
- /**
- * 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.core.resource.orm.OrmPackage#getXmlAttributeMapping_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeMapping#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);
-
- TextRange getNameTextRange();
-
- //TODO unsure about this api, might change soon
- String getMappingKey();
-
-} // XmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
deleted file mode 100644
index 28593c09dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
+++ /dev/null
@@ -1,433 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute Override</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.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride()
- * @model kind="class"
- * @generated
- */
-public class XmlAttributeOverride extends AbstractJpaEObject implements XmlOverride, XmlAttributeOverride_2_0
-{
- /**
- * 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 #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAttributeOverride()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ATTRIBUTE_OVERRIDE;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverride_Column()
- * @model containment="true" required="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN, newColumn, newColumn));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride#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, OrmPackage.XML_ATTRIBUTE_OVERRIDE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN:
- return basicSetColumn(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 OrmPackage.XML_ATTRIBUTE_OVERRIDE__NAME:
- return getName();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN:
- return getColumn();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN:
- setColumn((XmlColumn)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__COLUMN:
- return column != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributeOverride_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION: return OrmV2_0Package.XML_ATTRIBUTE_OVERRIDE_20__DESCRIPTION;
- 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 == XmlAttributeOverride_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ATTRIBUTE_OVERRIDE_20__DESCRIPTION: return OrmPackage.XML_ATTRIBUTE_OVERRIDE__DESCRIPTION;
- 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(" (name: ");
- result.append(name);
- result.append(", description: ");
- result.append(description);
- 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(),
- buildDescriptionTranslator(),
- buildColumnTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlOverride_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlAttributeOverride_2_0_Description());
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmPackage.eINSTANCE.getXmlAttributeOverride_Column());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideContainer.java
deleted file mode 100644
index fe13a6fc31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverrideContainer.java
+++ /dev/null
@@ -1,57 +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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attribute Override Container</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.core.resource.orm.XmlAttributeOverrideContainer#getAttributeOverrides <em>Attribute Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeOverrideContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAttributeOverride> getAttributeOverrides();
-
-} // XmlAttributeOverrideContainer
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java
deleted file mode 100644
index 731e0b1aa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,687 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Basic 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic()
- * @model kind="class"
- * @generated
- */
-public class XmlBasic extends AbstractXmlAttributeMapping implements ColumnMapping, XmlConvertibleMapping
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_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 TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_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 EnumType ENUMERATED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_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 FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected static final Boolean OPTIONAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOptional() <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptional()
- * @generated
- * @ordered
- */
- protected Boolean optional = OPTIONAL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasic()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_BASIC;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_BASIC__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isLob()
- {
- return lob;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- public void setLob(boolean newLob)
- {
- boolean oldLob = lob;
- lob = newLob;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- public void setEnumerated(EnumType newEnumerated)
- {
- EnumType oldEnumerated = enumerated;
- enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The default value is <code>"LAZY"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>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>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Fetch()
- * @model default="LAZY"
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optional</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optional</em>' attribute.
- * @see #setOptional(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlBasic_Optional()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOptional()
- {
- return optional;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlBasic#getOptional <em>Optional</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optional</em>' attribute.
- * @see #getOptional()
- * @generated
- */
- public void setOptional(Boolean newOptional)
- {
- Boolean oldOptional = optional;
- optional = newOptional;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_BASIC__OPTIONAL, oldOptional, optional));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC__COLUMN:
- return basicSetColumn(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 OrmPackage.XML_BASIC__COLUMN:
- return getColumn();
- case OrmPackage.XML_BASIC__LOB:
- return isLob();
- case OrmPackage.XML_BASIC__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_BASIC__ENUMERATED:
- return getEnumerated();
- case OrmPackage.XML_BASIC__FETCH:
- return getFetch();
- case OrmPackage.XML_BASIC__OPTIONAL:
- return getOptional();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_BASIC__LOB:
- setLob((Boolean)newValue);
- return;
- case OrmPackage.XML_BASIC__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_BASIC__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_BASIC__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_BASIC__OPTIONAL:
- setOptional((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_BASIC__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_BASIC__OPTIONAL:
- setOptional(OPTIONAL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_BASIC__COLUMN:
- return column != null;
- case OrmPackage.XML_BASIC__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_BASIC__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_BASIC__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case OrmPackage.XML_BASIC__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_BASIC__OPTIONAL:
- return OPTIONAL_EDEFAULT == null ? optional != null : !OPTIONAL_EDEFAULT.equals(optional);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_BASIC__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_BASIC__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_BASIC__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- 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 == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_BASIC__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_BASIC__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_BASIC__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_BASIC__ENUMERATED;
- 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(" (lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", optional: ");
- result.append(optional);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- return getAttributeTextRange(JPA.LOB);
- }
-
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA.TEMPORAL);
- }
-
- public String getMappingKey() {
- return MappingKeys.BASIC_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(),
- buildColumnTranslator(),
- buildLobTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator()
- };
- }
-
- protected static Translator buildFetchTranslator() {
- return new Translator(JPA.FETCH, OrmPackage.eINSTANCE.getXmlBasic_Fetch(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildOptionalTranslator() {
- return new BooleanTranslator(JPA.OPTIONAL, OrmPackage.eINSTANCE.getXmlBasic_Optional(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmPackage.eINSTANCE.getColumnMapping_Column());
- }
-
- protected static Translator buildLobTranslator() {
- return new EmptyTagBooleanTranslator(JPA.LOB, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Lob());
- }
-
- protected static Translator buildTemporalTranslator() {
- return new Translator(JPA.TEMPORAL, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Temporal());
- }
-
- protected static Translator buildEnumeratedTranslator() {
- return new Translator(JPA.ENUMERATED, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Enumerated());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlClassReference.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlClassReference.java
deleted file mode 100644
index 26cad878dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlClassReference.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Class Reference</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlClassReference#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlClassReference()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlClassReference extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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 XmlClassReference()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_CLASS_REFERENCE;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlClassReference_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlClassReference#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, OrmPackage.XML_CLASS_REFERENCE__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_CLASS_REFERENCE__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 OrmPackage.XML_CLASS_REFERENCE__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 OrmPackage.XML_CLASS_REFERENCE__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 OrmPackage.XML_CLASS_REFERENCE__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();
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getClassNameTextRange() {
- return getAttributeTextRange(JPA.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[] {
- buildClassTranslator()};
- }
-
- private static Translator buildClassTranslator() {
- return new Translator(JPA.CLASS, OrmPackage.eINSTANCE.getXmlClassReference_ClassName(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlCollectionTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlCollectionTable.java
deleted file mode 100644
index 586b0775a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlCollectionTable.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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0;
-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>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlCollectionTable()
- * @model kind="class"
- * @generated
- */
-public class XmlCollectionTable extends AbstractXmlReferenceTable implements XmlCollectionTable_2_0
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCollectionTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_COLLECTION_TABLE;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildJoinColumnTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java
deleted file mode 100644
index 4ae94bbb11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlColumn.java
+++ /dev/null
@@ -1,375 +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.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.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>Column 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlColumn extends AbstractXmlColumn
-{
- /**
- * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected static final Integer LENGTH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected Integer length = LENGTH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrecision()
- * @generated
- * @ordered
- */
- protected static final Integer PRECISION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPrecision() <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrecision()
- * @generated
- * @ordered
- */
- protected Integer precision = PRECISION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getScale() <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScale()
- * @generated
- * @ordered
- */
- protected static final Integer SCALE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getScale() <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getScale()
- * @generated
- * @ordered
- */
- protected Integer scale = SCALE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Length</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Length</em>' attribute.
- * @see #setLength(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Length()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getLength()
- {
- return length;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getLength <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Length</em>' attribute.
- * @see #getLength()
- * @generated
- */
- public void setLength(Integer newLength)
- {
- Integer oldLength = length;
- length = newLength;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__LENGTH, oldLength, length));
- }
-
- /**
- * Returns the value of the '<em><b>Precision</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Precision</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Precision</em>' attribute.
- * @see #setPrecision(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Precision()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getPrecision()
- {
- return precision;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getPrecision <em>Precision</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Precision</em>' attribute.
- * @see #getPrecision()
- * @generated
- */
- public void setPrecision(Integer newPrecision)
- {
- Integer oldPrecision = precision;
- precision = newPrecision;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__PRECISION, oldPrecision, precision));
- }
-
- /**
- * Returns the value of the '<em><b>Scale</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Scale</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Scale</em>' attribute.
- * @see #setScale(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlColumn_Scale()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getScale()
- {
- return scale;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlColumn#getScale <em>Scale</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Scale</em>' attribute.
- * @see #getScale()
- * @generated
- */
- public void setScale(Integer newScale)
- {
- Integer oldScale = scale;
- scale = newScale;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_COLUMN__SCALE, oldScale, scale));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH:
- return getLength();
- case OrmPackage.XML_COLUMN__PRECISION:
- return getPrecision();
- case OrmPackage.XML_COLUMN__SCALE:
- return getScale();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH:
- setLength((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN__PRECISION:
- setPrecision((Integer)newValue);
- return;
- case OrmPackage.XML_COLUMN__SCALE:
- setScale((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH:
- setLength(LENGTH_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN__PRECISION:
- setPrecision(PRECISION_EDEFAULT);
- return;
- case OrmPackage.XML_COLUMN__SCALE:
- setScale(SCALE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_COLUMN__LENGTH:
- return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length);
- case OrmPackage.XML_COLUMN__PRECISION:
- return PRECISION_EDEFAULT == null ? precision != null : !PRECISION_EDEFAULT.equals(precision);
- case OrmPackage.XML_COLUMN__SCALE:
- return SCALE_EDEFAULT == null ? scale != null : !SCALE_EDEFAULT.equals(scale);
- }
- 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(" (length: ");
- result.append(length);
- result.append(", precision: ");
- result.append(precision);
- result.append(", scale: ");
- result.append(scale);
- 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(),
- buildUniqueTranslator(),
- buildNullableTranslator(),
- buildInsertableTranslator(),
- buildUpdatableTranslator(),
- buildColumnDefinitionTranslator(),
- buildTableTranslator(),
- buildLengthTranslator(),
- buildPrecisionTranslator(),
- buildScaleTranslator(),
- };
- }
-
- protected static Translator buildLengthTranslator() {
- return new Translator(JPA.LENGTH, OrmPackage.eINSTANCE.getXmlColumn_Length(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPrecisionTranslator() {
- return new Translator(JPA.PRECISION, OrmPackage.eINSTANCE.getXmlColumn_Precision(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildScaleTranslator() {
- return new Translator(JPA.SCALE, OrmPackage.eINSTANCE.getXmlColumn_Scale(), Translator.DOM_ATTRIBUTE);
- }
-} // ColumnImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlConvertibleMapping.java
deleted file mode 100644
index 91839ed114..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlConvertibleMapping.java
+++ /dev/null
@@ -1,144 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#isLob <em>Lob</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getTemporal <em>Temporal</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getEnumerated <em>Enumerated</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConvertibleMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isLob();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- void setLob(boolean value);
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- TemporalType getTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- void setTemporal(TemporalType value);
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- EnumType getEnumerated();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- void setEnumerated(EnumType value);
-
- /**
- * Return the {@link TextRange} for the enumerated element. If the enumerated element
- * does not exist return the {@link TextRange} for the basic element.
- */
- TextRange getEnumeratedTextRange();
-
- /**
- * Return the {@link TextRange} for the temporal element. If the temporal element
- * does not exist return the {@link TextRange} for the basic element.
- */
- TextRange getTemporalTextRange();
-
- /**
- * Return the {@link TextRange} for the lob element. If the lob element
- * does not exist return the {@link TextRange} for the basic element.
- */
- TextRange getLobTextRange();
-
-} // ConvertableMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java
deleted file mode 100644
index 990d335456..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlDiscriminatorColumn.java
+++ /dev/null
@@ -1,297 +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.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.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>Discriminator Column</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.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn
-{
- /**
- * 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 DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorType() <em>Discriminator Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorType()
- * @generated
- * @ordered
- */
- protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected static final Integer LENGTH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLength() <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLength()
- * @generated
- * @ordered
- */
- protected Integer length = LENGTH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlDiscriminatorColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_DISCRIMINATOR_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Type</b></em>' attribute.
- * The default value is <code>"STRING"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.DiscriminatorType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator 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>Discriminator Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see #setDiscriminatorType(DiscriminatorType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_DiscriminatorType()
- * @model default="STRING"
- * @generated
- */
- public DiscriminatorType getDiscriminatorType()
- {
- return discriminatorType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.DiscriminatorType
- * @see #getDiscriminatorType()
- * @generated
- */
- public void setDiscriminatorType(DiscriminatorType newDiscriminatorType)
- {
- DiscriminatorType oldDiscriminatorType = discriminatorType;
- discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType));
- }
-
- /**
- * Returns the value of the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Length</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Length</em>' attribute.
- * @see #setLength(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_Length()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getLength()
- {
- return length;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Length</em>' attribute.
- * @see #getLength()
- * @generated
- */
- public void setLength(Integer newLength)
- {
- Integer oldLength = length;
- length = newLength;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH, oldLength, length));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- return getDiscriminatorType();
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- return getLength();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- setDiscriminatorType((DiscriminatorType)newValue);
- return;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- setLength((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT);
- return;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- setLength(LENGTH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE:
- return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT;
- case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH:
- return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length);
- }
- 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(" (discriminatorType: ");
- result.append(discriminatorType);
- result.append(", length: ");
- result.append(length);
- 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(),
- buildDiscrminiatorTypeTranslator(),
- buildColumnDefinitionTranslator(),
- buildLengthTranslator()
- };
- }
-
- protected static Translator buildDiscrminiatorTypeTranslator() {
- return new Translator(JPA.DISCRIMINATOR_TYPE, OrmPackage.eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildLengthTranslator() {
- return new Translator(JPA.LENGTH, OrmPackage.eINSTANCE.getXmlDiscriminatorColumn_Length(), Translator.DOM_ATTRIBUTE);
- }
-} // DiscriminatorColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlElementCollection.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlElementCollection.java
deleted file mode 100644
index 3103bc7640..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlElementCollection.java
+++ /dev/null
@@ -1,1634 +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.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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-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>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlElementCollection extends AbstractXmlAttributeMapping implements XmlElementCollection_2_0
-{
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_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 TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_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 EnumType ENUMERATED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getOrderColumn() <em>Order Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderColumn()
- * @generated
- * @ordered
- */
- protected XmlOrderColumn orderColumn;
-
- /**
- * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected static final String ORDER_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrderBy()
- * @generated
- * @ordered
- */
- protected String orderBy = ORDER_BY_EDEFAULT;
-
- /**
- * 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 cached value of the '{@link #getMapKeyAttributeOverrides() <em>Map Key Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> mapKeyAttributeOverrides;
-
- /**
- * The default value of the '{@link #getTargetClass() <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetClass()
- * @generated
- * @ordered
- */
- protected static final String TARGET_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetClass() <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetClass()
- * @generated
- * @ordered
- */
- protected String targetClass = TARGET_CLASS_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 FetchType FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getFetch() <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetch()
- * @generated
- * @ordered
- */
- protected FetchType fetch = FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMapKey() <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKey()
- * @generated
- * @ordered
- */
- protected MapKey mapKey;
-
- /**
- * The cached value of the '{@link #getMapKeyClass() <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyClass()
- * @generated
- * @ordered
- */
- protected XmlClassReference mapKeyClass;
-
- /**
- * 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 TemporalType MAP_KEY_TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyTemporal() <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType mapKeyTemporal = MAP_KEY_TEMPORAL_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 EnumType MAP_KEY_ENUMERATED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyEnumerated() <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType mapKeyEnumerated = MAP_KEY_ENUMERATED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMapKeyColumn() <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn mapKeyColumn;
-
- /**
- * The cached value of the '{@link #getMapKeyJoinColumns() <em>Map Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> mapKeyJoinColumns;
-
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
-
- /**
- * The cached value of the '{@link #getCollectionTable() <em>Collection Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCollectionTable()
- * @generated
- * @ordered
- */
- protected XmlCollectionTable collectionTable;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlElementCollection()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ELEMENT_COLLECTION;
- }
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isLob()
- {
- return lob;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- public void setLob(boolean newLob)
- {
- boolean oldLob = lob;
- lob = newLob;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- public void setEnumerated(EnumType newEnumerated)
- {
- EnumType oldEnumerated = enumerated;
- enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * Returns the value of the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target 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>Target Class</em>' attribute.
- * @see #setTargetClass(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_TargetClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetClass()
- {
- return targetClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getTargetClass <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Class</em>' attribute.
- * @see #getTargetClass()
- * @generated
- */
- public void setTargetClass(String newTargetClass)
- {
- String oldTargetClass = targetClass;
- targetClass = newTargetClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS, oldTargetClass, targetClass));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>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>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_Fetch()
- * @model
- * @generated
- */
- public FetchType getFetch()
- {
- return fetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- public void setFetch(FetchType newFetch)
- {
- FetchType oldFetch = fetch;
- fetch = newFetch == null ? FETCH_EDEFAULT : newFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__FETCH, oldFetch, fetch));
- }
-
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable_OrderBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getOrderBy()
- {
- return orderBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- public void setOrderBy(String newOrderBy)
- {
- String oldOrderBy = orderBy;
- orderBy = newOrderBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY, oldOrderBy, orderBy));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__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.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.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key 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>Map Key Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides()
- {
- if (mapKeyAttributeOverrides == null)
- {
- mapKeyAttributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES);
- }
- return mapKeyAttributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order Column</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>Order Column</em>' containment reference.
- * @see #setOrderColumn(XmlOrderColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable_2_0_OrderColumn()
- * @model containment="true"
- * @generated
- */
- public XmlOrderColumn getOrderColumn()
- {
- return orderColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOrderColumn(XmlOrderColumn newOrderColumn, NotificationChain msgs)
- {
- XmlOrderColumn oldOrderColumn = orderColumn;
- orderColumn = newOrderColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN, oldOrderColumn, newOrderColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getOrderColumn <em>Order Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order Column</em>' containment reference.
- * @see #getOrderColumn()
- * @generated
- */
- public void setOrderColumn(XmlOrderColumn newOrderColumn)
- {
- if (newOrderColumn != orderColumn)
- {
- NotificationChain msgs = null;
- if (orderColumn != null)
- msgs = ((InternalEObject)orderColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN, null, msgs);
- if (newOrderColumn != null)
- msgs = ((InternalEObject)newOrderColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN, null, msgs);
- msgs = basicSetOrderColumn(newOrderColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN, newOrderColumn, newOrderColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map 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>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKey()
- * @model containment="true"
- * @generated
- */
- public MapKey getMapKey()
- {
- return mapKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKey(MapKey newMapKey, NotificationChain msgs)
- {
- MapKey oldMapKey = mapKey;
- mapKey = newMapKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY, oldMapKey, newMapKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- public void setMapKey(MapKey newMapKey)
- {
- if (newMapKey != mapKey)
- {
- NotificationChain msgs = null;
- if (mapKey != null)
- msgs = ((InternalEObject)mapKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY, null, msgs);
- if (newMapKey != null)
- msgs = ((InternalEObject)newMapKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY, null, msgs);
- msgs = basicSetMapKey(newMapKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY, newMapKey, newMapKey));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Class</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>Map Key Class</em>' containment reference.
- * @see #setMapKeyClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKeyClass()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getMapKeyClass()
- {
- return mapKeyClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKeyClass(XmlClassReference newMapKeyClass, NotificationChain msgs)
- {
- XmlClassReference oldMapKeyClass = mapKeyClass;
- mapKeyClass = newMapKeyClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS, oldMapKeyClass, newMapKeyClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getMapKeyClass <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Class</em>' containment reference.
- * @see #getMapKeyClass()
- * @generated
- */
- public void setMapKeyClass(XmlClassReference newMapKeyClass)
- {
- if (newMapKeyClass != mapKeyClass)
- {
- NotificationChain msgs = null;
- if (mapKeyClass != null)
- msgs = ((InternalEObject)mapKeyClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS, null, msgs);
- if (newMapKeyClass != null)
- msgs = ((InternalEObject)newMapKeyClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS, null, msgs);
- msgs = basicSetMapKeyClass(newMapKeyClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS, newMapKeyClass, newMapKeyClass));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Temporal</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 Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setMapKeyTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKeyTemporal()
- * @model
- * @generated
- */
- public TemporalType getMapKeyTemporal()
- {
- return mapKeyTemporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getMapKeyTemporal <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getMapKeyTemporal()
- * @generated
- */
- public void setMapKeyTemporal(TemporalType newMapKeyTemporal)
- {
- TemporalType oldMapKeyTemporal = mapKeyTemporal;
- mapKeyTemporal = newMapKeyTemporal == null ? MAP_KEY_TEMPORAL_EDEFAULT : newMapKeyTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL, oldMapKeyTemporal, mapKeyTemporal));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Enumerated</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 Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setMapKeyEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKeyEnumerated()
- * @model
- * @generated
- */
- public EnumType getMapKeyEnumerated()
- {
- return mapKeyEnumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getMapKeyEnumerated <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getMapKeyEnumerated()
- * @generated
- */
- public void setMapKeyEnumerated(EnumType newMapKeyEnumerated)
- {
- EnumType oldMapKeyEnumerated = mapKeyEnumerated;
- mapKeyEnumerated = newMapKeyEnumerated == null ? MAP_KEY_ENUMERATED_EDEFAULT : newMapKeyEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED, oldMapKeyEnumerated, mapKeyEnumerated));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Column</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>Map Key Column</em>' containment reference.
- * @see #setMapKeyColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKeyColumn()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getMapKeyColumn()
- {
- return mapKeyColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMapKeyColumn(XmlColumn newMapKeyColumn, NotificationChain msgs)
- {
- XmlColumn oldMapKeyColumn = mapKeyColumn;
- mapKeyColumn = newMapKeyColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN, oldMapKeyColumn, newMapKeyColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getMapKeyColumn <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Column</em>' containment reference.
- * @see #getMapKeyColumn()
- * @generated
- */
- public void setMapKeyColumn(XmlColumn newMapKeyColumn)
- {
- if (newMapKeyColumn != mapKeyColumn)
- {
- NotificationChain msgs = null;
- if (mapKeyColumn != null)
- msgs = ((InternalEObject)mapKeyColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN, null, msgs);
- if (newMapKeyColumn != null)
- msgs = ((InternalEObject)newMapKeyColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN, null, msgs);
- msgs = basicSetMapKeyColumn(newMapKeyColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN, newMapKeyColumn, newMapKeyColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Join 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>Map Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_MapKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getMapKeyJoinColumns()
- {
- if (mapKeyJoinColumns == null)
- {
- mapKeyJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS);
- }
- return mapKeyJoinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Collection Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Collection Table</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>Collection Table</em>' containment reference.
- * @see #setCollectionTable(XmlCollectionTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlElementCollection_2_0_CollectionTable()
- * @model containment="true"
- * @generated
- */
- public XmlCollectionTable getCollectionTable()
- {
- return collectionTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCollectionTable(XmlCollectionTable newCollectionTable, NotificationChain msgs)
- {
- XmlCollectionTable oldCollectionTable = collectionTable;
- collectionTable = newCollectionTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE, oldCollectionTable, newCollectionTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlElementCollection#getCollectionTable <em>Collection Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Collection Table</em>' containment reference.
- * @see #getCollectionTable()
- * @generated
- */
- public void setCollectionTable(XmlCollectionTable newCollectionTable)
- {
- if (newCollectionTable != collectionTable)
- {
- NotificationChain msgs = null;
- if (collectionTable != null)
- msgs = ((InternalEObject)collectionTable).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE, null, msgs);
- if (newCollectionTable != null)
- msgs = ((InternalEObject)newCollectionTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE, null, msgs);
- msgs = basicSetCollectionTable(newCollectionTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE, newCollectionTable, newCollectionTable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN:
- return basicSetOrderColumn(null, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAttributeOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY:
- return basicSetMapKey(null, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS:
- return basicSetMapKeyClass(null, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN:
- return basicSetMapKeyColumn(null, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getMapKeyJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN:
- return basicSetColumn(null, msgs);
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE:
- return basicSetCollectionTable(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 OrmPackage.XML_ELEMENT_COLLECTION__LOB:
- return isLob();
- case OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED:
- return getEnumerated();
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN:
- return getOrderColumn();
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY:
- return getOrderBy();
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return getMapKeyAttributeOverrides();
- case OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS:
- return getTargetClass();
- case OrmPackage.XML_ELEMENT_COLLECTION__FETCH:
- return getFetch();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY:
- return getMapKey();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS:
- return getMapKeyClass();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL:
- return getMapKeyTemporal();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED:
- return getMapKeyEnumerated();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN:
- return getMapKeyColumn();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS:
- return getMapKeyJoinColumns();
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN:
- return getColumn();
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE:
- return getCollectionTable();
- }
- 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 OrmPackage.XML_ELEMENT_COLLECTION__LOB:
- setLob((Boolean)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN:
- setOrderColumn((XmlOrderColumn)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY:
- setOrderBy((String)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES:
- getMapKeyAttributeOverrides().clear();
- getMapKeyAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS:
- setTargetClass((String)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__FETCH:
- setFetch((FetchType)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY:
- setMapKey((MapKey)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS:
- setMapKeyClass((XmlClassReference)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL:
- setMapKeyTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED:
- setMapKeyEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN:
- setMapKeyColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS:
- getMapKeyJoinColumns().clear();
- getMapKeyJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE:
- setCollectionTable((XmlCollectionTable)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN:
- setOrderColumn((XmlOrderColumn)null);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY:
- setOrderBy(ORDER_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES:
- getMapKeyAttributeOverrides().clear();
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS:
- setTargetClass(TARGET_CLASS_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__FETCH:
- setFetch(FETCH_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY:
- setMapKey((MapKey)null);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS:
- setMapKeyClass((XmlClassReference)null);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL:
- setMapKeyTemporal(MAP_KEY_TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED:
- setMapKeyEnumerated(MAP_KEY_ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN:
- setMapKeyColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS:
- getMapKeyJoinColumns().clear();
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE:
- setCollectionTable((XmlCollectionTable)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN:
- return orderColumn != null;
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY:
- return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy);
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES:
- return mapKeyAttributeOverrides != null && !mapKeyAttributeOverrides.isEmpty();
- case OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS:
- return TARGET_CLASS_EDEFAULT == null ? targetClass != null : !TARGET_CLASS_EDEFAULT.equals(targetClass);
- case OrmPackage.XML_ELEMENT_COLLECTION__FETCH:
- return fetch != FETCH_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY:
- return mapKey != null;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS:
- return mapKeyClass != null;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL:
- return mapKeyTemporal != MAP_KEY_TEMPORAL_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED:
- return mapKeyEnumerated != MAP_KEY_ENUMERATED_EDEFAULT;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN:
- return mapKeyColumn != null;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS:
- return mapKeyJoinColumns != null && !mapKeyJoinColumns.isEmpty();
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN:
- return column != null;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE:
- return collectionTable != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN: return OrmV2_0Package.XML_ORDERABLE_20__ORDER_COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY: return OrmPackage.XML_ORDERABLE__ORDER_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAttributeOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES: return OrmV2_0Package.XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__TARGET_CLASS;
- case OrmPackage.XML_ELEMENT_COLLECTION__FETCH: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__FETCH;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_CLASS;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_TEMPORAL;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_ENUMERATED;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_COLUMN;
- case OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_JOIN_COLUMNS;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLUMN: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__COLUMN;
- case OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE: return OrmV2_0Package.XML_ELEMENT_COLLECTION_20__COLLECTION_TABLE;
- 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 == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_ELEMENT_COLLECTION__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ORDERABLE_20__ORDER_COLUMN: return OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlOrderable.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ORDERABLE__ORDER_BY: return OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAttributeOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__TARGET_CLASS: return OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__FETCH: return OrmPackage.XML_ELEMENT_COLLECTION__FETCH;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_CLASS: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_TEMPORAL: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_ENUMERATED: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_COLUMN: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__MAP_KEY_JOIN_COLUMNS: return OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__COLUMN: return OrmPackage.XML_ELEMENT_COLLECTION__COLUMN;
- case OrmV2_0Package.XML_ELEMENT_COLLECTION_20__COLLECTION_TABLE: return OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE;
- 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(" (lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(", orderBy: ");
- result.append(orderBy);
- result.append(", targetClass: ");
- result.append(targetClass);
- result.append(", fetch: ");
- result.append(fetch);
- result.append(", mapKeyTemporal: ");
- result.append(mapKeyTemporal);
- result.append(", mapKeyEnumerated: ");
- result.append(mapKeyEnumerated);
- result.append(')');
- return result.toString();
- }
-
-
- // **************** XmlAttributeMapping impl ******************************
-
- public String getMappingKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** validation support ************************************
-
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA2_0.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- return getAttributeTextRange(JPA2_0.LOB);
- }
-
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA2_0.TEMPORAL);
- }
-
- public TextRange getTargetClassTextRange() {
- return getAttributeTextRange(JPA2_0.TARGET_CLASS);
- }
-
- // **************** translators *******************************************
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetClassTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildOrderByTranslator(),
- buildOrderColumnTranslator(),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- 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(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- XmlCollectionTable.buildTranslator(JPA2_0.COLLECTION_TABLE, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_CollectionTable())
- };
- }
-
- protected static Translator buildTargetClassTranslator() {
- return new Translator(JPA2_0.TARGET_CLASS, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_TargetClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildFetchTranslator() {
- return new Translator(JPA.FETCH, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_Fetch(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildOrderByTranslator() {
- return new Translator(JPA.ORDER_BY, OrmPackage.eINSTANCE.getXmlOrderable_OrderBy());
- }
-
- protected static Translator buildOrderColumnTranslator() {
- return XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn());
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_Column());
- }
-
- protected static Translator buildLobTranslator() {
- return new EmptyTagBooleanTranslator(JPA.LOB, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Lob());
- }
-
- protected static Translator buildTemporalTranslator() {
- return new Translator(JPA.TEMPORAL, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Temporal());
- }
-
- protected static Translator buildEnumeratedTranslator() {
- return new Translator(JPA.ENUMERATED, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Enumerated());
- }
-
- protected static Translator buildMapKeyTranslator() {
- return MapKey.buildTranslator(JPA.MAP_KEY, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKey());
- }
-
- protected static Translator buildMapKeyClassTranslator() {
- return XmlClassReference.buildTranslator(JPA2_0.MAP_KEY_CLASS, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyClass());
- }
-
- protected static Translator buildMapKeyTemporalTranslator() {
- return new Translator(JPA2_0.MAP_KEY_TEMPORAL, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyTemporal());
- }
-
- protected static Translator buildMapKeyEnumeratedTranslator() {
- return new Translator(JPA2_0.MAP_KEY_ENUMERATED, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyEnumerated());
- }
-
- 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 buildMapKeyAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA2_0.MAP_KEY_ATTRIBUTE_OVERRIDE, OrmV2_0Package.eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java
deleted file mode 100644
index f1f277b27a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,85 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.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>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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddable()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddable extends AbstractXmlTypeMapping
-{
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddable()
- {
- super();
- }
-
- public String getMappingKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public XmlEntityMappings getEntityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDABLE;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator(),
- buildAccessTranslator(),
- buildMetadataCompleteTranslator(),
- buildDescriptionTranslator(),
- buildAttributesTranslator()
- };
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java
deleted file mode 100644
index 463de74c48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbedded.java
+++ /dev/null
@@ -1,256 +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.core.resource.orm;
-
-import java.util.Collection;
-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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Embedded</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.core.resource.orm.OrmPackage#getXmlEmbedded()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbedded extends AbstractXmlEmbedded implements XmlEmbedded_2_0
-{
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbedded()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED;
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).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 OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- }
- 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 OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbedded_2_0.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 == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbedded_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- public String getMappingKey() {
- return MappingKeys.EMBEDDED_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(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator()
- };
- }
-
- protected static Translator buildAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(JPA.ASSOCIATION_OVERRIDE, OrmPackage.eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java
deleted file mode 100644
index 289142a869..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEmbeddedId.java
+++ /dev/null
@@ -1,74 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.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>Embedded 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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEmbeddedId()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedId extends AbstractXmlEmbedded
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddedId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_EMBEDDED_ID;
- }
-
- public String getMappingKey() {
- return MappingKeys.EMBEDDED_ID_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(),
- buildAttributeOverrideTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java
deleted file mode 100644
index f181ec1dee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,2312 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSecondaryTables <em>Secondary Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContainer, XmlGeneratorContainer, XmlEventMethodContainer, XmlAttributeOverrideContainer, XmlAssociationOverrideContainer, XmlEntity_2_0, XmlIdClassContainer
-{
-
- /**
- * 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 #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 #getPrePersist() <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrePersist()
- * @generated
- * @ordered
- */
- protected PrePersist prePersist;
-
- /**
- * The cached value of the '{@link #getPostPersist() <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostPersist()
- * @generated
- * @ordered
- */
- protected PostPersist postPersist;
-
- /**
- * The cached value of the '{@link #getPreRemove() <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreRemove()
- * @generated
- * @ordered
- */
- protected PreRemove preRemove;
-
- /**
- * The cached value of the '{@link #getPostRemove() <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostRemove()
- * @generated
- * @ordered
- */
- protected PostRemove postRemove;
-
- /**
- * The cached value of the '{@link #getPreUpdate() <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPreUpdate()
- * @generated
- * @ordered
- */
- protected PreUpdate preUpdate;
-
- /**
- * The cached value of the '{@link #getPostUpdate() <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostUpdate()
- * @generated
- * @ordered
- */
- protected PostUpdate postUpdate;
-
- /**
- * The cached value of the '{@link #getPostLoad() <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPostLoad()
- * @generated
- * @ordered
- */
- protected PostLoad postLoad;
-
- /**
- * 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 #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 #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected XmlClassReference idClass;
-
- /**
- * 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 cached value of the '{@link #getTable() <em>Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected XmlTable table;
-
- /**
- * The cached value of the '{@link #getSecondaryTables() <em>Secondary Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecondaryTables()
- * @generated
- * @ordered
- */
- protected EList<XmlSecondaryTable> secondaryTables;
-
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * The cached value of the '{@link #getInheritance() <em>Inheritance</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInheritance()
- * @generated
- * @ordered
- */
- protected Inheritance inheritance;
-
- /**
- * The default value of the '{@link #getDiscriminatorValue() <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorValue()
- * @generated
- * @ordered
- */
- protected static final String DISCRIMINATOR_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiscriminatorValue() <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorValue()
- * @generated
- * @ordered
- */
- protected String discriminatorValue = DISCRIMINATOR_VALUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getDiscriminatorColumn() <em>Discriminator Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDiscriminatorColumn()
- * @generated
- * @ordered
- */
- protected XmlDiscriminatorColumn discriminatorColumn;
-
- /**
- * 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 default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntity()
- {
- super();
- }
-
- public String getMappingKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public XmlEntityMappings entityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ENTITY;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlEntity_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.core.resource.orm.XmlEntity#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, OrmPackage.XML_ENTITY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</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</em>' containment reference.
- * @see #setTable(XmlTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_Table()
- * @model containment="true"
- * @generated
- */
- public XmlTable getTable()
- {
- return table;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTable(XmlTable newTable, NotificationChain msgs)
- {
- XmlTable oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE, oldTable, newTable);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getTable <em>Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' containment reference.
- * @see #getTable()
- * @generated
- */
- public void setTable(XmlTable newTable)
- {
- if (newTable != table)
- {
- NotificationChain msgs = null;
- if (table != null)
- msgs = ((InternalEObject)table).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE, null, msgs);
- if (newTable != null)
- msgs = ((InternalEObject)newTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE, null, msgs);
- msgs = basicSetTable(newTable, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__TABLE, newTable, newTable));
- }
-
- /**
- * Returns the value of the '<em><b>Secondary Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Secondary 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>Secondary Tables</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_SecondaryTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlSecondaryTable> getSecondaryTables()
- {
- if (secondaryTables == null)
- {
- secondaryTables = new EObjectContainmentEList<XmlSecondaryTable>(XmlSecondaryTable.class, this, OrmPackage.XML_ENTITY__SECONDARY_TABLES);
- }
- return secondaryTables;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join 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>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id Class</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>Id Class</em>' containment reference.
- * @see #setIdClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer_IdClass()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(XmlClassReference newIdClass, NotificationChain msgs)
- {
- XmlClassReference oldIdClass = idClass;
- idClass = newIdClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ID_CLASS, oldIdClass, newIdClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getIdClass <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id Class</em>' containment reference.
- * @see #getIdClass()
- * @generated
- */
- public void setIdClass(XmlClassReference newIdClass)
- {
- if (newIdClass != idClass)
- {
- NotificationChain msgs = null;
- if (idClass != null)
- msgs = ((InternalEObject)idClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ID_CLASS, null, msgs);
- if (newIdClass != null)
- msgs = ((InternalEObject)newIdClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ID_CLASS, null, msgs);
- msgs = basicSetIdClass(newIdClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ID_CLASS, newIdClass, newIdClass));
- }
-
- /**
- * Returns the value of the '<em><b>Inheritance</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Inheritance</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>Inheritance</em>' containment reference.
- * @see #setInheritance(Inheritance)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_Inheritance()
- * @model containment="true"
- * @generated
- */
- public Inheritance getInheritance()
- {
- return inheritance;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInheritance(Inheritance newInheritance, NotificationChain msgs)
- {
- Inheritance oldInheritance = inheritance;
- inheritance = newInheritance;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__INHERITANCE, oldInheritance, newInheritance);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getInheritance <em>Inheritance</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Inheritance</em>' containment reference.
- * @see #getInheritance()
- * @generated
- */
- public void setInheritance(Inheritance newInheritance)
- {
- if (newInheritance != inheritance)
- {
- NotificationChain msgs = null;
- if (inheritance != null)
- msgs = ((InternalEObject)inheritance).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__INHERITANCE, null, msgs);
- if (newInheritance != null)
- msgs = ((InternalEObject)newInheritance).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__INHERITANCE, null, msgs);
- msgs = basicSetInheritance(newInheritance, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__INHERITANCE, newInheritance, newInheritance));
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator 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>Discriminator Value</em>' attribute.
- * @see #setDiscriminatorValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_DiscriminatorValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDiscriminatorValue()
- {
- return discriminatorValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Value</em>' attribute.
- * @see #getDiscriminatorValue()
- * @generated
- */
- public void setDiscriminatorValue(String newDiscriminatorValue)
- {
- String oldDiscriminatorValue = discriminatorValue;
- discriminatorValue = newDiscriminatorValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE, oldDiscriminatorValue, discriminatorValue));
- }
-
- /**
- * Returns the value of the '<em><b>Discriminator Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Discriminator Column</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>Discriminator Column</em>' containment reference.
- * @see #setDiscriminatorColumn(XmlDiscriminatorColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_DiscriminatorColumn()
- * @model containment="true"
- * @generated
- */
- public XmlDiscriminatorColumn getDiscriminatorColumn()
- {
- return discriminatorColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetDiscriminatorColumn(XmlDiscriminatorColumn newDiscriminatorColumn, NotificationChain msgs)
- {
- XmlDiscriminatorColumn oldDiscriminatorColumn = discriminatorColumn;
- discriminatorColumn = newDiscriminatorColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, oldDiscriminatorColumn, newDiscriminatorColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Discriminator Column</em>' containment reference.
- * @see #getDiscriminatorColumn()
- * @generated
- */
- public void setDiscriminatorColumn(XmlDiscriminatorColumn newDiscriminatorColumn)
- {
- if (newDiscriminatorColumn != discriminatorColumn)
- {
- NotificationChain msgs = null;
- if (discriminatorColumn != null)
- msgs = ((InternalEObject)discriminatorColumn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, null, msgs);
- if (newDiscriminatorColumn != null)
- msgs = ((InternalEObject)newDiscriminatorColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, null, msgs);
- msgs = basicSetDiscriminatorColumn(newDiscriminatorColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN, newDiscriminatorColumn, newDiscriminatorColumn));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#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, OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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 - OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__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.core.resource.orm.OrmPackage#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, OrmPackage.XML_ENTITY__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#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 - OrmPackage.XML_ENTITY__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__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.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, OrmPackage.XML_ENTITY__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.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * 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.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.core.resource.orm.OrmPackage#getXmlEntity_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Listeners</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 Listeners</em>' attribute.
- * @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_ExcludeDefaultListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultListeners()
- {
- return excludeDefaultListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #isExcludeDefaultListeners()
- * @generated
- */
- public void setExcludeDefaultListeners(boolean newExcludeDefaultListeners)
- {
- boolean oldExcludeDefaultListeners = excludeDefaultListeners;
- excludeDefaultListeners = newExcludeDefaultListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS, oldExcludeDefaultListeners, excludeDefaultListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Superclass Listeners</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 Superclass Listeners</em>' attribute.
- * @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_ExcludeSuperclassListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeSuperclassListeners()
- {
- return excludeSuperclassListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #isExcludeSuperclassListeners()
- * @generated
- */
- public void setExcludeSuperclassListeners(boolean newExcludeSuperclassListeners)
- {
- boolean oldExcludeSuperclassListeners = excludeSuperclassListeners;
- excludeSuperclassListeners = newExcludeSuperclassListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS, oldExcludeSuperclassListeners, excludeSuperclassListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</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>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntity_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</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>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PrePersist()
- * @model containment="true"
- * @generated
- */
- public PrePersist getPrePersist()
- {
- return prePersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrePersist(PrePersist newPrePersist, NotificationChain msgs)
- {
- PrePersist oldPrePersist = prePersist;
- prePersist = newPrePersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_PERSIST, oldPrePersist, newPrePersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- public void setPrePersist(PrePersist newPrePersist)
- {
- if (newPrePersist != prePersist)
- {
- NotificationChain msgs = null;
- if (prePersist != null)
- msgs = ((InternalEObject)prePersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_PERSIST, null, msgs);
- if (newPrePersist != null)
- msgs = ((InternalEObject)newPrePersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_PERSIST, null, msgs);
- msgs = basicSetPrePersist(newPrePersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_PERSIST, newPrePersist, newPrePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</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>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostPersist()
- * @model containment="true"
- * @generated
- */
- public PostPersist getPostPersist()
- {
- return postPersist;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostPersist(PostPersist newPostPersist, NotificationChain msgs)
- {
- PostPersist oldPostPersist = postPersist;
- postPersist = newPostPersist;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_PERSIST, oldPostPersist, newPostPersist);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- public void setPostPersist(PostPersist newPostPersist)
- {
- if (newPostPersist != postPersist)
- {
- NotificationChain msgs = null;
- if (postPersist != null)
- msgs = ((InternalEObject)postPersist).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_PERSIST, null, msgs);
- if (newPostPersist != null)
- msgs = ((InternalEObject)newPostPersist).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_PERSIST, null, msgs);
- msgs = basicSetPostPersist(newPostPersist, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_PERSIST, newPostPersist, newPostPersist));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</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>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreRemove()
- * @model containment="true"
- * @generated
- */
- public PreRemove getPreRemove()
- {
- return preRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreRemove(PreRemove newPreRemove, NotificationChain msgs)
- {
- PreRemove oldPreRemove = preRemove;
- preRemove = newPreRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_REMOVE, oldPreRemove, newPreRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- public void setPreRemove(PreRemove newPreRemove)
- {
- if (newPreRemove != preRemove)
- {
- NotificationChain msgs = null;
- if (preRemove != null)
- msgs = ((InternalEObject)preRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_REMOVE, null, msgs);
- if (newPreRemove != null)
- msgs = ((InternalEObject)newPreRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_REMOVE, null, msgs);
- msgs = basicSetPreRemove(newPreRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_REMOVE, newPreRemove, newPreRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</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>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostRemove()
- * @model containment="true"
- * @generated
- */
- public PostRemove getPostRemove()
- {
- return postRemove;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostRemove(PostRemove newPostRemove, NotificationChain msgs)
- {
- PostRemove oldPostRemove = postRemove;
- postRemove = newPostRemove;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_REMOVE, oldPostRemove, newPostRemove);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- public void setPostRemove(PostRemove newPostRemove)
- {
- if (newPostRemove != postRemove)
- {
- NotificationChain msgs = null;
- if (postRemove != null)
- msgs = ((InternalEObject)postRemove).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_REMOVE, null, msgs);
- if (newPostRemove != null)
- msgs = ((InternalEObject)newPostRemove).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_REMOVE, null, msgs);
- msgs = basicSetPostRemove(newPostRemove, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_REMOVE, newPostRemove, newPostRemove));
- }
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</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>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreUpdate()
- * @model containment="true"
- * @generated
- */
- public PreUpdate getPreUpdate()
- {
- return preUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPreUpdate(PreUpdate newPreUpdate, NotificationChain msgs)
- {
- PreUpdate oldPreUpdate = preUpdate;
- preUpdate = newPreUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_UPDATE, oldPreUpdate, newPreUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- public void setPreUpdate(PreUpdate newPreUpdate)
- {
- if (newPreUpdate != preUpdate)
- {
- NotificationChain msgs = null;
- if (preUpdate != null)
- msgs = ((InternalEObject)preUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_UPDATE, null, msgs);
- if (newPreUpdate != null)
- msgs = ((InternalEObject)newPreUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__PRE_UPDATE, null, msgs);
- msgs = basicSetPreUpdate(newPreUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__PRE_UPDATE, newPreUpdate, newPreUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</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>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostUpdate()
- * @model containment="true"
- * @generated
- */
- public PostUpdate getPostUpdate()
- {
- return postUpdate;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostUpdate(PostUpdate newPostUpdate, NotificationChain msgs)
- {
- PostUpdate oldPostUpdate = postUpdate;
- postUpdate = newPostUpdate;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_UPDATE, oldPostUpdate, newPostUpdate);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- public void setPostUpdate(PostUpdate newPostUpdate)
- {
- if (newPostUpdate != postUpdate)
- {
- NotificationChain msgs = null;
- if (postUpdate != null)
- msgs = ((InternalEObject)postUpdate).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_UPDATE, null, msgs);
- if (newPostUpdate != null)
- msgs = ((InternalEObject)newPostUpdate).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_UPDATE, null, msgs);
- msgs = basicSetPostUpdate(newPostUpdate, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_UPDATE, newPostUpdate, newPostUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</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>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostLoad()
- * @model containment="true"
- * @generated
- */
- public PostLoad getPostLoad()
- {
- return postLoad;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPostLoad(PostLoad newPostLoad, NotificationChain msgs)
- {
- PostLoad oldPostLoad = postLoad;
- postLoad = newPostLoad;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_LOAD, oldPostLoad, newPostLoad);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntity#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- public void setPostLoad(PostLoad newPostLoad)
- {
- if (newPostLoad != postLoad)
- {
- NotificationChain msgs = null;
- if (postLoad != null)
- msgs = ((InternalEObject)postLoad).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_LOAD, null, msgs);
- if (newPostLoad != null)
- msgs = ((InternalEObject)newPostLoad).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY__POST_LOAD, null, msgs);
- msgs = basicSetPostLoad(newPostLoad, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY__POST_LOAD, newPostLoad, newPostLoad));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, OrmPackage.XML_ENTITY__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.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.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#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.core.resource.orm.XmlEntity#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, OrmPackage.XML_ENTITY__CACHEABLE, oldCacheable, cacheable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return basicSetPrePersist(null, msgs);
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return basicSetPostPersist(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return basicSetPreRemove(null, msgs);
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return basicSetPostRemove(null, msgs);
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return basicSetPreUpdate(null, msgs);
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return basicSetPostUpdate(null, msgs);
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return basicSetPostLoad(null, msgs);
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return basicSetIdClass(null, msgs);
- case OrmPackage.XML_ENTITY__TABLE:
- return basicSetTable(null, msgs);
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return ((InternalEList<?>)getSecondaryTables()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return basicSetInheritance(null, msgs);
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return basicSetDiscriminatorColumn(null, msgs);
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return basicSetEntityListeners(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 OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return getPrePersist();
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return getPostPersist();
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return getPreRemove();
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return getPostRemove();
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return getPreUpdate();
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return getPostUpdate();
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return getPostLoad();
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case OrmPackage.XML_ENTITY__CACHEABLE:
- return getCacheable();
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return getIdClass();
- case OrmPackage.XML_ENTITY__NAME:
- return getName();
- case OrmPackage.XML_ENTITY__TABLE:
- return getTable();
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return getSecondaryTables();
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return getInheritance();
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- return getDiscriminatorValue();
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return getDiscriminatorColumn();
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners();
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners();
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- 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 OrmPackage.XML_ENTITY__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- setPrePersist((PrePersist)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- setPostPersist((PostPersist)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- setPreRemove((PreRemove)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- setPostRemove((PostRemove)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- setPreUpdate((PreUpdate)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- setPostUpdate((PostUpdate)newValue);
- return;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- setPostLoad((PostLoad)newValue);
- return;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case OrmPackage.XML_ENTITY__CACHEABLE:
- setCacheable((Boolean)newValue);
- return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((XmlClassReference)newValue);
- return;
- case OrmPackage.XML_ENTITY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_ENTITY__TABLE:
- setTable((XmlTable)newValue);
- return;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- getSecondaryTables().clear();
- getSecondaryTables().addAll((Collection<? extends XmlSecondaryTable>)newValue);
- return;
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ENTITY__INHERITANCE:
- setInheritance((Inheritance)newValue);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- setDiscriminatorValue((String)newValue);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((XmlDiscriminatorColumn)newValue);
- return;
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- setPrePersist((PrePersist)null);
- return;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- setPostPersist((PostPersist)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- setPreRemove((PreRemove)null);
- return;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- setPostRemove((PostRemove)null);
- return;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- setPreUpdate((PreUpdate)null);
- return;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- setPostUpdate((PostUpdate)null);
- return;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- setPostLoad((PostLoad)null);
- return;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case OrmPackage.XML_ENTITY__CACHEABLE:
- setCacheable(CACHEABLE_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((XmlClassReference)null);
- return;
- case OrmPackage.XML_ENTITY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__TABLE:
- setTable((XmlTable)null);
- return;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- getSecondaryTables().clear();
- return;
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- case OrmPackage.XML_ENTITY__INHERITANCE:
- setInheritance((Inheritance)null);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- setDiscriminatorValue(DISCRIMINATOR_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- setDiscriminatorColumn((XmlDiscriminatorColumn)null);
- return;
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR:
- return tableGenerator != null;
- case OrmPackage.XML_ENTITY__PRE_PERSIST:
- return prePersist != null;
- case OrmPackage.XML_ENTITY__POST_PERSIST:
- return postPersist != null;
- case OrmPackage.XML_ENTITY__PRE_REMOVE:
- return preRemove != null;
- case OrmPackage.XML_ENTITY__POST_REMOVE:
- return postRemove != null;
- case OrmPackage.XML_ENTITY__PRE_UPDATE:
- return preUpdate != null;
- case OrmPackage.XML_ENTITY__POST_UPDATE:
- return postUpdate != null;
- case OrmPackage.XML_ENTITY__POST_LOAD:
- return postLoad != null;
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case OrmPackage.XML_ENTITY__CACHEABLE:
- return CACHEABLE_EDEFAULT == null ? cacheable != null : !CACHEABLE_EDEFAULT.equals(cacheable);
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return idClass != null;
- case OrmPackage.XML_ENTITY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_ENTITY__TABLE:
- return table != null;
- case OrmPackage.XML_ENTITY__SECONDARY_TABLES:
- return secondaryTables != null && !secondaryTables.isEmpty();
- case OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- case OrmPackage.XML_ENTITY__INHERITANCE:
- return inheritance != null;
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE:
- return DISCRIMINATOR_VALUE_EDEFAULT == null ? discriminatorValue != null : !DISCRIMINATOR_VALUE_EDEFAULT.equals(discriminatorValue);
- case OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN:
- return discriminatorColumn != null;
- case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return entityListeners != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__NAMED_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES;
- case OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case OrmPackage.XML_ENTITY__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlEventMethodContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__PRE_PERSIST: return OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_PERSIST;
- case OrmPackage.XML_ENTITY__POST_PERSIST: return OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_PERSIST;
- case OrmPackage.XML_ENTITY__PRE_REMOVE: return OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_REMOVE;
- case OrmPackage.XML_ENTITY__POST_REMOVE: return OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_REMOVE;
- case OrmPackage.XML_ENTITY__PRE_UPDATE: return OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_UPDATE;
- case OrmPackage.XML_ENTITY__POST_UPDATE: return OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_UPDATE;
- case OrmPackage.XML_ENTITY__POST_LOAD: return OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_LOAD;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__CACHEABLE: return OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlIdClassContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__ID_CLASS: return OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS;
- 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 == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES: return OrmPackage.XML_ENTITY__NAMED_QUERIES;
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES: return OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return OrmPackage.XML_ENTITY__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlEventMethodContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_PERSIST: return OrmPackage.XML_ENTITY__PRE_PERSIST;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_PERSIST: return OrmPackage.XML_ENTITY__POST_PERSIST;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_REMOVE: return OrmPackage.XML_ENTITY__PRE_REMOVE;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_REMOVE: return OrmPackage.XML_ENTITY__POST_REMOVE;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__PRE_UPDATE: return OrmPackage.XML_ENTITY__PRE_UPDATE;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_UPDATE: return OrmPackage.XML_ENTITY__POST_UPDATE;
- case OrmPackage.XML_EVENT_METHOD_CONTAINER__POST_LOAD: return OrmPackage.XML_ENTITY__POST_LOAD;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE: return OrmPackage.XML_ENTITY__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlIdClassContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS: return OrmPackage.XML_ENTITY__ID_CLASS;
- 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(", name: ");
- result.append(name);
- result.append(", discriminatorValue: ");
- result.append(discriminatorValue);
- result.append(", excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getDiscriminatorValueTextRange() {
- return getElementTextRange(JPA.DISCRIMINATOR_VALUE);
- }
-
- public TextRange getInheritanceStrategyTextRange() {
- return getInheritance() != null ? getInheritance().getStrategyTextRange() : getValidationTextRange();
- }
-
- public TextRange getCacheableTextRange() {
- return getAttributeTextRange(JPA2_0.CACHEABLE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildClassTranslator(),
- buildAccessTranslator(),
- buildCacheableTranslator(),
- buildMetadataCompleteTranslator(),
- buildDescriptionTranslator(),
- buildTableTranslator(),
- buildSecondaryTableTranslator(),
- buildPrimaryKeyJoinColumnTranslator(),
- buildIdClassTranslator(),
- buildInheritanceTranslator(),
- buildDiscriminatorValueTranslator(),
- buildDiscriminatorColumnTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildSqlResultSetMappingTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- PrePersist.buildTranslator(),
- PostPersist.buildTranslator(),
- PreRemove.buildTranslator(),
- PostRemove.buildTranslator(),
- PreUpdate.buildTranslator(),
- PostUpdate.buildTranslator(),
- PostLoad.buildTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlEntity_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCacheableTranslator() {
- return new Translator(JPA2_0.CACHEABLE, OrmV2_0Package.eINSTANCE.getXmlCacheable_2_0_Cacheable(), Translator.DOM_ATTRIBUTE);
- }
-
- 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 buildPrimaryKeyJoinColumnTranslator() {
- return XmlPrimaryKeyJoinColumn.buildTranslator(JPA.PRIMARY_KEY_JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlEntity_PrimaryKeyJoinColumns());
- }
-
- protected static Translator buildIdClassTranslator() {
- return XmlClassReference.buildTranslator(JPA.ID_CLASS, OrmPackage.eINSTANCE.getXmlIdClassContainer_IdClass());
- }
-
- protected static Translator buildInheritanceTranslator() {
- return Inheritance.buildTranslator(JPA.INHERITANCE, OrmPackage.eINSTANCE.getXmlEntity_Inheritance());
- }
-
- protected static Translator buildDiscriminatorValueTranslator() {
- return new Translator(JPA.DISCRIMINATOR_VALUE, OrmPackage.eINSTANCE.getXmlEntity_DiscriminatorValue());
- }
-
- protected static Translator buildDiscriminatorColumnTranslator() {
- return XmlDiscriminatorColumn.buildTranslator(JPA.DISCRIMINATOR_COLUMN, OrmPackage.eINSTANCE.getXmlEntity_DiscriminatorColumn());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return 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 buildSqlResultSetMappingTranslator() {
- return SqlResultSetMapping.buildTranslator(JPA.SQL_RESULT_SET_MAPPING, OrmPackage.eINSTANCE.getXmlEntity_SqlResultSetMappings());
- }
-
- protected static Translator buildExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_ExcludeDefaultListeners());
- }
-
- protected static Translator buildExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_ExcludeSuperclassListeners());
- }
-
- protected static Translator buildEntityListenersTranslator() {
- return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_EntityListeners());
- }
-
- protected static Translator buildPrePersistTranslator() {
- return PrePersist.buildTranslator();
- }
-
- protected static Translator buildPostPersistTranslator() {
- return PostPersist.buildTranslator();
- }
-
- protected static Translator buildPreRemoveTranslator() {
- return PreRemove.buildTranslator();
- }
-
- protected static Translator buildPostRemoveTranslator() {
- return PostRemove.buildTranslator();
- }
-
- protected static Translator buildPreUpdateTranslator() {
- return PreUpdate.buildTranslator();
- }
-
- protected static Translator buildPostUpdateTranslator() {
- return PostUpdate.buildTranslator();
- }
-
- protected static Translator buildPostLoadTranslator() {
- return PostLoad.buildTranslator();
- }
-
- 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.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java
deleted file mode 100644
index 7affacee90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,1108 +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.core.resource.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-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.core.internal.utility.translators.SimpleRootTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSequenceGenerators <em>Sequence Generators</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getTableGenerators <em>Table Generators</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getMappedSuperclasses <em>Mapped Superclasses</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEntities <em>Entities</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getEmbeddables <em>Embeddables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings()
- * @model kind="class"
- * @generated
- */
-public class XmlEntityMappings extends AbstractJpaRootEObject implements XmlQueryContainer, XmlAccessHolder
-{
- /**
- * 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;
-
- /**
- * 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 AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPersistenceUnitMetadata() <em>Persistence Unit Metadata</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnitMetadata()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitMetadata persistenceUnitMetadata;
-
- /**
- * The default value of the '{@link #getPackage() <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackage()
- * @generated
- * @ordered
- */
- protected static final String PACKAGE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPackage() <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPackage()
- * @generated
- * @ordered
- */
- protected String package_ = PACKAGE_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 cached value of the '{@link #getSequenceGenerators() <em>Sequence Generators</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerators()
- * @generated
- * @ordered
- */
- protected EList<XmlSequenceGenerator> sequenceGenerators;
-
- /**
- * The cached value of the '{@link #getTableGenerators() <em>Table Generators</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerators()
- * @generated
- * @ordered
- */
- protected EList<XmlTableGenerator> tableGenerators;
-
- /**
- * 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 #getMappedSuperclasses() <em>Mapped Superclasses</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedSuperclasses()
- * @generated
- * @ordered
- */
- protected EList<XmlMappedSuperclass> mappedSuperclasses;
-
- /**
- * The cached value of the '{@link #getEntities() <em>Entities</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntities()
- * @generated
- * @ordered
- */
- protected EList<XmlEntity> entities;
-
- /**
- * The cached value of the '{@link #getEmbeddables() <em>Embeddables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEmbeddables()
- * @generated
- * @ordered
- */
- protected EList<XmlEmbeddable> embeddables;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntityMappings()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ENTITY_MAPPINGS;
- }
-
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__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.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Unit Metadata</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Unit Metadata</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>Persistence Unit Metadata</em>' containment reference.
- * @see #setPersistenceUnitMetadata(XmlPersistenceUnitMetadata)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_PersistenceUnitMetadata()
- * @model containment="true"
- * @generated
- */
- public XmlPersistenceUnitMetadata getPersistenceUnitMetadata()
- {
- return persistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata, NotificationChain msgs)
- {
- XmlPersistenceUnitMetadata oldPersistenceUnitMetadata = persistenceUnitMetadata;
- persistenceUnitMetadata = newPersistenceUnitMetadata;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, oldPersistenceUnitMetadata, newPersistenceUnitMetadata);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata <em>Persistence Unit Metadata</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Persistence Unit Metadata</em>' containment reference.
- * @see #getPersistenceUnitMetadata()
- * @generated
- */
- public void setPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata)
- {
- if (newPersistenceUnitMetadata != persistenceUnitMetadata)
- {
- NotificationChain msgs = null;
- if (persistenceUnitMetadata != null)
- msgs = ((InternalEObject)persistenceUnitMetadata).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs);
- if (newPersistenceUnitMetadata != null)
- msgs = ((InternalEObject)newPersistenceUnitMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs);
- msgs = basicSetPersistenceUnitMetadata(newPersistenceUnitMetadata, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, newPersistenceUnitMetadata, newPersistenceUnitMetadata));
- }
-
- /**
- * Returns the value of the '<em><b>Package</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Package</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Package</em>' attribute.
- * @see #setPackage(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Package()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPackage()
- {
- return package_;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage <em>Package</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Package</em>' attribute.
- * @see #getPackage()
- * @generated
- */
- public void setPackage(String newPackage)
- {
- String oldPackage = package_;
- package_ = newPackage;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE, oldPackage, package_));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlEntityMappings_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.core.resource.orm.XmlEntityMappings#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, OrmPackage.XML_ENTITY_MAPPINGS__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.core.resource.orm.OrmPackage#getXmlEntityMappings_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.core.resource.orm.XmlEntityMappings#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, OrmPackage.XML_ENTITY_MAPPINGS__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder_Access()
- * @model
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generators</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generators</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>Sequence Generators</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_SequenceGenerators()
- * @model containment="true"
- * @generated
- */
- public EList<XmlSequenceGenerator> getSequenceGenerators()
- {
- if (sequenceGenerators == null)
- {
- sequenceGenerators = new EObjectContainmentEList<XmlSequenceGenerator>(XmlSequenceGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS);
- }
- return sequenceGenerators;
- }
-
- /**
- * Returns the value of the '<em><b>Table Generators</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generators</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>Table Generators</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_TableGenerators()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTableGenerator> getTableGenerators()
- {
- if (tableGenerators == null)
- {
- tableGenerators = new EObjectContainmentEList<XmlTableGenerator>(XmlTableGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS);
- }
- return tableGenerators;
- }
-
- /**
- * 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.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.core.resource.orm.OrmPackage#getXmlEntityMappings_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Mapped Superclasses</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped Superclasses</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>Mapped Superclasses</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_MappedSuperclasses()
- * @model containment="true"
- * @generated
- */
- public EList<XmlMappedSuperclass> getMappedSuperclasses()
- {
- if (mappedSuperclasses == null)
- {
- mappedSuperclasses = new EObjectContainmentEList<XmlMappedSuperclass>(XmlMappedSuperclass.class, this, OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES);
- }
- return mappedSuperclasses;
- }
-
- /**
- * Returns the value of the '<em><b>Entities</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEntity}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entities</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>Entities</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Entities()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEntity> getEntities()
- {
- if (entities == null)
- {
- entities = new EObjectContainmentEList<XmlEntity>(XmlEntity.class, this, OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES);
- }
- return entities;
- }
-
- /**
- * Returns the value of the '<em><b>Embeddables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Embeddables</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>Embeddables</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Embeddables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlEmbeddable> getEmbeddables()
- {
- if (embeddables == null)
- {
- embeddables = new EObjectContainmentEList<XmlEmbeddable>(XmlEmbeddable.class, this, OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES);
- }
- return embeddables;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return basicSetPersistenceUnitMetadata(null, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return ((InternalEList<?>)getSequenceGenerators()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return ((InternalEList<?>)getTableGenerators()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return ((InternalEList<?>)getMappedSuperclasses()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return ((InternalEList<?>)getEntities()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return ((InternalEList<?>)getEmbeddables()).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 OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return getNamedQueries();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- return getAccess();
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return getPersistenceUnitMetadata();
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- return getPackage();
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- return getSchema();
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- return getCatalog();
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return getSequenceGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return getTableGenerators();
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return getMappedSuperclasses();
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return getEntities();
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return getEmbeddables();
- }
- 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 OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- setPackage((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- getSequenceGenerators().clear();
- getSequenceGenerators().addAll((Collection<? extends XmlSequenceGenerator>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- getTableGenerators().clear();
- getTableGenerators().addAll((Collection<? extends XmlTableGenerator>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- getMappedSuperclasses().clear();
- getMappedSuperclasses().addAll((Collection<? extends XmlMappedSuperclass>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- getEntities().clear();
- getEntities().addAll((Collection<? extends XmlEntity>)newValue);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- getEmbeddables().clear();
- getEmbeddables().addAll((Collection<? extends XmlEmbeddable>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)null);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- setPackage(PACKAGE_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- getSequenceGenerators().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- getTableGenerators().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- getMappedSuperclasses().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- getEntities().clear();
- return;
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- getEmbeddables().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA:
- return persistenceUnitMetadata != null;
- case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE:
- return PACKAGE_EDEFAULT == null ? package_ != null : !PACKAGE_EDEFAULT.equals(package_);
- case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS:
- return sequenceGenerators != null && !sequenceGenerators.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS:
- return tableGenerators != null && !tableGenerators.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES:
- return mappedSuperclasses != null && !mappedSuperclasses.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES:
- return entities != null && !entities.isEmpty();
- case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES:
- return embeddables != null && !embeddables.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES;
- case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessHolder.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS: return OrmPackage.XML_ACCESS_HOLDER__ACCESS;
- 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 == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES: return OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES;
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES: return OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessHolder.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ACCESS_HOLDER__ACCESS: return OrmPackage.XML_ENTITY_MAPPINGS__ACCESS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- // **************** overrides **********************************************
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (access: ");
- result.append(access);
- result.append(", description: ");
- result.append(description);
- result.append(", package: ");
- result.append(package_);
- result.append(", schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(')');
- return result.toString();
- }
-
- public List<XmlTypeMapping> getTypeMappings() {
- // convert lists to arrays to avoid ConcurrentModificationException while adding to result list
- ArrayList<XmlTypeMapping> typeMappings = new ArrayList<XmlTypeMapping>();
- CollectionTools.addAll(typeMappings, this.getMappedSuperclasses().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY));
- CollectionTools.addAll(typeMappings, this.getEntities().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY));
- CollectionTools.addAll(typeMappings, this.getEmbeddables().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY));
- return typeMappings;
- }
-
- private static final XmlTypeMapping[] EMPTY_XML_TYPE_MAPPING_ARRAY = new XmlTypeMapping[0];
-
-
- // **************** version -> schema location mapping ********************
-
- private static String namespace = JPA.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(JPA.SCHEMA_VERSION, JPA.SCHEMA_LOCATION);
- map.put(JPA2_0.SCHEMA_VERSION, JPA2_0.SCHEMA_LOCATION);
- return map;
- }
-
- @Override
- protected String getSchemaLocationForVersion(String version) {
- return versionsToSchemaLocations.get(version);
- }
-
-
- // **************** translators *******************************************
-
- public static Translator getRootTranslator() {
- return ROOT_TRANSLATOR;
- }
-
- private static final Translator ROOT_TRANSLATOR = buildRootTranslator();
-
- private static Translator buildRootTranslator() {
- return new SimpleRootTranslator(
- JPA.ENTITY_MAPPINGS,
- OrmPackage.eINSTANCE.getXmlEntityMappings(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildVersionTranslator(versionsToSchemaLocations),
- buildNamespaceTranslator(namespace),
- buildSchemaNamespaceTranslator(),
- buildSchemaLocationTranslator(namespace, versionsToSchemaLocations),
- buildDescriptionTranslator(),
- XmlPersistenceUnitMetadata.buildTranslator(JPA2_0.PERSISTENCE_UNIT_METADATA, OrmPackage.eINSTANCE.getXmlEntityMappings_PersistenceUnitMetadata()),
- buildPackageTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildAccessTranslator(),
- XmlSequenceGenerator.buildTranslator(JPA2_0.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_SequenceGenerators()),
- XmlTableGenerator.buildTranslator(JPA2_0.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_TableGenerators()),
- XmlNamedQuery.buildTranslator(JPA2_0.NAMED_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedQueries()),
- XmlNamedNativeQuery.buildTranslator(JPA2_0.NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedNativeQueries()),
- SqlResultSetMapping.buildTranslator(JPA2_0.SQL_RESULT_SET_MAPPING, OrmPackage.eINSTANCE.getXmlEntityMappings_SqlResultSetMappings()),
- XmlMappedSuperclass.buildTranslator(JPA2_0.MAPPED_SUPERCLASS, OrmPackage.eINSTANCE.getXmlEntityMappings_MappedSuperclasses()),
- XmlEntity.buildTranslator(JPA2_0.ENTITY, OrmPackage.eINSTANCE.getXmlEntityMappings_Entities()),
- XmlEmbeddable.buildTranslator(JPA2_0.EMBEDDABLE, OrmPackage.eINSTANCE.getXmlEntityMappings_Embeddables()),
- };
- }
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmPackage.eINSTANCE.getXmlEntityMappings_Description());
- }
-
- protected static Translator buildPackageTranslator() {
- return new Translator(JPA.PACKAGE, OrmPackage.eINSTANCE.getXmlEntityMappings_Package());
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(JPA.SCHEMA, OrmPackage.eINSTANCE.getXmlEntityMappings_Schema());
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(JPA.CATALOG, OrmPackage.eINSTANCE.getXmlEntityMappings_Catalog());
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEventMethodContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEventMethodContainer.java
deleted file mode 100644
index 0ec6f3099a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlEventMethodContainer.java
+++ /dev/null
@@ -1,227 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Event Method Container</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.core.resource.orm.XmlEventMethodContainer#getPrePersist <em>Pre Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostPersist <em>Post Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreRemove <em>Pre Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostRemove <em>Post Remove</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreUpdate <em>Pre Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostUpdate <em>Post Update</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostLoad <em>Post Load</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEventMethodContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Persist</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>Pre Persist</em>' containment reference.
- * @see #setPrePersist(PrePersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PrePersist()
- * @model containment="true"
- * @generated
- */
- PrePersist getPrePersist();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPrePersist <em>Pre Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Persist</em>' containment reference.
- * @see #getPrePersist()
- * @generated
- */
- void setPrePersist(PrePersist value);
-
- /**
- * Returns the value of the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Persist</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>Post Persist</em>' containment reference.
- * @see #setPostPersist(PostPersist)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostPersist()
- * @model containment="true"
- * @generated
- */
- PostPersist getPostPersist();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostPersist <em>Post Persist</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Persist</em>' containment reference.
- * @see #getPostPersist()
- * @generated
- */
- void setPostPersist(PostPersist value);
-
- /**
- * Returns the value of the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Remove</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>Pre Remove</em>' containment reference.
- * @see #setPreRemove(PreRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreRemove()
- * @model containment="true"
- * @generated
- */
- PreRemove getPreRemove();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreRemove <em>Pre Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Remove</em>' containment reference.
- * @see #getPreRemove()
- * @generated
- */
- void setPreRemove(PreRemove value);
-
- /**
- * Returns the value of the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Remove</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>Post Remove</em>' containment reference.
- * @see #setPostRemove(PostRemove)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostRemove()
- * @model containment="true"
- * @generated
- */
- PostRemove getPostRemove();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostRemove <em>Post Remove</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Remove</em>' containment reference.
- * @see #getPostRemove()
- * @generated
- */
- void setPostRemove(PostRemove value);
-
- /**
- * Returns the value of the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pre Update</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>Pre Update</em>' containment reference.
- * @see #setPreUpdate(PreUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PreUpdate()
- * @model containment="true"
- * @generated
- */
- PreUpdate getPreUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPreUpdate <em>Pre Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pre Update</em>' containment reference.
- * @see #getPreUpdate()
- * @generated
- */
- void setPreUpdate(PreUpdate value);
-
- /**
- * Returns the value of the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Update</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>Post Update</em>' containment reference.
- * @see #setPostUpdate(PostUpdate)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostUpdate()
- * @model containment="true"
- * @generated
- */
- PostUpdate getPostUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostUpdate <em>Post Update</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Update</em>' containment reference.
- * @see #getPostUpdate()
- * @generated
- */
- void setPostUpdate(PostUpdate value);
-
- /**
- * Returns the value of the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Post Load</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>Post Load</em>' containment reference.
- * @see #setPostLoad(PostLoad)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEventMethodContainer_PostLoad()
- * @model containment="true"
- * @generated
- */
- PostLoad getPostLoad();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEventMethodContainer#getPostLoad <em>Post Load</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Post Load</em>' containment reference.
- * @see #getPostLoad()
- * @generated
- */
- void setPostLoad(PostLoad value);
-
-} // XmlEventMethodContainer
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java
deleted file mode 100644
index 6b1d6db4c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValue.java
+++ /dev/null
@@ -1,303 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Generated 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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlGeneratedValue extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getGenerator() <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGenerator()
- * @generated
- * @ordered
- */
- protected static final String GENERATOR_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getGenerator() <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGenerator()
- * @generated
- * @ordered
- */
- protected String generator = GENERATOR_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 GenerationType STRATEGY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getStrategy() <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStrategy()
- * @generated
- * @ordered
- */
- protected GenerationType strategy = STRATEGY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlGeneratedValue()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_GENERATED_VALUE;
- }
-
- /**
- * Returns the value of the '<em><b>Generator</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generator</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generator</em>' attribute.
- * @see #setGenerator(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Generator()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getGenerator()
- {
- return generator;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getGenerator <em>Generator</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generator</em>' attribute.
- * @see #getGenerator()
- * @generated
- */
- public void setGenerator(String newGenerator)
- {
- String oldGenerator = generator;
- generator = newGenerator;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE__GENERATOR, oldGenerator, generator));
- }
-
- /**
- * Returns the value of the '<em><b>Strategy</b></em>' attribute.
- * The default value is <code>"TABLE"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.GenerationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Strategy</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #setStrategy(GenerationType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratedValue_Strategy()
- * @model default="TABLE"
- * @generated
- */
- public GenerationType getStrategy()
- {
- return strategy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratedValue#getStrategy <em>Strategy</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Strategy</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.GenerationType
- * @see #getStrategy()
- * @generated
- */
- public void setStrategy(GenerationType newStrategy)
- {
- GenerationType oldStrategy = strategy;
- strategy = newStrategy == null ? STRATEGY_EDEFAULT : newStrategy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_GENERATED_VALUE__STRATEGY, oldStrategy, strategy));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE__GENERATOR:
- return getGenerator();
- case OrmPackage.XML_GENERATED_VALUE__STRATEGY:
- return getStrategy();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE__GENERATOR:
- setGenerator((String)newValue);
- return;
- case OrmPackage.XML_GENERATED_VALUE__STRATEGY:
- setStrategy((GenerationType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE__GENERATOR:
- setGenerator(GENERATOR_EDEFAULT);
- return;
- case OrmPackage.XML_GENERATED_VALUE__STRATEGY:
- setStrategy(STRATEGY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_GENERATED_VALUE__GENERATOR:
- return GENERATOR_EDEFAULT == null ? generator != null : !GENERATOR_EDEFAULT.equals(generator);
- case OrmPackage.XML_GENERATED_VALUE__STRATEGY:
- return strategy != STRATEGY_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(" (generator: ");
- result.append(generator);
- result.append(", strategy: ");
- result.append(strategy);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getGeneratorTextRange() {
- return getAttributeTextRange(JPA.GENERATOR);
- }
-
- // ********** 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[] {
- buildStrategyTranslator(),
- buildGeneratorTranslator()
- };
- }
-
- protected static Translator buildStrategyTranslator() {
- return new Translator(JPA.STRATEGY, OrmPackage.eINSTANCE.getXmlGeneratedValue_Strategy(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildGeneratorTranslator() {
- return new Translator(JPA.GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratedValue_Generator(), Translator.DOM_ATTRIBUTE);
- }
-} // GeneratedValue
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java
deleted file mode 100644
index 1f53424b5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGenerator.java
+++ /dev/null
@@ -1,122 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Generator</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.core.resource.orm.XmlGenerator#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlGenerator extends XmlGenerator_2_0
-{
- /**
- * 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.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#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>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial 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>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getInitialValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- void setInitialValue(Integer value);
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation 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>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getAllocationSize();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGenerator#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- void setAllocationSize(Integer value);
-
- public TextRange getNameTextRange();
-
- boolean isVirtual();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratorContainer.java
deleted file mode 100644
index 6072fbc2c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratorContainer.java
+++ /dev/null
@@ -1,86 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Generator Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getSequenceGenerator <em>Sequence Generator</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#getTableGenerator <em>Table Generator</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGeneratorContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGeneratorContainer extends JpaEObject
-{
- /**
- * 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.core.resource.orm.OrmPackage#getXmlGeneratorContainer_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- XmlSequenceGenerator getSequenceGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#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
- */
- void setSequenceGenerator(XmlSequenceGenerator value);
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlGeneratorContainer_TableGenerator()
- * @model containment="true"
- * @generated
- */
- XmlTableGenerator getTableGenerator();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer#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
- */
- void setTableGenerator(XmlTableGenerator value);
-
-} // XmlGeneratorContainer
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
deleted file mode 100644
index ebb34f3748..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,805 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlId#getGeneratedValue <em>Generated Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlId()
- * @model kind="class"
- * @generated
- */
-public class XmlId extends AbstractXmlAttributeMapping implements ColumnMapping, XmlConvertibleMapping, XmlGeneratorContainer
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_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 TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
- /**
- * The default value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected static final EnumType ENUMERATED_EDEFAULT = EnumType.ORDINAL;
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_EDEFAULT;
- /**
- * 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isLob()
- {
- return lob;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- public void setLob(boolean newLob)
- {
- boolean oldLob = lob;
- lob = newLob;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- public void setEnumerated(EnumType newEnumerated)
- {
- EnumType oldEnumerated = enumerated;
- enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlId_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, OrmPackage.XML_ID__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#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 - OrmPackage.XML_ID__GENERATED_VALUE, null, msgs);
- if (newGeneratedValue != null)
- msgs = ((InternalEObject)newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__GENERATED_VALUE, null, msgs);
- msgs = basicSetGeneratedValue(newGeneratedValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__GENERATED_VALUE, newGeneratedValue, newGeneratedValue));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#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, OrmPackage.XML_ID__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#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 - OrmPackage.XML_ID__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#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, OrmPackage.XML_ID__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlId#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 - OrmPackage.XML_ID__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ID__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ID__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID__COLUMN:
- return basicSetColumn(null, msgs);
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case OrmPackage.XML_ID__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case OrmPackage.XML_ID__GENERATED_VALUE:
- return basicSetGeneratedValue(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 OrmPackage.XML_ID__COLUMN:
- return getColumn();
- case OrmPackage.XML_ID__LOB:
- return isLob();
- case OrmPackage.XML_ID__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_ID__ENUMERATED:
- return getEnumerated();
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case OrmPackage.XML_ID__TABLE_GENERATOR:
- return getTableGenerator();
- case OrmPackage.XML_ID__GENERATED_VALUE:
- return getGeneratedValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_ID__LOB:
- setLob((Boolean)newValue);
- return;
- case OrmPackage.XML_ID__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_ID__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case OrmPackage.XML_ID__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case OrmPackage.XML_ID__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_ID__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_ID__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_ID__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case OrmPackage.XML_ID__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case OrmPackage.XML_ID__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ID__COLUMN:
- return column != null;
- case OrmPackage.XML_ID__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_ID__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_ID__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case OrmPackage.XML_ID__TABLE_GENERATOR:
- return tableGenerator != null;
- case OrmPackage.XML_ID__GENERATED_VALUE:
- return generatedValue != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_ID__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_ID__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ID__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case OrmPackage.XML_ID__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- 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 == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_ID__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_ID__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_ID__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_ID__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return OrmPackage.XML_ID__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return OrmPackage.XML_ID__TABLE_GENERATOR;
- 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(" (lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- throw new UnsupportedOperationException("lob not supported by id mappings");
- }
-
- public TextRange getTemporalTextRange() {
- throw new UnsupportedOperationException("temporal not supported by id mappings");
- }
-
- public String getMappingKey() {
- return MappingKeys.ID_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(),
- buildColumnTranslator(),
- buildGeneratedValueTranslator(),
- buildTemporalTranslator(),
- buildTableGeneratorTranslator(),
- buildSequenceGeneratorTranslator()
- };
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmPackage.eINSTANCE.getColumnMapping_Column());
- }
-
- protected static Translator buildGeneratedValueTranslator() {
- return XmlGeneratedValue.buildTranslator(JPA.GENERATED_VALUE, OrmPackage.eINSTANCE.getXmlId_GeneratedValue());
- }
-
- protected static Translator buildTemporalTranslator() {
- return new Translator(JPA.TEMPORAL, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Temporal());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClassContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClassContainer.java
deleted file mode 100644
index 6a508798b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlIdClassContainer.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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id Class Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer#getIdClass <em>Id Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlIdClassContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id Class</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>Id Class</em>' containment reference.
- * @see #setIdClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer_IdClass()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getIdClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlIdClassContainer#getIdClass <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id Class</em>' containment reference.
- * @see #getIdClass()
- * @generated
- */
- void setIdClass(XmlClassReference value);
-
-} // XmlIdClassContainer
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java
deleted file mode 100644
index 31484c482a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumn.java
+++ /dev/null
@@ -1,234 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Join Column</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.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinColumn extends AbstractXmlColumn
-{
- /**
- * The default value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected String referencedColumnName = REFERENCED_COLUMN_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Column 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>Referenced Column Name</em>' attribute.
- * @see #setReferencedColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumn_ReferencedColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReferencedColumnName()
- {
- return referencedColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Referenced Column Name</em>' attribute.
- * @see #getReferencedColumnName()
- * @generated
- */
- public void setReferencedColumnName(String newReferencedColumnName)
- {
- String oldReferencedColumnName = referencedColumnName;
- referencedColumnName = newReferencedColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME, oldReferencedColumnName, referencedColumnName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return getReferencedColumnName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName(REFERENCED_COLUMN_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return REFERENCED_COLUMN_NAME_EDEFAULT == null ? referencedColumnName != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(referencedColumnName);
- }
- 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(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- return getAttributeTextRange(JPA.REFERENCED_COLUMN_NAME);
- }
-
- // ********** 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(),
- buildReferencedColumnNameTranslator(),
- buildUniqueTranslator(),
- buildNullableTranslator(),
- buildInsertableTranslator(),
- buildUpdatableTranslator(),
- buildColumnDefinitionTranslator(),
- buildTableTranslator(),
- };
- }
-
- protected static Translator buildReferencedColumnNameTranslator() {
- return new Translator(JPA.REFERENCED_COLUMN_NAME, OrmPackage.eINSTANCE.getXmlJoinColumn_ReferencedColumnName(), Translator.DOM_ATTRIBUTE);
- }
-} // JoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnsMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnsMapping.java
deleted file mode 100644
index e264fa4c7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnsMapping.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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Columns Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinColumnsMapping#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinColumnsMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java
deleted file mode 100644
index 535ef954f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTable.java
+++ /dev/null
@@ -1,210 +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.core.resource.orm;
-
-import java.util.Collection;
-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.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>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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinTable#getInverseJoinColumns <em>Inverse Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinTable extends AbstractXmlReferenceTable
-{
- /**
- * The cached value of the '{@link #getInverseJoinColumns() <em>Inverse Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInverseJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> inverseJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_JOIN_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Inverse Join 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>Inverse Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTable_InverseJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getInverseJoinColumns()
- {
- if (inverseJoinColumns == null)
- {
- inverseJoinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS);
- }
- return inverseJoinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS:
- return ((InternalEList<?>)getInverseJoinColumns()).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 OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS:
- return getInverseJoinColumns();
- }
- 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 OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS:
- getInverseJoinColumns().clear();
- getInverseJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS:
- getInverseJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS:
- return inverseJoinColumns != null && !inverseJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- public boolean isSpecified() {
- return true;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildJoinColumnTranslator(),
- buildInverseJoinColumnTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildInverseJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA.INVERSE_JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlJoinTable_InverseJoinColumns());
- }
-
-} // JoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableMapping.java
deleted file mode 100644
index f378d53ce6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinTableMapping.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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Table Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping#getJoinTable <em>Join Table</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinTableMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</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>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinTableMapping_JoinTable()
- * @model containment="true"
- * @generated
- */
- XmlJoinTable getJoinTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlJoinTableMapping#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- void setJoinTable(XmlJoinTable value);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java
deleted file mode 100644
index c76542ec21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,88 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToMany extends AbstractXmlMultiRelationshipMapping implements XmlManyToMany_2_0
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_MANY;
- }
-
- public String getMappingKey() {
- return MappingKeys.MANY_TO_MANY_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(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrderByTranslator(),
- buildOrderColumnTranslator(),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java
deleted file mode 100644
index a4eeaa6497..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,85 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.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>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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlManyToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOne extends AbstractXmlSingleRelationshipMapping
-{
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MANY_TO_ONE;
- }
-
- // **************** XmlAttributeMapping impl ******************************
-
- public String getMappingKey() {
- return MappingKeys.MANY_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(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedByMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedByMapping.java
deleted file mode 100644
index c1f70f7172..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedByMapping.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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Ownable Relationship Mapping</b></em>'.
- * <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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping#getMappedBy <em>Mapped By</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMappedByMapping extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMappedBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedByMapping#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- void setMappedBy(String value);
-
- TextRange getMappedByTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java
deleted file mode 100644
index e8d4b3a868..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,574 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.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>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlIdClassContainer
-{
-
- /**
- * The cached value of the '{@link #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected XmlClassReference idClass;
-
- /**
- * The default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappedSuperclass()
- {
- super();
- }
-
- public String getMappingKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public XmlEntityMappings entityMappings() {
- return (XmlEntityMappings) eContainer();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_MAPPED_SUPERCLASS;
- }
-
- /**
- * Returns the value of the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id Class</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>Id Class</em>' containment reference.
- * @see #setIdClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlIdClassContainer_IdClass()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getIdClass()
- {
- return idClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIdClass(XmlClassReference newIdClass, NotificationChain msgs)
- {
- XmlClassReference oldIdClass = idClass;
- idClass = newIdClass;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, oldIdClass, newIdClass);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getIdClass <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id Class</em>' containment reference.
- * @see #getIdClass()
- * @generated
- */
- public void setIdClass(XmlClassReference newIdClass)
- {
- if (newIdClass != idClass)
- {
- NotificationChain msgs = null;
- if (idClass != null)
- msgs = ((InternalEObject)idClass).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, null, msgs);
- if (newIdClass != null)
- msgs = ((InternalEObject)newIdClass).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, null, msgs);
- msgs = basicSetIdClass(newIdClass, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS, newIdClass, newIdClass));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Listeners</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 Listeners</em>' attribute.
- * @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeDefaultListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultListeners()
- {
- return excludeDefaultListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Listeners</em>' attribute.
- * @see #isExcludeDefaultListeners()
- * @generated
- */
- public void setExcludeDefaultListeners(boolean newExcludeDefaultListeners)
- {
- boolean oldExcludeDefaultListeners = excludeDefaultListeners;
- excludeDefaultListeners = newExcludeDefaultListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS, oldExcludeDefaultListeners, excludeDefaultListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Superclass Listeners</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 Superclass Listeners</em>' attribute.
- * @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeSuperclassListeners()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeSuperclassListeners()
- {
- return excludeSuperclassListeners;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Superclass Listeners</em>' attribute.
- * @see #isExcludeSuperclassListeners()
- * @generated
- */
- public void setExcludeSuperclassListeners(boolean newExcludeSuperclassListeners)
- {
- boolean oldExcludeSuperclassListeners = excludeSuperclassListeners;
- excludeSuperclassListeners = newExcludeSuperclassListeners;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS, oldExcludeSuperclassListeners, excludeSuperclassListeners));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</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>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedSuperclass_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return basicSetIdClass(null, msgs);
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return basicSetEntityListeners(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 OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return getIdClass();
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners();
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners();
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- setIdClass((XmlClassReference)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- setIdClass((XmlClassReference)null);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS:
- return idClass != null;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS:
- return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
- case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS:
- return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
- case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS:
- return entityListeners != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlIdClassContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS: return OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS;
- 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 == XmlIdClassContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS: return OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS;
- 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(" (excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
- 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(),
- buildAccessTranslator(),
- buildMetadataCompleteTranslator(),
- buildDescriptionTranslator(),
- buildIdClassTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- PrePersist.buildTranslator(),
- PostPersist.buildTranslator(),
- PreRemove.buildTranslator(),
- PostRemove.buildTranslator(),
- PreUpdate.buildTranslator(),
- PostUpdate.buildTranslator(),
- PostLoad.buildTranslator(),
- Attributes.buildTranslator()
- };
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIdClassTranslator() {
- return XmlClassReference.buildTranslator(JPA.ID_CLASS, OrmPackage.eINSTANCE.getXmlIdClassContainer_IdClass());
- }
-
- protected static Translator buildExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultListeners());
- }
-
- protected static Translator buildExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeSuperclassListeners());
- }
-
- protected static Translator buildEntityListenersTranslator() {
- return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_EntityListeners());
- }
-
- protected static Translator buildPrePersistTranslator() {
- return PrePersist.buildTranslator();
- }
-
- protected static Translator buildPostPersistTranslator() {
- return PostPersist.buildTranslator();
- }
-
- protected static Translator buildPreRemoveTranslator() {
- return PreRemove.buildTranslator();
- }
-
- protected static Translator buildPostRemoveTranslator() {
- return PostRemove.buildTranslator();
- }
-
- protected static Translator buildPreUpdateTranslator() {
- return PreUpdate.buildTranslator();
- }
-
- protected static Translator buildPostUpdateTranslator() {
- return PostUpdate.buildTranslator();
- }
-
- protected static Translator buildPostLoadTranslator() {
- return PostLoad.buildTranslator();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
deleted file mode 100644
index 52efa15bd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
+++ /dev/null
@@ -1,586 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Named Native 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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultClass <em>Result Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getResultSetMapping <em>Result Set Mapping</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedNativeQuery extends AbstractJpaEObject implements XmlQuery
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected static final String QUERY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected String query = QUERY_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 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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedNativeQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_NAMED_NATIVE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#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, OrmPackage.XML_NAMED_NATIVE_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.core.resource.orm.OrmPackage#getXmlNamedNativeQuery_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.core.resource.orm.XmlNamedNativeQuery#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, OrmPackage.XML_NAMED_NATIVE_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.core.resource.orm.OrmPackage#getXmlNamedNativeQuery_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.core.resource.orm.XmlNamedNativeQuery#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, OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping));
- }
-
- /**
- * Returns the value of the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</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</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getQuery()
- {
- return query;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- public void setQuery(String newQuery)
- {
- String oldQuery = query;
- query = newQuery;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY, oldQuery, query));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).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 OrmPackage.XML_NAMED_NATIVE_QUERY__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- return getName();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- return getQuery();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return getHints();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- return getResultClass();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- return getResultSetMapping();
- }
- 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 OrmPackage.XML_NAMED_NATIVE_QUERY__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- setQuery((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- setResultClass((String)newValue);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- setQuery(QUERY_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- getHints().clear();
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- setResultClass(RESULT_CLASS_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_NATIVE_QUERY__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__QUERY:
- return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_CLASS:
- return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass);
- case OrmPackage.XML_NAMED_NATIVE_QUERY__RESULT_SET_MAPPING:
- return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping);
- }
- 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(" (description: ");
- result.append(description);
- result.append(", name: ");
- result.append(name);
- result.append(", query: ");
- result.append(query);
- result.append(", resultClass: ");
- result.append(resultClass);
- result.append(", resultSetMapping: ");
- result.append(resultSetMapping);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- // ********** 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(),
- buildDescriptionTranslator(),
- buildQueryTranslator(),
- buildHintTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlQuery_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultClassTranslator() {
- return new Translator(JPA.RESULT_CLASS, OrmPackage.eINSTANCE.getXmlNamedNativeQuery_ResultClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultSetMappingTranslator() {
- return new Translator(JPA.RESULT_SET_MAPPING, OrmPackage.eINSTANCE.getXmlNamedNativeQuery_ResultSetMapping(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlQuery_2_0_Description());
- }
-
- protected static Translator buildQueryTranslator() {
- return new Translator(JPA.QUERY, OrmPackage.eINSTANCE.getXmlQuery_Query());
- }
-
- protected static Translator buildHintTranslator() {
- return XmlQueryHint.buildTranslator(JPA.HINT, OrmPackage.eINSTANCE.getXmlQuery_Hints());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
deleted file mode 100644
index d8729d66c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
+++ /dev/null
@@ -1,542 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Named 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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedQuery extends AbstractJpaEObject implements XmlQuery, XmlNamedQuery_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected static final String QUERY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQuery() <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQuery()
- * @generated
- * @ordered
- */
- protected String query = QUERY_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;
-
- /**
- * 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 LockModeType_2_0 LOCK_MODE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLockMode() <em>Lock Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLockMode()
- * @generated
- * @ordered
- */
- protected LockModeType_2_0 lockMode = LOCK_MODE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_NAMED_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_QUERY__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#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, OrmPackage.XML_NAMED_QUERY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</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</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getQuery()
- {
- return query;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- public void setQuery(String newQuery)
- {
- String oldQuery = query;
- query = newQuery;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_QUERY__QUERY, oldQuery, query));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, OrmPackage.XML_NAMED_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * Returns the value of the '<em><b>Lock Mode</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lock Mode</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lock Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see #setLockMode(LockModeType_2_0)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlNamedQuery_2_0_LockMode()
- * @model
- * @generated
- */
- public LockModeType_2_0 getLockMode()
- {
- return lockMode;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery#getLockMode <em>Lock Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lock Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see #getLockMode()
- * @generated
- */
- public void setLockMode(LockModeType_2_0 newLockMode)
- {
- LockModeType_2_0 oldLockMode = lockMode;
- lockMode = newLockMode == null ? LOCK_MODE_EDEFAULT : newLockMode;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_NAMED_QUERY__LOCK_MODE, oldLockMode, lockMode));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).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 OrmPackage.XML_NAMED_QUERY__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_NAMED_QUERY__NAME:
- return getName();
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- return getQuery();
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return getHints();
- case OrmPackage.XML_NAMED_QUERY__LOCK_MODE:
- return getLockMode();
- }
- 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 OrmPackage.XML_NAMED_QUERY__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- setQuery((String)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- case OrmPackage.XML_NAMED_QUERY__LOCK_MODE:
- setLockMode((LockModeType_2_0)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- setQuery(QUERY_EDEFAULT);
- return;
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- getHints().clear();
- return;
- case OrmPackage.XML_NAMED_QUERY__LOCK_MODE:
- setLockMode(LOCK_MODE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_NAMED_QUERY__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_NAMED_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_NAMED_QUERY__QUERY:
- return QUERY_EDEFAULT == null ? query != null : !QUERY_EDEFAULT.equals(query);
- case OrmPackage.XML_NAMED_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- case OrmPackage.XML_NAMED_QUERY__LOCK_MODE:
- return lockMode != LOCK_MODE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlNamedQuery_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_NAMED_QUERY__LOCK_MODE: return OrmV2_0Package.XML_NAMED_QUERY_20__LOCK_MODE;
- 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 == XmlNamedQuery_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_NAMED_QUERY_20__LOCK_MODE: return OrmPackage.XML_NAMED_QUERY__LOCK_MODE;
- 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(" (description: ");
- result.append(description);
- result.append(", name: ");
- result.append(name);
- result.append(", query: ");
- result.append(query);
- result.append(", lockMode: ");
- result.append(lockMode);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildDescriptionTranslator(),
- buildQueryTranslator(),
- buildLockModeTranslator(),
- XmlQueryHint.buildTranslator(JPA2_0.HINT, OrmPackage.eINSTANCE.getXmlQuery_Hints()),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlQuery_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlQuery_2_0_Description());
- }
-
- protected static Translator buildQueryTranslator() {
- return new Translator(JPA.QUERY, OrmPackage.eINSTANCE.getXmlQuery_Query());
- }
-
- protected static Translator buildLockModeTranslator() {
- return new Translator(JPA2_0.NAMED_QUERY__LOCK_MODE, OrmV2_0Package.eINSTANCE.getXmlNamedQuery_2_0_LockMode());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java
deleted file mode 100644
index 7e4e172305..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNullAttributeMapping.java
+++ /dev/null
@@ -1,54 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Null 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.core.resource.orm.OrmPackage#getXmlNullAttributeMapping()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class XmlNullAttributeMapping extends AbstractXmlAttributeMapping
-{
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNullAttributeMapping()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_NULL_ATTRIBUTE_MAPPING;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java
deleted file mode 100644
index cf312023d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToMany.java
+++ /dev/null
@@ -1,376 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToMany extends AbstractXmlMultiRelationshipMapping implements XmlJoinColumnsMapping, XmlOneToMany_2_0
-{
-
- /**
- * The cached value of the '{@link #getJoinColumns() <em>Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlJoinColumn> joinColumns;
-
- /**
- * The default value of the '{@link #getOrphanRemoval() <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrphanRemoval()
- * @generated
- * @ordered
- */
- protected static final Boolean ORPHAN_REMOVAL_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getOrphanRemoval() <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrphanRemoval()
- * @generated
- * @ordered
- */
- protected Boolean orphanRemoval = ORPHAN_REMOVAL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_MANY;
- }
-
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlJoinColumnsMapping_JoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJoinColumn> getJoinColumns()
- {
- if (joinColumns == null)
- {
- joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS);
- }
- return joinColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Orphan Removal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Orphan Removal</em>' attribute.
- * @see #setOrphanRemoval(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrphanRemovable_2_0_OrphanRemoval()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOrphanRemoval()
- {
- return orphanRemoval;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToMany#getOrphanRemoval <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Orphan Removal</em>' attribute.
- * @see #getOrphanRemoval()
- * @generated
- */
- public void setOrphanRemoval(Boolean newOrphanRemoval)
- {
- Boolean oldOrphanRemoval = orphanRemoval;
- orphanRemoval = newOrphanRemoval;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL, oldOrphanRemoval, orphanRemoval));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS:
- return ((InternalEList<?>)getJoinColumns()).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 OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS:
- return getJoinColumns();
- case OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL:
- return getOrphanRemoval();
- }
- 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 OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS:
- getJoinColumns().clear();
- getJoinColumns().addAll((Collection<? extends XmlJoinColumn>)newValue);
- return;
- case OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL:
- setOrphanRemoval((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS:
- getJoinColumns().clear();
- return;
- case OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL:
- setOrphanRemoval(ORPHAN_REMOVAL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS:
- return joinColumns != null && !joinColumns.isEmpty();
- case OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL:
- return ORPHAN_REMOVAL_EDEFAULT == null ? orphanRemoval != null : !ORPHAN_REMOVAL_EDEFAULT.equals(orphanRemoval);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinColumnsMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS: return OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOrphanRemovable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL: return OrmV2_0Package.XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.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 == XmlJoinColumnsMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_JOIN_COLUMNS_MAPPING__JOIN_COLUMNS: return OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS;
- default: return -1;
- }
- }
- if (baseClass == XmlOrphanRemovable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL: return OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.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(" (orphanRemoval: ");
- result.append(orphanRemoval);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return MappingKeys.ONE_TO_MANY_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(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildOrderByTranslator(),
- buildOrderColumnTranslator(),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildJoinColumnTranslator(),
- buildCascadeTranslator()
- };
- }
-
- protected static Translator buildOrphanRemovalTranslator() {
- return new Translator(JPA2_0.ORPHAN_REMOVAL, OrmV2_0Package.eINSTANCE.getXmlOrphanRemovable_2_0_OrphanRemoval(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJoinColumnTranslator() {
- return XmlJoinColumn.buildTranslator(JPA.JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlJoinColumnsMapping_JoinColumns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java
deleted file mode 100644
index 980050ba84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,457 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToOne_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOne extends AbstractXmlSingleRelationshipMapping implements XmlMappedByMapping, XmlOneToOne_2_0
-{
-
- /**
- * The default value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected static final String MAPPED_BY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getMappedBy() <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappedBy()
- * @generated
- * @ordered
- */
- protected String mappedBy = MAPPED_BY_EDEFAULT;
- /**
- * The default value of the '{@link #getOrphanRemoval() <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrphanRemoval()
- * @generated
- * @ordered
- */
- protected static final Boolean ORPHAN_REMOVAL_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getOrphanRemoval() <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOrphanRemoval()
- * @generated
- * @ordered
- */
- protected Boolean orphanRemoval = ORPHAN_REMOVAL_EDEFAULT;
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ONE_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapped By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapped By</em>' attribute.
- * @see #setMappedBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlMappedByMapping_MappedBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMappedBy()
- {
- return mappedBy;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getMappedBy <em>Mapped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mapped By</em>' attribute.
- * @see #getMappedBy()
- * @generated
- */
- public void setMappedBy(String newMappedBy)
- {
- String oldMappedBy = mappedBy;
- mappedBy = newMappedBy;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE__MAPPED_BY, oldMappedBy, mappedBy));
- }
-
- /**
- * Returns the value of the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Orphan Removal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Orphan Removal</em>' attribute.
- * @see #setOrphanRemoval(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrphanRemovable_2_0_OrphanRemoval()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getOrphanRemoval()
- {
- return orphanRemoval;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOneToOne#getOrphanRemoval <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Orphan Removal</em>' attribute.
- * @see #getOrphanRemoval()
- * @generated
- */
- public void setOrphanRemoval(Boolean newOrphanRemoval)
- {
- Boolean oldOrphanRemoval = orphanRemoval;
- orphanRemoval = newOrphanRemoval;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL, oldOrphanRemoval, orphanRemoval));
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join 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>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOneToOne_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).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 OrmPackage.XML_ONE_TO_ONE__MAPPED_BY:
- return getMappedBy();
- case OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL:
- return getOrphanRemoval();
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- }
- 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 OrmPackage.XML_ONE_TO_ONE__MAPPED_BY:
- setMappedBy((String)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL:
- setOrphanRemoval((Boolean)newValue);
- return;
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY:
- setMappedBy(MAPPED_BY_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL:
- setOrphanRemoval(ORPHAN_REMOVAL_EDEFAULT);
- return;
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY:
- return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy);
- case OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL:
- return ORPHAN_REMOVAL_EDEFAULT == null ? orphanRemoval != null : !ORPHAN_REMOVAL_EDEFAULT.equals(orphanRemoval);
- case OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMappedByMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__MAPPED_BY: return OrmPackage.XML_MAPPED_BY_MAPPING__MAPPED_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlOrphanRemovable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL: return OrmV2_0Package.XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_0.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 == XmlMappedByMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_MAPPED_BY_MAPPING__MAPPED_BY: return OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
- default: return -1;
- }
- }
- if (baseClass == XmlOrphanRemovable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL: return OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_0.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(" (mappedBy: ");
- result.append(mappedBy);
- result.append(", orphanRemoval: ");
- result.append(orphanRemoval);
- result.append(')');
- return result.toString();
- }
-
-
- // **************** XmlAttributeMapping impl ******************************
-
- public String getMappingKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
-
- // **************** validation support ************************************
-
- public TextRange getMappedByTextRange() {
- return getAttributeTextRange(JPA.MAPPED_BY);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildPrimaryKeyJoinColumnTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator()
- };
- }
-
- protected static Translator buildMappedByTranslator() {
- return new Translator(JPA.MAPPED_BY, OrmPackage.eINSTANCE.getXmlMappedByMapping_MappedBy(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildOrphanRemovalTranslator() {
- return new Translator(JPA2_0.ORPHAN_REMOVAL, OrmV2_0Package.eINSTANCE.getXmlOrphanRemovable_2_0_OrphanRemoval(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPrimaryKeyJoinColumnTranslator() {
- return XmlPrimaryKeyJoinColumn.buildTranslator(JPA.PRIMARY_KEY_JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlOneToOne_PrimaryKeyJoinColumns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderColumn.java
deleted file mode 100644
index 7452e2f9f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderColumn.java
+++ /dev/null
@@ -1,404 +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.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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlOrderColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlOrderColumn extends AbstractXmlNamedColumn implements XmlOrderColumn_2_0
-{
- /**
- * The default value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected static final Boolean NULLABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNullable() <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNullable()
- * @generated
- * @ordered
- */
- protected Boolean nullable = NULLABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected static final Boolean INSERTABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInsertable() <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsertable()
- * @generated
- * @ordered
- */
- protected Boolean insertable = INSERTABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected static final Boolean UPDATABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdatable() <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdatable()
- * @generated
- * @ordered
- */
- protected Boolean updatable = UPDATABLE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOrderColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_ORDER_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Nullable</em>' attribute.
- * @see #setNullable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderColumn_2_0_Nullable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getNullable()
- {
- return nullable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderColumn#getNullable <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Nullable</em>' attribute.
- * @see #getNullable()
- * @generated
- */
- public void setNullable(Boolean newNullable)
- {
- Boolean oldNullable = nullable;
- nullable = newNullable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ORDER_COLUMN__NULLABLE, oldNullable, nullable));
- }
-
- /**
- * Returns the value of the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insertable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insertable</em>' attribute.
- * @see #setInsertable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderColumn_2_0_Insertable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getInsertable()
- {
- return insertable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderColumn#getInsertable <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insertable</em>' attribute.
- * @see #getInsertable()
- * @generated
- */
- public void setInsertable(Boolean newInsertable)
- {
- Boolean oldInsertable = insertable;
- insertable = newInsertable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ORDER_COLUMN__INSERTABLE, oldInsertable, insertable));
- }
-
- /**
- * Returns the value of the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Updatable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Updatable</em>' attribute.
- * @see #setUpdatable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderColumn_2_0_Updatable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUpdatable()
- {
- return updatable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderColumn#getUpdatable <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Updatable</em>' attribute.
- * @see #getUpdatable()
- * @generated
- */
- public void setUpdatable(Boolean newUpdatable)
- {
- Boolean oldUpdatable = updatable;
- updatable = newUpdatable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ORDER_COLUMN__UPDATABLE, oldUpdatable, updatable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ORDER_COLUMN__NULLABLE:
- return getNullable();
- case OrmPackage.XML_ORDER_COLUMN__INSERTABLE:
- return getInsertable();
- case OrmPackage.XML_ORDER_COLUMN__UPDATABLE:
- return getUpdatable();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ORDER_COLUMN__NULLABLE:
- setNullable((Boolean)newValue);
- return;
- case OrmPackage.XML_ORDER_COLUMN__INSERTABLE:
- setInsertable((Boolean)newValue);
- return;
- case OrmPackage.XML_ORDER_COLUMN__UPDATABLE:
- setUpdatable((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ORDER_COLUMN__NULLABLE:
- setNullable(NULLABLE_EDEFAULT);
- return;
- case OrmPackage.XML_ORDER_COLUMN__INSERTABLE:
- setInsertable(INSERTABLE_EDEFAULT);
- return;
- case OrmPackage.XML_ORDER_COLUMN__UPDATABLE:
- setUpdatable(UPDATABLE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_ORDER_COLUMN__NULLABLE:
- return NULLABLE_EDEFAULT == null ? nullable != null : !NULLABLE_EDEFAULT.equals(nullable);
- case OrmPackage.XML_ORDER_COLUMN__INSERTABLE:
- return INSERTABLE_EDEFAULT == null ? insertable != null : !INSERTABLE_EDEFAULT.equals(insertable);
- case OrmPackage.XML_ORDER_COLUMN__UPDATABLE:
- return UPDATABLE_EDEFAULT == null ? updatable != null : !UPDATABLE_EDEFAULT.equals(updatable);
- }
- 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 OrmPackage.XML_ORDER_COLUMN__NULLABLE: return OrmV2_0Package.XML_ORDER_COLUMN_20__NULLABLE;
- case OrmPackage.XML_ORDER_COLUMN__INSERTABLE: return OrmV2_0Package.XML_ORDER_COLUMN_20__INSERTABLE;
- case OrmPackage.XML_ORDER_COLUMN__UPDATABLE: return OrmV2_0Package.XML_ORDER_COLUMN_20__UPDATABLE;
- 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 OrmV2_0Package.XML_ORDER_COLUMN_20__NULLABLE: return OrmPackage.XML_ORDER_COLUMN__NULLABLE;
- case OrmV2_0Package.XML_ORDER_COLUMN_20__INSERTABLE: return OrmPackage.XML_ORDER_COLUMN__INSERTABLE;
- case OrmV2_0Package.XML_ORDER_COLUMN_20__UPDATABLE: return OrmPackage.XML_ORDER_COLUMN__UPDATABLE;
- 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(" (nullable: ");
- result.append(nullable);
- result.append(", insertable: ");
- result.append(insertable);
- result.append(", updatable: ");
- result.append(updatable);
- 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(),
- };
- }
-
- protected static Translator buildNullableTranslator() {
- return new BooleanTranslator(JPA.NULLABLE, OrmV2_0Package.eINSTANCE.getXmlOrderColumn_2_0_Nullable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInsertableTranslator() {
- return new BooleanTranslator(JPA.INSERTABLE, OrmV2_0Package.eINSTANCE.getXmlOrderColumn_2_0_Insertable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUpdatableTranslator() {
- return new BooleanTranslator(JPA.UPDATABLE, OrmV2_0Package.eINSTANCE.getXmlOrderColumn_2_0_Updatable(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderable.java
deleted file mode 100644
index 0cfbcbf2ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOrderable.java
+++ /dev/null
@@ -1,64 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Orderable</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.core.resource.orm.XmlOrderable#getOrderBy <em>Order By</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOrderable extends XmlOrderable_2_0
-{
- /**
- * Returns the value of the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order By</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Order By</em>' attribute.
- * @see #setOrderBy(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOrderable_OrderBy()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getOrderBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOrderable#getOrderBy <em>Order By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order By</em>' attribute.
- * @see #getOrderBy()
- * @generated
- */
- void setOrderBy(String value);
-
-} // XmlOrderable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java
deleted file mode 100644
index ec3c36fc2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.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.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Override</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.core.resource.orm.XmlOverride#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlOverride()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOverride 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.core.resource.orm.OrmPackage#getXmlOverride_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlOverride#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);
-
-} // XmlOverride
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java
deleted file mode 100644
index dbc04b541c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,727 +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.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.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence 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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends AbstractJpaEObject implements XmlAccessHolder, XmlPersistenceUnitDefaults_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 AccessType ACCESS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAccess() <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccess()
- * @generated
- * @ordered
- */
- protected AccessType access = ACCESS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDelimitedIdentifiers() <em>Delimited Identifiers</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDelimitedIdentifiers()
- * @generated
- * @ordered
- */
- protected static final boolean DELIMITED_IDENTIFIERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDelimitedIdentifiers() <em>Delimited Identifiers</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDelimitedIdentifiers()
- * @generated
- * @ordered
- */
- protected boolean delimitedIdentifiers = DELIMITED_IDENTIFIERS_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 #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected static final boolean CASCADE_PERSIST_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isCascadePersist() <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isCascadePersist()
- * @generated
- * @ordered
- */
- protected boolean cascadePersist = CASCADE_PERSIST_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitDefaults()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PERSISTENCE_UNIT_DEFAULTS;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_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.core.resource.orm.XmlPersistenceUnitDefaults#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, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__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.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_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.core.resource.orm.XmlPersistenceUnitDefaults#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, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Access</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #setAccess(AccessType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlAccessHolder_Access()
- * @model
- * @generated
- */
- public AccessType getAccess()
- {
- return access;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getAccess <em>Access</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.AccessType
- * @see #getAccess()
- * @generated
- */
- public void setAccess(AccessType newAccess)
- {
- AccessType oldAccess = access;
- access = newAccess == null ? ACCESS_EDEFAULT : newAccess;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS, oldAccess, access));
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Delimited Identifiers</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delimited Identifiers</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delimited Identifiers</em>' attribute.
- * @see #setDelimitedIdentifiers(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isDelimitedIdentifiers()
- {
- return delimitedIdentifiers;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isDelimitedIdentifiers <em>Delimited Identifiers</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delimited Identifiers</em>' attribute.
- * @see #isDelimitedIdentifiers()
- * @generated
- */
- public void setDelimitedIdentifiers(boolean newDelimitedIdentifiers)
- {
- boolean oldDelimitedIdentifiers = delimitedIdentifiers;
- delimitedIdentifiers = newDelimitedIdentifiers;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS, oldDelimitedIdentifiers, delimitedIdentifiers));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Persist</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 Persist</em>' attribute.
- * @see #setCascadePersist(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_CascadePersist()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isCascadePersist()
- {
- return cascadePersist;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#isCascadePersist <em>Cascade Persist</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Persist</em>' attribute.
- * @see #isCascadePersist()
- * @generated
- */
- public void setCascadePersist(boolean newCascadePersist)
- {
- boolean oldCascadePersist = cascadePersist;
- cascadePersist = newCascadePersist;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST, oldCascadePersist, cascadePersist));
- }
-
- /**
- * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Entity Listeners</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>Entity Listeners</em>' containment reference.
- * @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults_EntityListeners()
- * @model containment="true"
- * @generated
- */
- public EntityListeners getEntityListeners()
- {
- return entityListeners;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetEntityListeners(EntityListeners newEntityListeners, NotificationChain msgs)
- {
- EntityListeners oldEntityListeners = entityListeners;
- entityListeners = newEntityListeners;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, oldEntityListeners, newEntityListeners);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults#getEntityListeners <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
- * @see #getEntityListeners()
- * @generated
- */
- public void setEntityListeners(EntityListeners newEntityListeners)
- {
- if (newEntityListeners != entityListeners)
- {
- NotificationChain msgs = null;
- if (entityListeners != null)
- msgs = ((InternalEObject)entityListeners).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, null, msgs);
- if (newEntityListeners != null)
- msgs = ((InternalEObject)newEntityListeners).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, null, msgs);
- msgs = basicSetEntityListeners(newEntityListeners, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS, newEntityListeners, newEntityListeners));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return basicSetEntityListeners(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 OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- return getAccess();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS:
- return isDelimitedIdentifiers();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- return getSchema();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- return getCatalog();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- return isCascadePersist();
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return getEntityListeners();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess((AccessType)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS:
- setDelimitedIdentifiers((Boolean)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- setCascadePersist((Boolean)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- setAccess(ACCESS_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS:
- setDelimitedIdentifiers(DELIMITED_IDENTIFIERS_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- setCascadePersist(CASCADE_PERSIST_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS:
- return access != ACCESS_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS:
- return delimitedIdentifiers != DELIMITED_IDENTIFIERS_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST:
- return cascadePersist != CASCADE_PERSIST_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS:
- return entityListeners != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPersistenceUnitDefaults_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION: return OrmV2_0Package.XML_PERSISTENCE_UNIT_DEFAULTS_20__DESCRIPTION;
- case OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS: return OrmV2_0Package.XML_PERSISTENCE_UNIT_DEFAULTS_20__DELIMITED_IDENTIFIERS;
- 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 == XmlPersistenceUnitDefaults_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_PERSISTENCE_UNIT_DEFAULTS_20__DESCRIPTION: return OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION;
- case OrmV2_0Package.XML_PERSISTENCE_UNIT_DEFAULTS_20__DELIMITED_IDENTIFIERS: return OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS;
- 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(" (access: ");
- result.append(access);
- result.append(", description: ");
- result.append(description);
- result.append(", delimitedIdentifiers: ");
- result.append(delimitedIdentifiers);
- result.append(", schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", cascadePersist: ");
- result.append(cascadePersist);
- 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[] {
- buildDescriptionTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildDelimitedIdentifiersTranslator(),
- buildAccessTranslator(),
- buildCascadePersistTranslator(),
- buildEntityListenersTranslator()
- };
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_0_Description());
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(JPA.SCHEMA, OrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults_Schema());
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(JPA.CATALOG, OrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults_Catalog());
- }
-
- protected static Translator buildDelimitedIdentifiersTranslator() {
- return new EmptyTagBooleanTranslator(JPA2_0.DELIMITIED_IDENTIFIERS, OrmV2_0Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers());
- }
-
- protected static Translator buildAccessTranslator() {
- return new Translator(JPA.ACCESS, OrmPackage.eINSTANCE.getXmlAccessHolder_Access());
- }
-
- protected static Translator buildCascadePersistTranslator() {
- return new EmptyTagBooleanTranslator(JPA.CASCADE_PERSIST, OrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults_CascadePersist());
- }
-
- protected static Translator buildEntityListenersTranslator() {
- return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults_EntityListeners());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java
deleted file mode 100644
index c0bf2e6d9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,394 +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.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.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence 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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends AbstractJpaEObject implements XmlPersistenceUnitMetadata_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
- * @generated
- * @ordered
- */
- protected static final boolean XML_MAPPING_METADATA_COMPLETE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isXmlMappingMetadataComplete() <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isXmlMappingMetadataComplete()
- * @generated
- * @ordered
- */
- protected boolean xmlMappingMetadataComplete = XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPersistenceUnitDefaults() <em>Persistence Unit Defaults</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnitDefaults()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitDefaults persistenceUnitDefaults;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitMetadata()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PERSISTENCE_UNIT_METADATA;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Xml Mapping Metadata Complete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #setXmlMappingMetadataComplete(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isXmlMappingMetadataComplete()
- {
- return xmlMappingMetadataComplete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#isXmlMappingMetadataComplete <em>Xml Mapping Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Xml Mapping Metadata Complete</em>' attribute.
- * @see #isXmlMappingMetadataComplete()
- * @generated
- */
- public void setXmlMappingMetadataComplete(boolean newXmlMappingMetadataComplete)
- {
- boolean oldXmlMappingMetadataComplete = xmlMappingMetadataComplete;
- xmlMappingMetadataComplete = newXmlMappingMetadataComplete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE, oldXmlMappingMetadataComplete, xmlMappingMetadataComplete));
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Unit Defaults</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Unit Defaults</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>Persistence Unit Defaults</em>' containment reference.
- * @see #setPersistenceUnitDefaults(XmlPersistenceUnitDefaults)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata_PersistenceUnitDefaults()
- * @model containment="true"
- * @generated
- */
- public XmlPersistenceUnitDefaults getPersistenceUnitDefaults()
- {
- return persistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPersistenceUnitDefaults(XmlPersistenceUnitDefaults newPersistenceUnitDefaults, NotificationChain msgs)
- {
- XmlPersistenceUnitDefaults oldPersistenceUnitDefaults = persistenceUnitDefaults;
- persistenceUnitDefaults = newPersistenceUnitDefaults;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, oldPersistenceUnitDefaults, newPersistenceUnitDefaults);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata#getPersistenceUnitDefaults <em>Persistence Unit Defaults</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Persistence Unit Defaults</em>' containment reference.
- * @see #getPersistenceUnitDefaults()
- * @generated
- */
- public void setPersistenceUnitDefaults(XmlPersistenceUnitDefaults newPersistenceUnitDefaults)
- {
- if (newPersistenceUnitDefaults != persistenceUnitDefaults)
- {
- NotificationChain msgs = null;
- if (persistenceUnitDefaults != null)
- msgs = ((InternalEObject)persistenceUnitDefaults).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, null, msgs);
- if (newPersistenceUnitDefaults != null)
- msgs = ((InternalEObject)newPersistenceUnitDefaults).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, null, msgs);
- msgs = basicSetPersistenceUnitDefaults(newPersistenceUnitDefaults, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS, newPersistenceUnitDefaults, newPersistenceUnitDefaults));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return basicSetPersistenceUnitDefaults(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 OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- return isXmlMappingMetadataComplete();
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return getPersistenceUnitDefaults();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- setXmlMappingMetadataComplete((Boolean)newValue);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- setPersistenceUnitDefaults((XmlPersistenceUnitDefaults)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- setXmlMappingMetadataComplete(XML_MAPPING_METADATA_COMPLETE_EDEFAULT);
- return;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- setPersistenceUnitDefaults((XmlPersistenceUnitDefaults)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE:
- return xmlMappingMetadataComplete != XML_MAPPING_METADATA_COMPLETE_EDEFAULT;
- case OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS:
- return persistenceUnitDefaults != null;
- }
- 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(" (description: ");
- result.append(description);
- result.append(", xmlMappingMetadataComplete: ");
- result.append(xmlMappingMetadataComplete);
- 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[] {
- buildDescriptionTranslator(),
- buildXmlMappingMetadataCompleteTranslator(),
- XmlPersistenceUnitDefaults.buildTranslator(JPA.PERSISTENCE_UNIT_DEFAULTS, OrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults())
- };
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlPersistenceUnitMetadata_2_0_Description());
- }
-
- protected static Translator buildXmlMappingMetadataCompleteTranslator() {
- return new EmptyTagBooleanTranslator(JPA.XML_MAPPING_METADATA_COMPLETE, OrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_XmlMappingMetadataComplete());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.java
deleted file mode 100644
index 1c3bee5d41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumn.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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key Join Column 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlPrimaryKeyJoinColumn extends AbstractXmlNamedColumn
-{
- /**
- * The default value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected static final String REFERENCED_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReferencedColumnName() <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReferencedColumnName()
- * @generated
- * @ordered
- */
- protected String referencedColumnName = REFERENCED_COLUMN_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPrimaryKeyJoinColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_PRIMARY_KEY_JOIN_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Referenced Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Referenced Column 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>Referenced Column Name</em>' attribute.
- * @see #setReferencedColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn_ReferencedColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReferencedColumnName()
- {
- return referencedColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn#getReferencedColumnName <em>Referenced Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Referenced Column Name</em>' attribute.
- * @see #getReferencedColumnName()
- * @generated
- */
- public void setReferencedColumnName(String newReferencedColumnName)
- {
- String oldReferencedColumnName = referencedColumnName;
- referencedColumnName = newReferencedColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME, oldReferencedColumnName, referencedColumnName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return getReferencedColumnName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- setReferencedColumnName(REFERENCED_COLUMN_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME:
- return REFERENCED_COLUMN_NAME_EDEFAULT == null ? referencedColumnName != null : !REFERENCED_COLUMN_NAME_EDEFAULT.equals(referencedColumnName);
- }
- 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(" (referencedColumnName: ");
- result.append(referencedColumnName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReferencedColumnNameTextRange() {
- return getAttributeTextRange(JPA.REFERENCED_COLUMN_NAME);
- }
-
- // ********** 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(),
- buildReferencedColumnNameTranslator(),
- buildColumnDefinitionTranslator(),
- };
- }
-
- protected static Translator buildReferencedColumnNameTranslator() {
- return new Translator(JPA.REFERENCED_COLUMN_NAME, OrmPackage.eINSTANCE.getXmlPrimaryKeyJoinColumn_ReferencedColumnName(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlPrimaryKeyJoinColumnImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java
deleted file mode 100644
index 93e64f1c0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQuery.java
+++ /dev/null
@@ -1,111 +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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getHints <em>Hints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlQuery extends XmlQuery_2_0
-{
- /**
- * 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.core.resource.orm.OrmPackage#getXmlQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#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>Query</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query</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</em>' attribute.
- * @see #setQuery(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQuery_Query()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getQuery();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQuery#getQuery <em>Query</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query</em>' attribute.
- * @see #getQuery()
- * @generated
- */
- void setQuery(String value);
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlQuery_Hints()
- * @model containment="true"
- * @generated
- */
- EList<XmlQueryHint> getHints();
-
- public TextRange getNameTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryContainer.java
deleted file mode 100644
index ab7411c761..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryContainer.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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Queries Holder</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedQueries <em>Named Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQueryContainer#getNamedNativeQueries <em>Named Native Queries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedQuery> getNamedQueries();
-
- /**
- * 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.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.core.resource.orm.OrmPackage#getXmlQueryContainer_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedNativeQuery> getNamedNativeQueries();
-
-} // XmlQueriesHolder
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java
deleted file mode 100644
index 53ef6bd8ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlQueryHint.java
+++ /dev/null
@@ -1,366 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Query Hint</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.core.resource.orm.XmlQueryHint#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @model kind="class"
- * @generated
- */
-public class XmlQueryHint extends AbstractJpaEObject implements XmlQueryHint_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 #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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlQueryHint()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_QUERY_HINT;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlQueryHint_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_QUERY_HINT__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlQueryHint_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#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, OrmPackage.XML_QUERY_HINT__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.core.resource.orm.OrmPackage#getXmlQueryHint_Value()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlQueryHint#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, OrmPackage.XML_QUERY_HINT__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_QUERY_HINT__NAME:
- return getName();
- case OrmPackage.XML_QUERY_HINT__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_QUERY_HINT__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_QUERY_HINT__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_QUERY_HINT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_QUERY_HINT__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_QUERY_HINT__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_QUERY_HINT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_QUERY_HINT__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- 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(" (description: ");
- result.append(description);
- result.append(", name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- 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(),
- buildDescriptionTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlQueryHint_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueTranslator() {
- return new Translator(JPA.VALUE, OrmPackage.eINSTANCE.getXmlQueryHint_Value(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA2_0.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlQueryHint_2_0_Description());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlReferenceTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlReferenceTable.java
deleted file mode 100644
index 725a1378e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlReferenceTable.java
+++ /dev/null
@@ -1,57 +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.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Reference 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlReferenceTable#getJoinColumns <em>Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlReferenceTable()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReferenceTable extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join 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>Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlReferenceTable_JoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getJoinColumns();
-
-} // XmlReferenceTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.java
deleted file mode 100644
index fb55b507a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSecondaryTable.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.core.resource.orm;
-
-import java.util.Collection;
-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.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 Secondary Table 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlSecondaryTable#getPrimaryKeyJoinColumns <em>Primary Key Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @model kind="class"
- * @generated
- */
-public class XmlSecondaryTable extends AbstractXmlTable
-{
- /**
- * The cached value of the '{@link #getPrimaryKeyJoinColumns() <em>Primary Key Join Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyJoinColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlPrimaryKeyJoinColumn> primaryKeyJoinColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSecondaryTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SECONDARY_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key Join 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>Primary Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSecondaryTable_PrimaryKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns()
- {
- if (primaryKeyJoinColumns == null)
- {
- primaryKeyJoinColumns = new EObjectContainmentEList<XmlPrimaryKeyJoinColumn>(XmlPrimaryKeyJoinColumn.class, this, OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS);
- }
- return primaryKeyJoinColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS:
- return ((InternalEList<?>)getPrimaryKeyJoinColumns()).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 OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS:
- return getPrimaryKeyJoinColumns();
- }
- 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 OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- getPrimaryKeyJoinColumns().addAll((Collection<? extends XmlPrimaryKeyJoinColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS:
- getPrimaryKeyJoinColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS:
- return primaryKeyJoinColumns != null && !primaryKeyJoinColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildPrimaryKeyJoinColumnsTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildPrimaryKeyJoinColumnsTranslator() {
- return XmlPrimaryKeyJoinColumn.buildTranslator(JPA.PRIMARY_KEY_JOIN_COLUMN, OrmPackage.eINSTANCE.getXmlSecondaryTable_PrimaryKeyJoinColumns());
- }
-
-} // XmlSecondaryTableImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java
deleted file mode 100644
index 7427678d54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGenerator.java
+++ /dev/null
@@ -1,705 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Sequence Generator</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.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @model kind="class"
- * @generated
- */
-public class XmlSequenceGenerator extends AbstractJpaEObject implements XmlGenerator, XmlSequenceGenerator_2_0
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected static final Integer INITIAL_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected Integer initialValue = INITIAL_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected static final Integer ALLOCATION_SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected Integer allocationSize = ALLOCATION_SIZE_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 #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 #getSequenceName() <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceName()
- * @generated
- * @ordered
- */
- protected static final String SEQUENCE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSequenceName() <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceName()
- * @generated
- * @ordered
- */
- protected String sequenceName = SEQUENCE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSequenceGenerator()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_SEQUENCE_GENERATOR;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#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, OrmPackage.XML_SEQUENCE_GENERATOR__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence 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>Sequence Name</em>' attribute.
- * @see #setSequenceName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlSequenceGenerator_SequenceName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSequenceName()
- {
- return sequenceName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getSequenceName <em>Sequence Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Name</em>' attribute.
- * @see #getSequenceName()
- * @generated
- */
- public void setSequenceName(String newSequenceName)
- {
- String oldSequenceName = sequenceName;
- sequenceName = newSequenceName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME, oldSequenceName, sequenceName));
- }
-
- /**
- * Returns the value of the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial 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>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getInitialValue()
- {
- return initialValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- public void setInitialValue(Integer newInitialValue)
- {
- Integer oldInitialValue = initialValue;
- initialValue = newInitialValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR__INITIAL_VALUE, oldInitialValue, initialValue));
- }
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation 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>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getAllocationSize()
- {
- return allocationSize;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- public void setAllocationSize(Integer newAllocationSize)
- {
- Integer oldAllocationSize = allocationSize;
- allocationSize = newAllocationSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE, oldAllocationSize, allocationSize));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlSequenceGenerator_2_0_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.core.resource.orm.XmlSequenceGenerator#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, OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlSequenceGenerator_2_0_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.core.resource.orm.XmlSequenceGenerator#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, OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA, oldSchema, schema));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_SEQUENCE_GENERATOR__NAME:
- return getName();
- case OrmPackage.XML_SEQUENCE_GENERATOR__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG:
- return getCatalog();
- case OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA:
- return getSchema();
- case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME:
- return getSequenceName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME:
- setSequenceName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME:
- setSequenceName(SEQUENCE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_SEQUENCE_GENERATOR__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_SEQUENCE_GENERATOR__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_SEQUENCE_GENERATOR__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_SEQUENCE_GENERATOR__SEQUENCE_NAME:
- return SEQUENCE_NAME_EDEFAULT == null ? sequenceName != null : !SEQUENCE_NAME_EDEFAULT.equals(sequenceName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSequenceGenerator_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG: return OrmV2_0Package.XML_SEQUENCE_GENERATOR_20__CATALOG;
- case OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA: return OrmV2_0Package.XML_SEQUENCE_GENERATOR_20__SCHEMA;
- 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 == XmlSequenceGenerator_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_SEQUENCE_GENERATOR_20__CATALOG: return OrmPackage.XML_SEQUENCE_GENERATOR__CATALOG;
- case OrmV2_0Package.XML_SEQUENCE_GENERATOR_20__SCHEMA: return OrmPackage.XML_SEQUENCE_GENERATOR__SCHEMA;
- 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(" (description: ");
- result.append(description);
- result.append(", name: ");
- result.append(name);
- result.append(", initialValue: ");
- result.append(initialValue);
- result.append(", allocationSize: ");
- result.append(allocationSize);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", schema: ");
- result.append(schema);
- result.append(", sequenceName: ");
- result.append(sequenceName);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- // ********** 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(),
- buildSequenceNameTranslator(),
- buildInitialValueTranslator(),
- buildAllocationSizeTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildDescriptionTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlGenerator_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSequenceNameTranslator() {
- return new Translator(JPA.SEQUENCE_NAME, OrmPackage.eINSTANCE.getXmlSequenceGenerator_SequenceName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInitialValueTranslator() {
- return new Translator(JPA.INITIAL_VALUE, OrmPackage.eINSTANCE.getXmlGenerator_InitialValue(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAllocationSizeTranslator() {
- return new Translator(JPA.ALLOCATION_SIZE, OrmPackage.eINSTANCE.getXmlGenerator_AllocationSize(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlGenerator_2_0_Description());
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(JPA.CATALOG, OrmV2_0Package.eINSTANCE.getXmlSequenceGenerator_2_0_Catalog(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(JPA.SCHEMA, OrmV2_0Package.eINSTANCE.getXmlSequenceGenerator_2_0_Schema(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java
deleted file mode 100644
index 5b2c147a61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTable.java
+++ /dev/null
@@ -1,71 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.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>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.core.resource.orm.OrmPackage#getXmlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlTable extends AbstractXmlTable
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TABLE;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
-} // Table
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java
deleted file mode 100644
index 8ab04ba3fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGenerator.java
+++ /dev/null
@@ -1,950 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Table Generator</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.core.resource.orm.XmlTableGenerator#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getUniqueConstraints <em>Unique Constraints</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @model kind="class"
- * @generated
- */
-public class XmlTableGenerator extends AbstractJpaEObject implements XmlGenerator
-{
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_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 #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected static final Integer INITIAL_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInitialValue()
- * @generated
- * @ordered
- */
- protected Integer initialValue = INITIAL_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected static final Integer ALLOCATION_SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllocationSize()
- * @generated
- * @ordered
- */
- protected Integer allocationSize = ALLOCATION_SIZE_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 #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 #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 #getPkColumnName() <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnName()
- * @generated
- * @ordered
- */
- protected static final String PK_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPkColumnName() <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnName()
- * @generated
- * @ordered
- */
- protected String pkColumnName = PK_COLUMN_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValueColumnName() <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueColumnName()
- * @generated
- * @ordered
- */
- protected static final String VALUE_COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValueColumnName() <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueColumnName()
- * @generated
- * @ordered
- */
- protected String valueColumnName = VALUE_COLUMN_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPkColumnValue() <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnValue()
- * @generated
- * @ordered
- */
- protected static final String PK_COLUMN_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPkColumnValue() <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPkColumnValue()
- * @generated
- * @ordered
- */
- protected String pkColumnValue = PK_COLUMN_VALUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUniqueConstraints()
- * @generated
- * @ordered
- */
- protected EList<XmlUniqueConstraint> uniqueConstraints;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTableGenerator()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TABLE_GENERATOR;
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlGenerator_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#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, OrmPackage.XML_TABLE_GENERATOR__NAME, oldName, name));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlTableGenerator_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.core.resource.orm.XmlTableGenerator#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, OrmPackage.XML_TABLE_GENERATOR__TABLE, oldTable, table));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlTableGenerator_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.core.resource.orm.XmlTableGenerator#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, OrmPackage.XML_TABLE_GENERATOR__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlTableGenerator_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.core.resource.orm.XmlTableGenerator#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, OrmPackage.XML_TABLE_GENERATOR__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column 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>Pk Column Name</em>' attribute.
- * @see #setPkColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPkColumnName()
- {
- return pkColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnName <em>Pk Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Name</em>' attribute.
- * @see #getPkColumnName()
- * @generated
- */
- public void setPkColumnName(String newPkColumnName)
- {
- String oldPkColumnName = pkColumnName;
- pkColumnName = newPkColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME, oldPkColumnName, pkColumnName));
- }
-
- /**
- * Returns the value of the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Column 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>Value Column Name</em>' attribute.
- * @see #setValueColumnName(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_ValueColumnName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValueColumnName()
- {
- return valueColumnName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getValueColumnName <em>Value Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Column Name</em>' attribute.
- * @see #getValueColumnName()
- * @generated
- */
- public void setValueColumnName(String newValueColumnName)
- {
- String oldValueColumnName = valueColumnName;
- valueColumnName = newValueColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME, oldValueColumnName, valueColumnName));
- }
-
- /**
- * Returns the value of the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pk Column 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>Pk Column Value</em>' attribute.
- * @see #setPkColumnValue(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_PkColumnValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPkColumnValue()
- {
- return pkColumnValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getPkColumnValue <em>Pk Column Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pk Column Value</em>' attribute.
- * @see #getPkColumnValue()
- * @generated
- */
- public void setPkColumnValue(String newPkColumnValue)
- {
- String oldPkColumnValue = pkColumnValue;
- pkColumnValue = newPkColumnValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE, oldPkColumnValue, pkColumnValue));
- }
-
- /**
- * Returns the value of the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Initial 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>Initial Value</em>' attribute.
- * @see #setInitialValue(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_InitialValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getInitialValue()
- {
- return initialValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getInitialValue <em>Initial Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Initial Value</em>' attribute.
- * @see #getInitialValue()
- * @generated
- */
- public void setInitialValue(Integer newInitialValue)
- {
- Integer oldInitialValue = initialValue;
- initialValue = newInitialValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE, oldInitialValue, initialValue));
- }
-
- /**
- * Returns the value of the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Allocation 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>Allocation Size</em>' attribute.
- * @see #setAllocationSize(Integer)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlGenerator_AllocationSize()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getAllocationSize()
- {
- return allocationSize;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator#getAllocationSize <em>Allocation Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Allocation Size</em>' attribute.
- * @see #getAllocationSize()
- * @generated
- */
- public void setAllocationSize(Integer newAllocationSize)
- {
- Integer oldAllocationSize = allocationSize;
- allocationSize = newAllocationSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE, oldAllocationSize, allocationSize));
- }
-
- /**
- * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique Constraints</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>Unique Constraints</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTableGenerator_UniqueConstraints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlUniqueConstraint> getUniqueConstraints()
- {
- if (uniqueConstraints == null)
- {
- uniqueConstraints = new EObjectContainmentEList<XmlUniqueConstraint>(XmlUniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
- }
- return uniqueConstraints;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS:
- return ((InternalEList<?>)getUniqueConstraints()).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 OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION:
- return getDescription();
- case OrmPackage.XML_TABLE_GENERATOR__NAME:
- return getName();
- case OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE:
- return getInitialValue();
- case OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE:
- return getAllocationSize();
- case OrmPackage.XML_TABLE_GENERATOR__TABLE:
- return getTable();
- case OrmPackage.XML_TABLE_GENERATOR__CATALOG:
- return getCatalog();
- case OrmPackage.XML_TABLE_GENERATOR__SCHEMA:
- return getSchema();
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME:
- return getPkColumnName();
- case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME:
- return getValueColumnName();
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE:
- return getPkColumnValue();
- case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS:
- return getUniqueConstraints();
- }
- 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 OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE:
- setInitialValue((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE:
- setAllocationSize((Integer)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__TABLE:
- setTable((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__CATALOG:
- setCatalog((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__SCHEMA:
- setSchema((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME:
- setPkColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME:
- setValueColumnName((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE:
- setPkColumnValue((String)newValue);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- getUniqueConstraints().addAll((Collection<? extends XmlUniqueConstraint>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE:
- setInitialValue(INITIAL_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE:
- setAllocationSize(ALLOCATION_SIZE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME:
- setPkColumnName(PK_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME:
- setValueColumnName(VALUE_COLUMN_NAME_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE:
- setPkColumnValue(PK_COLUMN_VALUE_EDEFAULT);
- return;
- case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS:
- getUniqueConstraints().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case OrmPackage.XML_TABLE_GENERATOR__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE:
- return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue);
- case OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE:
- return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize);
- case OrmPackage.XML_TABLE_GENERATOR__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case OrmPackage.XML_TABLE_GENERATOR__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case OrmPackage.XML_TABLE_GENERATOR__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME:
- return PK_COLUMN_NAME_EDEFAULT == null ? pkColumnName != null : !PK_COLUMN_NAME_EDEFAULT.equals(pkColumnName);
- case OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME:
- return VALUE_COLUMN_NAME_EDEFAULT == null ? valueColumnName != null : !VALUE_COLUMN_NAME_EDEFAULT.equals(valueColumnName);
- case OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE:
- return PK_COLUMN_VALUE_EDEFAULT == null ? pkColumnValue != null : !PK_COLUMN_VALUE_EDEFAULT.equals(pkColumnValue);
- case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS:
- return uniqueConstraints != null && !uniqueConstraints.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(" (description: ");
- result.append(description);
- result.append(", name: ");
- result.append(name);
- result.append(", initialValue: ");
- result.append(initialValue);
- result.append(", allocationSize: ");
- result.append(allocationSize);
- result.append(", table: ");
- result.append(table);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", schema: ");
- result.append(schema);
- result.append(", pkColumnName: ");
- result.append(pkColumnName);
- result.append(", valueColumnName: ");
- result.append(valueColumnName);
- result.append(", pkColumnValue: ");
- result.append(pkColumnValue);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- public boolean isVirtual() {
- return false;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTableTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildPkColumnNameTranslator(),
- buildValueColumnNameTranslator(),
- buildPkColumnValueTranslator(),
- buildInitialValueTranslator(),
- buildAllocationSizeTranslator(),
- buildDescriptionTranslator(),
- XmlUniqueConstraint.buildTranslator(JPA.UNIQUE_CONSTRAINT, OrmPackage.eINSTANCE.getXmlTableGenerator_UniqueConstraints())
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmPackage.eINSTANCE.getXmlGenerator_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(JPA.TABLE, OrmPackage.eINSTANCE.getXmlTableGenerator_Table(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(JPA.CATALOG, OrmPackage.eINSTANCE.getXmlTableGenerator_Catalog(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(JPA.SCHEMA, OrmPackage.eINSTANCE.getXmlTableGenerator_Schema(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPkColumnNameTranslator() {
- return new Translator(JPA.PK_COLUMN_NAME, OrmPackage.eINSTANCE.getXmlTableGenerator_PkColumnName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueColumnNameTranslator() {
- return new Translator(JPA.VALUE_COLUMN_NAME, OrmPackage.eINSTANCE.getXmlTableGenerator_ValueColumnName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPkColumnValueTranslator() {
- return new Translator(JPA.PK_COLUMN_VALUE, OrmPackage.eINSTANCE.getXmlTableGenerator_PkColumnValue(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInitialValueTranslator() {
- return new Translator(JPA.INITIAL_VALUE, OrmPackage.eINSTANCE.getXmlGenerator_InitialValue(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAllocationSizeTranslator() {
- return new Translator(JPA.ALLOCATION_SIZE, OrmPackage.eINSTANCE.getXmlGenerator_AllocationSize(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(JPA.DESCRIPTION, OrmV2_0Package.eINSTANCE.getXmlGenerator_2_0_Description());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java
deleted file mode 100644
index 5be9c033de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTransient.java
+++ /dev/null
@@ -1,77 +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.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.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>Transient</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.core.resource.orm.OrmPackage#getXmlTransient()
- * @model kind="class"
- * @generated
- */
-public class XmlTransient extends AbstractXmlAttributeMapping
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransient()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_TRANSIENT;
- }
-
- public String getMappingKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-
- // ********** 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()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTypeMapping.java
deleted file mode 100644
index e8a71a6ccc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTypeMapping.java
+++ /dev/null
@@ -1,152 +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.core.resource.orm;
-
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Type 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getClassName <em>Class Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTypeMapping extends XmlAccessHolder
-{
- /**
- * 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.core.resource.orm.OrmPackage#getXmlTypeMapping_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#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);
-
- /**
- * Returns the value of the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Metadata Complete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Metadata Complete</em>' attribute.
- * @see #setMetadataComplete(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_MetadataComplete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getMetadataComplete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getMetadataComplete <em>Metadata Complete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Metadata Complete</em>' attribute.
- * @see #getMetadataComplete()
- * @generated
- */
- void setMetadataComplete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</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>Attributes</em>' containment reference.
- * @see #setAttributes(Attributes)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlTypeMapping_Attributes()
- * @model containment="true"
- * @generated
- */
- Attributes getAttributes();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlTypeMapping#getAttributes <em>Attributes</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attributes</em>' containment reference.
- * @see #getAttributes()
- * @generated
- */
- void setAttributes(Attributes value);
-
- TextRange getClassTextRange();
-
- TextRange getAttributesTextRange();
-
- //TODO not happy with this, or the corresponding one in XmlAttributeMapping
- String getMappingKey();
-} // XmlTypeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java
deleted file mode 100644
index 9662e2ea78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlUniqueConstraint.java
+++ /dev/null
@@ -1,274 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Unique Constraint</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.core.resource.orm.XmlUniqueConstraint#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlUniqueConstraint()
- * @model kind="class"
- * @generated
- */
-public class XmlUniqueConstraint extends AbstractJpaEObject implements XmlUniqueConstraint_2_0
-{
- /**
- * 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 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 XmlUniqueConstraint()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_UNIQUE_CONSTRAINT;
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlUniqueConstraint_2_0_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.core.resource.orm.XmlUniqueConstraint#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, OrmPackage.XML_UNIQUE_CONSTRAINT__NAME, oldName, name));
- }
-
- /**
- * 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.core.resource.orm.OrmPackage#getXmlUniqueConstraint_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case OrmPackage.XML_UNIQUE_CONSTRAINT__NAME:
- return getName();
- case OrmPackage.XML_UNIQUE_CONSTRAINT__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 OrmPackage.XML_UNIQUE_CONSTRAINT__NAME:
- setName((String)newValue);
- return;
- case OrmPackage.XML_UNIQUE_CONSTRAINT__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 OrmPackage.XML_UNIQUE_CONSTRAINT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_UNIQUE_CONSTRAINT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case OrmPackage.XML_UNIQUE_CONSTRAINT__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(", columnNames: ");
- result.append(columnNames);
- 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(),
- buildColumnNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, OrmV2_0Package.eINSTANCE.getXmlUniqueConstraint_2_0_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildColumnNameTranslator() {
- return new Translator(JPA.COLUMN_NAME, OrmPackage.eINSTANCE.getXmlUniqueConstraint_ColumnNames());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java
deleted file mode 100644
index 846deb978b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlVersion.java
+++ /dev/null
@@ -1,523 +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.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.core.MappingKeys;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>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.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlVersion()
- * @model kind="class"
- * @generated
- */
-public class XmlVersion extends AbstractXmlAttributeMapping implements ColumnMapping, XmlConvertibleMapping
-{
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected XmlColumn column;
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_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 TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
- /**
- * The default value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected static final EnumType ENUMERATED_EDEFAULT = EnumType.ORDINAL;
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVersion()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return OrmPackage.Literals.XML_VERSION;
- }
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getColumnMapping_Column()
- * @model containment="true"
- * @generated
- */
- public XmlColumn getColumn()
- {
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetColumn(XmlColumn newColumn, NotificationChain msgs)
- {
- XmlColumn oldColumn = column;
- column = newColumn;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- public void setColumn(XmlColumn newColumn)
- {
- if (newColumn != column)
- {
- NotificationChain msgs = null;
- if (column != null)
- msgs = ((InternalEObject)column).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_VERSION__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_VERSION__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lob</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lob</em>' attribute.
- * @see #setLob(boolean)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Lob()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isLob()
- {
- return lob;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#isLob <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lob</em>' attribute.
- * @see #isLob()
- * @generated
- */
- public void setLob(boolean newLob)
- {
- boolean oldLob = lob;
- lob = newLob;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Temporal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getTemporal <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getTemporal()
- * @generated
- */
- public void setTemporal(TemporalType newTemporal)
- {
- TemporalType oldTemporal = temporal;
- temporal = newTemporal == null ? TEMPORAL_EDEFAULT : newTemporal;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Enumerated</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlVersion#getEnumerated <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getEnumerated()
- * @generated
- */
- public void setEnumerated(EnumType newEnumerated)
- {
- EnumType oldEnumerated = enumerated;
- enumerated = newEnumerated == null ? ENUMERATED_EDEFAULT : newEnumerated;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_VERSION__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION__COLUMN:
- return basicSetColumn(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 OrmPackage.XML_VERSION__COLUMN:
- return getColumn();
- case OrmPackage.XML_VERSION__LOB:
- return isLob();
- case OrmPackage.XML_VERSION__TEMPORAL:
- return getTemporal();
- case OrmPackage.XML_VERSION__ENUMERATED:
- return getEnumerated();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case OrmPackage.XML_VERSION__LOB:
- setLob((Boolean)newValue);
- return;
- case OrmPackage.XML_VERSION__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case OrmPackage.XML_VERSION__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case OrmPackage.XML_VERSION__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case OrmPackage.XML_VERSION__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case OrmPackage.XML_VERSION__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case OrmPackage.XML_VERSION__COLUMN:
- return column != null;
- case OrmPackage.XML_VERSION__LOB:
- return lob != LOB_EDEFAULT;
- case OrmPackage.XML_VERSION__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case OrmPackage.XML_VERSION__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_VERSION__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_VERSION__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case OrmPackage.XML_VERSION__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case OrmPackage.XML_VERSION__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- 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 == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return OrmPackage.XML_VERSION__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return OrmPackage.XML_VERSION__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return OrmPackage.XML_VERSION__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return OrmPackage.XML_VERSION__ENUMERATED;
- 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(" (lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getEnumeratedTextRange() {
- throw new UnsupportedOperationException("enumerated not supported by version mappings");
- }
-
- public TextRange getLobTextRange() {
- throw new UnsupportedOperationException("lob not supported by version mappings");
- }
-
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA.TEMPORAL);
- }
-
- public String getMappingKey() {
- return MappingKeys.VERSION_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(),
- buildColumnTranslator(),
- buildTemporalTranslator(),
- };
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmPackage.eINSTANCE.getColumnMapping_Column());
- }
-
- protected static Translator buildTemporalTranslator() {
- return new Translator(JPA.TEMPORAL, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Temporal());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/JPA2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/JPA2_0.java
deleted file mode 100644
index 5c7f3f07b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/JPA2_0.java
+++ /dev/null
@@ -1,53 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.JPA;
-
-/**
- * JPA 2.0 orm.xml-related stuff (elements, attributes 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.3
- * @since 2.3
- */
-@SuppressWarnings("nls")
-public interface JPA2_0
- extends JPA
-{
- String SCHEMA_NAMESPACE = JPA.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://java.sun.com/xml/ns/persistence/orm_2_0.xsd";
- String SCHEMA_VERSION = "2.0";
-
- // JPA 2.0 specific nodes
-
- String CACHEABLE = "cacheable";
- String COLLECTION_TABLE = "collection-table";
- String DELIMITIED_IDENTIFIERS = "delimited-identifiers";
- String ELEMENT_COLLECTION = "element-collection";
- String MAP_KEY_ATTRIBUTE_OVERRIDE = "map-key-attribute-override";
- String MAP_KEY_CLASS = "map-key-class";
- String MAP_KEY_COLUMN = "map-key-column";
- String MAP_KEY_CONVERT = "map-key-convert";
- String MAP_KEY_ENUMERATED = "map-key-enumerated";
- String MAP_KEY_JOIN_COLUMN = "map-key-join-column";
- String MAPS_ID = "maps-id";
- String NAMED_QUERY__LOCK_MODE = "lock-mode";
- String ORDER_COLUMN = "order-column";
- String ORPHAN_REMOVAL = "orphan-removal";
- String TARGET_CLASS = "target-class";
- String MAP_KEY_TEMPORAL = "map-key-temporal";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/LockModeType_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/LockModeType_2_0.java
deleted file mode 100644
index 2b3de360f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/LockModeType_2_0.java
+++ /dev/null
@@ -1,397 +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.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>Lock Mode Type 20</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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getLockModeType_2_0()
- * @model
- * @generated
- */
-public enum LockModeType_2_0 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>READ</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #READ_VALUE
- * @generated
- * @ordered
- */
- READ(1, "READ", "READ"),
-
- /**
- * The '<em><b>WRITE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #WRITE_VALUE
- * @generated
- * @ordered
- */
- WRITE(2, "WRITE", "WRITE"),
-
- /**
- * The '<em><b>OPTIMISTIC</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OPTIMISTIC_VALUE
- * @generated
- * @ordered
- */
- OPTIMISTIC(3, "OPTIMISTIC", "OPTIMISTIC"),
-
- /**
- * The '<em><b>OPTIMISTIC FORCE INCREMENT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OPTIMISTIC_FORCE_INCREMENT_VALUE
- * @generated
- * @ordered
- */
- OPTIMISTIC_FORCE_INCREMENT(4, "OPTIMISTIC_FORCE_INCREMENT", "OPTIMISTIC_FORCE_INCREMENT"),
-
- /**
- * The '<em><b>PESSIMISTIC READ</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_READ_VALUE
- * @generated
- * @ordered
- */
- PESSIMISTIC_READ(5, "PESSIMISTIC_READ", "PESSIMISTIC_READ"),
-
- /**
- * The '<em><b>PESSIMISTIC WRITE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_WRITE_VALUE
- * @generated
- * @ordered
- */
- PESSIMISTIC_WRITE(6, "PESSIMISTIC_WRITE", "PESSIMISTIC_WRITE"),
-
- /**
- * The '<em><b>PESSIMISTIC FORCE INCREMENT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_FORCE_INCREMENT_VALUE
- * @generated
- * @ordered
- */
- PESSIMISTIC_FORCE_INCREMENT(7, "PESSIMISTIC_FORCE_INCREMENT", "PESSIMISTIC_FORCE_INCREMENT");
-
- /**
- * 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>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 = 1;
-
- /**
- * The '<em><b>WRITE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>WRITE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #WRITE
- * @model
- * @generated
- * @ordered
- */
- public static final int WRITE_VALUE = 2;
-
- /**
- * The '<em><b>OPTIMISTIC</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OPTIMISTIC</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OPTIMISTIC
- * @model
- * @generated
- * @ordered
- */
- public static final int OPTIMISTIC_VALUE = 3;
-
- /**
- * The '<em><b>OPTIMISTIC FORCE INCREMENT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OPTIMISTIC FORCE INCREMENT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OPTIMISTIC_FORCE_INCREMENT
- * @model
- * @generated
- * @ordered
- */
- public static final int OPTIMISTIC_FORCE_INCREMENT_VALUE = 4;
-
- /**
- * The '<em><b>PESSIMISTIC READ</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PESSIMISTIC READ</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_READ
- * @model
- * @generated
- * @ordered
- */
- public static final int PESSIMISTIC_READ_VALUE = 5;
-
- /**
- * The '<em><b>PESSIMISTIC WRITE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PESSIMISTIC WRITE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_WRITE
- * @model
- * @generated
- * @ordered
- */
- public static final int PESSIMISTIC_WRITE_VALUE = 6;
-
- /**
- * The '<em><b>PESSIMISTIC FORCE INCREMENT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PESSIMISTIC FORCE INCREMENT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PESSIMISTIC_FORCE_INCREMENT
- * @model
- * @generated
- * @ordered
- */
- public static final int PESSIMISTIC_FORCE_INCREMENT_VALUE = 7;
-
- /**
- * An array of all the '<em><b>Lock Mode Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final LockModeType_2_0[] VALUES_ARRAY =
- new LockModeType_2_0[]
- {
- NONE,
- READ,
- WRITE,
- OPTIMISTIC,
- OPTIMISTIC_FORCE_INCREMENT,
- PESSIMISTIC_READ,
- PESSIMISTIC_WRITE,
- PESSIMISTIC_FORCE_INCREMENT,
- };
-
- /**
- * A public read-only list of all the '<em><b>Lock Mode Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<LockModeType_2_0> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Lock Mode Type 20</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static LockModeType_2_0 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- LockModeType_2_0 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Lock Mode Type 20</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static LockModeType_2_0 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- LockModeType_2_0 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Lock Mode Type 20</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static LockModeType_2_0 get(int value)
- {
- switch (value)
- {
- case NONE_VALUE: return NONE;
- case READ_VALUE: return READ;
- case WRITE_VALUE: return WRITE;
- case OPTIMISTIC_VALUE: return OPTIMISTIC;
- case OPTIMISTIC_FORCE_INCREMENT_VALUE: return OPTIMISTIC_FORCE_INCREMENT;
- case PESSIMISTIC_READ_VALUE: return PESSIMISTIC_READ;
- case PESSIMISTIC_WRITE_VALUE: return PESSIMISTIC_WRITE;
- case PESSIMISTIC_FORCE_INCREMENT_VALUE: return PESSIMISTIC_FORCE_INCREMENT;
- }
- 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 LockModeType_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;
- }
-
-} //LockModeType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Factory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Factory.java
deleted file mode 100644
index 14b69cdd4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_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.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.core.resource.orm.v2_0.OrmV2_0Package
- * @generated
- */
-public class OrmV2_0Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmV2_0Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrmV2_0Factory init()
- {
- try
- {
- OrmV2_0Factory theOrmV2_0Factory = (OrmV2_0Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.orm.v2_0.xmi");
- if (theOrmV2_0Factory != null)
- {
- return theOrmV2_0Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new OrmV2_0Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmV2_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 OrmV2_0Package.LOCK_MODE_TYPE_20:
- return createLockModeType_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 OrmV2_0Package.LOCK_MODE_TYPE_20:
- return convertLockModeType_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 LockModeType_2_0 createLockModeType_2_0FromString(EDataType eDataType, String initialValue)
- {
- LockModeType_2_0 result = LockModeType_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 convertLockModeType_2_0ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrmV2_0Package getOrmV2_0Package()
- {
- return (OrmV2_0Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static OrmV2_0Package getPackage()
- {
- return OrmV2_0Package.eINSTANCE;
- }
-
-} //OrmV2_0Factory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Package.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Package.java
deleted file mode 100644
index 887d05594d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/OrmV2_0Package.java
+++ /dev/null
@@ -1,3810 +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.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.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-
-/**
- * <!-- 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.core.resource.orm.v2_0.OrmV2_0Factory
- * @model kind="package"
- * @generated
- */
-public class OrmV2_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.orm.v2_0.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.orm.v2_0";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final OrmV2_0Package eINSTANCE = org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0 <em>Xml Attribute Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeMapping_2_0()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING_20 = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0 <em>Xml Association Override 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAssociationOverride_2_0()
- * @generated
- */
- public static final int XML_ASSOCIATION_OVERRIDE_20 = 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_20__DESCRIPTION = 0;
-
- /**
- * 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_ASSOCIATION_OVERRIDE_20__JOIN_TABLE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Association Override 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ASSOCIATION_OVERRIDE_20_FEATURE_COUNT = 2;
-
- /**
- * 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_20__ACCESS = OrmPackage.XML_ACCESS_HOLDER__ACCESS;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING_20_FEATURE_COUNT = OrmPackage.XML_ACCESS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0 <em>Xml Attribute Override 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeOverride_2_0()
- * @generated
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_20 = 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_ATTRIBUTE_OVERRIDE_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Attribute Override 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_OVERRIDE_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0 <em>Xml Attributes 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributes_2_0()
- * @generated
- */
- public static final int XML_ATTRIBUTES_20 = 3;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_20__DESCRIPTION = 0;
-
- /**
- * 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 XML_ATTRIBUTES_20__ELEMENT_COLLECTIONS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Attributes 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_20_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0 <em>Xml Collection Table 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCollectionTable_2_0()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE_20 = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0 <em>Xml Derived Id 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlDerivedId_2_0()
- * @generated
- */
- public static final int XML_DERIVED_ID_20 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_20 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0 <em>Xml Embedded 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEmbedded_2_0()
- * @generated
- */
- public static final int XML_EMBEDDED_20 = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0 <em>Xml Cacheable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCacheable_2_0()
- * @generated
- */
- public static final int XML_CACHEABLE_20 = 4;
-
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHEABLE_20__CACHEABLE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cacheable 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHEABLE_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0 <em>Xml Cascade Type 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCascadeType_2_0()
- * @generated
- */
- public static final int XML_CASCADE_TYPE_20 = 5;
-
- /**
- * The feature id for the '<em><b>Cascade Detach</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CASCADE_TYPE_20__CASCADE_DETACH = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cascade Type 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CASCADE_TYPE_20_FEATURE_COUNT = 1;
-
- /**
- * 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_20__JOIN_COLUMNS = OrmPackage.XML_REFERENCE_TABLE__JOIN_COLUMNS;
-
- /**
- * The number of structural features of the '<em>Xml Collection Table 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_20_FEATURE_COUNT = OrmPackage.XML_REFERENCE_TABLE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DERIVED_ID_20__ID = 0;
-
- /**
- * The number of structural features of the '<em>Xml Derived Id 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_DERIVED_ID_20_FEATURE_COUNT = 1;
-
- /**
- * 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 = 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_ELEMENT_COLLECTION_20__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_ELEMENT_COLLECTION_20__ENUMERATED = OrmPackage.XML_CONVERTIBLE_MAPPING__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_20__ORDER_COLUMN = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * 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_20__ORDER_BY = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * 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_20__ATTRIBUTE_OVERRIDES = OrmPackage.XML_CONVERTIBLE_MAPPING_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_ELEMENT_COLLECTION_20__ASSOCIATION_OVERRIDES = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * 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_20__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 4;
-
- /**
- * 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_20__TARGET_CLASS = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 5;
-
- /**
- * 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_20__FETCH = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 6;
-
- /**
- * 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_20__MAP_KEY = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 7;
-
- /**
- * 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_20__MAP_KEY_CLASS = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * 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_20__MAP_KEY_TEMPORAL = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * 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_20__MAP_KEY_ENUMERATED = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * 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_20__MAP_KEY_COLUMN = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 11;
-
- /**
- * 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_20__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 12;
-
- /**
- * 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_20__COLUMN = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 13;
-
- /**
- * 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_20__COLLECTION_TABLE = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 14;
-
- /**
- * 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 = OrmPackage.XML_CONVERTIBLE_MAPPING_FEATURE_COUNT + 15;
-
- /**
- * 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_20__ASSOCIATION_OVERRIDES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
-
- /**
- * The number of structural features of the '<em>Xml Embedded 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_20_FEATURE_COUNT = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final int XML_ENTITY_20 = 10;
-
- /**
- * 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_20__CACHEABLE = XML_CACHEABLE_20__CACHEABLE;
-
- /**
- * 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 = XML_CACHEABLE_20_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0 <em>Xml Entity Listener 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntityListener_2_0()
- * @generated
- */
- public static final int XML_ENTITY_LISTENER_20 = 11;
-
- /**
- * 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_LISTENER_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Entity Listener 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_LISTENER_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0 <em>Xml Event Method 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEventMethod_2_0()
- * @generated
- */
- public static final int XML_EVENT_METHOD_20 = 12;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EVENT_METHOD_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Event Method 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EVENT_METHOD_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0 <em>Xml Generator 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlGenerator_2_0()
- * @generated
- */
- public static final int XML_GENERATOR_20 = 13;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Generator 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_GENERATOR_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0 <em>Xml Orderable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderable_2_0()
- * @generated
- */
- public static final int XML_ORDERABLE_20 = 21;
-
- /**
- * 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_ORDERABLE_20__ORDER_COLUMN = 0;
-
- /**
- * The number of structural features of the '<em>Xml Orderable 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDERABLE_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0 <em>Xml Multi Relationship Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING_20 = 17;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__ORDER_COLUMN = XML_ORDERABLE_20__ORDER_COLUMN;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ATTRIBUTE_OVERRIDES = XML_ORDERABLE_20_FEATURE_COUNT + 0;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS = XML_ORDERABLE_20_FEATURE_COUNT + 1;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_TEMPORAL = XML_ORDERABLE_20_FEATURE_COUNT + 2;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED = XML_ORDERABLE_20_FEATURE_COUNT + 3;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_COLUMN = XML_ORDERABLE_20_FEATURE_COUNT + 4;
-
- /**
- * 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_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_COLUMNS = XML_ORDERABLE_20_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Multi Relationship Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING_20_FEATURE_COUNT = XML_ORDERABLE_20_FEATURE_COUNT + 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlManyToMany_2_0()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_20 = 14;
-
- /**
- * 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_20__ORDER_COLUMN = XML_MULTI_RELATIONSHIP_MAPPING_20__ORDER_COLUMN;
-
- /**
- * 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_20__MAP_KEY_ATTRIBUTE_OVERRIDES = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ATTRIBUTE_OVERRIDES;
-
- /**
- * 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_20__MAP_KEY_CLASS = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS;
-
- /**
- * 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_20__MAP_KEY_TEMPORAL = XML_MULTI_RELATIONSHIP_MAPPING_20__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_20__MAP_KEY_ENUMERATED = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED;
-
- /**
- * 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_20__MAP_KEY_COLUMN = XML_MULTI_RELATIONSHIP_MAPPING_20__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_20__MAP_KEY_JOIN_COLUMNS = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_COLUMNS;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0 <em>Xml Map Key Attribute Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyAttributeOverrideContainer_2_0()
- * @generated
- */
- public static final int XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20 = 15;
-
- /**
- * 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_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Map Key Attribute Override Container 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0 <em>Xml Maps Id 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapsId_2_0()
- * @generated
- */
- public static final int XML_MAPS_ID_20 = 16;
-
- /**
- * 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_MAPS_ID_20__MAPS_ID = 0;
-
- /**
- * The number of structural features of the '<em>Xml Maps Id 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPS_ID_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0 <em>Xml Named Query 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlNamedQuery_2_0()
- * @generated
- */
- public static final int XML_NAMED_QUERY_20 = 18;
-
- /**
- * The feature id for the '<em><b>Lock Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY_20__LOCK_MODE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Query 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_QUERY_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0 <em>Xml Orphan Removable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrphanRemovable_2_0()
- * @generated
- */
- public static final int XML_ORPHAN_REMOVABLE_20 = 23;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOneToMany_2_0()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_20 = 19;
-
- /**
- * 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_20__ORDER_COLUMN = XML_MULTI_RELATIONSHIP_MAPPING_20__ORDER_COLUMN;
-
- /**
- * 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_20__MAP_KEY_ATTRIBUTE_OVERRIDES = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ATTRIBUTE_OVERRIDES;
-
- /**
- * 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_20__MAP_KEY_CLASS = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS;
-
- /**
- * 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_20__MAP_KEY_TEMPORAL = XML_MULTI_RELATIONSHIP_MAPPING_20__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_20__MAP_KEY_ENUMERATED = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED;
-
- /**
- * 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_20__MAP_KEY_COLUMN = XML_MULTI_RELATIONSHIP_MAPPING_20__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_20__MAP_KEY_JOIN_COLUMNS = XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_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_MANY_20__ORPHAN_REMOVAL = XML_MULTI_RELATIONSHIP_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * 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 = XML_MULTI_RELATIONSHIP_MAPPING_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0 <em>Xml Single Relationship Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSingleRelationshipMapping_2_0()
- * @generated
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING_20 = 29;
-
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING_20__ID = XML_DERIVED_ID_20__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_SINGLE_RELATIONSHIP_MAPPING_20__MAPS_ID = XML_DERIVED_ID_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Single Relationship Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SINGLE_RELATIONSHIP_MAPPING_20_FEATURE_COUNT = XML_DERIVED_ID_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToOne_2_0 <em>Xml One To One 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToOne_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOneToOne_2_0()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_20 = 20;
-
- /**
- * 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_20__ID = XML_SINGLE_RELATIONSHIP_MAPPING_20__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_20__MAPS_ID = XML_SINGLE_RELATIONSHIP_MAPPING_20__MAPS_ID;
-
- /**
- * 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_20__ORPHAN_REMOVAL = XML_SINGLE_RELATIONSHIP_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml One To One 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_20_FEATURE_COUNT = XML_SINGLE_RELATIONSHIP_MAPPING_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderColumn_2_0()
- * @generated
- */
- public static final int XML_ORDER_COLUMN_20 = 22;
-
- /**
- * 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_20__NULLABLE = 0;
-
- /**
- * 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_20__INSERTABLE = 1;
-
- /**
- * 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_20__UPDATABLE = 2;
-
- /**
- * 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 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0 <em>Xml Persistence Unit Defaults 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitDefaults_2_0()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_20 = 24;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0 <em>Xml Persistence Unit Metadata 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitMetadata_2_0()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA_20 = 25;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0 <em>Xml Query 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQuery_2_0()
- * @generated
- */
- public static final int XML_QUERY_20 = 26;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0 <em>Xml Query Hint 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQueryHint_2_0()
- * @generated
- */
- public static final int XML_QUERY_HINT_20 = 27;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0 <em>Xml Sequence Generator 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSequenceGenerator_2_0()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR_20 = 28;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0 <em>Xml Sql Result Set Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSqlResultSetMapping_2_0()
- * @generated
- */
- public static final int XML_SQL_RESULT_SET_MAPPING_20 = 30;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0 <em>Xml Unique Constraint 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlUniqueConstraint_2_0()
- * @generated
- */
- public static final int XML_UNIQUE_CONSTRAINT_20 = 31;
-
- /**
- * 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_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL = 0;
-
- /**
- * The number of structural features of the '<em>Xml Orphan Removable 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORPHAN_REMOVABLE_20_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_PERSISTENCE_UNIT_DEFAULTS_20__DESCRIPTION = 0;
-
- /**
- * 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_20__DELIMITED_IDENTIFIERS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_20_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_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Metadata 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA_20_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_QUERY_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Query 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_20_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_QUERY_HINT_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Query Hint 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_HINT_20_FEATURE_COUNT = 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_SEQUENCE_GENERATOR_20__CATALOG = 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_SEQUENCE_GENERATOR_20__SCHEMA = 1;
-
- /**
- * The number of structural features of the '<em>Xml Sequence Generator 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SEQUENCE_GENERATOR_20_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_SQL_RESULT_SET_MAPPING_20__DESCRIPTION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Sql Result Set Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SQL_RESULT_SET_MAPPING_20_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_UNIQUE_CONSTRAINT_20__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Unique Constraint 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNIQUE_CONSTRAINT_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 <em>Lock Mode Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getLockModeType_2_0()
- * @generated
- */
- public static final int LOCK_MODE_TYPE_20 = 32;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAssociationOverride_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeOverride_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributes_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTable_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlDerivedId_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 xmlEmbedded_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 xmlEntityListener_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEventMethod_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlGenerator_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 xmlMapKeyAttributeOverrideContainer_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMapsId_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultiRelationshipMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedQuery_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 xmlOneToOne_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 xmlPersistenceUnitDefaults_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitMetadata_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQuery_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryHint_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSequenceGenerator_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSingleRelationshipMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSqlResultSetMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUniqueConstraint_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheable_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCascadeType_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrphanRemovable_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderable_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum lockModeType_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.core.resource.orm.v2_0.OrmV2_0Package#eNS_URI
- * @see #init()
- * @generated
- */
- private OrmV2_0Package()
- {
- super(eNS_URI, OrmV2_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 OrmV2_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 OrmV2_0Package init()
- {
- if (isInited) return (OrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI);
-
- // Obtain or create and register package
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof OrmV2_0Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new OrmV2_0Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- CommonPackage theCommonPackage = (CommonPackage)(EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) instanceof CommonPackage ? EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) : CommonPackage.eINSTANCE);
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE);
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE);
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) instanceof PersistenceV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) : PersistenceV2_0Package.eINSTANCE);
-
- // Create package meta-data objects
- theOrmV2_0Package.createPackageContents();
- theCommonPackage.createPackageContents();
- theOrmPackage.createPackageContents();
- thePersistencePackage.createPackageContents();
- thePersistenceV2_0Package.createPackageContents();
-
- // Initialize created meta-data
- theOrmV2_0Package.initializePackageContents();
- theCommonPackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
- thePersistencePackage.initializePackageContents();
- thePersistenceV2_0Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theOrmV2_0Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(OrmV2_0Package.eNS_URI, theOrmV2_0Package);
- return theOrmV2_0Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0 <em>Xml Attribute Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Mapping 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0
- * @generated
- */
- public EClass getXmlAttributeMapping_2_0()
- {
- return xmlAttributeMapping_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0 <em>Xml Association Override 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Association Override 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0
- * @generated
- */
- public EClass getXmlAssociationOverride_2_0()
- {
- return xmlAssociationOverride_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getDescription()
- * @see #getXmlAssociationOverride_2_0()
- * @generated
- */
- public EAttribute getXmlAssociationOverride_2_0_Description()
- {
- return (EAttribute)xmlAssociationOverride_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getJoinTable <em>Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Join Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getJoinTable()
- * @see #getXmlAssociationOverride_2_0()
- * @generated
- */
- public EReference getXmlAssociationOverride_2_0_JoinTable()
- {
- return (EReference)xmlAssociationOverride_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0 <em>Xml Attribute Override 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Override 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0
- * @generated
- */
- public EClass getXmlAttributeOverride_2_0()
- {
- return xmlAttributeOverride_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0#getDescription()
- * @see #getXmlAttributeOverride_2_0()
- * @generated
- */
- public EAttribute getXmlAttributeOverride_2_0_Description()
- {
- return (EAttribute)xmlAttributeOverride_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0 <em>Xml Attributes 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attributes 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0
- * @generated
- */
- public EClass getXmlAttributes_2_0()
- {
- return xmlAttributes_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getDescription()
- * @see #getXmlAttributes_2_0()
- * @generated
- */
- public EAttribute getXmlAttributes_2_0_Description()
- {
- return (EAttribute)xmlAttributes_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getElementCollections <em>Element Collections</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Element Collections</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getElementCollections()
- * @see #getXmlAttributes_2_0()
- * @generated
- */
- public EReference getXmlAttributes_2_0_ElementCollections()
- {
- return (EReference)xmlAttributes_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0 <em>Xml Collection Table 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Table 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0
- * @generated
- */
- public EClass getXmlCollectionTable_2_0()
- {
- return xmlCollectionTable_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0 <em>Xml Derived Id 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Derived Id 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0
- * @generated
- */
- public EClass getXmlDerivedId_2_0()
- {
- return xmlDerivedId_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0#getId <em>Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Id</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0#getId()
- * @see #getXmlDerivedId_2_0()
- * @generated
- */
- public EAttribute getXmlDerivedId_2_0_Id()
- {
- return (EAttribute)xmlDerivedId_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @generated
- */
- public EClass getXmlElementCollection_2_0()
- {
- return xmlElementCollection_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getTargetClass <em>Target Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Target Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getTargetClass()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_0_TargetClass()
- {
- return (EAttribute)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getFetch <em>Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Fetch</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getFetch()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_0_Fetch()
- {
- return (EAttribute)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKey <em>Map Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKey()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_MapKey()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyClass <em>Map Key Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyClass()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_MapKeyClass()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyTemporal()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_0_MapKeyTemporal()
- {
- return (EAttribute)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Enumerated</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyEnumerated()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_0_MapKeyEnumerated()
- {
- return (EAttribute)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyColumn <em>Map Key Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyColumn()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_MapKeyColumn()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyJoinColumns <em>Map Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Map Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyJoinColumns()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_MapKeyJoinColumns()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getColumn <em>Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getColumn()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_Column()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getCollectionTable <em>Collection Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Collection Table</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getCollectionTable()
- * @see #getXmlElementCollection_2_0()
- * @generated
- */
- public EReference getXmlElementCollection_2_0_CollectionTable()
- {
- return (EReference)xmlElementCollection_2_0EClass.getEStructuralFeatures().get(9);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0 <em>Xml Embedded 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0
- * @generated
- */
- public EClass getXmlEmbedded_2_0()
- {
- return xmlEmbedded_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlEntity_2_0
- * @generated
- */
- public EClass getXmlEntity_2_0()
- {
- return xmlEntity_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0 <em>Xml Entity Listener 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Listener 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0
- * @generated
- */
- public EClass getXmlEntityListener_2_0()
- {
- return xmlEntityListener_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0#getDescription()
- * @see #getXmlEntityListener_2_0()
- * @generated
- */
- public EAttribute getXmlEntityListener_2_0_Description()
- {
- return (EAttribute)xmlEntityListener_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0 <em>Xml Event Method 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Event Method 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0
- * @generated
- */
- public EClass getXmlEventMethod_2_0()
- {
- return xmlEventMethod_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0#getDescription()
- * @see #getXmlEventMethod_2_0()
- * @generated
- */
- public EAttribute getXmlEventMethod_2_0_Description()
- {
- return (EAttribute)xmlEventMethod_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0 <em>Xml Generator 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Generator 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0
- * @generated
- */
- public EClass getXmlGenerator_2_0()
- {
- return xmlGenerator_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0#getDescription()
- * @see #getXmlGenerator_2_0()
- * @generated
- */
- public EAttribute getXmlGenerator_2_0_Description()
- {
- return (EAttribute)xmlGenerator_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.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.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0 <em>Xml Map Key Attribute Override Container 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Map Key Attribute Override Container 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0
- * @generated
- */
- public EClass getXmlMapKeyAttributeOverrideContainer_2_0()
- {
- return xmlMapKeyAttributeOverrideContainer_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0#getMapKeyAttributeOverrides <em>Map Key Attribute Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Map Key Attribute Overrides</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0#getMapKeyAttributeOverrides()
- * @see #getXmlMapKeyAttributeOverrideContainer_2_0()
- * @generated
- */
- public EReference getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides()
- {
- return (EReference)xmlMapKeyAttributeOverrideContainer_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0 <em>Xml Maps Id 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Maps Id 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0
- * @generated
- */
- public EClass getXmlMapsId_2_0()
- {
- return xmlMapsId_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0#getMapsId <em>Maps Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Maps Id</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0#getMapsId()
- * @see #getXmlMapsId_2_0()
- * @generated
- */
- public EAttribute getXmlMapsId_2_0_MapsId()
- {
- return (EAttribute)xmlMapsId_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0 <em>Xml Multi Relationship Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multi Relationship Mapping 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0
- * @generated
- */
- public EClass getXmlMultiRelationshipMapping_2_0()
- {
- return xmlMultiRelationshipMapping_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyClass <em>Map Key Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key Class</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyClass()
- * @see #getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public EReference getXmlMultiRelationshipMapping_2_0_MapKeyClass()
- {
- return (EReference)xmlMultiRelationshipMapping_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Temporal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyTemporal()
- * @see #getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_2_0_MapKeyTemporal()
- {
- return (EAttribute)xmlMultiRelationshipMapping_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Enumerated</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyEnumerated()
- * @see #getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public EAttribute getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated()
- {
- return (EAttribute)xmlMultiRelationshipMapping_2_0EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyColumn <em>Map Key Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Map Key Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyColumn()
- * @see #getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public EReference getXmlMultiRelationshipMapping_2_0_MapKeyColumn()
- {
- return (EReference)xmlMultiRelationshipMapping_2_0EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyJoinColumns <em>Map Key Join Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Map Key Join Columns</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyJoinColumns()
- * @see #getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public EReference getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns()
- {
- return (EReference)xmlMultiRelationshipMapping_2_0EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0 <em>Xml Named Query 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Query 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0
- * @generated
- */
- public EClass getXmlNamedQuery_2_0()
- {
- return xmlNamedQuery_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0#getLockMode <em>Lock Mode</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Lock Mode</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0#getLockMode()
- * @see #getXmlNamedQuery_2_0()
- * @generated
- */
- public EAttribute getXmlNamedQuery_2_0_LockMode()
- {
- return (EAttribute)xmlNamedQuery_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.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.core.resource.orm.v2_0.XmlOneToOne_2_0 <em>Xml One To One 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToOne_2_0
- * @generated
- */
- public EClass getXmlOneToOne_2_0()
- {
- return xmlOneToOne_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.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.core.resource.orm.v2_0.XmlOrderColumn_2_0#getNullable <em>Nullable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Nullable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getNullable()
- * @see #getXmlOrderColumn_2_0()
- * @generated
- */
- public EAttribute getXmlOrderColumn_2_0_Nullable()
- {
- return (EAttribute)xmlOrderColumn_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getInsertable <em>Insertable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Insertable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getInsertable()
- * @see #getXmlOrderColumn_2_0()
- * @generated
- */
- public EAttribute getXmlOrderColumn_2_0_Insertable()
- {
- return (EAttribute)xmlOrderColumn_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getUpdatable <em>Updatable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Updatable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getUpdatable()
- * @see #getXmlOrderColumn_2_0()
- * @generated
- */
- public EAttribute getXmlOrderColumn_2_0_Updatable()
- {
- return (EAttribute)xmlOrderColumn_2_0EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0 <em>Xml Persistence Unit Defaults 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults_2_0()
- {
- return xmlPersistenceUnitDefaults_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#getDescription()
- * @see #getXmlPersistenceUnitDefaults_2_0()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_2_0_Description()
- {
- return (EAttribute)xmlPersistenceUnitDefaults_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#isDelimitedIdentifiers <em>Delimited Identifiers</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delimited Identifiers</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#isDelimitedIdentifiers()
- * @see #getXmlPersistenceUnitDefaults_2_0()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers()
- {
- return (EAttribute)xmlPersistenceUnitDefaults_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0 <em>Xml Persistence Unit Metadata 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Metadata 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata_2_0()
- {
- return xmlPersistenceUnitMetadata_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0#getDescription()
- * @see #getXmlPersistenceUnitMetadata_2_0()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitMetadata_2_0_Description()
- {
- return (EAttribute)xmlPersistenceUnitMetadata_2_0EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0 <em>Xml Query 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0
- * @generated
- */
- public EClass getXmlQuery_2_0()
- {
- return xmlQuery_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0#getDescription()
- * @see #getXmlQuery_2_0()
- * @generated
- */
- public EAttribute getXmlQuery_2_0_Description()
- {
- return (EAttribute)xmlQuery_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0 <em>Xml Query Hint 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Hint 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0
- * @generated
- */
- public EClass getXmlQueryHint_2_0()
- {
- return xmlQueryHint_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0#getDescription()
- * @see #getXmlQueryHint_2_0()
- * @generated
- */
- public EAttribute getXmlQueryHint_2_0_Description()
- {
- return (EAttribute)xmlQueryHint_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0 <em>Xml Sequence Generator 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sequence Generator 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0
- * @generated
- */
- public EClass getXmlSequenceGenerator_2_0()
- {
- return xmlSequenceGenerator_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getCatalog()
- * @see #getXmlSequenceGenerator_2_0()
- * @generated
- */
- public EAttribute getXmlSequenceGenerator_2_0_Catalog()
- {
- return (EAttribute)xmlSequenceGenerator_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getSchema()
- * @see #getXmlSequenceGenerator_2_0()
- * @generated
- */
- public EAttribute getXmlSequenceGenerator_2_0_Schema()
- {
- return (EAttribute)xmlSequenceGenerator_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0 <em>Xml Single Relationship Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Single Relationship Mapping 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0
- * @generated
- */
- public EClass getXmlSingleRelationshipMapping_2_0()
- {
- return xmlSingleRelationshipMapping_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0 <em>Xml Sql Result Set Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Sql Result Set Mapping 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0
- * @generated
- */
- public EClass getXmlSqlResultSetMapping_2_0()
- {
- return xmlSqlResultSetMapping_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0#getDescription()
- * @see #getXmlSqlResultSetMapping_2_0()
- * @generated
- */
- public EAttribute getXmlSqlResultSetMapping_2_0_Description()
- {
- return (EAttribute)xmlSqlResultSetMapping_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0 <em>Xml Unique Constraint 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Unique Constraint 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0
- * @generated
- */
- public EClass getXmlUniqueConstraint_2_0()
- {
- return xmlUniqueConstraint_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0#getName()
- * @see #getXmlUniqueConstraint_2_0()
- * @generated
- */
- public EAttribute getXmlUniqueConstraint_2_0_Name()
- {
- return (EAttribute)xmlUniqueConstraint_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0 <em>Xml Cacheable 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cacheable 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0
- * @generated
- */
- public EClass getXmlCacheable_2_0()
- {
- return xmlCacheable_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0#getCacheable <em>Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cacheable</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0#getCacheable()
- * @see #getXmlCacheable_2_0()
- * @generated
- */
- public EAttribute getXmlCacheable_2_0_Cacheable()
- {
- return (EAttribute)xmlCacheable_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0 <em>Xml Cascade Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cascade Type 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0
- * @generated
- */
- public EClass getXmlCascadeType_2_0()
- {
- return xmlCascadeType_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0#isCascadeDetach <em>Cascade Detach</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade Detach</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0#isCascadeDetach()
- * @see #getXmlCascadeType_2_0()
- * @generated
- */
- public EAttribute getXmlCascadeType_2_0_CascadeDetach()
- {
- return (EAttribute)xmlCascadeType_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0 <em>Xml Orphan Removable 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Orphan Removable 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0
- * @generated
- */
- public EClass getXmlOrphanRemovable_2_0()
- {
- return xmlOrphanRemovable_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0#getOrphanRemoval <em>Orphan Removal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Orphan Removal</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0#getOrphanRemoval()
- * @see #getXmlOrphanRemovable_2_0()
- * @generated
- */
- public EAttribute getXmlOrphanRemovable_2_0_OrphanRemoval()
- {
- return (EAttribute)xmlOrphanRemovable_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0 <em>Xml Orderable 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Orderable 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0
- * @generated
- */
- public EClass getXmlOrderable_2_0()
- {
- return xmlOrderable_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0#getOrderColumn <em>Order Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Order Column</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0#getOrderColumn()
- * @see #getXmlOrderable_2_0()
- * @generated
- */
- public EReference getXmlOrderable_2_0_OrderColumn()
- {
- return (EReference)xmlOrderable_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 <em>Lock Mode Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Lock Mode Type 20</em>'.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @generated
- */
- public EEnum getLockModeType_2_0()
- {
- return lockModeType_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 OrmV2_0Factory getOrmV2_0Factory()
- {
- return (OrmV2_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
- xmlAssociationOverride_2_0EClass = createEClass(XML_ASSOCIATION_OVERRIDE_20);
- createEAttribute(xmlAssociationOverride_2_0EClass, XML_ASSOCIATION_OVERRIDE_20__DESCRIPTION);
- createEReference(xmlAssociationOverride_2_0EClass, XML_ASSOCIATION_OVERRIDE_20__JOIN_TABLE);
-
- xmlAttributeMapping_2_0EClass = createEClass(XML_ATTRIBUTE_MAPPING_20);
-
- xmlAttributeOverride_2_0EClass = createEClass(XML_ATTRIBUTE_OVERRIDE_20);
- createEAttribute(xmlAttributeOverride_2_0EClass, XML_ATTRIBUTE_OVERRIDE_20__DESCRIPTION);
-
- xmlAttributes_2_0EClass = createEClass(XML_ATTRIBUTES_20);
- createEAttribute(xmlAttributes_2_0EClass, XML_ATTRIBUTES_20__DESCRIPTION);
- createEReference(xmlAttributes_2_0EClass, XML_ATTRIBUTES_20__ELEMENT_COLLECTIONS);
-
- xmlCacheable_2_0EClass = createEClass(XML_CACHEABLE_20);
- createEAttribute(xmlCacheable_2_0EClass, XML_CACHEABLE_20__CACHEABLE);
-
- xmlCascadeType_2_0EClass = createEClass(XML_CASCADE_TYPE_20);
- createEAttribute(xmlCascadeType_2_0EClass, XML_CASCADE_TYPE_20__CASCADE_DETACH);
-
- xmlCollectionTable_2_0EClass = createEClass(XML_COLLECTION_TABLE_20);
-
- xmlDerivedId_2_0EClass = createEClass(XML_DERIVED_ID_20);
- createEAttribute(xmlDerivedId_2_0EClass, XML_DERIVED_ID_20__ID);
-
- xmlElementCollection_2_0EClass = createEClass(XML_ELEMENT_COLLECTION_20);
- createEAttribute(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__TARGET_CLASS);
- createEAttribute(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__FETCH);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY_CLASS);
- createEAttribute(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY_TEMPORAL);
- createEAttribute(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY_ENUMERATED);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY_COLUMN);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__MAP_KEY_JOIN_COLUMNS);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__COLUMN);
- createEReference(xmlElementCollection_2_0EClass, XML_ELEMENT_COLLECTION_20__COLLECTION_TABLE);
-
- xmlEmbedded_2_0EClass = createEClass(XML_EMBEDDED_20);
-
- xmlEntity_2_0EClass = createEClass(XML_ENTITY_20);
-
- xmlEntityListener_2_0EClass = createEClass(XML_ENTITY_LISTENER_20);
- createEAttribute(xmlEntityListener_2_0EClass, XML_ENTITY_LISTENER_20__DESCRIPTION);
-
- xmlEventMethod_2_0EClass = createEClass(XML_EVENT_METHOD_20);
- createEAttribute(xmlEventMethod_2_0EClass, XML_EVENT_METHOD_20__DESCRIPTION);
-
- xmlGenerator_2_0EClass = createEClass(XML_GENERATOR_20);
- createEAttribute(xmlGenerator_2_0EClass, XML_GENERATOR_20__DESCRIPTION);
-
- xmlManyToMany_2_0EClass = createEClass(XML_MANY_TO_MANY_20);
-
- xmlMapKeyAttributeOverrideContainer_2_0EClass = createEClass(XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20);
- createEReference(xmlMapKeyAttributeOverrideContainer_2_0EClass, XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES);
-
- xmlMapsId_2_0EClass = createEClass(XML_MAPS_ID_20);
- createEAttribute(xmlMapsId_2_0EClass, XML_MAPS_ID_20__MAPS_ID);
-
- xmlMultiRelationshipMapping_2_0EClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING_20);
- createEReference(xmlMultiRelationshipMapping_2_0EClass, XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS);
- createEAttribute(xmlMultiRelationshipMapping_2_0EClass, XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_TEMPORAL);
- createEAttribute(xmlMultiRelationshipMapping_2_0EClass, XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED);
- createEReference(xmlMultiRelationshipMapping_2_0EClass, XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_COLUMN);
- createEReference(xmlMultiRelationshipMapping_2_0EClass, XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_COLUMNS);
-
- xmlNamedQuery_2_0EClass = createEClass(XML_NAMED_QUERY_20);
- createEAttribute(xmlNamedQuery_2_0EClass, XML_NAMED_QUERY_20__LOCK_MODE);
-
- xmlOneToMany_2_0EClass = createEClass(XML_ONE_TO_MANY_20);
-
- xmlOneToOne_2_0EClass = createEClass(XML_ONE_TO_ONE_20);
-
- xmlOrderable_2_0EClass = createEClass(XML_ORDERABLE_20);
- createEReference(xmlOrderable_2_0EClass, XML_ORDERABLE_20__ORDER_COLUMN);
-
- xmlOrderColumn_2_0EClass = createEClass(XML_ORDER_COLUMN_20);
- createEAttribute(xmlOrderColumn_2_0EClass, XML_ORDER_COLUMN_20__NULLABLE);
- createEAttribute(xmlOrderColumn_2_0EClass, XML_ORDER_COLUMN_20__INSERTABLE);
- createEAttribute(xmlOrderColumn_2_0EClass, XML_ORDER_COLUMN_20__UPDATABLE);
-
- xmlOrphanRemovable_2_0EClass = createEClass(XML_ORPHAN_REMOVABLE_20);
- createEAttribute(xmlOrphanRemovable_2_0EClass, XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL);
-
- xmlPersistenceUnitDefaults_2_0EClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS_20);
- createEAttribute(xmlPersistenceUnitDefaults_2_0EClass, XML_PERSISTENCE_UNIT_DEFAULTS_20__DESCRIPTION);
- createEAttribute(xmlPersistenceUnitDefaults_2_0EClass, XML_PERSISTENCE_UNIT_DEFAULTS_20__DELIMITED_IDENTIFIERS);
-
- xmlPersistenceUnitMetadata_2_0EClass = createEClass(XML_PERSISTENCE_UNIT_METADATA_20);
- createEAttribute(xmlPersistenceUnitMetadata_2_0EClass, XML_PERSISTENCE_UNIT_METADATA_20__DESCRIPTION);
-
- xmlQuery_2_0EClass = createEClass(XML_QUERY_20);
- createEAttribute(xmlQuery_2_0EClass, XML_QUERY_20__DESCRIPTION);
-
- xmlQueryHint_2_0EClass = createEClass(XML_QUERY_HINT_20);
- createEAttribute(xmlQueryHint_2_0EClass, XML_QUERY_HINT_20__DESCRIPTION);
-
- xmlSequenceGenerator_2_0EClass = createEClass(XML_SEQUENCE_GENERATOR_20);
- createEAttribute(xmlSequenceGenerator_2_0EClass, XML_SEQUENCE_GENERATOR_20__CATALOG);
- createEAttribute(xmlSequenceGenerator_2_0EClass, XML_SEQUENCE_GENERATOR_20__SCHEMA);
-
- xmlSingleRelationshipMapping_2_0EClass = createEClass(XML_SINGLE_RELATIONSHIP_MAPPING_20);
-
- xmlSqlResultSetMapping_2_0EClass = createEClass(XML_SQL_RESULT_SET_MAPPING_20);
- createEAttribute(xmlSqlResultSetMapping_2_0EClass, XML_SQL_RESULT_SET_MAPPING_20__DESCRIPTION);
-
- xmlUniqueConstraint_2_0EClass = createEClass(XML_UNIQUE_CONSTRAINT_20);
- createEAttribute(xmlUniqueConstraint_2_0EClass, XML_UNIQUE_CONSTRAINT_20__NAME);
-
- // Create enums
- lockModeType_2_0EEnum = createEEnum(LOCK_MODE_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);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlAttributeMapping_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlAccessHolder());
- xmlCollectionTable_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlReferenceTable());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlConvertibleMapping());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlOrderable());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlAttributeOverrideContainer());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlElementCollection_2_0EClass.getESuperTypes().add(this.getXmlMapKeyAttributeOverrideContainer_2_0());
- xmlEmbedded_2_0EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlEntity_2_0EClass.getESuperTypes().add(this.getXmlCacheable_2_0());
- xmlManyToMany_2_0EClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping_2_0());
- xmlMultiRelationshipMapping_2_0EClass.getESuperTypes().add(this.getXmlOrderable_2_0());
- xmlMultiRelationshipMapping_2_0EClass.getESuperTypes().add(this.getXmlMapKeyAttributeOverrideContainer_2_0());
- xmlOneToMany_2_0EClass.getESuperTypes().add(this.getXmlMultiRelationshipMapping_2_0());
- xmlOneToMany_2_0EClass.getESuperTypes().add(this.getXmlOrphanRemovable_2_0());
- xmlOneToOne_2_0EClass.getESuperTypes().add(this.getXmlSingleRelationshipMapping_2_0());
- xmlOneToOne_2_0EClass.getESuperTypes().add(this.getXmlOrphanRemovable_2_0());
- xmlSingleRelationshipMapping_2_0EClass.getESuperTypes().add(this.getXmlDerivedId_2_0());
- xmlSingleRelationshipMapping_2_0EClass.getESuperTypes().add(this.getXmlMapsId_2_0());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlAssociationOverride_2_0EClass, XmlAssociationOverride_2_0.class, "XmlAssociationOverride_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAssociationOverride_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlAssociationOverride_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlAssociationOverride_2_0_JoinTable(), theOrmPackage.getXmlJoinTable(), null, "joinTable", null, 0, 1, XmlAssociationOverride_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributeMapping_2_0EClass, XmlAttributeMapping_2_0.class, "XmlAttributeMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAttributeOverride_2_0EClass, XmlAttributeOverride_2_0.class, "XmlAttributeOverride_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAttributeOverride_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlAttributeOverride_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributes_2_0EClass, XmlAttributes_2_0.class, "XmlAttributes_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAttributes_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlAttributes_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlAttributes_2_0_ElementCollections(), theOrmPackage.getXmlElementCollection(), null, "elementCollections", null, 0, -1, XmlAttributes_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheable_2_0EClass, XmlCacheable_2_0.class, "XmlCacheable_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCacheable_2_0_Cacheable(), theXMLTypePackage.getBooleanObject(), "cacheable", null, 0, 1, XmlCacheable_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCascadeType_2_0EClass, XmlCascadeType_2_0.class, "XmlCascadeType_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCascadeType_2_0_CascadeDetach(), theXMLTypePackage.getBoolean(), "cascadeDetach", null, 0, 1, XmlCascadeType_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCollectionTable_2_0EClass, XmlCollectionTable_2_0.class, "XmlCollectionTable_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlDerivedId_2_0EClass, XmlDerivedId_2_0.class, "XmlDerivedId_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlDerivedId_2_0_Id(), theXMLTypePackage.getBooleanObject(), "id", null, 0, 1, XmlDerivedId_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);
- initEAttribute(getXmlElementCollection_2_0_TargetClass(), theXMLTypePackage.getString(), "targetClass", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlElementCollection_2_0_Fetch(), theOrmPackage.getFetchType(), "fetch", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_MapKey(), theOrmPackage.getMapKey(), null, "mapKey", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_MapKeyClass(), theOrmPackage.getXmlClassReference(), null, "mapKeyClass", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlElementCollection_2_0_MapKeyTemporal(), theOrmPackage.getTemporalType(), "mapKeyTemporal", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlElementCollection_2_0_MapKeyEnumerated(), theOrmPackage.getEnumType(), "mapKeyEnumerated", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_MapKeyColumn(), theOrmPackage.getXmlColumn(), null, "mapKeyColumn", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_MapKeyJoinColumns(), theOrmPackage.getXmlJoinColumn(), null, "mapKeyJoinColumns", null, 0, -1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_Column(), theOrmPackage.getXmlColumn(), null, "column", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlElementCollection_2_0_CollectionTable(), theOrmPackage.getXmlCollectionTable(), null, "collectionTable", null, 0, 1, XmlElementCollection_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbedded_2_0EClass, XmlEmbedded_2_0.class, "XmlEmbedded_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);
-
- initEClass(xmlEntityListener_2_0EClass, XmlEntityListener_2_0.class, "XmlEntityListener_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEntityListener_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlEntityListener_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEventMethod_2_0EClass, XmlEventMethod_2_0.class, "XmlEventMethod_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlEventMethod_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlEventMethod_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlGenerator_2_0EClass, XmlGenerator_2_0.class, "XmlGenerator_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlGenerator_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlGenerator_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, 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(xmlMapKeyAttributeOverrideContainer_2_0EClass, XmlMapKeyAttributeOverrideContainer_2_0.class, "XmlMapKeyAttributeOverrideContainer_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides(), theOrmPackage.getXmlAttributeOverride(), null, "mapKeyAttributeOverrides", null, 0, -1, XmlMapKeyAttributeOverrideContainer_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMapsId_2_0EClass, XmlMapsId_2_0.class, "XmlMapsId_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMapsId_2_0_MapsId(), theXMLTypePackage.getString(), "mapsId", null, 0, 1, XmlMapsId_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultiRelationshipMapping_2_0EClass, XmlMultiRelationshipMapping_2_0.class, "XmlMultiRelationshipMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMultiRelationshipMapping_2_0_MapKeyClass(), theOrmPackage.getXmlClassReference(), null, "mapKeyClass", null, 0, 1, XmlMultiRelationshipMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMultiRelationshipMapping_2_0_MapKeyTemporal(), theOrmPackage.getTemporalType(), "mapKeyTemporal", null, 0, 1, XmlMultiRelationshipMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated(), theOrmPackage.getEnumType(), "mapKeyEnumerated", null, 0, 1, XmlMultiRelationshipMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultiRelationshipMapping_2_0_MapKeyColumn(), theOrmPackage.getXmlColumn(), null, "mapKeyColumn", null, 0, 1, XmlMultiRelationshipMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns(), theOrmPackage.getXmlJoinColumn(), null, "mapKeyJoinColumns", null, 0, -1, XmlMultiRelationshipMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedQuery_2_0EClass, XmlNamedQuery_2_0.class, "XmlNamedQuery_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedQuery_2_0_LockMode(), this.getLockModeType_2_0(), "lockMode", null, 0, 1, XmlNamedQuery_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, 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(xmlOneToOne_2_0EClass, XmlOneToOne_2_0.class, "XmlOneToOne_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOrderable_2_0EClass, XmlOrderable_2_0.class, "XmlOrderable_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlOrderable_2_0_OrderColumn(), theOrmPackage.getXmlOrderColumn(), null, "orderColumn", null, 0, 1, XmlOrderable_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrderColumn_2_0EClass, XmlOrderColumn_2_0.class, "XmlOrderColumn_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOrderColumn_2_0_Nullable(), theXMLTypePackage.getBooleanObject(), "nullable", null, 0, 1, XmlOrderColumn_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOrderColumn_2_0_Insertable(), theXMLTypePackage.getBooleanObject(), "insertable", null, 0, 1, XmlOrderColumn_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOrderColumn_2_0_Updatable(), theXMLTypePackage.getBooleanObject(), "updatable", null, 0, 1, XmlOrderColumn_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrphanRemovable_2_0EClass, XmlOrphanRemovable_2_0.class, "XmlOrphanRemovable_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOrphanRemovable_2_0_OrphanRemoval(), theXMLTypePackage.getBooleanObject(), "orphanRemoval", null, 0, 1, XmlOrphanRemovable_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitDefaults_2_0EClass, XmlPersistenceUnitDefaults_2_0.class, "XmlPersistenceUnitDefaults_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitDefaults_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlPersistenceUnitDefaults_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers(), theXMLTypePackage.getBoolean(), "delimitedIdentifiers", null, 0, 1, XmlPersistenceUnitDefaults_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitMetadata_2_0EClass, XmlPersistenceUnitMetadata_2_0.class, "XmlPersistenceUnitMetadata_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitMetadata_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlPersistenceUnitMetadata_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQuery_2_0EClass, XmlQuery_2_0.class, "XmlQuery_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQuery_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlQuery_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryHint_2_0EClass, XmlQueryHint_2_0.class, "XmlQueryHint_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQueryHint_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlQueryHint_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSequenceGenerator_2_0EClass, XmlSequenceGenerator_2_0.class, "XmlSequenceGenerator_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSequenceGenerator_2_0_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlSequenceGenerator_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlSequenceGenerator_2_0_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlSequenceGenerator_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSingleRelationshipMapping_2_0EClass, XmlSingleRelationshipMapping_2_0.class, "XmlSingleRelationshipMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlSqlResultSetMapping_2_0EClass, XmlSqlResultSetMapping_2_0.class, "XmlSqlResultSetMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSqlResultSetMapping_2_0_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlSqlResultSetMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlUniqueConstraint_2_0EClass, XmlUniqueConstraint_2_0.class, "XmlUniqueConstraint_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlUniqueConstraint_2_0_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlUniqueConstraint_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(lockModeType_2_0EEnum, LockModeType_2_0.class, "LockModeType_2_0");
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.NONE);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.READ);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.WRITE);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.OPTIMISTIC);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.OPTIMISTIC_FORCE_INCREMENT);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.PESSIMISTIC_READ);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.PESSIMISTIC_WRITE);
- addEEnumLiteral(lockModeType_2_0EEnum, LockModeType_2_0.PESSIMISTIC_FORCE_INCREMENT);
- }
-
- /**
- * <!-- 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.core.resource.orm.v2_0.XmlAttributeMapping_2_0 <em>Xml Attribute Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeMapping_2_0()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_MAPPING_20 = eINSTANCE.getXmlAttributeMapping_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0 <em>Xml Association Override 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAssociationOverride_2_0()
- * @generated
- */
- public static final EClass XML_ASSOCIATION_OVERRIDE_20 = eINSTANCE.getXmlAssociationOverride_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ASSOCIATION_OVERRIDE_20__DESCRIPTION = eINSTANCE.getXmlAssociationOverride_2_0_Description();
-
- /**
- * The meta object literal for the '<em><b>Join Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ASSOCIATION_OVERRIDE_20__JOIN_TABLE = eINSTANCE.getXmlAssociationOverride_2_0_JoinTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0 <em>Xml Attribute Override 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeOverride_2_0()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_OVERRIDE_20 = eINSTANCE.getXmlAttributeOverride_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTE_OVERRIDE_20__DESCRIPTION = eINSTANCE.getXmlAttributeOverride_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0 <em>Xml Attributes 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributes_2_0()
- * @generated
- */
- public static final EClass XML_ATTRIBUTES_20 = eINSTANCE.getXmlAttributes_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTES_20__DESCRIPTION = eINSTANCE.getXmlAttributes_2_0_Description();
-
- /**
- * The meta object literal for the '<em><b>Element Collections</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTES_20__ELEMENT_COLLECTIONS = eINSTANCE.getXmlAttributes_2_0_ElementCollections();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0 <em>Xml Collection Table 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCollectionTable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCollectionTable_2_0()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE_20 = eINSTANCE.getXmlCollectionTable_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0 <em>Xml Derived Id 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlDerivedId_2_0()
- * @generated
- */
- public static final EClass XML_DERIVED_ID_20 = eINSTANCE.getXmlDerivedId_2_0();
-
- /**
- * The meta object literal for the '<em><b>Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_DERIVED_ID_20__ID = eINSTANCE.getXmlDerivedId_2_0_Id();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_20 = eINSTANCE.getXmlElementCollection_2_0();
-
- /**
- * The meta object literal for the '<em><b>Target Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_20__TARGET_CLASS = eINSTANCE.getXmlElementCollection_2_0_TargetClass();
-
- /**
- * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_20__FETCH = eINSTANCE.getXmlElementCollection_2_0_Fetch();
-
- /**
- * The meta object literal for the '<em><b>Map Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__MAP_KEY = eINSTANCE.getXmlElementCollection_2_0_MapKey();
-
- /**
- * The meta object literal for the '<em><b>Map Key Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__MAP_KEY_CLASS = eINSTANCE.getXmlElementCollection_2_0_MapKeyClass();
-
- /**
- * The meta object literal for the '<em><b>Map Key Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_20__MAP_KEY_TEMPORAL = eINSTANCE.getXmlElementCollection_2_0_MapKeyTemporal();
-
- /**
- * The meta object literal for the '<em><b>Map Key Enumerated</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_20__MAP_KEY_ENUMERATED = eINSTANCE.getXmlElementCollection_2_0_MapKeyEnumerated();
-
- /**
- * The meta object literal for the '<em><b>Map Key Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__MAP_KEY_COLUMN = eINSTANCE.getXmlElementCollection_2_0_MapKeyColumn();
-
- /**
- * The meta object literal for the '<em><b>Map Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__MAP_KEY_JOIN_COLUMNS = eINSTANCE.getXmlElementCollection_2_0_MapKeyJoinColumns();
-
- /**
- * The meta object literal for the '<em><b>Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__COLUMN = eINSTANCE.getXmlElementCollection_2_0_Column();
-
- /**
- * The meta object literal for the '<em><b>Collection Table</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ELEMENT_COLLECTION_20__COLLECTION_TABLE = eINSTANCE.getXmlElementCollection_2_0_CollectionTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0 <em>Xml Embedded 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEmbedded_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEmbedded_2_0()
- * @generated
- */
- public static final EClass XML_EMBEDDED_20 = eINSTANCE.getXmlEmbedded_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final EClass XML_ENTITY_20 = eINSTANCE.getXmlEntity_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0 <em>Xml Entity Listener 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntityListener_2_0()
- * @generated
- */
- public static final EClass XML_ENTITY_LISTENER_20 = eINSTANCE.getXmlEntityListener_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_LISTENER_20__DESCRIPTION = eINSTANCE.getXmlEntityListener_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0 <em>Xml Event Method 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEventMethod_2_0()
- * @generated
- */
- public static final EClass XML_EVENT_METHOD_20 = eINSTANCE.getXmlEventMethod_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EVENT_METHOD_20__DESCRIPTION = eINSTANCE.getXmlEventMethod_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0 <em>Xml Generator 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlGenerator_2_0()
- * @generated
- */
- public static final EClass XML_GENERATOR_20 = eINSTANCE.getXmlGenerator_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_GENERATOR_20__DESCRIPTION = eINSTANCE.getXmlGenerator_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_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.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0 <em>Xml Map Key Attribute Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyAttributeOverrideContainer_2_0()
- * @generated
- */
- public static final EClass XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20 = eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAP_KEY_ATTRIBUTE_OVERRIDE_CONTAINER_20__MAP_KEY_ATTRIBUTE_OVERRIDES = eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0 <em>Xml Maps Id 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapsId_2_0()
- * @generated
- */
- public static final EClass XML_MAPS_ID_20 = eINSTANCE.getXmlMapsId_2_0();
-
- /**
- * The meta object literal for the '<em><b>Maps Id</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPS_ID_20__MAPS_ID = eINSTANCE.getXmlMapsId_2_0_MapsId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0 <em>Xml Multi Relationship Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0()
- * @generated
- */
- public static final EClass XML_MULTI_RELATIONSHIP_MAPPING_20 = eINSTANCE.getXmlMultiRelationshipMapping_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Class</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_CLASS = eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyClass();
-
- /**
- * The meta object literal for the '<em><b>Map Key Temporal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_TEMPORAL = eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyTemporal();
-
- /**
- * The meta object literal for the '<em><b>Map Key Enumerated</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_ENUMERATED = eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated();
-
- /**
- * The meta object literal for the '<em><b>Map Key Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_COLUMN = eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyColumn();
-
- /**
- * The meta object literal for the '<em><b>Map Key Join Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_20__MAP_KEY_JOIN_COLUMNS = eINSTANCE.getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0 <em>Xml Named Query 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlNamedQuery_2_0()
- * @generated
- */
- public static final EClass XML_NAMED_QUERY_20 = eINSTANCE.getXmlNamedQuery_2_0();
-
- /**
- * The meta object literal for the '<em><b>Lock Mode</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_QUERY_20__LOCK_MODE = eINSTANCE.getXmlNamedQuery_2_0_LockMode();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_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.core.resource.orm.v2_0.XmlOneToOne_2_0 <em>Xml One To One 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOneToOne_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOneToOne_2_0()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_20 = eINSTANCE.getXmlOneToOne_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.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.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_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>Nullable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDER_COLUMN_20__NULLABLE = eINSTANCE.getXmlOrderColumn_2_0_Nullable();
-
- /**
- * The meta object literal for the '<em><b>Insertable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDER_COLUMN_20__INSERTABLE = eINSTANCE.getXmlOrderColumn_2_0_Insertable();
-
- /**
- * The meta object literal for the '<em><b>Updatable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDER_COLUMN_20__UPDATABLE = eINSTANCE.getXmlOrderColumn_2_0_Updatable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0 <em>Xml Persistence Unit Defaults 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitDefaults_2_0()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS_20 = eINSTANCE.getXmlPersistenceUnitDefaults_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS_20__DESCRIPTION = eINSTANCE.getXmlPersistenceUnitDefaults_2_0_Description();
-
- /**
- * The meta object literal for the '<em><b>Delimited Identifiers</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_DEFAULTS_20__DELIMITED_IDENTIFIERS = eINSTANCE.getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0 <em>Xml Persistence Unit Metadata 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitMetadata_2_0()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_METADATA_20 = eINSTANCE.getXmlPersistenceUnitMetadata_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_METADATA_20__DESCRIPTION = eINSTANCE.getXmlPersistenceUnitMetadata_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0 <em>Xml Query 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQuery_2_0()
- * @generated
- */
- public static final EClass XML_QUERY_20 = eINSTANCE.getXmlQuery_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_20__DESCRIPTION = eINSTANCE.getXmlQuery_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0 <em>Xml Query Hint 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQueryHint_2_0()
- * @generated
- */
- public static final EClass XML_QUERY_HINT_20 = eINSTANCE.getXmlQueryHint_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_HINT_20__DESCRIPTION = eINSTANCE.getXmlQueryHint_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0 <em>Xml Sequence Generator 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSequenceGenerator_2_0()
- * @generated
- */
- public static final EClass XML_SEQUENCE_GENERATOR_20 = eINSTANCE.getXmlSequenceGenerator_2_0();
-
- /**
- * 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_SEQUENCE_GENERATOR_20__CATALOG = eINSTANCE.getXmlSequenceGenerator_2_0_Catalog();
-
- /**
- * 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_SEQUENCE_GENERATOR_20__SCHEMA = eINSTANCE.getXmlSequenceGenerator_2_0_Schema();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0 <em>Xml Single Relationship Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSingleRelationshipMapping_2_0()
- * @generated
- */
- public static final EClass XML_SINGLE_RELATIONSHIP_MAPPING_20 = eINSTANCE.getXmlSingleRelationshipMapping_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0 <em>Xml Sql Result Set Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSqlResultSetMapping_2_0()
- * @generated
- */
- public static final EClass XML_SQL_RESULT_SET_MAPPING_20 = eINSTANCE.getXmlSqlResultSetMapping_2_0();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SQL_RESULT_SET_MAPPING_20__DESCRIPTION = eINSTANCE.getXmlSqlResultSetMapping_2_0_Description();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0 <em>Xml Unique Constraint 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlUniqueConstraint_2_0()
- * @generated
- */
- public static final EClass XML_UNIQUE_CONSTRAINT_20 = eINSTANCE.getXmlUniqueConstraint_2_0();
-
- /**
- * 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_UNIQUE_CONSTRAINT_20__NAME = eINSTANCE.getXmlUniqueConstraint_2_0_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0 <em>Xml Cacheable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCacheable_2_0()
- * @generated
- */
- public static final EClass XML_CACHEABLE_20 = eINSTANCE.getXmlCacheable_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHEABLE_20__CACHEABLE = eINSTANCE.getXmlCacheable_2_0_Cacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0 <em>Xml Cascade Type 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCascadeType_2_0()
- * @generated
- */
- public static final EClass XML_CASCADE_TYPE_20 = eINSTANCE.getXmlCascadeType_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cascade Detach</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CASCADE_TYPE_20__CASCADE_DETACH = eINSTANCE.getXmlCascadeType_2_0_CascadeDetach();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0 <em>Xml Orphan Removable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrphanRemovable_2_0()
- * @generated
- */
- public static final EClass XML_ORPHAN_REMOVABLE_20 = eINSTANCE.getXmlOrphanRemovable_2_0();
-
- /**
- * The meta object literal for the '<em><b>Orphan Removal</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORPHAN_REMOVABLE_20__ORPHAN_REMOVAL = eINSTANCE.getXmlOrphanRemovable_2_0_OrphanRemoval();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0 <em>Xml Orderable 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderable_2_0()
- * @generated
- */
- public static final EClass XML_ORDERABLE_20 = eINSTANCE.getXmlOrderable_2_0();
-
- /**
- * The meta object literal for the '<em><b>Order Column</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ORDERABLE_20__ORDER_COLUMN = eINSTANCE.getXmlOrderable_2_0_OrderColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0 <em>Lock Mode Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getLockModeType_2_0()
- * @generated
- */
- public static final EEnum LOCK_MODE_TYPE_20 = eINSTANCE.getLockModeType_2_0();
-
- }
-
-} //OrmV2_0Package
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAssociationOverride_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAssociationOverride_2_0.java
deleted file mode 100644
index d214d9052b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAssociationOverride_2_0.java
+++ /dev/null
@@ -1,95 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Association Override 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.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getJoinTable <em>Join Table</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAssociationOverride_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAssociationOverride_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAssociationOverride_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Table</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>Join Table</em>' containment reference.
- * @see #setJoinTable(XmlJoinTable)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAssociationOverride_2_0_JoinTable()
- * @model containment="true"
- * @generated
- */
- XmlJoinTable getJoinTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0#getJoinTable <em>Join Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Table</em>' containment reference.
- * @see #getJoinTable()
- * @generated
- */
- void setJoinTable(XmlJoinTable value);
-
-} // XmlAssociationOverride_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeMapping_2_0.java
deleted file mode 100644
index eff8cdb591..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeMapping_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlAccessHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attribute 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAttributeMapping_2_0 extends XmlAccessHolder
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeOverride_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeOverride_2_0.java
deleted file mode 100644
index 1a0cdfdcd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributeOverride_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attribute Override 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.core.resource.orm.v2_0.XmlAttributeOverride_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeOverride_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributeOverride_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributeOverride_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlAttributeOverride_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributes_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributes_2_0.java
deleted file mode 100644
index c268766550..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlAttributes_2_0.java
+++ /dev/null
@@ -1,86 +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.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attributes 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.core.resource.orm.v2_0.XmlAttributes_2_0#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getElementCollections <em>Element Collections</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributes_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributes_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributes_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributes_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>Element Collections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlElementCollection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Element 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>Element Collections</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlAttributes_2_0_ElementCollections()
- * @model containment="true"
- * @generated
- */
- EList<XmlElementCollection> getElementCollections();
-
-} // XmlAttributes_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCacheable_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCacheable_2_0.java
deleted file mode 100644
index 8c0de4d47d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCacheable_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cacheable2 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.core.resource.orm.v2_0.XmlCacheable_2_0#getCacheable <em>Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCacheable_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheable_2_0 extends JpaEObject
-{
- /**
- * 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlCacheable_2_0_Cacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0#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
- */
- void setCacheable(Boolean value);
-
- /**
- * Return the {@link TextRange} for the cacheable annotation
- */
- TextRange getCacheableTextRange();
-} // XmlCacheable2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCascadeType_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCascadeType_2_0.java
deleted file mode 100644
index c499f525ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCascadeType_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cascade Type 20</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0#isCascadeDetach <em>Cascade Detach</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCascadeType_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCascadeType_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade Detach</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade Detach</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 Detach</em>' attribute.
- * @see #setCascadeDetach(boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlCascadeType_2_0_CascadeDetach()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isCascadeDetach();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlCascadeType_2_0#isCascadeDetach <em>Cascade Detach</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade Detach</em>' attribute.
- * @see #isCascadeDetach()
- * @generated
- */
- void setCascadeDetach(boolean value);
-
-} // XmlCascadeType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCollectionTable_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCollectionTable_2_0.java
deleted file mode 100644
index 61e926b81b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlCollectionTable_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlReferenceTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Table 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlCollectionTable_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlCollectionTable_2_0 extends XmlReferenceTable
-{
-
-} // XmlCollectionTable_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlDerivedId_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlDerivedId_2_0.java
deleted file mode 100644
index 7918f93a92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlDerivedId_2_0.java
+++ /dev/null
@@ -1,72 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Derived Id 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.core.resource.orm.v2_0.XmlDerivedId_2_0#getId <em>Id</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlDerivedId_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlDerivedId_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Id</em>' attribute.
- * @see #setId(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlDerivedId_2_0_Id()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0#getId <em>Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Id</em>' attribute.
- * @see #getId()
- * @generated
- */
- void setId(Boolean value);
-
- /**
- * Return the text range of the derived id part of the XML document
- */
- TextRange getIdTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlElementCollection_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlElementCollection_2_0.java
deleted file mode 100644
index d92f42b8c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlElementCollection_2_0.java
+++ /dev/null
@@ -1,326 +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.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlOrderable;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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 -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getTargetClass <em>Target Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getFetch <em>Fetch</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKey <em>Map Key</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyClass <em>Map Key Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyColumn <em>Map Key Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyJoinColumns <em>Map Key Join Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getColumn <em>Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getCollectionTable <em>Collection Table</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_0 extends XmlConvertibleMapping, XmlOrderable, XmlAttributeOverrideContainer, XmlAssociationOverrideContainer, XmlMapKeyAttributeOverrideContainer_2_0
-{
- /**
- * Returns the value of the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target 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>Target Class</em>' attribute.
- * @see #setTargetClass(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_TargetClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTargetClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getTargetClass <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Class</em>' attribute.
- * @see #getTargetClass()
- * @generated
- */
- void setTargetClass(String value);
-
- /**
- * Returns the value of the '<em><b>Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.FetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>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>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #setFetch(FetchType)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_Fetch()
- * @model
- * @generated
- */
- FetchType getFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getFetch <em>Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Fetch</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.FetchType
- * @see #getFetch()
- * @generated
- */
- void setFetch(FetchType value);
-
- /**
- * Returns the value of the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map 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>Map Key</em>' containment reference.
- * @see #setMapKey(MapKey)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKey()
- * @model containment="true"
- * @generated
- */
- MapKey getMapKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKey <em>Map Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key</em>' containment reference.
- * @see #getMapKey()
- * @generated
- */
- void setMapKey(MapKey value);
-
- /**
- * Returns the value of the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Class</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>Map Key Class</em>' containment reference.
- * @see #setMapKeyClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKeyClass()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getMapKeyClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyClass <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Class</em>' containment reference.
- * @see #getMapKeyClass()
- * @generated
- */
- void setMapKeyClass(XmlClassReference value);
-
- /**
- * Returns the value of the '<em><b>Map Key Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Temporal</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 Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setMapKeyTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKeyTemporal()
- * @model
- * @generated
- */
- TemporalType getMapKeyTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getMapKeyTemporal()
- * @generated
- */
- void setMapKeyTemporal(TemporalType value);
-
- /**
- * Returns the value of the '<em><b>Map Key Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Enumerated</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 Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setMapKeyEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKeyEnumerated()
- * @model
- * @generated
- */
- EnumType getMapKeyEnumerated();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getMapKeyEnumerated()
- * @generated
- */
- void setMapKeyEnumerated(EnumType value);
-
- /**
- * Returns the value of the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Column</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>Map Key Column</em>' containment reference.
- * @see #setMapKeyColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKeyColumn()
- * @model containment="true"
- * @generated
- */
- XmlColumn getMapKeyColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getMapKeyColumn <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Column</em>' containment reference.
- * @see #getMapKeyColumn()
- * @generated
- */
- void setMapKeyColumn(XmlColumn value);
-
- /**
- * Returns the value of the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Join 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>Map Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_MapKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getMapKeyJoinColumns();
-
- /**
- * Returns the value of the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column</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>Column</em>' containment reference.
- * @see #setColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_Column()
- * @model containment="true"
- * @generated
- */
- XmlColumn getColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getColumn <em>Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Column</em>' containment reference.
- * @see #getColumn()
- * @generated
- */
- void setColumn(XmlColumn value);
-
- /**
- * Returns the value of the '<em><b>Collection Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Collection Table</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>Collection Table</em>' containment reference.
- * @see #setCollectionTable(XmlCollectionTable)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlElementCollection_2_0_CollectionTable()
- * @model containment="true"
- * @generated
- */
- XmlCollectionTable getCollectionTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0#getCollectionTable <em>Collection Table</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Collection Table</em>' containment reference.
- * @see #getCollectionTable()
- * @generated
- */
- void setCollectionTable(XmlCollectionTable value);
-
- /**
- * Return the {@link TextRange} for the target-class attribute.
- */
- TextRange getTargetClassTextRange();
-
-} // XmlElementCollection_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEmbedded_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEmbedded_2_0.java
deleted file mode 100644
index 2e9a788d1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEmbedded_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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlEmbedded_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbedded_2_0 extends XmlAssociationOverrideContainer
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntityListener_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntityListener_2_0.java
deleted file mode 100644
index c677c15fa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntityListener_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Listener 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.core.resource.orm.v2_0.XmlEntityListener_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntityListener_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntityListener_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntityListener_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEntityListener_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlEntityListener_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntity_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntity_2_0.java
deleted file mode 100644
index 38770059b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEntity_2_0.java
+++ /dev/null
@@ -1,32 +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.core.resource.orm.v2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlEntity_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_0 extends XmlCacheable_2_0
-{
-
-} // XmlEntity_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEventMethod_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEventMethod_2_0.java
deleted file mode 100644
index 6f31decdd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlEventMethod_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Event Method 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.core.resource.orm.v2_0.XmlEventMethod_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEventMethod_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEventMethod_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlEventMethod_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlEventMethod_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlEventMethod_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlGenerator_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlGenerator_2_0.java
deleted file mode 100644
index 984c3ffaba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlGenerator_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Generator 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.core.resource.orm.v2_0.XmlGenerator_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlGenerator_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlGenerator_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlGenerator_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlGenerator_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlGenerator_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlManyToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlManyToMany_2_0.java
deleted file mode 100644
index fc1b205174..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlManyToMany_2_0.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.core.resource.orm.v2_0;
-
-
-/**
- * <!-- 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlManyToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_0 extends XmlMultiRelationshipMapping_2_0
-{
-
-} // XmlManyToMany_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyAttributeOverrideContainer_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyAttributeOverrideContainer_2_0.java
deleted file mode 100644
index dc79723228..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyAttributeOverrideContainer_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Map Key Attribute 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.core.resource.orm.v2_0.XmlMapKeyAttributeOverrideContainer_2_0#getMapKeyAttributeOverrides <em>Map Key Attribute Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyAttributeOverrideContainer_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMapKeyAttributeOverrideContainer_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key 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>Map Key Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAttributeOverride> getMapKeyAttributeOverrides();
-
-} // XmlMapKeyAttributeOverrideContainer2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyClass_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyClass_2_0.java
deleted file mode 100644
index e901fd4d2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapKeyClass_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Map Key Class 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.core.resource.orm.v2_0.XmlMapKeyClass_2_0#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyClass_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMapKeyClass_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.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapKeyClass_2_0_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- String getClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapKeyClass_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);
-
-} // XmlMapKeyClass_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapsId_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapsId_2_0.java
deleted file mode 100644
index 2fec97de5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMapsId_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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Maps Id 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.core.resource.orm.v2_0.XmlMapsId_2_0#getMapsId <em>Maps Id</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapsId_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMapsId_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Maps Id</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Maps Id</em>' attribute.
- * @see #setMapsId(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMapsId_2_0_MapsId()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMapsId();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0#getMapsId <em>Maps Id</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Maps Id</em>' attribute.
- * @see #getMapsId()
- * @generated
- */
- void setMapsId(String value);
-
- /**
- * Return the text range of the "maps-id" part of the XML document
- */
- TextRange getMapsIdTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMultiRelationshipMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMultiRelationshipMapping_2_0.java
deleted file mode 100644
index 3b0955a969..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlMultiRelationshipMapping_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multi Relationship 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.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyClass <em>Map Key Class</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyColumn <em>Map Key Column</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyJoinColumns <em>Map Key Join Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMultiRelationshipMapping_2_0 extends XmlOrderable_2_0, XmlMapKeyAttributeOverrideContainer_2_0
-{
- /**
- * Returns the value of the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Class</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>Map Key Class</em>' containment reference.
- * @see #setMapKeyClass(XmlClassReference)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0_MapKeyClass()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getMapKeyClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyClass <em>Map Key Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Class</em>' containment reference.
- * @see #getMapKeyClass()
- * @generated
- */
- void setMapKeyClass(XmlClassReference value);
-
- /**
- * Returns the value of the '<em><b>Map Key Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.TemporalType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Temporal</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 Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #setMapKeyTemporal(TemporalType)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0_MapKeyTemporal()
- * @model
- * @generated
- */
- TemporalType getMapKeyTemporal();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyTemporal <em>Map Key Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Temporal</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.TemporalType
- * @see #getMapKeyTemporal()
- * @generated
- */
- void setMapKeyTemporal(TemporalType value);
-
- /**
- * Returns the value of the '<em><b>Map Key Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.EnumType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Enumerated</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 Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #setMapKeyEnumerated(EnumType)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0_MapKeyEnumerated()
- * @model
- * @generated
- */
- EnumType getMapKeyEnumerated();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyEnumerated <em>Map Key Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Enumerated</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.EnumType
- * @see #getMapKeyEnumerated()
- * @generated
- */
- void setMapKeyEnumerated(EnumType value);
-
- /**
- * Returns the value of the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Column</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>Map Key Column</em>' containment reference.
- * @see #setMapKeyColumn(XmlColumn)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0_MapKeyColumn()
- * @model containment="true"
- * @generated
- */
- XmlColumn getMapKeyColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlMultiRelationshipMapping_2_0#getMapKeyColumn <em>Map Key Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Column</em>' containment reference.
- * @see #getMapKeyColumn()
- * @generated
- */
- void setMapKeyColumn(XmlColumn value);
-
- /**
- * Returns the value of the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlJoinColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Join 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>Map Key Join Columns</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlMultiRelationshipMapping_2_0_MapKeyJoinColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlJoinColumn> getMapKeyJoinColumns();
-
-} // XmlMultiRelationshipMapping_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlNamedQuery_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlNamedQuery_2_0.java
deleted file mode 100644
index 994e037027..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlNamedQuery_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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Query 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.core.resource.orm.v2_0.XmlNamedQuery_2_0#getLockMode <em>Lock Mode</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlNamedQuery_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedQuery_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Lock Mode</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Lock Mode</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Lock Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see #setLockMode(LockModeType_2_0)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlNamedQuery_2_0_LockMode()
- * @model
- * @generated
- */
- LockModeType_2_0 getLockMode();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlNamedQuery_2_0#getLockMode <em>Lock Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Lock Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.orm.v2_0.LockModeType_2_0
- * @see #getLockMode()
- * @generated
- */
- void setLockMode(LockModeType_2_0 value);
-
-} // XmlNamedQuery_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToMany_2_0.java
deleted file mode 100644
index bc79a92245..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToMany_2_0.java
+++ /dev/null
@@ -1,28 +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.core.resource.orm.v2_0;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 20</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOneToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_0 extends XmlMultiRelationshipMapping_2_0, XmlOrphanRemovable_2_0
-{
-
-} // XmlOneToMany_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToOne_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToOne_2_0.java
deleted file mode 100644
index cacddeb7d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOneToOne_2_0.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.core.resource.orm.v2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To One 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlOneToOne_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne_2_0 extends XmlSingleRelationshipMapping_2_0, XmlOrphanRemovable_2_0
-{
-
-} // XmlOneToOne_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderColumn_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
deleted file mode 100644
index b28b45f1a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
+++ /dev/null
@@ -1,121 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.core.resource.orm.v2_0.XmlOrderColumn_2_0#getNullable <em>Nullable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getInsertable <em>Insertable</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getUpdatable <em>Updatable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_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>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Nullable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Nullable</em>' attribute.
- * @see #setNullable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderColumn_2_0_Nullable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getNullable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getNullable <em>Nullable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Nullable</em>' attribute.
- * @see #getNullable()
- * @generated
- */
- void setNullable(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insertable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insertable</em>' attribute.
- * @see #setInsertable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderColumn_2_0_Insertable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getInsertable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getInsertable <em>Insertable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insertable</em>' attribute.
- * @see #getInsertable()
- * @generated
- */
- void setInsertable(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Updatable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Updatable</em>' attribute.
- * @see #setUpdatable(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderColumn_2_0_Updatable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUpdatable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderColumn_2_0#getUpdatable <em>Updatable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Updatable</em>' attribute.
- * @see #getUpdatable()
- * @generated
- */
- void setUpdatable(Boolean value);
-
-} // XmlOrderColumn_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderable_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderable_2_0.java
deleted file mode 100644
index 9d9783ef56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrderable_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Orderable 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.core.resource.orm.v2_0.XmlOrderable_2_0#getOrderColumn <em>Order Column</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderable_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOrderable_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Order Column</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>Order Column</em>' containment reference.
- * @see #setOrderColumn(XmlOrderColumn)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrderable_2_0_OrderColumn()
- * @model containment="true"
- * @generated
- */
- XmlOrderColumn getOrderColumn();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrderable_2_0#getOrderColumn <em>Order Column</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Order Column</em>' containment reference.
- * @see #getOrderColumn()
- * @generated
- */
- void setOrderColumn(XmlOrderColumn value);
-
-} // XmlOrderable_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrphanRemovable_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrphanRemovable_2_0.java
deleted file mode 100644
index 6fde468cdc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlOrphanRemovable_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Orphan Removable2 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.core.resource.orm.v2_0.XmlOrphanRemovable_2_0#getOrphanRemoval <em>Orphan Removal</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrphanRemovable_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOrphanRemovable_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Orphan Removal</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Orphan Removal</em>' attribute.
- * @see #setOrphanRemoval(Boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlOrphanRemovable_2_0_OrphanRemoval()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getOrphanRemoval();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0#getOrphanRemoval <em>Orphan Removal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Orphan Removal</em>' attribute.
- * @see #getOrphanRemoval()
- * @generated
- */
- void setOrphanRemoval(Boolean value);
-
-} // XmlOrphanRemovable2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitDefaults_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitDefaults_2_0.java
deleted file mode 100644
index b86c7ba7d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitDefaults_2_0.java
+++ /dev/null
@@ -1,94 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults 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.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#isDelimitedIdentifiers <em>Delimited Identifiers</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitDefaults_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPersistenceUnitDefaults_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitDefaults_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>Delimited Identifiers</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delimited Identifiers</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delimited Identifiers</em>' attribute.
- * @see #setDelimitedIdentifiers(boolean)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitDefaults_2_0_DelimitedIdentifiers()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isDelimitedIdentifiers();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitDefaults_2_0#isDelimitedIdentifiers <em>Delimited Identifiers</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delimited Identifiers</em>' attribute.
- * @see #isDelimitedIdentifiers()
- * @generated
- */
- void setDelimitedIdentifiers(boolean value);
-
-} // XmlPersistenceUnitDefaults_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitMetadata_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitMetadata_2_0.java
deleted file mode 100644
index 6e5078b0a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlPersistenceUnitMetadata_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Metadata 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.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitMetadata_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPersistenceUnitMetadata_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlPersistenceUnitMetadata_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlPersistenceUnitMetadata_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlPersistenceUnitMetadata_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQueryHint_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQueryHint_2_0.java
deleted file mode 100644
index 693a3d128f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQueryHint_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Hint 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.core.resource.orm.v2_0.XmlQueryHint_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQueryHint_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryHint_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQueryHint_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQueryHint_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlQueryHint_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQuery_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQuery_2_0.java
deleted file mode 100644
index da4fbf0904..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlQuery_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query 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.core.resource.orm.v2_0.XmlQuery_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQuery_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQuery_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlQuery_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlQuery_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlQuery_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSequenceGenerator_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSequenceGenerator_2_0.java
deleted file mode 100644
index 78667c5fa4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSequenceGenerator_2_0.java
+++ /dev/null
@@ -1,94 +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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Sequence Generator 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.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#getSchema <em>Schema</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSequenceGenerator_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlSequenceGenerator_2_0 extends JpaEObject
-{
- /**
- * 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlSequenceGenerator_2_0_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCatalog();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#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>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.core.resource.orm.v2_0.OrmV2_0Package#getXmlSequenceGenerator_2_0_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSchema();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSequenceGenerator_2_0#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);
-
-} // XmlSequenceGenerator_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSingleRelationshipMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSingleRelationshipMapping_2_0.java
deleted file mode 100644
index 5fadba4ce0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSingleRelationshipMapping_2_0.java
+++ /dev/null
@@ -1,31 +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.core.resource.orm.v2_0;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Single Relationship 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 -->
- *
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSingleRelationshipMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlSingleRelationshipMapping_2_0 extends XmlDerivedId_2_0, XmlMapsId_2_0
-{
-} // XmlSingleRelationshipMapping_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSqlResultSetMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSqlResultSetMapping_2_0.java
deleted file mode 100644
index 42fa4b7172..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlSqlResultSetMapping_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Sql Result Set 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.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0#getDescription <em>Description</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSqlResultSetMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlSqlResultSetMapping_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlSqlResultSetMapping_2_0_Description()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlSqlResultSetMapping_2_0#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
-} // XmlSqlResultSetMapping_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlUniqueConstraint_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlUniqueConstraint_2_0.java
deleted file mode 100644
index 12265da28c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/v2_0/XmlUniqueConstraint_2_0.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.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Unique Constraint 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.core.resource.orm.v2_0.XmlUniqueConstraint_2_0#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package#getXmlUniqueConstraint_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlUniqueConstraint_2_0 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.core.resource.orm.v2_0.OrmV2_0Package#getXmlUniqueConstraint_2_0_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.v2_0.XmlUniqueConstraint_2_0#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);
-
-} // XmlUniqueConstraint_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/JPA.java
deleted file mode 100644
index 4bf08e61f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/JPA.java
+++ /dev/null
@@ -1,57 +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.core.resource.persistence;
-
-/**
- * JPA persistence.xml-related stuff (elements, attributes 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.
- */
-@SuppressWarnings("nls")
-public interface JPA
-{
- String SCHEMA_NAMESPACE = "http://java.sun.com/xml/ns/persistence";
- String SCHEMA_LOCATION = "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd";
- String SCHEMA_VERSION = "1.0";
-
- String CLASS = "class";
-
- String DESCRIPTION = "description";
-
- String EXCLUDE_UNLISTED_CLASSES = "exclude-unlisted-classes";
-
- String JAR_FILE = "jar-file";
-
- String JTA_DATA_SOURCE = "jta-data-source";
-
- String MAPPING_FILE = "mapping-file";
-
- String NON_JTA_DATA_SOURCE = "non-jta-data-source";
-
- String PERSISTENCE = "persistence";
-
- String PERSISTENCE_UNIT = "persistence-unit";
- String PERSISTENCE_UNIT__NAME = "name";
- String PERSISTENCE_UNIT__TRANSACTION_TYPE = "transaction-type";
-
- String PROPERTIES = "properties";
-
- String PROPERTY = "property";
- String PROPERTY__NAME = "name";
- String PROPERTY__VALUE = "value";
-
- String PROVIDER = "provider";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java
deleted file mode 100644
index dc795d1599..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceFactory.java
+++ /dev/null
@@ -1,250 +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.core.resource.persistence;
-
-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.core.resource.persistence.PersistencePackage
- * @generated
- */
-public class PersistenceFactory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistenceFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static PersistenceFactory init()
- {
- try
- {
- PersistenceFactory thePersistenceFactory = (PersistenceFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.persistence.xmi");
- if (thePersistenceFactory != null)
- {
- return thePersistenceFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new PersistenceFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistenceFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case PersistencePackage.XML_JAVA_CLASS_REF: return (EObject)createXmlJavaClassRef();
- case PersistencePackage.XML_JAR_FILE_REF: return (EObject)createXmlJarFileRef();
- case PersistencePackage.XML_MAPPING_FILE_REF: return (EObject)createXmlMappingFileRef();
- case PersistencePackage.XML_PERSISTENCE: return (EObject)createXmlPersistence();
- case PersistencePackage.XML_PERSISTENCE_UNIT: return (EObject)createXmlPersistenceUnit();
- case PersistencePackage.XML_PROPERTIES: return (EObject)createXmlProperties();
- case PersistencePackage.XML_PROPERTY: return (EObject)createXmlProperty();
- 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 PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE:
- return createXmlPersistenceUnitTransactionTypeFromString(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 PersistencePackage.XML_PERSISTENCE_UNIT_TRANSACTION_TYPE:
- return convertXmlPersistenceUnitTransactionTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJavaClassRef createXmlJavaClassRef()
- {
- XmlJavaClassRef xmlJavaClassRef = new XmlJavaClassRef();
- return xmlJavaClassRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJarFileRef createXmlJarFileRef()
- {
- XmlJarFileRef xmlJarFileRef = new XmlJarFileRef();
- return xmlJarFileRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappingFileRef createXmlMappingFileRef()
- {
- XmlMappingFileRef xmlMappingFileRef = new XmlMappingFileRef();
- return xmlMappingFileRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistence createXmlPersistence()
- {
- XmlPersistence xmlPersistence = new XmlPersistence();
- return xmlPersistence;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnit createXmlPersistenceUnit()
- {
- XmlPersistenceUnit xmlPersistenceUnit = new XmlPersistenceUnit();
- return xmlPersistenceUnit;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperties createXmlProperties()
- {
- XmlProperties xmlProperties = new XmlProperties();
- return xmlProperties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperty createXmlProperty()
- {
- XmlProperty xmlProperty = new XmlProperty();
- return xmlProperty;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitTransactionType createXmlPersistenceUnitTransactionTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlPersistenceUnitTransactionType result = XmlPersistenceUnitTransactionType.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 convertXmlPersistenceUnitTransactionTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistencePackage getPersistencePackage()
- {
- return (PersistencePackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static PersistencePackage getPackage()
- {
- return PersistencePackage.eINSTANCE;
- }
-
-} //PersistenceFactory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java
deleted file mode 100644
index 8b14d3a2c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistencePackage.java
+++ /dev/null
@@ -1,1302 +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.core.resource.persistence;
-
-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.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-
-/**
- * <!-- 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.core.resource.persistence.PersistenceFactory
- * @model kind="package"
- * @generated
- */
-public class PersistencePackage extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "persistence";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.persistence.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.persistence";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistencePackage eINSTANCE = org.eclipse.jpt.core.resource.persistence.PersistencePackage.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @generated
- */
- public static final int XML_JAVA_CLASS_REF = 0;
-
- /**
- * The feature id for the '<em><b>Java Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAVA_CLASS_REF__JAVA_CLASS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Java Class Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAVA_CLASS_REF_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef <em>Xml Jar File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJarFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJarFileRef()
- * @generated
- */
- public static final int XML_JAR_FILE_REF = 1;
-
- /**
- * The feature id for the '<em><b>File Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAR_FILE_REF__FILE_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Jar File Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JAR_FILE_REF_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @generated
- */
- public static final int XML_MAPPING_FILE_REF = 2;
-
- /**
- * The feature id for the '<em><b>File Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPING_FILE_REF__FILE_NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapping File Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPING_FILE_REF_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @generated
- */
- public static final int XML_PERSISTENCE = 3;
-
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE__VERSION = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__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_PERSISTENCE__SCHEMA_LOCATION = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION;
-
- /**
- * The feature id for the '<em><b>Persistence Units</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE__PERSISTENCE_UNITS = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Persistence</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_FEATURE_COUNT = CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT = 4;
-
- /**
- * The feature id for the '<em><b>Shared Cache Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20__SHARED_CACHE_MODE;
-
- /**
- * The feature id for the '<em><b>Validation Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__VALIDATION_MODE = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20__VALIDATION_MODE;
-
- /**
- * 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__DESCRIPTION = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__PROVIDER = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Non Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Mapping Files</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__MAPPING_FILES = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Jar Files</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__JAR_FILES = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Classes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__CLASSES = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Exclude Unlisted Classes</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__PROPERTIES = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_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_PERSISTENCE_UNIT__NAME = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Transaction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT__TRANSACTION_TYPE = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 10;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_FEATURE_COUNT = PersistenceV2_0Package.XML_PERSISTENCE_UNIT_20_FEATURE_COUNT + 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @generated
- */
- public static final int XML_PROPERTIES = 5;
-
- /**
- * 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_PROPERTIES__PROPERTIES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Properties</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTIES_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperty()
- * @generated
- */
- public static final int XML_PROPERTY = 6;
-
- /**
- * 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 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 = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_TRANSACTION_TYPE = 7;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJavaClassRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJarFileRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappingFileRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertiesEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlPersistenceUnitTransactionTypeEEnum = 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.core.resource.persistence.PersistencePackage#eNS_URI
- * @see #init()
- * @generated
- */
- private PersistencePackage()
- {
- super(eNS_URI, PersistenceFactory.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 PersistencePackage#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 PersistencePackage init()
- {
- if (isInited) return (PersistencePackage)EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI);
-
- // Obtain or create and register package
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PersistencePackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- CommonPackage theCommonPackage = (CommonPackage)(EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) instanceof CommonPackage ? EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) : CommonPackage.eINSTANCE);
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) instanceof OrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) : OrmV2_0Package.eINSTANCE);
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) instanceof PersistenceV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) : PersistenceV2_0Package.eINSTANCE);
-
- // Create package meta-data objects
- thePersistencePackage.createPackageContents();
- theCommonPackage.createPackageContents();
- theOrmPackage.createPackageContents();
- theOrmV2_0Package.createPackageContents();
- thePersistenceV2_0Package.createPackageContents();
-
- // Initialize created meta-data
- thePersistencePackage.initializePackageContents();
- theCommonPackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
- theOrmV2_0Package.initializePackageContents();
- thePersistenceV2_0Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePersistencePackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(PersistencePackage.eNS_URI, thePersistencePackage);
- return thePersistencePackage;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Java Class Ref</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @generated
- */
- public EClass getXmlJavaClassRef()
- {
- return xmlJavaClassRefEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Java Class</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass()
- * @see #getXmlJavaClassRef()
- * @generated
- */
- public EAttribute getXmlJavaClassRef_JavaClass()
- {
- return (EAttribute)xmlJavaClassRefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef <em>Xml Jar File Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Jar File Ref</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJarFileRef
- * @generated
- */
- public EClass getXmlJarFileRef()
- {
- return xmlJarFileRefEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef#getFileName <em>File Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>File Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlJarFileRef#getFileName()
- * @see #getXmlJarFileRef()
- * @generated
- */
- public EAttribute getXmlJarFileRef_FileName()
- {
- return (EAttribute)xmlJarFileRefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapping File Ref</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @generated
- */
- public EClass getXmlMappingFileRef()
- {
- return xmlMappingFileRefEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>File Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName()
- * @see #getXmlMappingFileRef()
- * @generated
- */
- public EAttribute getXmlMappingFileRef_FileName()
- {
- return (EAttribute)xmlMappingFileRefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @generated
- */
- public EClass getXmlPersistence()
- {
- return xmlPersistenceEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence#getPersistenceUnits <em>Persistence Units</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Persistence Units</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence#getPersistenceUnits()
- * @see #getXmlPersistence()
- * @generated
- */
- public EReference getXmlPersistence_PersistenceUnits()
- {
- return (EReference)xmlPersistenceEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @generated
- */
- public EClass getXmlPersistenceUnit()
- {
- return xmlPersistenceUnitEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Description()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Provider</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Provider()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jta Data Source</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_JtaDataSource()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Jta Data Source</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_NonJtaDataSource()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles <em>Mapping Files</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Mapping Files</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_MappingFiles()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles <em>Jar Files</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Jar Files</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_JarFiles()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses <em>Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Classes</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_Classes()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Unlisted Classes</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getExcludeUnlistedClasses()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_ExcludeUnlistedClasses()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Properties</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EReference getXmlPersistenceUnit_Properties()
- {
- return (EReference)xmlPersistenceUnitEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_Name()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Transaction Type</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType()
- * @see #getXmlPersistenceUnit()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_TransactionType()
- {
- return (EAttribute)xmlPersistenceUnitEClass.getEStructuralFeatures().get(10);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Properties</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @generated
- */
- public EClass getXmlProperties()
- {
- return xmlPropertiesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties#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.core.resource.persistence.XmlProperties#getProperties()
- * @see #getXmlProperties()
- * @generated
- */
- public EReference getXmlProperties_Properties()
- {
- return (EReference)xmlPropertiesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.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.core.resource.persistence.XmlProperty
- * @generated
- */
- public EClass getXmlProperty()
- {
- return xmlPropertyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.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.core.resource.persistence.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.core.resource.persistence.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.core.resource.persistence.XmlProperty#getValue()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Value()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Persistence Unit Transaction Type</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @generated
- */
- public EEnum getXmlPersistenceUnitTransactionType()
- {
- return xmlPersistenceUnitTransactionTypeEEnum;
- }
-
- /**
- * 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 PersistenceFactory getPersistenceFactory()
- {
- return (PersistenceFactory)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
- xmlJavaClassRefEClass = createEClass(XML_JAVA_CLASS_REF);
- createEAttribute(xmlJavaClassRefEClass, XML_JAVA_CLASS_REF__JAVA_CLASS);
-
- xmlJarFileRefEClass = createEClass(XML_JAR_FILE_REF);
- createEAttribute(xmlJarFileRefEClass, XML_JAR_FILE_REF__FILE_NAME);
-
- xmlMappingFileRefEClass = createEClass(XML_MAPPING_FILE_REF);
- createEAttribute(xmlMappingFileRefEClass, XML_MAPPING_FILE_REF__FILE_NAME);
-
- xmlPersistenceEClass = createEClass(XML_PERSISTENCE);
- createEReference(xmlPersistenceEClass, XML_PERSISTENCE__PERSISTENCE_UNITS);
-
- xmlPersistenceUnitEClass = createEClass(XML_PERSISTENCE_UNIT);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__DESCRIPTION);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__PROVIDER);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__MAPPING_FILES);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__JAR_FILES);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__CLASSES);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES);
- createEReference(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__PROPERTIES);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__NAME);
- createEAttribute(xmlPersistenceUnitEClass, XML_PERSISTENCE_UNIT__TRANSACTION_TYPE);
-
- xmlPropertiesEClass = createEClass(XML_PROPERTIES);
- createEReference(xmlPropertiesEClass, XML_PROPERTIES__PROPERTIES);
-
- xmlPropertyEClass = createEClass(XML_PROPERTY);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__NAME);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE);
-
- // Create enums
- xmlPersistenceUnitTransactionTypeEEnum = createEEnum(XML_PERSISTENCE_UNIT_TRANSACTION_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
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI);
- EcorePackage theEcorePackage = (EcorePackage)EPackage.Registry.INSTANCE.getEPackage(EcorePackage.eNS_URI);
- CommonPackage theCommonPackage = (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Add subpackages
- getESubpackages().add(thePersistenceV2_0Package);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlPersistenceEClass.getESuperTypes().add(theCommonPackage.getAbstractJpaRootEObject());
- xmlPersistenceUnitEClass.getESuperTypes().add(thePersistenceV2_0Package.getXmlPersistenceUnit_2_0());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlJavaClassRefEClass, XmlJavaClassRef.class, "XmlJavaClassRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJavaClassRef_JavaClass(), theEcorePackage.getEString(), "javaClass", "", 0, 1, XmlJavaClassRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
-
- initEClass(xmlJarFileRefEClass, XmlJarFileRef.class, "XmlJarFileRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJarFileRef_FileName(), theEcorePackage.getEString(), "fileName", "", 0, 1, XmlJarFileRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
-
- initEClass(xmlMappingFileRefEClass, XmlMappingFileRef.class, "XmlMappingFileRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMappingFileRef_FileName(), theEcorePackage.getEString(), "fileName", "", 0, 1, XmlMappingFileRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
-
- initEClass(xmlPersistenceEClass, XmlPersistence.class, "XmlPersistence", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPersistence_PersistenceUnits(), this.getXmlPersistenceUnit(), null, "persistenceUnits", null, 0, -1, XmlPersistence.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitEClass, XmlPersistenceUnit.class, "XmlPersistenceUnit", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnit_Description(), theXMLTypePackage.getString(), "description", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_Provider(), theXMLTypePackage.getString(), "provider", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_JtaDataSource(), theXMLTypePackage.getString(), "jtaDataSource", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_NonJtaDataSource(), theXMLTypePackage.getString(), "nonJtaDataSource", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_MappingFiles(), this.getXmlMappingFileRef(), null, "mappingFiles", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_JarFiles(), this.getXmlJarFileRef(), null, "jarFiles", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_Classes(), this.getXmlJavaClassRef(), null, "classes", null, 0, -1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_ExcludeUnlistedClasses(), theXMLTypePackage.getBooleanObject(), "excludeUnlistedClasses", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPersistenceUnit_Properties(), this.getXmlProperties(), null, "properties", null, 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_Name(), theXMLTypePackage.getString(), "name", null, 1, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_TransactionType(), this.getXmlPersistenceUnitTransactionType(), "transactionType", "JTA", 0, 1, XmlPersistenceUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertiesEClass, XmlProperties.class, "XmlProperties", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlProperties_Properties(), this.getXmlProperty(), null, "properties", null, 0, -1, XmlProperties.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, 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, 1, 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, 1, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.class, "XmlPersistenceUnitTransactionType");
- addEEnumLiteral(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.JTA);
- addEEnumLiteral(xmlPersistenceUnitTransactionTypeEEnum, XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- // 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.core.resource.persistence.XmlJavaClassRef <em>Xml Java Class Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @generated
- */
- public static final EClass XML_JAVA_CLASS_REF = eINSTANCE.getXmlJavaClassRef();
-
- /**
- * The meta object literal for the '<em><b>Java Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JAVA_CLASS_REF__JAVA_CLASS = eINSTANCE.getXmlJavaClassRef_JavaClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef <em>Xml Jar File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlJarFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJarFileRef()
- * @generated
- */
- public static final EClass XML_JAR_FILE_REF = eINSTANCE.getXmlJarFileRef();
-
- /**
- * The meta object literal for the '<em><b>File Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JAR_FILE_REF__FILE_NAME = eINSTANCE.getXmlJarFileRef_FileName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef <em>Xml Mapping File Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @generated
- */
- public static final EClass XML_MAPPING_FILE_REF = eINSTANCE.getXmlMappingFileRef();
-
- /**
- * The meta object literal for the '<em><b>File Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPING_FILE_REF__FILE_NAME = eINSTANCE.getXmlMappingFileRef_FileName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistence <em>Xml Persistence</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistence
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @generated
- */
- public static final EClass XML_PERSISTENCE = eINSTANCE.getXmlPersistence();
-
- /**
- * The meta object literal for the '<em><b>Persistence Units</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE__PERSISTENCE_UNITS = eINSTANCE.getXmlPersistence_PersistenceUnits();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit <em>Xml Persistence Unit</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT = eINSTANCE.getXmlPersistenceUnit();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__DESCRIPTION = eINSTANCE.getXmlPersistenceUnit_Description();
-
- /**
- * The meta object literal for the '<em><b>Provider</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__PROVIDER = eINSTANCE.getXmlPersistenceUnit_Provider();
-
- /**
- * The meta object literal for the '<em><b>Jta Data Source</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE = eINSTANCE.getXmlPersistenceUnit_JtaDataSource();
-
- /**
- * The meta object literal for the '<em><b>Non Jta Data Source</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE = eINSTANCE.getXmlPersistenceUnit_NonJtaDataSource();
-
- /**
- * The meta object literal for the '<em><b>Mapping Files</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__MAPPING_FILES = eINSTANCE.getXmlPersistenceUnit_MappingFiles();
-
- /**
- * The meta object literal for the '<em><b>Jar Files</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__JAR_FILES = eINSTANCE.getXmlPersistenceUnit_JarFiles();
-
- /**
- * The meta object literal for the '<em><b>Classes</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__CLASSES = eINSTANCE.getXmlPersistenceUnit_Classes();
-
- /**
- * The meta object literal for the '<em><b>Exclude Unlisted Classes</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES = eINSTANCE.getXmlPersistenceUnit_ExcludeUnlistedClasses();
-
- /**
- * The meta object literal for the '<em><b>Properties</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT__PROPERTIES = eINSTANCE.getXmlPersistenceUnit_Properties();
-
- /**
- * 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_PERSISTENCE_UNIT__NAME = eINSTANCE.getXmlPersistenceUnit_Name();
-
- /**
- * The meta object literal for the '<em><b>Transaction Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT__TRANSACTION_TYPE = eINSTANCE.getXmlPersistenceUnit_TransactionType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperties <em>Xml Properties</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperties
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @generated
- */
- public static final EClass XML_PROPERTIES = eINSTANCE.getXmlProperties();
-
- /**
- * 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_PROPERTIES__PROPERTIES = eINSTANCE.getXmlProperties_Properties();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlProperty
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#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 '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType <em>Xml Persistence Unit Transaction Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @generated
- */
- public static final EEnum XML_PERSISTENCE_UNIT_TRANSACTION_TYPE = eINSTANCE.getXmlPersistenceUnitTransactionType();
-
- }
-
-} //PersistencePackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceXmlResourceFactory.java
deleted file mode 100644
index 635368632f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/PersistenceXmlResourceFactory.java
+++ /dev/null
@@ -1,52 +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.core.resource.persistence;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-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.
- */
-public class PersistenceXmlResourceFactory extends TranslatorResourceFactory
-{
- public PersistenceXmlResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public PersistenceXmlResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public PersistenceXmlResourceFactory(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, JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE, XmlPersistence.getRootTranslator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJarFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJarFileRef.java
deleted file mode 100644
index fe584e6571..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJarFileRef.java
+++ /dev/null
@@ -1,235 +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.core.resource.persistence;
-
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Jar File Ref</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef#getFileName <em>File Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJarFileRef()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlJarFileRef extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected static final String FILE_NAME_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected String fileName = FILE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJarFileRef()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_JAR_FILE_REF;
- }
-
- /**
- * Returns the value of the '<em><b>File Name</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>File 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>File Name</em>' attribute.
- * @see #setFileName(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJarFileRef_FileName()
- * @model default="" unique="false" ordered="false"
- * @generated
- */
- public String getFileName()
- {
- return fileName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef#getFileName <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>File Name</em>' attribute.
- * @see #getFileName()
- * @generated
- */
- public void setFileName(String newFileName)
- {
- String oldFileName = fileName;
- fileName = newFileName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_JAR_FILE_REF__FILE_NAME, oldFileName, fileName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAR_FILE_REF__FILE_NAME:
- return getFileName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAR_FILE_REF__FILE_NAME:
- setFileName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAR_FILE_REF__FILE_NAME:
- setFileName(FILE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAR_FILE_REF__FILE_NAME:
- return FILE_NAME_EDEFAULT == null ? fileName != null : !FILE_NAME_EDEFAULT.equals(fileName);
- }
- 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(" (fileName: ");
- result.append(fileName);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public TextRange getValidationTextRange() {
- return (! StringTools.stringIsEmpty(this.fileName)) ?
- getTextTextRange() :
- super.getValidationTextRange();
- }
-
-
- // ********** 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[] {
- buildFileNameTranslator(),
- };
- }
-
- private static Translator buildFileNameTranslator() {
- return new Translator(
- Translator.TEXT_ATTRIBUTE_VALUE,
- PersistencePackage.eINSTANCE.getXmlJarFileRef_FileName()
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java
deleted file mode 100644
index 807ed320c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlJavaClassRef.java
+++ /dev/null
@@ -1,231 +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.core.resource.persistence;
-
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Java Class Ref</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.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlJavaClassRef extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJavaClass()
- * @generated
- * @ordered
- */
- protected static final String JAVA_CLASS_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJavaClass()
- * @generated
- * @ordered
- */
- protected String javaClass = JAVA_CLASS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJavaClassRef()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_JAVA_CLASS_REF;
- }
-
- /**
- * Returns the value of the '<em><b>Java Class</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Java 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>Java Class</em>' attribute.
- * @see #setJavaClass(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlJavaClassRef_JavaClass()
- * @model default="" unique="false" ordered="false"
- * @generated
- */
- public String getJavaClass()
- {
- return javaClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef#getJavaClass <em>Java Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Java Class</em>' attribute.
- * @see #getJavaClass()
- * @generated
- */
- public void setJavaClass(String newJavaClass)
- {
- String oldJavaClass = javaClass;
- javaClass = newJavaClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS, oldJavaClass, javaClass));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- return getJavaClass();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- setJavaClass((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- setJavaClass(JAVA_CLASS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_JAVA_CLASS_REF__JAVA_CLASS:
- return JAVA_CLASS_EDEFAULT == null ? javaClass != null : !JAVA_CLASS_EDEFAULT.equals(javaClass);
- }
- 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(" (javaClass: ");
- result.append(javaClass);
- 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[] {
- buildClassNameTranslator(),
- };
- }
-
- private static Translator buildClassNameTranslator() {
- return new Translator(
- Translator.TEXT_ATTRIBUTE_VALUE,
- PersistencePackage.eINSTANCE.getXmlJavaClassRef_JavaClass()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java
deleted file mode 100644
index d93eda98b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlMappingFileRef.java
+++ /dev/null
@@ -1,239 +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.core.resource.persistence;
-
-import org.eclipse.emf.common.notify.Adapter;
-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.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Mapping File Ref</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.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlMappingFileRef extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected static final String FILE_NAME_EDEFAULT = "";
-
- /**
- * The cached value of the '{@link #getFileName() <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFileName()
- * @generated
- * @ordered
- */
- protected String fileName = FILE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappingFileRef()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_MAPPING_FILE_REF;
- }
-
- /**
- * Returns the value of the '<em><b>File Name</b></em>' attribute.
- * The default value is <code>""</code>.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>File 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>File Name</em>' attribute.
- * @see #setFileName(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlMappingFileRef_FileName()
- * @model default="" unique="false" ordered="false"
- * @generated
- */
- public String getFileName()
- {
- return fileName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef#getFileName <em>File Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>File Name</em>' attribute.
- * @see #getFileName()
- * @generated
- */
- public void setFileName(String newFileName)
- {
- String oldFileName = fileName;
- fileName = newFileName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME, oldFileName, fileName));
- }
-
- @Override
- public EList<Adapter> eAdapters() {
- // TODO Auto-generated method stub
- return super.eAdapters();
- }
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- return getFileName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- setFileName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- setFileName(FILE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_MAPPING_FILE_REF__FILE_NAME:
- return FILE_NAME_EDEFAULT == null ? fileName != null : !FILE_NAME_EDEFAULT.equals(fileName);
- }
- 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(" (fileName: ");
- result.append(fileName);
- 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[] {
- buildFileNameTranslator(),
- };
- }
-
- private static Translator buildFileNameTranslator() {
- return new Translator(
- Translator.TEXT_ATTRIBUTE_VALUE,
- PersistencePackage.eINSTANCE.getXmlMappingFileRef_FileName()
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java
deleted file mode 100644
index c591d37be6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistence.java
+++ /dev/null
@@ -1,249 +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.core.resource.persistence;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-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.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleRootTranslator;
-import org.eclipse.jpt.core.resource.persistence.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlPersistence</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.core.resource.persistence.XmlPersistence#getPersistenceUnits <em>Persistence Units</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistence extends AbstractJpaRootEObject
-{
- /**
- * The cached value of the '{@link #getPersistenceUnits() <em>Persistence Units</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPersistenceUnits()
- * @generated
- * @ordered
- */
- protected EList<XmlPersistenceUnit> persistenceUnits;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistence()
- {
- super();
- }
-
- @Override
- public EObject eContainer() {
- return super.eContainer();
- }
-
- @Override
- protected void eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID) {
- super.eBasicSetContainer(newContainer, newContainerFeatureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PERSISTENCE;
- }
-
- /**
- * Returns the value of the '<em><b>Persistence Units</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlPersistence Units</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>Persistence Units</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistence_PersistenceUnits()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPersistenceUnit> getPersistenceUnits()
- {
- if (persistenceUnits == null)
- {
- persistenceUnits = new EObjectContainmentEList<XmlPersistenceUnit>(XmlPersistenceUnit.class, this, PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS);
- }
- return persistenceUnits;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return ((InternalEList<?>)getPersistenceUnits()).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 PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return getPersistenceUnits();
- }
- 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 PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- getPersistenceUnits().clear();
- getPersistenceUnits().addAll((Collection<? extends XmlPersistenceUnit>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- getPersistenceUnits().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE__PERSISTENCE_UNITS:
- return persistenceUnits != null && !persistenceUnits.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-
- // **************** version -> schema location mapping ********************
-
- private static String namespace = JPA.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(JPA.SCHEMA_VERSION, JPA.SCHEMA_LOCATION);
- map.put(JPA2_0.SCHEMA_VERSION, JPA2_0.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.PERSISTENCE,
- PersistencePackage.eINSTANCE.getXmlPersistence(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildVersionTranslator(versionsToSchemaLocations),
- buildNamespaceTranslator(namespace),
- buildSchemaNamespaceTranslator(),
- buildSchemaLocationTranslator(namespace, versionsToSchemaLocations),
- XmlPersistenceUnit.buildTranslator(JPA.PERSISTENCE_UNIT, PersistencePackage.eINSTANCE.getXmlPersistence_PersistenceUnits())
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java
deleted file mode 100644
index 2eacb67dd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnit.java
+++ /dev/null
@@ -1,1077 +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.core.resource.persistence;
-
-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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.persistence.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package;
-import org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0;
-import org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0;
-import org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Unit</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.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getMappingFiles <em>Mapping Files</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJarFiles <em>Jar Files</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getClasses <em>Classes</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnit extends AbstractJpaEObject implements XmlPersistenceUnit_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 XmlPersistenceUnitCachingType_2_0 SHARED_CACHE_MODE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSharedCacheMode() <em>Shared Cache Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSharedCacheMode()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitCachingType_2_0 sharedCacheMode = SHARED_CACHE_MODE_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 XmlPersistenceUnitValidationModeType_2_0 VALIDATION_MODE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValidationMode() <em>Validation Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValidationMode()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitValidationModeType_2_0 validationMode = VALIDATION_MODE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getProvider() <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProvider()
- * @generated
- * @ordered
- */
- protected static final String PROVIDER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getProvider() <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProvider()
- * @generated
- * @ordered
- */
- protected String provider = PROVIDER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJtaDataSource()
- * @generated
- * @ordered
- */
- protected static final String JTA_DATA_SOURCE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJtaDataSource() <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJtaDataSource()
- * @generated
- * @ordered
- */
- protected String jtaDataSource = JTA_DATA_SOURCE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonJtaDataSource()
- * @generated
- * @ordered
- */
- protected static final String NON_JTA_DATA_SOURCE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getNonJtaDataSource() <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNonJtaDataSource()
- * @generated
- * @ordered
- */
- protected String nonJtaDataSource = NON_JTA_DATA_SOURCE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMappingFiles() <em>Mapping Files</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappingFiles()
- * @generated
- * @ordered
- */
- protected EList<XmlMappingFileRef> mappingFiles;
-
- /**
- * The cached value of the '{@link #getJarFiles() <em>Jar Files</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJarFiles()
- * @generated
- * @ordered
- */
- protected EList<XmlJarFileRef> jarFiles;
-
- /**
- * The cached value of the '{@link #getClasses() <em>Classes</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClasses()
- * @generated
- * @ordered
- */
- protected EList<XmlJavaClassRef> classes;
-
- /**
- * The default value of the '{@link #getExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeUnlistedClasses()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_UNLISTED_CLASSES_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeUnlistedClasses() <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeUnlistedClasses()
- * @generated
- * @ordered
- */
- protected Boolean excludeUnlistedClasses = EXCLUDE_UNLISTED_CLASSES_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected XmlProperties properties;
-
- /**
- * 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;
-
- /**
- * 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 XmlPersistenceUnitTransactionType TRANSACTION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTransactionType() <em>Transaction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransactionType()
- * @generated
- * @ordered
- */
- protected XmlPersistenceUnitTransactionType transactionType = TRANSACTION_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnit()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PERSISTENCE_UNIT;
- }
-
- /**
- * Returns the value of the '<em><b>Shared Cache Mode</b></em>' attribute.
- * The default value is <code>"UNSPECIFIED"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Shared Cache Mode</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 Cache Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see #setSharedCacheMode(XmlPersistenceUnitCachingType_2_0)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_2_0_SharedCacheMode()
- * @model default="UNSPECIFIED" unique="false"
- * @generated
- */
- public XmlPersistenceUnitCachingType_2_0 getSharedCacheMode()
- {
- return sharedCacheMode;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getSharedCacheMode <em>Shared Cache Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Shared Cache Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see #getSharedCacheMode()
- * @generated
- */
- public void setSharedCacheMode(XmlPersistenceUnitCachingType_2_0 newSharedCacheMode)
- {
- XmlPersistenceUnitCachingType_2_0 oldSharedCacheMode = sharedCacheMode;
- sharedCacheMode = newSharedCacheMode == null ? SHARED_CACHE_MODE_EDEFAULT : newSharedCacheMode;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE, oldSharedCacheMode, sharedCacheMode));
- }
-
- /**
- * Returns the value of the '<em><b>Validation Mode</b></em>' attribute.
- * The default value is <code>"AUTO"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation Mode</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 Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see #setValidationMode(XmlPersistenceUnitValidationModeType_2_0)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_2_0_ValidationMode()
- * @model default="AUTO" unique="false"
- * @generated
- */
- public XmlPersistenceUnitValidationModeType_2_0 getValidationMode()
- {
- return validationMode;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getValidationMode <em>Validation Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see #getValidationMode()
- * @generated
- */
- public void setValidationMode(XmlPersistenceUnitValidationModeType_2_0 newValidationMode)
- {
- XmlPersistenceUnitValidationModeType_2_0 oldValidationMode = validationMode;
- validationMode = newValidationMode == null ? VALIDATION_MODE_EDEFAULT : newValidationMode;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__VALIDATION_MODE, oldValidationMode, validationMode));
- }
-
- /**
- * 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.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Name()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#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, PersistencePackage.XML_PERSISTENCE_UNIT__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Transaction Type</b></em>' attribute.
- * The default value is <code>"JTA"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transaction 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>Transaction Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see #setTransactionType(XmlPersistenceUnitTransactionType)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_TransactionType()
- * @model default="JTA" unique="false"
- * @generated
- */
- public XmlPersistenceUnitTransactionType getTransactionType()
- {
- return transactionType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getTransactionType <em>Transaction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Transaction Type</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnitTransactionType
- * @see #getTransactionType()
- * @generated
- */
- public void setTransactionType(XmlPersistenceUnitTransactionType newTransactionType)
- {
- XmlPersistenceUnitTransactionType oldTransactionType = transactionType;
- transactionType = newTransactionType == null ? TRANSACTION_TYPE_EDEFAULT : newTransactionType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE, oldTransactionType, transactionType));
- }
-
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Description()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- public void setDescription(String newDescription)
- {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION, oldDescription, description));
- }
-
- /**
- * Returns the value of the '<em><b>Provider</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Provider</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Provider</em>' attribute.
- * @see #setProvider(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Provider()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getProvider()
- {
- return provider;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProvider <em>Provider</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Provider</em>' attribute.
- * @see #getProvider()
- * @generated
- */
- public void setProvider(String newProvider)
- {
- String oldProvider = provider;
- provider = newProvider;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER, oldProvider, provider));
- }
-
- /**
- * Returns the value of the '<em><b>Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jta Data Source</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jta Data Source</em>' attribute.
- * @see #setJtaDataSource(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_JtaDataSource()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getJtaDataSource()
- {
- return jtaDataSource;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getJtaDataSource <em>Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jta Data Source</em>' attribute.
- * @see #getJtaDataSource()
- * @generated
- */
- public void setJtaDataSource(String newJtaDataSource)
- {
- String oldJtaDataSource = jtaDataSource;
- jtaDataSource = newJtaDataSource;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE, oldJtaDataSource, jtaDataSource));
- }
-
- /**
- * Returns the value of the '<em><b>Non Jta Data Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Jta Data Source</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 Jta Data Source</em>' attribute.
- * @see #setNonJtaDataSource(String)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_NonJtaDataSource()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getNonJtaDataSource()
- {
- return nonJtaDataSource;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getNonJtaDataSource <em>Non Jta Data Source</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Jta Data Source</em>' attribute.
- * @see #getNonJtaDataSource()
- * @generated
- */
- public void setNonJtaDataSource(String newNonJtaDataSource)
- {
- String oldNonJtaDataSource = nonJtaDataSource;
- nonJtaDataSource = newNonJtaDataSource;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE, oldNonJtaDataSource, nonJtaDataSource));
- }
-
- /**
- * Returns the value of the '<em><b>Mapping Files</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapping Files</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>Mapping Files</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_MappingFiles()
- * @model containment="true"
- * @generated
- */
- public EList<XmlMappingFileRef> getMappingFiles()
- {
- if (mappingFiles == null)
- {
- mappingFiles = new EObjectContainmentEList<XmlMappingFileRef>(XmlMappingFileRef.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES);
- }
- return mappingFiles;
- }
-
- /**
- * Returns the value of the '<em><b>Jar Files</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlJarFileRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jar Files</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>Jar Files</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_JarFiles()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJarFileRef> getJarFiles()
- {
- if (jarFiles == null)
- {
- jarFiles = new EObjectContainmentEList<XmlJarFileRef>(XmlJarFileRef.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES);
- }
- return jarFiles;
- }
-
- /**
- * Returns the value of the '<em><b>Classes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Classes</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>Classes</em>' containment reference list.
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Classes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlJavaClassRef> getClasses()
- {
- if (classes == null)
- {
- classes = new EObjectContainmentEList<XmlJavaClassRef>(XmlJavaClassRef.class, this, PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES);
- }
- return classes;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Unlisted Classes</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Unlisted Classes</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 Unlisted Classes</em>' attribute.
- * @see #setExcludeUnlistedClasses(Boolean)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_ExcludeUnlistedClasses()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeUnlistedClasses()
- {
- return excludeUnlistedClasses;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getExcludeUnlistedClasses <em>Exclude Unlisted Classes</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Unlisted Classes</em>' attribute.
- * @see #getExcludeUnlistedClasses()
- * @generated
- */
- public void setExcludeUnlistedClasses(Boolean newExcludeUnlistedClasses)
- {
- Boolean oldExcludeUnlistedClasses = excludeUnlistedClasses;
- excludeUnlistedClasses = newExcludeUnlistedClasses;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES, oldExcludeUnlistedClasses, excludeUnlistedClasses));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlProperties</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>Properties</em>' containment reference.
- * @see #setProperties(XmlProperties)
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnit_Properties()
- * @model containment="true"
- * @generated
- */
- public XmlProperties getProperties()
- {
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetProperties(XmlProperties newProperties, NotificationChain msgs)
- {
- XmlProperties oldProperties = properties;
- properties = newProperties;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, oldProperties, newProperties);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit#getProperties <em>Properties</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Properties</em>' containment reference.
- * @see #getProperties()
- * @generated
- */
- public void setProperties(XmlProperties newProperties)
- {
- if (newProperties != properties)
- {
- NotificationChain msgs = null;
- if (properties != null)
- msgs = ((InternalEObject)properties).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, null, msgs);
- if (newProperties != null)
- msgs = ((InternalEObject)newProperties).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, null, msgs);
- msgs = basicSetProperties(newProperties, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES, newProperties, newProperties));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return ((InternalEList<?>)getMappingFiles()).basicRemove(otherEnd, msgs);
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- return ((InternalEList<?>)getJarFiles()).basicRemove(otherEnd, msgs);
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return ((InternalEList<?>)getClasses()).basicRemove(otherEnd, msgs);
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return basicSetProperties(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 PersistencePackage.XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE:
- return getSharedCacheMode();
- case PersistencePackage.XML_PERSISTENCE_UNIT__VALIDATION_MODE:
- return getValidationMode();
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- return getDescription();
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- return getProvider();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- return getJtaDataSource();
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- return getNonJtaDataSource();
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return getMappingFiles();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- return getJarFiles();
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return getClasses();
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- return getExcludeUnlistedClasses();
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return getProperties();
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- return getName();
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- return getTransactionType();
- }
- 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 PersistencePackage.XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE:
- setSharedCacheMode((XmlPersistenceUnitCachingType_2_0)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__VALIDATION_MODE:
- setValidationMode((XmlPersistenceUnitValidationModeType_2_0)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- setDescription((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- setProvider((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- setJtaDataSource((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- setNonJtaDataSource((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- getMappingFiles().clear();
- getMappingFiles().addAll((Collection<? extends XmlMappingFileRef>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- getJarFiles().clear();
- getJarFiles().addAll((Collection<? extends XmlJarFileRef>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- getClasses().clear();
- getClasses().addAll((Collection<? extends XmlJavaClassRef>)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- setExcludeUnlistedClasses((Boolean)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- setProperties((XmlProperties)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- setName((String)newValue);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- setTransactionType((XmlPersistenceUnitTransactionType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE:
- setSharedCacheMode(SHARED_CACHE_MODE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__VALIDATION_MODE:
- setValidationMode(VALIDATION_MODE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- setProvider(PROVIDER_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- setJtaDataSource(JTA_DATA_SOURCE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- setNonJtaDataSource(NON_JTA_DATA_SOURCE_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- getMappingFiles().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- getJarFiles().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- getClasses().clear();
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- setExcludeUnlistedClasses(EXCLUDE_UNLISTED_CLASSES_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- setProperties((XmlProperties)null);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- setName(NAME_EDEFAULT);
- return;
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- setTransactionType(TRANSACTION_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PERSISTENCE_UNIT__SHARED_CACHE_MODE:
- return sharedCacheMode != SHARED_CACHE_MODE_EDEFAULT;
- case PersistencePackage.XML_PERSISTENCE_UNIT__VALIDATION_MODE:
- return validationMode != VALIDATION_MODE_EDEFAULT;
- case PersistencePackage.XML_PERSISTENCE_UNIT__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROVIDER:
- return PROVIDER_EDEFAULT == null ? provider != null : !PROVIDER_EDEFAULT.equals(provider);
- case PersistencePackage.XML_PERSISTENCE_UNIT__JTA_DATA_SOURCE:
- return JTA_DATA_SOURCE_EDEFAULT == null ? jtaDataSource != null : !JTA_DATA_SOURCE_EDEFAULT.equals(jtaDataSource);
- case PersistencePackage.XML_PERSISTENCE_UNIT__NON_JTA_DATA_SOURCE:
- return NON_JTA_DATA_SOURCE_EDEFAULT == null ? nonJtaDataSource != null : !NON_JTA_DATA_SOURCE_EDEFAULT.equals(nonJtaDataSource);
- case PersistencePackage.XML_PERSISTENCE_UNIT__MAPPING_FILES:
- return mappingFiles != null && !mappingFiles.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__JAR_FILES:
- return jarFiles != null && !jarFiles.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__CLASSES:
- return classes != null && !classes.isEmpty();
- case PersistencePackage.XML_PERSISTENCE_UNIT__EXCLUDE_UNLISTED_CLASSES:
- return EXCLUDE_UNLISTED_CLASSES_EDEFAULT == null ? excludeUnlistedClasses != null : !EXCLUDE_UNLISTED_CLASSES_EDEFAULT.equals(excludeUnlistedClasses);
- case PersistencePackage.XML_PERSISTENCE_UNIT__PROPERTIES:
- return properties != null;
- case PersistencePackage.XML_PERSISTENCE_UNIT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case PersistencePackage.XML_PERSISTENCE_UNIT__TRANSACTION_TYPE:
- return transactionType != TRANSACTION_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(" (sharedCacheMode: ");
- result.append(sharedCacheMode);
- result.append(", validationMode: ");
- result.append(validationMode);
- result.append(", description: ");
- result.append(description);
- result.append(", provider: ");
- result.append(provider);
- result.append(", jtaDataSource: ");
- result.append(jtaDataSource);
- result.append(", nonJtaDataSource: ");
- result.append(nonJtaDataSource);
- result.append(", excludeUnlistedClasses: ");
- result.append(excludeUnlistedClasses);
- result.append(", name: ");
- result.append(name);
- result.append(", transactionType: ");
- result.append(transactionType);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- PersistencePackage pkg = PersistencePackage.eINSTANCE;
- return new Translator[] {
- buildNameTranslator(),
- buildTransactionTypeTranslator(),
- buildDescriptionTranslator(),
- buildProviderTranslator(),
- buildJtaDataSourceTranslator(),
- buildNonJtaDataSourceTranslator(),
- XmlMappingFileRef.buildTranslator(JPA.MAPPING_FILE, pkg.getXmlPersistenceUnit_MappingFiles()),
- XmlJarFileRef.buildTranslator(JPA.JAR_FILE, pkg.getXmlPersistenceUnit_JarFiles()),
- XmlJavaClassRef.buildTranslator(JPA.CLASS, pkg.getXmlPersistenceUnit_Classes()),
- buildExcludeUnlistedClassesTranslator(),
- buildSharedCacheModeTranslator(),
- buildValidationModeTranslator(),
- XmlProperties.buildTranslator(JPA.PROPERTIES, pkg.getXmlPersistenceUnit_Properties())};
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(
- JPA.PERSISTENCE_UNIT__NAME,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_Name(),
- Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTransactionTypeTranslator() {
- return new Translator(
- JPA.PERSISTENCE_UNIT__TRANSACTION_TYPE,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_TransactionType(),
- Translator.DOM_ATTRIBUTE | Translator.UNSET_IF_NULL);
- }
-
- protected static Translator buildDescriptionTranslator() {
- return new Translator(
- JPA.DESCRIPTION,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_Description());
- }
-
- protected static Translator buildProviderTranslator() {
- return new Translator(
- JPA.PROVIDER,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_Provider());
- }
-
- protected static Translator buildJtaDataSourceTranslator() {
- return new Translator(
- JPA.JTA_DATA_SOURCE,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_JtaDataSource());
- }
-
- protected static Translator buildNonJtaDataSourceTranslator() {
- return new Translator(
- JPA.NON_JTA_DATA_SOURCE,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_NonJtaDataSource());
- }
-
- protected static Translator buildExcludeUnlistedClassesTranslator() {
- return new BooleanTranslator(
- JPA.EXCLUDE_UNLISTED_CLASSES,
- PersistencePackage.eINSTANCE.getXmlPersistenceUnit_ExcludeUnlistedClasses());
- }
-
- protected static Translator buildSharedCacheModeTranslator() {
- return new Translator(
- JPA2_0.PERSISTENCE_UNIT__SHARED_CACHE_MODE,
- PersistenceV2_0Package.eINSTANCE.getXmlPersistenceUnit_2_0_SharedCacheMode());
- }
-
- protected static Translator buildValidationModeTranslator() {
- return new Translator(
- JPA2_0.PERSISTENCE_UNIT__VALIDATION_MODE,
- PersistenceV2_0Package.eINSTANCE.getXmlPersistenceUnit_2_0_ValidationMode());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java
deleted file mode 100644
index d8048c024f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlPersistenceUnitTransactionType.java
+++ /dev/null
@@ -1,236 +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.core.resource.persistence;
-
-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>Unit Transaction 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.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlPersistenceUnitTransactionType()
- * @model
- * @generated
- */
-public enum XmlPersistenceUnitTransactionType implements Enumerator
-{
- /**
- * The '<em><b>JTA</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JTA_VALUE
- * @generated
- * @ordered
- */
- JTA(0, "JTA", "JTA"),
-
- /**
- * The '<em><b>RESOURCE LOCAL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #RESOURCE_LOCAL_VALUE
- * @generated
- * @ordered
- */
- RESOURCE_LOCAL(1, "RESOURCE_LOCAL", "RESOURCE_LOCAL");
-
- /**
- * The '<em><b>JTA</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JTA</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JTA
- * @model
- * @generated
- * @ordered
- */
- public static final int JTA_VALUE = 0;
-
- /**
- * The '<em><b>RESOURCE LOCAL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>RESOURCE LOCAL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #RESOURCE_LOCAL
- * @model
- * @generated
- * @ordered
- */
- public static final int RESOURCE_LOCAL_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Xml Persistence Unit Transaction Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlPersistenceUnitTransactionType[] VALUES_ARRAY =
- new XmlPersistenceUnitTransactionType[]
- {
- JTA,
- RESOURCE_LOCAL,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Persistence Unit Transaction Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlPersistenceUnitTransactionType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitTransactionType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitTransactionType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Transaction Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitTransactionType get(int value)
- {
- switch (value)
- {
- case JTA_VALUE: return JTA;
- case RESOURCE_LOCAL_VALUE: return RESOURCE_LOCAL;
- }
- 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 XmlPersistenceUnitTransactionType(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;
- }
-
-} //XmlPersistenceUnitTransactionType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java
deleted file mode 100644
index 69b6f64cb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperties.java
+++ /dev/null
@@ -1,202 +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.core.resource.persistence;
-
-import java.util.Collection;
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlProperties</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.core.resource.persistence.XmlProperties#getProperties <em>Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#getXmlProperties()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlProperties extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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 XmlProperties()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.Literals.XML_PROPERTIES;
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.core.resource.persistence.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>XmlProperties</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.core.resource.persistence.PersistencePackage#getXmlProperties_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, PersistencePackage.XML_PROPERTIES__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__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 PersistencePackage.XML_PROPERTIES__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 PersistencePackage.XML_PROPERTIES__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 PersistencePackage.XML_PROPERTIES__PROPERTIES:
- getProperties().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTIES__PROPERTIES:
- return properties != null && !properties.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- XmlProperty.buildTranslator(JPA.PROPERTY, PersistencePackage.eINSTANCE.getXmlProperties_Properties()),
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java
deleted file mode 100644
index 22e944c680..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/XmlProperty.java
+++ /dev/null
@@ -1,305 +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.core.resource.persistence;
-
-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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>XmlProperty</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.core.resource.persistence.XmlProperty#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.XmlProperty#getValue <em>Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.PersistencePackage#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;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlProperty()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return PersistencePackage.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.core.resource.persistence.PersistencePackage#getXmlProperty_Name()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.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, PersistencePackage.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.core.resource.persistence.PersistencePackage#getXmlProperty_Value()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.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, PersistencePackage.XML_PROPERTY__VALUE, oldValue, value));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- return getName();
- case PersistencePackage.XML_PROPERTY__VALUE:
- return getValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- setName((String)newValue);
- return;
- case PersistencePackage.XML_PROPERTY__VALUE:
- setValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case PersistencePackage.XML_PROPERTY__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case PersistencePackage.XML_PROPERTY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case PersistencePackage.XML_PROPERTY__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- }
- return super.eIsSet(featureID);
- }
-
-
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuilder result = new StringBuilder(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- 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(),
- buildValueTranslator()
- };
- }
-
- private static Translator buildNameTranslator() {
- return new Translator(
- JPA.PROPERTY__NAME,
- PersistencePackage.eINSTANCE.getXmlProperty_Name(),
- Translator.DOM_ATTRIBUTE
- );
- }
-
- private static Translator buildValueTranslator() {
- return new Translator(
- JPA.PROPERTY__VALUE,
- PersistencePackage.eINSTANCE.getXmlProperty_Value(),
- Translator.DOM_ATTRIBUTE
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/JPA2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/JPA2_0.java
deleted file mode 100644
index b243d62222..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/JPA2_0.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.core.resource.persistence.v2_0;
-
-import org.eclipse.jpt.core.resource.persistence.JPA;
-
-/**
- * JPA persistence2_0.xml-related stuff (elements, attributes 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.3
- * @since 2.3
- */
-@SuppressWarnings("nls")
-public interface JPA2_0
- extends JPA
-{
- String SCHEMA_NAMESPACE = JPA.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";
- String SCHEMA_VERSION = "2.0";
-
- // JPA 2.0 specific nodes
-
- String PERSISTENCE_UNIT__SHARED_CACHE_MODE = "shared-cache-mode";
- String PERSISTENCE_UNIT__VALIDATION_MODE = "validation-mode";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Factory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Factory.java
deleted file mode 100644
index 5d03956ab7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Factory.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.core.resource.persistence.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.core.resource.persistence.v2_0.PersistenceV2_0Package
- * @generated
- */
-public class PersistenceV2_0Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistenceV2_0Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static PersistenceV2_0Factory init()
- {
- try
- {
- PersistenceV2_0Factory thePersistenceV2_0Factory = (PersistenceV2_0Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.persistence.v2_0.xmi");
- if (thePersistenceV2_0Factory != null)
- {
- return thePersistenceV2_0Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new PersistenceV2_0Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistenceV2_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 PersistenceV2_0Package.XML_PERSISTENCE_UNIT_CACHING_TYPE_20:
- return createXmlPersistenceUnitCachingType_2_0FromString(eDataType, initialValue);
- case PersistenceV2_0Package.XML_PERSISTENCE_UNIT_VALIDATION_MODE_TYPE_20:
- return createXmlPersistenceUnitValidationModeType_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 PersistenceV2_0Package.XML_PERSISTENCE_UNIT_CACHING_TYPE_20:
- return convertXmlPersistenceUnitCachingType_2_0ToString(eDataType, instanceValue);
- case PersistenceV2_0Package.XML_PERSISTENCE_UNIT_VALIDATION_MODE_TYPE_20:
- return convertXmlPersistenceUnitValidationModeType_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 XmlPersistenceUnitCachingType_2_0 createXmlPersistenceUnitCachingType_2_0FromString(EDataType eDataType, String initialValue)
- {
- XmlPersistenceUnitCachingType_2_0 result = XmlPersistenceUnitCachingType_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 convertXmlPersistenceUnitCachingType_2_0ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitValidationModeType_2_0 createXmlPersistenceUnitValidationModeType_2_0FromString(EDataType eDataType, String initialValue)
- {
- XmlPersistenceUnitValidationModeType_2_0 result = XmlPersistenceUnitValidationModeType_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 convertXmlPersistenceUnitValidationModeType_2_0ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public PersistenceV2_0Package getPersistenceV2_0Package()
- {
- return (PersistenceV2_0Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static PersistenceV2_0Package getPackage()
- {
- return PersistenceV2_0Package.eINSTANCE;
- }
-
-} //PersistenceV2_0Factory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Package.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Package.java
deleted file mode 100644
index 3311b93f8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/PersistenceV2_0Package.java
+++ /dev/null
@@ -1,452 +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.core.resource.persistence.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.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-
-/**
- * <!-- 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.core.resource.persistence.v2_0.PersistenceV2_0Factory
- * @model kind="package"
- * @generated
- */
-public class PersistenceV2_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.persistence.v2_0.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.persistence.v2_0";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final PersistenceV2_0Package eINSTANCE = org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0 <em>Xml Persistence Unit 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnit_2_0()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_20 = 0;
-
- /**
- * The feature id for the '<em><b>Shared Cache Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_20__SHARED_CACHE_MODE = 0;
-
- /**
- * The feature id for the '<em><b>Validation Mode</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_20__VALIDATION_MODE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_20_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0 <em>Xml Persistence Unit Caching Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitCachingType_2_0()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_CACHING_TYPE_20 = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0 <em>Xml Persistence Unit Validation Mode Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitValidationModeType_2_0()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_VALIDATION_MODE_TYPE_20 = 2;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnit_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlPersistenceUnitCachingType_2_0EEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlPersistenceUnitValidationModeType_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.core.resource.persistence.v2_0.PersistenceV2_0Package#eNS_URI
- * @see #init()
- * @generated
- */
- private PersistenceV2_0Package()
- {
- super(eNS_URI, PersistenceV2_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 PersistenceV2_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 PersistenceV2_0Package init()
- {
- if (isInited) return (PersistenceV2_0Package)EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI);
-
- // Obtain or create and register package
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PersistenceV2_0Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PersistenceV2_0Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- CommonPackage theCommonPackage = (CommonPackage)(EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) instanceof CommonPackage ? EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI) : CommonPackage.eINSTANCE);
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) instanceof OrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) : OrmV2_0Package.eINSTANCE);
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE);
-
- // Create package meta-data objects
- thePersistenceV2_0Package.createPackageContents();
- theCommonPackage.createPackageContents();
- theOrmPackage.createPackageContents();
- theOrmV2_0Package.createPackageContents();
- thePersistencePackage.createPackageContents();
-
- // Initialize created meta-data
- thePersistenceV2_0Package.initializePackageContents();
- theCommonPackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
- theOrmV2_0Package.initializePackageContents();
- thePersistencePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- thePersistenceV2_0Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(PersistenceV2_0Package.eNS_URI, thePersistenceV2_0Package);
- return thePersistenceV2_0Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0 <em>Xml Persistence Unit 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit 20</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0
- * @generated
- */
- public EClass getXmlPersistenceUnit_2_0()
- {
- return xmlPersistenceUnit_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getSharedCacheMode <em>Shared Cache Mode</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Shared Cache Mode</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getSharedCacheMode()
- * @see #getXmlPersistenceUnit_2_0()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_2_0_SharedCacheMode()
- {
- return (EAttribute)xmlPersistenceUnit_2_0EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getValidationMode <em>Validation Mode</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Validation Mode</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getValidationMode()
- * @see #getXmlPersistenceUnit_2_0()
- * @generated
- */
- public EAttribute getXmlPersistenceUnit_2_0_ValidationMode()
- {
- return (EAttribute)xmlPersistenceUnit_2_0EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0 <em>Xml Persistence Unit Caching Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Persistence Unit Caching Type 20</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @generated
- */
- public EEnum getXmlPersistenceUnitCachingType_2_0()
- {
- return xmlPersistenceUnitCachingType_2_0EEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0 <em>Xml Persistence Unit Validation Mode Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Persistence Unit Validation Mode Type 20</em>'.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @generated
- */
- public EEnum getXmlPersistenceUnitValidationModeType_2_0()
- {
- return xmlPersistenceUnitValidationModeType_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 PersistenceV2_0Factory getPersistenceV2_0Factory()
- {
- return (PersistenceV2_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
- xmlPersistenceUnit_2_0EClass = createEClass(XML_PERSISTENCE_UNIT_20);
- createEAttribute(xmlPersistenceUnit_2_0EClass, XML_PERSISTENCE_UNIT_20__SHARED_CACHE_MODE);
- createEAttribute(xmlPersistenceUnit_2_0EClass, XML_PERSISTENCE_UNIT_20__VALIDATION_MODE);
-
- // Create enums
- xmlPersistenceUnitCachingType_2_0EEnum = createEEnum(XML_PERSISTENCE_UNIT_CACHING_TYPE_20);
- xmlPersistenceUnitValidationModeType_2_0EEnum = createEEnum(XML_PERSISTENCE_UNIT_VALIDATION_MODE_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);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlPersistenceUnit_2_0EClass, XmlPersistenceUnit_2_0.class, "XmlPersistenceUnit_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnit_2_0_SharedCacheMode(), this.getXmlPersistenceUnitCachingType_2_0(), "sharedCacheMode", "UNSPECIFIED", 0, 1, XmlPersistenceUnit_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPersistenceUnit_2_0_ValidationMode(), this.getXmlPersistenceUnitValidationModeType_2_0(), "validationMode", "AUTO", 0, 1, XmlPersistenceUnit_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(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.class, "XmlPersistenceUnitCachingType_2_0");
- addEEnumLiteral(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.ALL);
- addEEnumLiteral(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.NONE);
- addEEnumLiteral(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.ENABLE_SELECTIVE);
- addEEnumLiteral(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.DISABLE_SELECTIVE);
- addEEnumLiteral(xmlPersistenceUnitCachingType_2_0EEnum, XmlPersistenceUnitCachingType_2_0.UNSPECIFIED);
-
- initEEnum(xmlPersistenceUnitValidationModeType_2_0EEnum, XmlPersistenceUnitValidationModeType_2_0.class, "XmlPersistenceUnitValidationModeType_2_0");
- addEEnumLiteral(xmlPersistenceUnitValidationModeType_2_0EEnum, XmlPersistenceUnitValidationModeType_2_0.AUTO);
- addEEnumLiteral(xmlPersistenceUnitValidationModeType_2_0EEnum, XmlPersistenceUnitValidationModeType_2_0.CALLBACK);
- addEEnumLiteral(xmlPersistenceUnitValidationModeType_2_0EEnum, XmlPersistenceUnitValidationModeType_2_0.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.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0 <em>Xml Persistence Unit 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnit_2_0()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_20 = eINSTANCE.getXmlPersistenceUnit_2_0();
-
- /**
- * The meta object literal for the '<em><b>Shared Cache Mode</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_20__SHARED_CACHE_MODE = eINSTANCE.getXmlPersistenceUnit_2_0_SharedCacheMode();
-
- /**
- * The meta object literal for the '<em><b>Validation Mode</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_20__VALIDATION_MODE = eINSTANCE.getXmlPersistenceUnit_2_0_ValidationMode();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0 <em>Xml Persistence Unit Caching Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitCachingType_2_0()
- * @generated
- */
- public static final EEnum XML_PERSISTENCE_UNIT_CACHING_TYPE_20 = eINSTANCE.getXmlPersistenceUnitCachingType_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0 <em>Xml Persistence Unit Validation Mode Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitValidationModeType_2_0()
- * @generated
- */
- public static final EEnum XML_PERSISTENCE_UNIT_VALIDATION_MODE_TYPE_20 = eINSTANCE.getXmlPersistenceUnitValidationModeType_2_0();
-
- }
-
-} //PersistenceV2_0Package
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitCachingType_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitCachingType_2_0.java
deleted file mode 100644
index bb2abcae67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitCachingType_2_0.java
+++ /dev/null
@@ -1,312 +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.core.resource.persistence.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>Xml Persistence Unit Caching Type 20</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitCachingType_2_0()
- * @model
- * @generated
- */
-public enum XmlPersistenceUnitCachingType_2_0 implements Enumerator
-{
- /**
- * The '<em><b>ALL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ALL_VALUE
- * @generated
- * @ordered
- */
- ALL(0, "ALL", "ALL"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(1, "NONE", "NONE"),
-
- /**
- * The '<em><b>ENABLE SELECTIVE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ENABLE_SELECTIVE_VALUE
- * @generated
- * @ordered
- */
- ENABLE_SELECTIVE(2, "ENABLE_SELECTIVE", "ENABLE_SELECTIVE"),
-
- /**
- * The '<em><b>DISABLE SELECTIVE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DISABLE_SELECTIVE_VALUE
- * @generated
- * @ordered
- */
- DISABLE_SELECTIVE(3, "DISABLE_SELECTIVE", "DISABLE_SELECTIVE"),
-
- /**
- * The '<em><b>UNSPECIFIED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #UNSPECIFIED_VALUE
- * @generated
- * @ordered
- */
- UNSPECIFIED(4, "UNSPECIFIED", "UNSPECIFIED");
-
- /**
- * The '<em><b>ALL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ALL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ALL
- * @model
- * @generated
- * @ordered
- */
- public static final int ALL_VALUE = 0;
-
- /**
- * 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 = 1;
-
- /**
- * The '<em><b>ENABLE SELECTIVE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ENABLE SELECTIVE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ENABLE_SELECTIVE
- * @model
- * @generated
- * @ordered
- */
- public static final int ENABLE_SELECTIVE_VALUE = 2;
-
- /**
- * The '<em><b>DISABLE SELECTIVE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DISABLE SELECTIVE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DISABLE_SELECTIVE
- * @model
- * @generated
- * @ordered
- */
- public static final int DISABLE_SELECTIVE_VALUE = 3;
-
- /**
- * The '<em><b>UNSPECIFIED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>UNSPECIFIED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #UNSPECIFIED
- * @model
- * @generated
- * @ordered
- */
- public static final int UNSPECIFIED_VALUE = 4;
-
- /**
- * An array of all the '<em><b>Xml Persistence Unit Caching Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlPersistenceUnitCachingType_2_0[] VALUES_ARRAY =
- new XmlPersistenceUnitCachingType_2_0[]
- {
- ALL,
- NONE,
- ENABLE_SELECTIVE,
- DISABLE_SELECTIVE,
- UNSPECIFIED,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Persistence Unit Caching Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlPersistenceUnitCachingType_2_0> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Caching Type 20</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitCachingType_2_0 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitCachingType_2_0 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Caching Type 20</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitCachingType_2_0 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitCachingType_2_0 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Caching Type 20</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitCachingType_2_0 get(int value)
- {
- switch (value)
- {
- case ALL_VALUE: return ALL;
- case NONE_VALUE: return NONE;
- case ENABLE_SELECTIVE_VALUE: return ENABLE_SELECTIVE;
- case DISABLE_SELECTIVE_VALUE: return DISABLE_SELECTIVE;
- case UNSPECIFIED_VALUE: return UNSPECIFIED;
- }
- 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 XmlPersistenceUnitCachingType_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;
- }
-
-} //XmlPersistenceUnitCachingType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitValidationModeType_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitValidationModeType_2_0.java
deleted file mode 100644
index a2758c35b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnitValidationModeType_2_0.java
+++ /dev/null
@@ -1,258 +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.core.resource.persistence.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>Xml Persistence Unit Validation Mode Type 20</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnitValidationModeType_2_0()
- * @model
- * @generated
- */
-public enum XmlPersistenceUnitValidationModeType_2_0 implements Enumerator
-{
- /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(0, "AUTO", "AUTO"),
-
- /**
- * The '<em><b>CALLBACK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CALLBACK_VALUE
- * @generated
- * @ordered
- */
- CALLBACK(1, "CALLBACK", "CALLBACK"),
-
- /**
- * 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>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 = 0;
-
- /**
- * The '<em><b>CALLBACK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CALLBACK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CALLBACK
- * @model
- * @generated
- * @ordered
- */
- public static final int CALLBACK_VALUE = 1;
-
- /**
- * 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>Xml Persistence Unit Validation Mode Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlPersistenceUnitValidationModeType_2_0[] VALUES_ARRAY =
- new XmlPersistenceUnitValidationModeType_2_0[]
- {
- AUTO,
- CALLBACK,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Persistence Unit Validation Mode Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlPersistenceUnitValidationModeType_2_0> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Validation Mode Type 20</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitValidationModeType_2_0 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitValidationModeType_2_0 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Validation Mode Type 20</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitValidationModeType_2_0 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlPersistenceUnitValidationModeType_2_0 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Persistence Unit Validation Mode Type 20</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlPersistenceUnitValidationModeType_2_0 get(int value)
- {
- switch (value)
- {
- case AUTO_VALUE: return AUTO;
- case CALLBACK_VALUE: return CALLBACK;
- 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 XmlPersistenceUnitValidationModeType_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;
- }
-
-} //XmlPersistenceUnitValidationModeType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnit_2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnit_2_0.java
deleted file mode 100644
index 586ccabf7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/persistence/v2_0/XmlPersistenceUnit_2_0.java
+++ /dev/null
@@ -1,96 +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.core.resource.persistence.v2_0;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit 20</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getSharedCacheMode <em>Shared Cache Mode</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getValidationMode <em>Validation Mode</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnit_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPersistenceUnit_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Shared Cache Mode</b></em>' attribute.
- * The default value is <code>"UNSPECIFIED"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Shared Cache Mode</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 Cache Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see #setSharedCacheMode(XmlPersistenceUnitCachingType_2_0)
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnit_2_0_SharedCacheMode()
- * @model default="UNSPECIFIED" unique="false"
- * @generated
- */
- XmlPersistenceUnitCachingType_2_0 getSharedCacheMode();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getSharedCacheMode <em>Shared Cache Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Shared Cache Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitCachingType_2_0
- * @see #getSharedCacheMode()
- * @generated
- */
- void setSharedCacheMode(XmlPersistenceUnitCachingType_2_0 value);
-
- /**
- * Returns the value of the '<em><b>Validation Mode</b></em>' attribute.
- * The default value is <code>"AUTO"</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation Mode</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 Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see #setValidationMode(XmlPersistenceUnitValidationModeType_2_0)
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package#getXmlPersistenceUnit_2_0_ValidationMode()
- * @model default="AUTO" unique="false"
- * @generated
- */
- XmlPersistenceUnitValidationModeType_2_0 getValidationMode();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnit_2_0#getValidationMode <em>Validation Mode</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation Mode</em>' attribute.
- * @see org.eclipse.jpt.core.resource.persistence.v2_0.XmlPersistenceUnitValidationModeType_2_0
- * @see #getValidationMode()
- * @generated
- */
- void setValidationMode(XmlPersistenceUnitValidationModeType_2_0 value);
-
-} // XmlPersistenceUnit_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaEObject.java
deleted file mode 100644
index 131e9749c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaEObject.java
+++ /dev/null
@@ -1,300 +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.core.resource.xml;
-
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Set;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.jpt.core.utility.AbstractTextRange;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.EMF2DOMAdapter;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 abstract class AbstractJpaEObject
- extends EObjectImpl
- implements JpaEObject
-{
- protected IDOMNode node;
-
- /**
- * Sets of "insignificant" feature ids, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final Hashtable<Class<? extends AbstractJpaEObject>, HashSet<Integer>> insignificantFeatureIdSets = new Hashtable<Class<? extends AbstractJpaEObject>, HashSet<Integer>>();
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractJpaEObject() {
- super();
- }
-
-
- // ********** JpaEObject implementation **********
-
- public boolean isUnset() {
- for (EStructuralFeature feature : this.eClass().getEAllStructuralFeatures()) {
- if (this.eIsSet(feature)) {
- return false;
- }
- }
- return true;
- }
-
-
- // ********** change notification **********
-
- /**
- * override to build a custom list for the adapters
- */
- @Override
- public EList<Adapter> eAdapters() {
- if (this.eAdapters == null) {
- this.eAdapters = new XmlEAdapterList<Adapter>(this);
- }
- return this.eAdapters;
- }
-
- /**
- * override to prevent notification when the object's state is unchanged
- */
- @Override
- public void eNotify(Notification notification) {
- if ( ! notification.isTouch()) {
- super.eNotify(notification);
- this.featureChanged(notification.getFeatureID(this.getClass()));
- }
- }
-
- protected void featureChanged(int featureId) {
- if (this.featureIsSignificant(featureId)) {
- this.getXmlResource().resourceModelChanged();
- }
- }
-
- protected JpaXmlResource getXmlResource() {
- return (JpaXmlResource) this.eResource();
- }
-
- protected boolean featureIsSignificant(int featureId) {
- return ! this.featureIsInsignificant(featureId);
- }
-
- protected boolean featureIsInsignificant(int featureId) {
- return this.insignificantFeatureIds().contains(Integer.valueOf(featureId));
- }
-
- /**
- * Return a set of the object's "insignificant" feature ids.
- * These are the EMF features that will not be used to determine if all
- * the features are unset. We use this to determine when to remove
- * an element from the xml.
- *
- * If you need instance-based calculation of your xml "insignificant" aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addInsignificantXmlFeatureIdsTo(Set).
- *
- * @see isAllFeaturesUnset()
- */
- protected Set<Integer> insignificantFeatureIds() {
- synchronized (insignificantFeatureIdSets) {
- HashSet<Integer> insignificantXmlFeatureIds = insignificantFeatureIdSets.get(this.getClass());
- if (insignificantXmlFeatureIds == null) {
- insignificantXmlFeatureIds = new HashSet<Integer>();
- this.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
- insignificantFeatureIdSets.put(this.getClass(), insignificantXmlFeatureIds);
- }
- return insignificantXmlFeatureIds;
- }
- }
-
- /**
- * Add the object's "insignificant" feature ids to the specified set.
- * These are the EMF features that, when they change, will NOT cause the
- * object (or its containing tree) to be updated, i.e. defaults calculated.
- * If class-based calculation of your "insignificant" features is sufficient,
- * override this method. If you need instance-based calculation,
- * override #insignificantXmlFeatureIds().
- */
- protected void addInsignificantXmlFeatureIdsTo(@SuppressWarnings("unused") Set<Integer> insignificantXmlFeatureIds) {
- // when you override this method, don't forget to include:
- // super.addInsignificantXmlFeatureIdsTo(insignificantXmlFeatureIds);
- }
-
-
- // ********** text ranges **********
-
- /**
- * Return a text range for the "text" node.
- * If the text node does not exist, return a text range for this object's node
- */
- protected TextRange getTextTextRange() {
- IDOMNode textNode = this.getTextNode();
- return (textNode != null) ? buildTextRange(textNode) : this.getValidationTextRange();
- }
-
- protected IDOMNode getTextNode() {
- if (this.node == null) return null; // virtual objects have no node
- NodeList children = this.node.getChildNodes();
- for (int i = 0; i < children.getLength(); i ++) {
- IDOMNode child = (IDOMNode) children.item(i);
- if (child.getNodeType() == Node.TEXT_NODE) {
- return child;
- }
- }
- return null;
- }
-
- /**
- * Return a text range for the specified attribute node.
- * If the attribute node does not exist, return a text range for this object's
- * node
- */
- protected TextRange getAttributeTextRange(String attributeName) {
- IDOMNode attributeNode = this.getAttributeNode(attributeName);
- return (attributeNode != null) ? buildTextRange(attributeNode) : this.getValidationTextRange();
- }
-
- protected IDOMNode getAttributeNode(String attributeName) {
- return (this.node == null) ? // virtual objects have no node
- null : (IDOMNode) this.node.getAttributes().getNamedItem(attributeName);
- }
-
- /**
- * Return a text range for the specified element node.
- * If the element node does not exist, return a text range for this object's
- * node
- */
- protected TextRange getElementTextRange(String elementName) {
- IDOMNode elementNode = this.getElementNode(elementName);
- return (elementNode != null) ? buildTextRange(elementNode) : this.getValidationTextRange();
- }
-
- /**
- * Returns the first element node with the given name, if one exists
- */
- protected IDOMNode getElementNode(String elementName) {
- if (this.node == null) return null; // virtual objects have no node
- NodeList children = this.node.getChildNodes();
- for (int i = 0; i < children.getLength(); i ++) {
- IDOMNode child = (IDOMNode) children.item(i);
- if ((child.getNodeType() == Node.ELEMENT_NODE)
- && elementName.equals(child.getNodeName())) {
- return child;
- }
- }
- return null;
- }
-
- public TextRange getValidationTextRange() {
- return this.getFullTextRange();
- }
-
- public TextRange getSelectionTextRange() {
- return this.getFullTextRange();
- }
-
- protected TextRange getFullTextRange() {
- return buildTextRange(this.node);
- }
-
- protected static TextRange buildTextRange(IDOMNode domNode) {
- return (domNode == null) ? null : new DOMNodeTextRange(domNode);
- }
-
- public boolean containsOffset(int textOffset) {
- return (this.node == null) ? false : this.node.contains(textOffset);
- }
-
-
- // ********** custom adapter list **********
-
- protected static class XmlEAdapterList<E extends Object & Adapter>
- extends EAdapterList<E>
- {
- public XmlEAdapterList(AbstractJpaEObject jpaEObject) {
- super(jpaEObject);
- }
-
- @Override
- protected void didAdd(int index, E newObject) {
- super.didAdd(index, newObject);
- if (newObject instanceof EMF2DOMAdapter) {
- Object n = ((EMF2DOMAdapter) newObject).getNode();
- if (n instanceof IDOMNode) {
- ((AbstractJpaEObject) this.notifier).node = (IDOMNode) n;
- }
- }
- }
-
- @Override
- protected void didRemove(int index, E oldObject) {
- if ((oldObject instanceof EMF2DOMAdapter) &&
- (((EMF2DOMAdapter) oldObject).getNode() == ((AbstractJpaEObject) this.notifier).node)) {
- ((AbstractJpaEObject) this.notifier).node = null;
- }
- super.didRemove(index, oldObject);
- }
- }
-
-
- // ********** DOM node text range **********
-
- /**
- * Adapt an IDOMNode to the TextRange interface.
- */
- protected static class DOMNodeTextRange
- extends AbstractTextRange
- {
- private final IDOMNode node;
-
- DOMNodeTextRange(IDOMNode node) {
- super();
- this.node = node;
- }
-
- public int getOffset() {
- return this.node.getStartOffset();
- }
-
- public int getLength() {
- if (this.node.getNodeType() == Node.ELEMENT_NODE) {
- return ((IDOMElement) this.node).getStartEndOffset() - this.node.getStartOffset();
- }
- return this.node.getLength();
- }
-
- public int getLineNumber() {
- return this.node.getStructuredDocument().getLineOfOffset(this.getOffset()) + 1;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaRootEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaRootEObject.java
deleted file mode 100644
index 977e4f327b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/AbstractJpaRootEObject.java
+++ /dev/null
@@ -1,336 +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.core.resource.xml;
-
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.core.internal.utility.translators.EnumeratedValueTranslator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.wst.common.internal.emf.resource.ConstantAttributeTranslator;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Jpa Root EObject</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.core.resource.xml.CommonPackage#getAbstractJpaRootEObject()
- * @model kind="class" abstract="true"
- * @generated
- */
-public abstract class AbstractJpaRootEObject extends AbstractJpaEObject implements JpaRootEObject
-{
- /**
- * The default value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected static final String VERSION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVersion()
- * @generated
- * @ordered
- */
- protected String version = VERSION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchemaLocation() <em>Schema Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchemaLocation()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_LOCATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchemaLocation() <em>Schema Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchemaLocation()
- * @generated
- * @ordered
- */
- protected String schemaLocation = SCHEMA_LOCATION_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected AbstractJpaRootEObject()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return CommonPackage.Literals.ABSTRACT_JPA_ROOT_EOBJECT;
- }
-
- /**
- * Returns the value of the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Version</em>' attribute.
- * @see #setVersion(String)
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject_Version()
- * @model required="true"
- * @generated
- */
- public String getVersion()
- {
- return version;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #getVersion()
- * @generated
- */
- protected void setVersionGen(String newVersion)
- {
- String oldVersion = version;
- version = newVersion;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__VERSION, oldVersion, version));
- }
-
- public void setVersion(String newVersion) {
- setVersionGen(newVersion);
- setSchemaLocation(buildSchemaLocationString(getNamespace(), getSchemaLocationForVersion(newVersion)));
- }
-
- /**
- * Returns the value of the '<em><b>Schema Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema Location</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 Location</em>' attribute.
- * @see #setSchemaLocation(String)
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject_SchemaLocation()
- * @model required="true"
- * @generated
- */
- public String getSchemaLocation()
- {
- return schemaLocation;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject#getSchemaLocation <em>Schema Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema Location</em>' attribute.
- * @see #getSchemaLocation()
- * @generated
- */
- public void setSchemaLocation(String newSchemaLocation)
- {
- String oldSchemaLocation = schemaLocation;
- schemaLocation = newSchemaLocation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION, oldSchemaLocation, schemaLocation));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__VERSION:
- return getVersion();
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION:
- return getSchemaLocation();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__VERSION:
- setVersion((String)newValue);
- return;
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION:
- setSchemaLocation((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__VERSION:
- setVersion(VERSION_EDEFAULT);
- return;
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION:
- setSchemaLocation(SCHEMA_LOCATION_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__VERSION:
- return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version);
- case CommonPackage.ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION:
- return SCHEMA_LOCATION_EDEFAULT == null ? schemaLocation != null : !SCHEMA_LOCATION_EDEFAULT.equals(schemaLocation);
- }
- 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(" (version: ");
- result.append(version);
- result.append(", schemaLocation: ");
- result.append(schemaLocation);
- result.append(')');
- return result.toString();
- }
-
-
- // **************** validation ********************************************
-
- public TextRange getVersionTextRange() {
- return getAttributeTextRange(XML.VERSION);
- }
-
-
- // **************** version -> schema location mapping ********************
-
- protected abstract String getNamespace();
-
- protected abstract String getSchemaLocationForVersion(String version);
-
- private static String buildSchemaLocationString(String namespace, String schemaLocation) {
- return namespace + ' ' + schemaLocation;
- }
-
-
- // **************** translators *******************************************
-
- protected static Translator buildVersionTranslator(final Map<String, String> versionsToSchemaLocations) {
- return new EnumeratedValueTranslator(
- XML.VERSION,
- CommonPackage.eINSTANCE.getJpaRootEObject_Version(),
- Translator.DOM_ATTRIBUTE) {
-
- @Override
- protected Iterator<String> enumeratedObjectValues() {
- return versionsToSchemaLocations.keySet().iterator();
- }
- };
- }
-
- protected static Translator buildNamespaceTranslator(String namespace) {
- return new ConstantAttributeTranslator(XML.NAMESPACE, namespace);
- }
-
- protected static Translator buildSchemaNamespaceTranslator() {
- return new ConstantAttributeTranslator(XML.NAMESPACE_XSI, XML.XSI_NAMESPACE_URL);
- }
-
- protected static Translator buildSchemaLocationTranslator(
- final String namespace,
- final Map<String, String> versionsToSchemaLocations) {
-
- return new EnumeratedValueTranslator(
- XML.XSI_SCHEMA_LOCATION,
- CommonPackage.eINSTANCE.getJpaRootEObject_SchemaLocation(),
- Translator.DOM_ATTRIBUTE) {
-
- @Override
- protected Iterator<String> enumeratedObjectValues() {
- return new TransformationIterator<String, String>(versionsToSchemaLocations.values().iterator()) {
- @Override
- protected String transform(String next) {
- return buildSchemaLocationString(namespace, next);
- }
- };
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonFactory.java
deleted file mode 100644
index 594bad9f12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonFactory.java
+++ /dev/null
@@ -1,115 +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.core.resource.xml;
-
-import org.eclipse.emf.ecore.EClass;
-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.core.resource.xml.CommonPackage
- * @generated
- */
-public class CommonFactory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final CommonFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CommonFactory init()
- {
- try
- {
- CommonFactory theCommonFactory = (CommonFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.common.xmi");
- if (theCommonFactory != null)
- {
- return theCommonFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new CommonFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CommonFactory()
- {
- 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
- */
- public CommonPackage getCommonPackage()
- {
- return (CommonPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static CommonPackage getPackage()
- {
- return CommonPackage.eINSTANCE;
- }
-
-} //CommonFactory
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonPackage.java
deleted file mode 100644
index da7c40bce3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/CommonPackage.java
+++ /dev/null
@@ -1,436 +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.core.resource.xml;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.persistence.PersistencePackage;
-import org.eclipse.jpt.core.resource.persistence.v2_0.PersistenceV2_0Package;
-
-/**
- * <!-- 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.core.resource.xml.CommonFactory
- * @model kind="package"
- * @generated
- */
-public class CommonPackage extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "xml";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.common.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.core.resource.xml";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final CommonPackage eINSTANCE = org.eclipse.jpt.core.resource.xml.CommonPackage.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject <em>Jpa Root EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.xml.JpaRootEObject
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject()
- * @generated
- */
- public static final int JPA_ROOT_EOBJECT = 1;
-
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int JPA_ROOT_EOBJECT__VERSION = 0;
-
- /**
- * The feature id for the '<em><b>Schema Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int JPA_ROOT_EOBJECT__SCHEMA_LOCATION = 1;
-
- /**
- * The number of structural features of the '<em>Jpa Root EObject</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int JPA_ROOT_EOBJECT_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject <em>Abstract Jpa Root EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getAbstractJpaRootEObject()
- * @generated
- */
- public static final int ABSTRACT_JPA_ROOT_EOBJECT = 0;
-
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_JPA_ROOT_EOBJECT__VERSION = JPA_ROOT_EOBJECT__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 ABSTRACT_JPA_ROOT_EOBJECT__SCHEMA_LOCATION = JPA_ROOT_EOBJECT__SCHEMA_LOCATION;
-
- /**
- * The number of structural features of the '<em>Abstract Jpa Root EObject</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ABSTRACT_JPA_ROOT_EOBJECT_FEATURE_COUNT = JPA_ROOT_EOBJECT_FEATURE_COUNT + 0;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass abstractJpaRootEObjectEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass jpaRootEObjectEClass = 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.core.resource.xml.CommonPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private CommonPackage()
- {
- super(eNS_URI, CommonFactory.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 CommonPackage#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 CommonPackage init()
- {
- if (isInited) return (CommonPackage)EPackage.Registry.INSTANCE.getEPackage(CommonPackage.eNS_URI);
-
- // Obtain or create and register package
- CommonPackage theCommonPackage = (CommonPackage)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof CommonPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new CommonPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- EcorePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- OrmPackage theOrmPackage = (OrmPackage)(EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) instanceof OrmPackage ? EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI) : OrmPackage.eINSTANCE);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) instanceof OrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI) : OrmV2_0Package.eINSTANCE);
- PersistencePackage thePersistencePackage = (PersistencePackage)(EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) instanceof PersistencePackage ? EPackage.Registry.INSTANCE.getEPackage(PersistencePackage.eNS_URI) : PersistencePackage.eINSTANCE);
- PersistenceV2_0Package thePersistenceV2_0Package = (PersistenceV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) instanceof PersistenceV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(PersistenceV2_0Package.eNS_URI) : PersistenceV2_0Package.eINSTANCE);
-
- // Create package meta-data objects
- theCommonPackage.createPackageContents();
- theOrmPackage.createPackageContents();
- theOrmV2_0Package.createPackageContents();
- thePersistencePackage.createPackageContents();
- thePersistenceV2_0Package.createPackageContents();
-
- // Initialize created meta-data
- theCommonPackage.initializePackageContents();
- theOrmPackage.initializePackageContents();
- theOrmV2_0Package.initializePackageContents();
- thePersistencePackage.initializePackageContents();
- thePersistenceV2_0Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theCommonPackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(CommonPackage.eNS_URI, theCommonPackage);
- return theCommonPackage;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject <em>Abstract Jpa Root EObject</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Abstract Jpa Root EObject</em>'.
- * @see org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject
- * @generated
- */
- public EClass getAbstractJpaRootEObject()
- {
- return abstractJpaRootEObjectEClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject <em>Jpa Root EObject</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Jpa Root EObject</em>'.
- * @see org.eclipse.jpt.core.resource.xml.JpaRootEObject
- * @generated
- */
- public EClass getJpaRootEObject()
- {
- return jpaRootEObjectEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject#getVersion <em>Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Version</em>'.
- * @see org.eclipse.jpt.core.resource.xml.JpaRootEObject#getVersion()
- * @see #getJpaRootEObject()
- * @generated
- */
- public EAttribute getJpaRootEObject_Version()
- {
- return (EAttribute)jpaRootEObjectEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject#getSchemaLocation <em>Schema Location</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema Location</em>'.
- * @see org.eclipse.jpt.core.resource.xml.JpaRootEObject#getSchemaLocation()
- * @see #getJpaRootEObject()
- * @generated
- */
- public EAttribute getJpaRootEObject_SchemaLocation()
- {
- return (EAttribute)jpaRootEObjectEClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * 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 CommonFactory getCommonFactory()
- {
- return (CommonFactory)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
- abstractJpaRootEObjectEClass = createEClass(ABSTRACT_JPA_ROOT_EOBJECT);
-
- jpaRootEObjectEClass = createEClass(JPA_ROOT_EOBJECT);
- createEAttribute(jpaRootEObjectEClass, JPA_ROOT_EOBJECT__VERSION);
- createEAttribute(jpaRootEObjectEClass, JPA_ROOT_EOBJECT__SCHEMA_LOCATION);
- }
-
- /**
- * <!-- 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);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- abstractJpaRootEObjectEClass.getESuperTypes().add(this.getJpaRootEObject());
-
- // Initialize classes and features; add operations and parameters
- initEClass(abstractJpaRootEObjectEClass, AbstractJpaRootEObject.class, "AbstractJpaRootEObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(jpaRootEObjectEClass, JpaRootEObject.class, "JpaRootEObject", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getJpaRootEObject_Version(), ecorePackage.getEString(), "version", null, 1, 1, JpaRootEObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getJpaRootEObject_SchemaLocation(), ecorePackage.getEString(), "schemaLocation", null, 1, 1, JpaRootEObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // 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.core.resource.xml.AbstractJpaRootEObject <em>Abstract Jpa Root EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.xml.AbstractJpaRootEObject
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getAbstractJpaRootEObject()
- * @generated
- */
- public static final EClass ABSTRACT_JPA_ROOT_EOBJECT = eINSTANCE.getAbstractJpaRootEObject();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject <em>Jpa Root EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.resource.xml.JpaRootEObject
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject()
- * @generated
- */
- public static final EClass JPA_ROOT_EOBJECT = eINSTANCE.getJpaRootEObject();
-
- /**
- * The meta object literal for the '<em><b>Version</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute JPA_ROOT_EOBJECT__VERSION = eINSTANCE.getJpaRootEObject_Version();
-
- /**
- * The meta object literal for the '<em><b>Schema Location</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute JPA_ROOT_EOBJECT__SCHEMA_LOCATION = eINSTANCE.getJpaRootEObject_SchemaLocation();
-
- }
-
-} //CommonPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/EmfTools.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/EmfTools.java
deleted file mode 100644
index 95e53ec8f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/EmfTools.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.core.resource.xml;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EmfTools
-{
- public static <T extends EObject> T create(
- EFactory eFactory, EClass eClass, Class<T> javaClass) {
-
- EPackage ePackage = eFactory.getEPackage();
- for (EClassifier each : ePackage.getEClassifiers()) {
- if (each instanceof EClass) {
- EClass eachEClass = (EClass) each;
- if (eClass.isSuperTypeOf(eachEClass)) {
- return (T) eFactory.create(eachEClass);
- }
- }
- }
- throw new IllegalArgumentException(
- "Factory does not support objects of type \'" + eClass.getName() + "\'"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaEObject.java
deleted file mode 100644
index 32e702b496..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaEObject.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.core.resource.xml;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Common Dali behavior for EMF objects.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JpaEObject
- extends EObject
-{
- /**
- * Return whether all the object's EMF features are "unset".
- */
- boolean isUnset();
-
- /**
- * Return true if this object's text representation contains the text offset
- */
- boolean containsOffset(int textOffset);
-
- /**
- * Return the text range to be used for validation. This is the source
- * range that will be highlighted for a validation error.
- */
- TextRange getValidationTextRange();
-
- /**
- * Return the text range to be used for selection. This is the source
- * range that will be highlighted when selecting in the structure view.
- */
- TextRange getSelectionTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaRootEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaRootEObject.java
deleted file mode 100644
index c3e27b1c9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaRootEObject.java
+++ /dev/null
@@ -1,96 +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.core.resource.xml;
-
-import org.eclipse.jpt.core.utility.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Jpa Root EObject</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.core.resource.xml.JpaRootEObject#getVersion <em>Version</em>}</li>
- * <li>{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject#getSchemaLocation <em>Schema Location</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface JpaRootEObject extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Version</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Version</em>' attribute.
- * @see #setVersion(String)
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject_Version()
- * @model required="true"
- * @generated
- */
- String getVersion();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject#getVersion <em>Version</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Version</em>' attribute.
- * @see #getVersion()
- * @generated
- */
- void setVersion(String value);
-
- /**
- * Returns the value of the '<em><b>Schema Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema Location</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 Location</em>' attribute.
- * @see #setSchemaLocation(String)
- * @see org.eclipse.jpt.core.resource.xml.CommonPackage#getJpaRootEObject_SchemaLocation()
- * @model required="true"
- * @generated
- */
- String getSchemaLocation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.core.resource.xml.JpaRootEObject#getSchemaLocation <em>Schema Location</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema Location</em>' attribute.
- * @see #getSchemaLocation()
- * @generated
- */
- void setSchemaLocation(String value);
-
- TextRange getVersionTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaXmlResource.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaXmlResource.java
deleted file mode 100644
index b17102f77b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/JpaXmlResource.java
+++ /dev/null
@@ -1,305 +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.core.resource.xml;
-
-import java.io.IOException;
-import java.util.Collections;
-
-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.core.runtime.content.IContentType;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-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.jem.util.emf.workbench.WorkbenchResourceHelperBase;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-import org.eclipse.jpt.core.JpaResourceModel;
-import org.eclipse.jpt.core.JpaResourceModelListener;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jst.j2ee.internal.xml.J2EEXmlDtDEntityResolver;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceImpl;
-import org.xml.sax.EntityResolver;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 class JpaXmlResource
- extends TranslatorResourceImpl
- implements JpaResourceModel
-{
- /**
- * cache the content type - if the content type changes, the JPA project
- * will throw out the JPA file holding the xml resource and build a new one
- */
- protected final IContentType contentType;
-
- protected final Translator rootTranslator;
-
- protected final ListenerList<JpaResourceModelListener> resourceModelListenerList =
- new ListenerList<JpaResourceModelListener>(JpaResourceModelListener.class);
-
-
- public JpaXmlResource(URI uri, Renderer renderer, IContentType contentType, Translator rootTranslator) {
- super(uri, renderer);
- this.contentType = contentType;
- this.rootTranslator = rootTranslator;
- }
-
- public IContentType getContentType() {
- return this.contentType;
- }
-
- public String getVersion() {
- JpaRootEObject root = this.getRootObject();
- return (root == null) ? null : root.getVersion();
- }
-
-
- // ********** BasicNotifierImpl override **********
-
- /**
- * Override to fire notification only when:<ul>
- * <li>the resource's state has actually changed; and
- * <li>the resource is loaded; and
- * <li>the resource's resource set is still present (EMF will fire an
- * notification when the resource set is set to 'null', just before
- * the resource is "unloaded" - we want to swallow this notification)
- * </ul>
- */
- @Override
- public void eNotify(Notification notification) {
- // unload events can happen before the resource set is removed - should always react to unload events
- if (this.loadedFlagCleared(notification)) {
- super.eNotify(notification);
- if (this.isReverting()) {
- this.resourceModelReverted();
- } else {
- this.resourceModelUnloaded();
- }
- }
- else if ( ! notification.isTouch() && this.isLoaded() && (this.resourceSet != null)) {
- super.eNotify(notification);
- this.resourceModelChanged();
- }
- }
-
- /**
- * Return whether the specified notification indicates the resource has been
- * unloaded.
- * we could use this method to suppress some notifications; or we could just
- * check whether 'resourceSet' is 'null' (which is what we do)
- */
- protected boolean loadedFlagCleared(Notification notification) {
- return (notification.getNotifier() == this) &&
- (notification.getEventType() == Notification.SET) &&
- (notification.getFeatureID(Resource.class) == RESOURCE__IS_LOADED) &&
- ( ! notification.getNewBooleanValue());
- }
-
- /**
- * Return whether the specified notification indicates the resource's
- * resource set was cleared.
- * We could use this method to suppress some resource set notifications;
- * or we could just check whether <code>resourceSet</code> is
- * <code>null</code> (which is what we do)/
- */
- protected boolean resultSetCleared(Notification notification) {
- return (notification.getNotifier() == this) &&
- (notification.getEventType() == Notification.SET) &&
- (notification.getFeatureID(Resource.class) == RESOURCE__RESOURCE_SET) &&
- (notification.getNewValue() == null);
- }
-
-
- // ********** TranslatorResource implementation **********
-
- /**
- * only applicable for DTD-based files
- */
- public String getDoctype() {
- return null;
- }
-
- public Translator getRootTranslator() {
- return this.rootTranslator;
- }
-
-
- // ********** TranslatorResourceImpl implementation **********
-
- /**
- * only applicable for DTD-based files
- */
- @Override
- protected String getDefaultPublicId() {
- return null;
- }
-
- /**
- * only applicable for DTD-based files
- */
- @Override
- protected String getDefaultSystemId() {
- return null;
- }
-
- /**
- * this seems to be the default version of the spec for this doc
- * and the id 10 maps to the version 1.0
- */
- @Override
- protected int getDefaultVersionID() {
- return 10;
- }
-
- @Override
- public JpaRootEObject getRootObject() {
- EObject root = super.getRootObject();
- try {
- return (JpaRootEObject) root;
- } catch (ClassCastException ex) {
- throw new IllegalStateException("The root object of a JPA XML resource must implement JpaRootEObject: " + root, ex); //$NON-NLS-1$
- }
- }
-
- //296544 - override this to avoid internet access finding the schema during tests
- @Override
- public EntityResolver getEntityResolver() {
- return J2EEXmlDtDEntityResolver.INSTANCE;
- }
-
-
- // ********** convenience methods **********
-
- public boolean fileExists() {
- return this.getFile().exists();
- }
-
- public IFile getFile() {
- IFile file = this.getFile(this.uri);
- return (file != null) ? file : this.getConvertedURIFile();
- }
-
- protected IFile getConvertedURIFile() {
- if (this.resourceSet == null) {
- return null;
- }
- URI convertedURI = this.resourceSet.getURIConverter().normalize(this.uri);
- return this.uri.equals(convertedURI) ? null : this.getFile(convertedURI);
- }
-
- /**
- * Return the Eclipse file for the specified URI.
- * This URI is assumed to be absolute in the following format:
- * platform:/resource/....
- */
- protected IFile getFile(URI fileURI) {
- if ( ! WorkbenchResourceHelperBase.isPlatformResourceURI(fileURI)) {
- return null;
- }
- String fileName = URI.decode(fileURI.path()).substring(JEMUtilPlugin.PLATFORM_RESOURCE.length() + 1);
- return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(fileName));
- }
-
- public IProject getProject() {
- return this.getFile().getProject();
- }
-
- public void modify(Runnable runnable) {
- try {
- runnable.run();
- try {
- save(Collections.EMPTY_MAP);
- } catch (IOException ex) {
- JptCorePlugin.log(ex);
- }
- } catch (Exception ex) {
- JptCorePlugin.log(ex);
- }
- }
-
- @Override
- public String toString() {
- // implementation in TranslatorResourceImpl is a bit off...
- return StringTools.buildToStringFor(this, this.getURI());
- }
-
-
- // ********** JpaResourceModel implementation **********
-
- public JpaResourceType getResourceType() {
- if (this.contentType == null) {
- return null;
- }
- String version = this.getVersion();
- return (version == null) ? null : new JpaResourceType(this.contentType, version);
- }
-
- public void addResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.add(listener);
- }
-
- public void removeResourceModelListener(JpaResourceModelListener listener) {
- this.resourceModelListenerList.remove(listener);
- }
-
-
- // ********** listener notifications **********
-
- protected void resourceModelChanged() {
- for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelChanged(this);
- }
- }
-
- protected void resourceModelReverted() {
- for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelReverted(this);
- }
- }
-
- protected void resourceModelUnloaded() {
- for (JpaResourceModelListener listener : this.resourceModelListenerList.getListeners()) {
- listener.resourceModelUnloaded(this);
- }
- }
-
-
- // ********** cast things back to what they are in EMF **********
-
- @SuppressWarnings("unchecked")
- @Override
- public EList<Adapter> eAdapters() {
- return super.eAdapters();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public EList<EObject> getContents() {
- return super.getContents();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/XML.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/XML.java
deleted file mode 100644
index 99d75e5530..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/xml/XML.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.core.resource.xml;
-
-/**
- * XML-related stuff.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
- */
-@SuppressWarnings("nls")
-public interface XML
-{
- String VERSION = "version";
-
- String NAMESPACE = "xmlns";
-
- String NAMESPACE_XSI = "xmlns:xsi";
- String XSI_NAMESPACE_URL = "http://www.w3.org/2001/XMLSchema-instance";
-
- String XSI_SCHEMA_LOCATION = "xsi:schemaLocation";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java
deleted file mode 100644
index e57ce66bea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/AbstractTextRange.java
+++ /dev/null
@@ -1,71 +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.core.utility;
-
-import org.eclipse.jpt.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
-{
-
- public boolean includes(int index) {
- return (this.getOffset() <= index) && (index < this.end());
- }
-
- public boolean touches(int index) {
- return this.includes(index) || (index == this.end());
- }
-
- /**
- * The end offset is "exclusive", i.e. the element at the end offset
- * is not included in the range.
- */
- protected int end() {
- return this.getOffset() + this.getLength();
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == this.getOffset())
- && (r.getLength() == this.getLength());
- }
-
- @Override
- public int hashCode() {
- return this.getOffset() ^ this.getLength();
- }
-
- @Override
- public String toString() {
- String start = String.valueOf(this.getOffset());
- String end = String.valueOf(this.end());
- return StringTools.buildToStringFor(this, start + ", " + end); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/BodySourceWriter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/BodySourceWriter.java
deleted file mode 100644
index 0be7b18053..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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.utility.Filter;
-import org.eclipse.jpt.utility.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java
deleted file mode 100644
index 28303cea72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/TextRange.java
+++ /dev/null
@@ -1,119 +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.core.utility;
-
-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.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit 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.
- *
- * @version 2.0
- * @since 2.0
- */
-public interface TextRange {
-
- /**
- * Returns the offset of the text.
- *
- * @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();
-
- /**
- * Return true if the offsets and lengths are the same.
- */
- boolean equals(Object obj);
-
- /**
- * Return a hash code that corresponds to the #equals() contract.
- */
- int hashCode();
-
-
- /**
- * Empty implementation of text range.
- */
- final class Empty implements TextRange {
- 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;
- }
- public boolean includes(int index) {
- return false;
- }
- public boolean touches(int index) {
- return index == 0; // ???
- }
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof TextRange)) {
- return false;
- }
- TextRange r = (TextRange) o;
- return (r.getOffset() == 0)
- && (r.getLength() == 0);
- }
- @Override
- public int hashCode() {
- return 0;
- }
- @Override
- public String toString() {
- return "TextRange.Empty"; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationAdapter.java
deleted file mode 100644
index b0920c3816..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationEditFormatter.java
deleted file mode 100644
index f8c98a3984..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/AnnotationElementAdapter.java
deleted file mode 100644
index 2a5d589e49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.java
deleted file mode 100644
index 3842638f01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Attribute.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.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").
- */
- // TODO rename to getName()?
- 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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationAdapter.java
deleted file mode 100644
index 290d389e4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/DeclarationAnnotationElementAdapter.java
deleted file mode 100644
index 70f1a79558..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ExpressionConverter.java
deleted file mode 100644
index d21d0c7a37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/FieldAttribute.java
deleted file mode 100644
index 4046cf9f49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedAnnotationAdapter.java
deleted file mode 100644
index ba2209e3cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/IndexedDeclarationAnnotationAdapter.java
deleted file mode 100644
index 1336363bd6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java
deleted file mode 100644
index d36bbf6862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Member.java
+++ /dev/null
@@ -1,91 +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.core.utility.jdt;
-
-import org.eclipse.jdt.core.dom.BodyDeclaration;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.IBinding;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * 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 {
-
- /**
- * Return the member's body declaration from the specified AST.
- * This can be null if the member is no longer present in the AST
- * because the source has been changed in another thread.
- */
- BodyDeclaration getBodyDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the member's binding from the specified AST.
- */
- IBinding getBinding(CompilationUnit astRoot);
-
- /**
- * Return the member's "modified" declaration from the specified AST.
- */
- ModifiedDeclaration getModifiedDeclaration(CompilationUnit astRoot);
-
- /**
- * Return the member's "modified" declaration from a newly-generated AST.
- */
- ModifiedDeclaration getModifiedDeclaration();
-
- /**
- * Return whether the attribute is a persistable field or property getter.
- */
- boolean isPersistable(CompilationUnit astRoot);
-
- /**
- * Return whether the member matches the specified member
- * and occurrence.
- */
- boolean matches(String memberName, int occurrence);
-
- /**
- * Return the member's name text range from the specified AST.
- */
- TextRange getNameTextRange(CompilationUnit astRoot);
-
- /**
- * Edit the member's declaration using the specified editor.
- */
- void edit(Editor editor);
-
-
- // ********** "editor" interface **********
-
- /**
- * This interface defines a callback that is invoked when the member'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 member's compilation unit.
- */
- void edit(ModifiedDeclaration declaration);
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java
deleted file mode 100644
index 4637ab76cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/MethodAttribute.java
+++ /dev/null
@@ -1,46 +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.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.utility.MethodSignature;
-
-/**
- * Property 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.
- */
-// TODO rename PropertyAttribute?
-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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/ModifiedDeclaration.java
deleted file mode 100644
index c36d582fa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/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.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/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.java
deleted file mode 100644
index 26726d98a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/utility/jdt/Type.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.core.utility.jdt;
-
-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.MethodDeclaration;
-import org.eclipse.jdt.core.dom.TypeDeclaration;
-
-/**
- * Type: 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 Type extends Member {
-
- /**
- * Covariant override.
- */
- ITypeBinding getBinding(CompilationUnit astRoot);
-
- /**
- * 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 fields.
- */
- FieldDeclaration[] getFields(CompilationUnit astRoot);
-
- /**
- * Return the type's methods.
- */
- MethodDeclaration[] getMethods(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.db.ui/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ 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 88ea5da610..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.db.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8fa7db1fac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:22 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 842c286bb1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:42 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 99dd8f5a2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db.ui
-Bundle-Version: 1.1.200.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.db;bundle-version="[1.2.0,2.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.db.ui.internal; x-friends:="org.eclipse.jpt.ui"
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.db.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.db.ui/build.properties
deleted file mode 100644
index 41837ebdd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.db.ui/component.xml
deleted file mode 100644
index cb5c8c39d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.db.ui/plugin.properties
deleted file mode 100644
index eac396ce77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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 - DB UI
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/db/ui/internal/DTPUiTools.java
deleted file mode 100644
index 5e0fd6a3db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/src/org/eclipse/jpt/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.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
- * JptDbPlugin.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.db/.classpath b/jpa/plugins/org.eclipse.jpt.db/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.db/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ 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 5675a48e3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.db/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 84ebb5c739..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:02 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 929d54536d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:18 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.db/META-INF/MANIFEST.MF
deleted file mode 100644
index eba715983c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db
-Bundle-Version: 1.2.200.qualifier
-Bundle-Activator: org.eclipse.jpt.db.JptDbPlugin
-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.utility;bundle-version="[1.2.0,2.0.0)"
-Export-Package: org.eclipse.jpt.db,
- org.eclipse.jpt.db.internal;x-internal:=true,
- org.eclipse.jpt.db.internal.vendor;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.db/about.html b/jpa/plugins/org.eclipse.jpt.db/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db/build.properties b/jpa/plugins/org.eclipse.jpt.db/build.properties
deleted file mode 100644
index b56290810e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/build.properties
+++ /dev/null
@@ -1,18 +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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.db/component.xml b/jpa/plugins/org.eclipse.jpt.db/component.xml
deleted file mode 100644
index 239174409f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.db"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.db" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.db/plugin.properties
deleted file mode 100644
index 0b9199034a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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 - DB
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.java
deleted file mode 100644
index 69cfd0801b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Catalog.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.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.db/src/org/eclipse/jpt/db/Column.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java
deleted file mode 100644
index e1ee3fda36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Column.java
+++ /dev/null
@@ -1,120 +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.db;
-
-import org.eclipse.jpt.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.db/src/org/eclipse/jpt/db/ConnectionAdapter.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.java
deleted file mode 100644
index c18f3f995f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionAdapter.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.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.db/src/org/eclipse/jpt/db/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java
deleted file mode 100644
index 0c15b93187..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionListener.java
+++ /dev/null
@@ -1,41 +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.db;
-
-import java.util.EventListener;
-
-/**
- * A <code>ConnectionListener</code> is notified of any changes to a connection.
- * <p>
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- * <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 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.db/src/org/eclipse/jpt/db/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java
deleted file mode 100644
index d16a7e8d41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfile.java
+++ /dev/null
@@ -1,202 +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.db;
-
-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 null 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();
-
- // ********** 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();
-
-
- // ********** 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.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.java
deleted file mode 100644
index 832b56f73a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileAdapter.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.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.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java
deleted file mode 100644
index 5001c55663..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileFactory.java
+++ /dev/null
@@ -1,62 +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.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 null 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 converted to names and vice versa.
- */
- ConnectionProfile buildConnectionProfile(String name, DatabaseIdentifierAdapter adapter);
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return null 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 conversions for identifiers and names.
- */
- 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.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java
deleted file mode 100644
index 5631e32a71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ConnectionProfileListener.java
+++ /dev/null
@@ -1,42 +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.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.db/src/org/eclipse/jpt/db/Database.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java
deleted file mode 100644
index 955fea1040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Database.java
+++ /dev/null
@@ -1,153 +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.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 {
-
- // ********** 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 specified name. The name must be an exact match
- * of the catalog's name.
- * Return null 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 null 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 null 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 database objects the
- * database object identified by the specified identifier.
- * The identifier should be an SQL identifier (i.e. delimited when
- * non-"normal").
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier);
-
- /**
- * Convert the specified name to a database-appropriate SQL identifier.
- */
- String convertNameToIdentifier(String name);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseIdentifierAdapter.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseIdentifierAdapter.java
deleted file mode 100644
index cef37c0be9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseIdentifierAdapter.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.db;
-
-/**
- * This interface allows clients of the Dali db package to plug in a custom
- * strategy for converting a database identifier to a database name and vice
- * versa.
- * <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 {
-
- /**
- * Convert the specified "identifier" to a "name".
- */
- String convertIdentifierToName(String identifier, DefaultCallback defaultCallback);
-
- /**
- * Convert the specified "name" to an "identifier".
- */
- String convertNameToIdentifier(String name, DefaultCallback defaultCallback);
-
- /**
- * The client-provided finder is passed a "default" callback that can be
- * used if appropriate.
- */
- interface DefaultCallback {
-
- /**
- * Convert the specified "identifier" to a "name".
- */
- String convertIdentifierToName(String identifier);
-
- /**
- * Convert the specified "name" to an "identifier".
- */
- String convertNameToIdentifier(String name);
-
- }
-
- /**
- * This adapter simply uses the passed in default callback.
- */
- final class Default implements DatabaseIdentifierAdapter {
- public static final DatabaseIdentifierAdapter INSTANCE = new Default();
- public static DatabaseIdentifierAdapter instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply use the default callback
- public String convertIdentifierToName(String identifier, DefaultCallback defaultCallback) {
- return defaultCallback.convertIdentifierToName(identifier);
- }
- // simply use the default callback
- public String convertNameToIdentifier(String name, DefaultCallback defaultCallback) {
- return defaultCallback.convertNameToIdentifier(name);
- }
- @Override
- public String toString() {
- return "DatabaseIdentifierAdapter.Default"; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java
deleted file mode 100644
index 155435050e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/DatabaseObject.java
+++ /dev/null
@@ -1,101 +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.db;
-
-import java.util.Comparator;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * Common behavior 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 "identifier", 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 null if the database object's identifier matches the specified
- * "default name".
- * <p>
- * This is used by the old 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 database object
- * (taking into consideration case-sensitivity and special characters).
- */
- String getIdentifier(String defaultName);
-
- /**
- * Return the database object's "identifier", 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 database.
- */
- Database getDatabase();
-
- /**
- * Return the database object's connection profile.
- */
- ConnectionProfile getConnectionProfile();
-
-
- 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 "DatabaseObject.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 "DatabaseObject.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 "DatabaseObject.IDENTIFIER_TRANSFORMER"; //$NON-NLS-1$
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java
deleted file mode 100644
index 5d9dae3ab0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/ForeignKey.java
+++ /dev/null
@@ -1,157 +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.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 "base" table.
- */
- Table getBaseTable();
-
- /**
- * Return the foreign key's "referenced" 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 "base" columns.
- */
- Iterable<Column> getBaseColumns();
-
- /**
- * Return the foreign key's "base" 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 "referenced" columns.
- */
- Iterable<Column> getReferencedColumns();
-
- /**
- * Return whether the foreign key references the primary key of the
- * "referenced" 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 "referenced" table.
- */
- String getAttributeName();
-
- /**
- * If the name of the "base" column adheres to the JPA spec for a
- * default mapping (i.e. it ends with an underscore followed by the name
- * of the "referenced" column, and the "referenced" column is the single
- * primary key column of the "referenced" table), return the corresponding
- * default attribute name:<pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * </pre>
- * Return a <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 old 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 and special characters).
- */
- String getJoinColumnAnnotationIdentifier(String attributeName);
-
- // ********** column pair interface **********
-
- /**
- * Pair up the foreign key's column pairs, matching each "base" column with
- * the appropriate "referenced" column.
- * @see #columnPairs()
- */
- interface ColumnPair {
-
- /**
- * Return the column pair's "base" column.
- */
- Column getBaseColumn();
-
- /**
- * Return the column pair's "referenced" 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.db/src/org/eclipse/jpt/db/JptDbPlugin.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java
deleted file mode 100644
index bfecfb1555..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/JptDbPlugin.java
+++ /dev/null
@@ -1,84 +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.db;
-
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.datatools.enablement.jdt.classpath.DriverClasspathContainer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jpt.db.internal.DTPConnectionProfileFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The JPT 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 JptDbPlugin extends Plugin {
- private DTPConnectionProfileFactory connectionProfileFactory;
-
- private static JptDbPlugin INSTANCE; // sorta-final
-
- /**
- * Return the singleton JPT DB plug-in.
- */
- public static JptDbPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * The constructor
- */
- public JptDbPlugin() {
- 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);
- this.connectionProfileFactory = DTPConnectionProfileFactory.instance();
- this.connectionProfileFactory.start();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- this.connectionProfileFactory.stop();
- this.connectionProfileFactory = null;
- INSTANCE = null;
- super.stop(context);
- }
-
- public ConnectionProfileFactory getConnectionProfileFactory() {
- return this.connectionProfileFactory;
- }
-
- /**
- * 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.db/src/org/eclipse/jpt/db/Schema.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java
deleted file mode 100644
index 6b0fd2b29c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Schema.java
+++ /dev/null
@@ -1,98 +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.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 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 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);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java
deleted file mode 100644
index 882c8d0e48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/SchemaContainer.java
+++ /dev/null
@@ -1,84 +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.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 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 null 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.db/src/org/eclipse/jpt/db/Sequence.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java
deleted file mode 100644
index 5351fffa9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Sequence.java
+++ /dev/null
@@ -1,28 +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.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.db/src/org/eclipse/jpt/db/Table.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java
deleted file mode 100644
index 4f629214c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/Table.java
+++ /dev/null
@@ -1,126 +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.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 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 "join" table
- * (i.e. it contains only 2 foreign keys). Whether the table <em>actually</em> is
- * a "join" table is determined by the semantics of the database design.
- */
- boolean isPossibleJoinTable();
-
- /**
- * Assuming the table is a "join" table, return the foreign key to the
- * "owning" table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableOwningForeignKey();
-
- /**
- * Assuming the table is a "join" table, return the foreign key to the
- * "non-owning" table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableNonOwningForeignKey();
-
- /**
- * Assuming the table is a "join" 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.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java
deleted file mode 100644
index 96d924fbee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPCatalogWrapper.java
+++ /dev/null
@@ -1,90 +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.db.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.db.Catalog;
-
-/**
- * Wrap a DTP Catalog
- */
-final class DTPCatalogWrapper
- extends DTPSchemaContainerWrapper
- 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, dtpCatalog);
- this.dtpCatalog = dtpCatalog;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().catalogChanged(this);
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata() {
- 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.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java
deleted file mode 100644
index 31c42b6a92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPColumnWrapper.java
+++ /dev/null
@@ -1,229 +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.db.internal;
-
-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.db.Column;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-
-/**
- * Wrap a DTP Column
- */
-final class DTPColumnWrapper
- extends DTPDatabaseObjectWrapper
- 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, dtpColumn);
- this.dtpColumn = dtpColumn;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().columnChanged(this);
- }
-
-
- // ********** Column implementation **********
-
- public String getName() {
- return this.dtpColumn.getName();
- }
-
- public DTPTableWrapper getTable() {
- return (DTPTableWrapper) this.getParent();
- }
-
- 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.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java
deleted file mode 100644
index a543bd5a93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileFactory.java
+++ /dev/null
@@ -1,163 +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.db.internal;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener1;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.ConnectionProfileListener;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Wrap the DTP 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;
- }
-
- /**
- * 'private' 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 new DTPConnectionProfileWrapper(dtpProfile, adapter);
- }
- }
- return null;
- }
-
- 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 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.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
deleted file mode 100644
index 49c61517bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,574 +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.db.internal;
-
-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.db.ConnectionListener;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap a DTP ConnectionProfile
- */
-final class DTPConnectionProfileWrapper
- implements DTPDatabaseObject, ConnectionProfile
-{
- /** the wrapped DTP connection profile */
- private final IConnectionProfile dtpConnectionProfile;
-
- /** adapter supplied by the client (determines identifier delimiters, etc.) */
- private final DatabaseIdentifierAdapter identifierAdapter;
-
- /** callback passed to the identifier adapter */
- private final DatabaseIdentifierAdapter.DefaultCallback identifierAdapterCallback;
-
- /** 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"; //$NON-NLS-1$
-
- 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 adapter) {
- super();
- this.dtpConnectionProfile = dtpConnectionProfile;
- this.identifierAdapter = adapter;
- this.identifierAdapterCallback = new IdentifierAdapterCallback();
- this.dtpManagedConnection = this.buildDTPManagedConnection();
- this.connectionListener = new LocalConnectionListener();
- // don't listen to the managed connection yet
- }
-
- private IManagedConnection buildDTPManagedConnection() {
- String connectionType = this.dtpConnectionProfile.supportsWorkOfflineMode() ?
- OFFLINE_DTP_CONNECTION_TYPE : LIVE_DTP_CONNECTION_TYPE;
- return this.dtpConnectionProfile.getManagedConnection(connectionType);
- }
-
-
- // ********** 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);
- }
-
- /**
- * Returns the user name.
- * Allows user name composed by more than one word.
- * If the user name contains a keyword, it returns the first word only.
- */
- public String getUserName() {
- String userName = this.getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
- userName = userName.trim();
- String[] names = userName.split("\\s+"); //$NON-NLS-1$
- if(names.length == 3) { // 208946 handle username like "sys as sysdba" on Oracle
- if(this.nameIsKeyword(names[1])) {
- return names[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());
- }
-
- // ***** 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() {
- if (this.isInactive()) {
- return null;
- }
-
- if (this.isWorkingOffline()) {
- ConnectionInfo connectionInfo = (ConnectionInfo) this.dtpManagedConnection.getConnection().getRawConnection();
- return new DTPDatabaseWrapper(this, connectionInfo.getSharedDatabase());
- }
-
- // 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 new DTPDatabaseWrapper(this, 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;
- }
- }
-
- /**
- * This is called whenever we need to convert an identifier to a name
- * (e.g. {@link org.eclipse.jpt.db.Table#getColumnForIdentifier(String)}).
- * We channel all the calls to here and then we delegate to the
- * client-supplied "database identifier adapter".
- */
- String convertIdentifierToName(String identifier) {
- return this.identifierAdapter.convertIdentifierToName(identifier, this.identifierAdapterCallback);
- }
-
- /**
- * The default "database identifier adapter" calls back to here so we can delegate to
- * the database, which contains all the information necessary to properly
- * convert identifiers.
- */
- String convertIdentifierToName_(String identifier) {
- // the database should not be null here - call its internal method
- return this.database.convertIdentifierToName_(identifier);
- }
-
- /**
- * This is called whenever we need to convert a name to an identifier
- * (e.g. {@link org.eclipse.jpt.db.Table#getColumnForIdentifier(String)}).
- * We channel all the calls to here and then we delegate to the
- * client-supplied "database identifier adapter".
- */
- String convertNameToIdentifier(String name) {
- return this.identifierAdapter.convertNameToIdentifier(name, this.identifierAdapterCallback);
- }
-
- /**
- * The default "database identifier adapter" calls back to here so we can delegate to
- * the database, which contains all the information necessary to properly
- * convert names.
- */
- String convertNameToIdentifier_(String name) {
- // the database should not be null here - call its internal method
- return this.database.convertNameToIdentifier_(name);
- }
-
- 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);
- }
-
- private boolean nameIsKeyword(String name) {
- return name.equalsIgnoreCase("as"); //$NON-NLS-1$
- }
-
-
- // ********** 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.
- */
- 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 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);
- }
- }
-
- }
-
-
- // ********** default DatabaseFinder **********
-
- class IdentifierAdapterCallback implements DatabaseIdentifierAdapter.DefaultCallback {
- public String convertIdentifierToName(String identifier) {
- // call back to the internal method
- return DTPConnectionProfileWrapper.this.convertIdentifierToName_(identifier);
- }
- public String convertNameToIdentifier(String name) {
- // call back to the internal method
- return DTPConnectionProfileWrapper.this.convertNameToIdentifier_(name);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java
deleted file mode 100644
index c976fe4b39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObject.java
+++ /dev/null
@@ -1,24 +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.db.internal;
-
-import org.eclipse.jpt.db.DatabaseObject;
-
-/**
- * DTP database object
- */
-public interface DTPDatabaseObject extends DatabaseObject {
-
- /**
- * covariant override
- */
- DTPConnectionProfileWrapper getConnectionProfile();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java
deleted file mode 100644
index 37c3cb7d0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseObjectWrapper.java
+++ /dev/null
@@ -1,204 +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.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.db.DatabaseObject;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * DTP Catalog Object Wrapper base class
- */
-abstract class DTPDatabaseObjectWrapper
- implements DTPDatabaseObject
-{
- /** we need a way to get to the connection profile */
- private final DTPDatabaseObject parent;
-
- /** listen for the "catalog object" being refreshed */
- private final ICatalogObjectListener catalogObjectListener;
-
- /** listen for this DTP catalog object to refresh */
- final ICatalogObject catalogObject;
-
-
- // ********** construction/initialization **********
-
- DTPDatabaseObjectWrapper(DTPDatabaseObject parent, Object dtpObject) {
- 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.catalogObject = (ICatalogObject) dtpObject;
- this.catalogObjectListener = this.buildCatalogObjectListener();
- if (this.getConnectionProfile().hasAnyListeners()) {
- this.startListening();
- }
- } else {
- this.catalogObject = null;
- this.catalogObjectListener = null;
- }
- }
-
- private ICatalogObjectListener buildCatalogObjectListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged(ICatalogObject dmElement, int eventType) {
- if (dmElement == DTPDatabaseObjectWrapper.this.catalogObject) {
- // 'eventType' doesn't seem to be very useful, so drop it
- DTPDatabaseObjectWrapper.this.catalogObjectChanged();
- }
- }
- };
- }
-
- // typically, 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();
-
-
-
- // ********** queries **********
-
- DTPDatabaseObject getParent() {
- return this.parent;
- }
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this.parent.getConnectionProfile();
- }
-
- public DTPDatabaseWrapper getDatabase() {
- return this.getConnectionProfile().getDatabase();
- }
-
- /**
- * Return the database object identified by the specified identifier. If
- * the identifier is "delimited" (typically with double-quotes), it will be
- * used without any folding. If the name is "regular" (i.e. not delimited),
- * it will be folded to the appropriate case (typically uppercase).
- * This is called by whenever we need to find a component by identifier
- * (e.g. {{@link org.eclipse.jpt.db.Table#getColumnForIdentifier(String)}).
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamed(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- private String convertIdentifierToName(String identifier) {
- return this.getConnectionProfile().convertIdentifierToName(identifier);
- }
-
- /**
- * Convenience method.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- for (T dbObject : databaseObjects) {
- if (dbObject.getName().equals(name)) {
- return dbObject;
- }
- }
- return null;
- }
-
- /**
- * 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.getDatabase().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>
- * </ul>
- */
- public String getIdentifier() {
- return this.convertNameToIdentifier(this.getName());
- }
-
- String convertNameToIdentifier(String name) {
- return this.getConnectionProfile().convertNameToIdentifier(name);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** listening to DTP database object **********
-
- // this should only be called when the connection profile is "live" and has listeners
- void startListening() {
- this.checkListener();
- RefreshManager.getInstance().AddListener(this.catalogObject, 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.catalogObject, this.catalogObjectListener);
- }
-
- private void checkListener() {
- if (this.catalogObjectListener == null) {
- throw new IllegalStateException("the catalog listener is null"); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
deleted file mode 100644
index 7821854ecf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,380 +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.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.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.db.internal.vendor.Vendor;
-import org.eclipse.jpt.db.internal.vendor.VendorRepository;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Wrap a DTP Database.
- * <p>
- * Catalogs vs. Schemata:<br>
- * Typically, if a DTP database does not support "catalogs",
- * 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 *no* 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 "catalogs", 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 "name" 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 "identifier" 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
- implements Database
-{
- /** the wrapped DTP database */
- private final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
-
- /** vendor-specific behavior */
- private final Vendor vendor;
-
- /** lazy-initialized, sorted */
- private DTPCatalogWrapper[] catalogs;
-
-
- // ********** constructor **********
-
- DTPDatabaseWrapper(DTPConnectionProfileWrapper connectionProfile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super(connectionProfile, dtpDatabase);
- this.dtpDatabase = dtpDatabase;
- this.vendor = VendorRepository.instance().getVendor(this.getVendorName());
- }
-
-
- // ********** DTPWrapper implementation **********
-
- /* 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> getDTPSchemata() {
- return this.vendor.getSchemas(this.dtpDatabase);
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getSchema_(dtpSchema);
- }
-
- 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);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpDatabase.getName();
- }
-
-
- // ********** Database implementation **********
-
- public String getVendorName() {
- return this.dtpDatabase.getVendor();
- }
-
- public String getVersion() {
- return this.dtpDatabase.getVersion();
- }
-
- // override to make method public since it's in the Database interface
- @Override
- public <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier) {
- return super.selectDatabaseObjectForIdentifier(databaseObjects, identifier);
- }
-
- // ***** catalogs
-
- public boolean supportsCatalogs() {
- return this.vendor.supportsCatalogs(this.dtpDatabase);
- }
-
- 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.vendor.getCatalogs(this.dtpDatabase);
- }
-
- 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 DTPCatalogWrapper getCatalogForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getCatalogWrappers(), identifier);
- }
-
- public synchronized DTPCatalogWrapper getDefaultCatalog() {
- return this.getCatalogForNames(this.getDefaultCatalogNames());
- }
-
- private Iterable<String> getDefaultCatalogNames() {
- return this.vendor.getDefaultCatalogNames(this.dtpDatabase, this.getConnectionProfile().getUserName());
- }
-
- /**
- * 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;
- }
-
- // ***** schemata
-
- Iterable<String> getDefaultSchemaNames() {
- return this.vendor.getDefaultSchemaNames(this.dtpDatabase, this.getConnectionProfile().getUserName());
- }
-
-
- // ********** 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);
- }
-
- /**
- * Delegate to the vendor.
- */
- String convertNameToIdentifier_(String name) {
- return this.vendor.convertNameToIdentifier(name);
- }
-
- /**
- * Delegate to the vendor.
- */
- String convertIdentifierToName_(String identifier) {
- return this.vendor.convertIdentifierToName(identifier);
- }
-
- /**
- * Convert the specified name to an identifier. Return null if the resulting
- * identifier matches the specified default name.
- * <p>
- * This is used by the old 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
- * and special characters).
- */
- // TODO add to database identifier adapter? currently not used...
- String convertNameToIdentifier(String name, String defaultName) {
- return this.vendor.convertNameToIdentifier(name, defaultName);
- }
-
-
- // ********** internal methods **********
-
- 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.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
deleted file mode 100644
index 633a0f45a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPForeignKeyWrapper.java
+++ /dev/null
@@ -1,331 +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.db.internal;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Wrap a DTP ForeignKey
- */
-final class DTPForeignKeyWrapper
- extends DTPDatabaseObjectWrapper
- 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, dtpForeignKey);
- this.dtpForeignKey = dtpForeignKey;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @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 (DTPTableWrapper) this.getParent();
- }
-
- 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.getDatabase().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.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java
deleted file mode 100644
index 2df5d64db7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaContainerWrapper.java
+++ /dev/null
@@ -1,228 +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.db.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Coalesce behavior for a schema container (i.e. database or catalog).
- */
-abstract class DTPSchemaContainerWrapper
- extends DTPDatabaseObjectWrapper
- implements SchemaContainer
-{
- /** lazy-initialized */
- private DTPSchemaWrapper[] schemata;
-
-
- // ********** constructor **********
-
- DTPSchemaContainerWrapper(DTPDatabaseObject parent, Object dtpSchemaContainer) {
- super(parent, dtpSchemaContainer);
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- }
-
-
- // ********** abstract methods **********
-
- /**
- * return the schema container's DTP schemata
- */
- abstract List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemata();
-
- /**
- * return the schema for the specified DTP schema
- */
- abstract DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema);
-
- /**
- * assume 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);
-
- /**
- * assume 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);
-
- /**
- * assume 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.getDTPSchemata();
- 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 DTPSchemaWrapper getSchemaForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSchemaWrappers(), identifier);
- }
-
- public DTPSchemaWrapper getDefaultSchema() {
- return this.getSchemaForNames(this.getDatabase().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.getDatabase().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.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java
deleted file mode 100644
index 7c1a61929b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSchemaWrapper.java
+++ /dev/null
@@ -1,326 +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.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.modelbase.sql.tables.SQLTablesPackage;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Sequence;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Wrap a DTP Schema
- */
-final class DTPSchemaWrapper
- extends DTPDatabaseObjectWrapper
- 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, dtpSchema);
- this.dtpSchema = dtpSchema;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().schemaChanged(this);
- }
-
-
- // ********** Schema implementation **********
-
- public String getName() {
- return this.dtpSchema.getName();
- }
-
- public DTPSchemaContainerWrapper getContainer() {
- return (DTPSchemaContainerWrapper) this.getParent();
- }
-
- // ***** 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 DTPTableWrapper getTableForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getTableWrappers(), 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 DTPSequenceWrapper getSequenceForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getSequenceWrappers(), identifier);
- }
-
-
- // ********** 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.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java
deleted file mode 100644
index f8e3edf700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPSequenceWrapper.java
+++ /dev/null
@@ -1,64 +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.db.internal;
-
-import org.eclipse.jpt.db.Sequence;
-
-/**
- * Wrap a DTP Sequence
- */
-final class DTPSequenceWrapper
- extends DTPDatabaseObjectWrapper
- 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, dtpSequence);
- this.dtpSequence = dtpSequence;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().sequenceChanged(this);
- }
-
-
- // ********** Sequence implementation **********
-
- public String getName() {
- return this.dtpSequence.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return (DTPSchemaWrapper) this.getParent();
- }
-
-
- // ********** 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.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java
deleted file mode 100644
index b109675c90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/DTPTableWrapper.java
+++ /dev/null
@@ -1,409 +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.db.internal;
-
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey;
-import org.eclipse.datatools.modelbase.sql.tables.BaseTable;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.DatabaseObject;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-
-/**
- * Wrap a DTP Table
- */
-final class DTPTableWrapper
- extends DTPDatabaseObjectWrapper
- 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, dtpTable);
- this.dtpTable = dtpTable;
- }
-
-
- // ********** DTPWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().tableChanged(this);
- }
-
-
- // ********** Table implementation **********
-
- public String getName() {
- return this.dtpTable.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return (DTPSchemaWrapper) this.getParent();
- }
-
- // ***** 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);
- }
-
- /**
- * assume 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 DTPColumnWrapper getColumnForIdentifier(String identifier) {
- return this.selectDatabaseObjectForIdentifier(this.getColumnWrappers(), identifier);
- }
-
- // ***** primaryKeyColumns
-
- 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);
- }
-
- // ***** foreignKeys
-
- 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();
- }
-
-
- // ********** internal methods **********
-
- 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.db/src/org/eclipse/jpt/db/internal/vendor/AbstractVendor.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/AbstractVendor.java
deleted file mode 100644
index 62a08c232d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/AbstractVendor.java
+++ /dev/null
@@ -1,304 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-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;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Consolidate the behavior common to the typical vendors.
- *
- * @see UnrecognizedVendor
- */
-abstract class AbstractVendor
- implements Vendor
-{
- AbstractVendor() {
- super();
- }
-
- public abstract String getDTPVendorName();
-
-
- // ********** catalog and schema support **********
-
- abstract CatalogStrategy getCatalogStrategy();
-
- public boolean supportsCatalogs(Database database) {
- return this.getCatalogStrategy().supportsCatalogs(database);
- }
-
- public List<Catalog> getCatalogs(Database database) {
- return this.getCatalogStrategy().getCatalogs(database);
- }
-
- public List<Schema> getSchemas(Database database) {
- try {
- return this.getCatalogStrategy().getSchemas(database);
- } catch (Exception ex) {
- throw new RuntimeException("vendor: " + this, ex); //$NON-NLS-1$
- }
- }
-
- /**
- * Typically, the name of the default catalog is the user name.
- */
- public final Iterable<String> getDefaultCatalogNames(Database database, String userName) {
- if ( ! this.supportsCatalogs(database)) {
- return Collections.emptyList();
- }
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultCatalogNamesTo(database, userName, names);
- return names;
- }
-
- /**
- * See comment at
- * {@link #addDefaultSchemaNamesTo(Database, String, ArrayList)}.
- */
- void addDefaultCatalogNamesTo(@SuppressWarnings("unused") Database database, String userName, ArrayList<String> names) {
- names.add(this.convertIdentifierToName(userName));
- }
-
- /**
- * Typically, the name of the default schema is the user name.
- */
- public final Iterable<String> getDefaultSchemaNames(Database database, String userName) {
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultSchemaNamesTo(database, userName, names);
- return names;
- }
-
- /**
- * The user name passed in here was retrieved from DTP.
- * DTP stores the user name that was passed to it during the connection
- * to the database. As a result, this user name is an <em>identifier</em>
- * not a <em>name</em>.
- * If the user name were retrieved from the JDBC connection it would probably
- * be a <em>name</em>. For example, you can connect to an Oracle database with the
- * user name "scott", but that identifer is folded to the actual user name
- * "SCOTT". DTP stores the original string "scott", while the Oracle JDBC
- * driver stores the folded string "SCOTT".
- */
- void addDefaultSchemaNamesTo(@SuppressWarnings("unused") Database database, String userName, ArrayList<String> names) {
- names.add(this.convertIdentifierToName(userName));
- }
-
-
- // ********** folding strategy used to convert names and identifiers **********
-
- /**
- * The SQL spec says a <em>regular</em> (non-delimited) identifier should be
- * folded to uppercase; but some databases do otherwise (e.g. Sybase).
- */
- abstract FoldingStrategy getFoldingStrategy();
-
-
- // ********** name -> identifier **********
-
- public String convertNameToIdentifier(String name, String defaultName) {
- return this.nameRequiresDelimiters(name) ?
- this.delimitName(name) :
- this.regularNamesMatch(name, defaultName) ? null : name;
- }
-
- public String convertNameToIdentifier(String name) {
- return this.nameRequiresDelimiters(name) ? this.delimitName(name) : name;
- }
-
- /**
- * Return whether the specified database object name must be delimited
- * when used in an SQL statement.
- * If the name has any "special" 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.nameContainsAnySpecialCharacters(name)
- || this.nameIsNotFolded(name);
- }
-
- /**
- * Return whether the specified name contains any "special" characters
- * that require the name to be delimited.
- * 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-regular" 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, vendor-specific, <em>regular</em> start characters
- * </ul>
- */
- boolean characterIsRegularNameStart(char c) {
- // all vendors allow a letter
- return Character.isLetter(c)
- || this.characterIsExtendedRegularNameStart(c);
- }
-
- boolean characterIsExtendedRegularNameStart(char c) {
- return arrayContains(this.getExtendedRegularNameStartCharacters(), c);
- }
-
- /**
- * Return the <em>regular</em> characters, beyond letters, for the
- * first character of a name.
- * Return null if there are no "extended" characters.
- */
- char[] getExtendedRegularNameStartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified character is "non-regular" 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, vendor-specific, <em>regular</em> start characters
- * <li>any of the extended, vendor-specific, <em>regular</em> part characters
- * </ul>
- */
- boolean characterIsRegularNamePart(char c) {
- // all vendors allow a letter or digit
- return Character.isLetterOrDigit(c) ||
- (c == '_') ||
- this.characterIsExtendedRegularNameStart(c) ||
- this.characterIsExtendedRegularNamePart(c);
- }
-
- boolean characterIsExtendedRegularNamePart(char c) {
- return 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.getFoldingStrategy().nameIsFolded(name);
- }
-
- /**
- * Return whether the specified <em>regular</em> names match.
- */
- boolean regularNamesMatch(String name1, String name2) {
- return this.regularIdentifiersAreCaseSensitive() ?
- name1.equals(name2) :
- name1.equalsIgnoreCase(name2);
- }
-
- /**
- * Typically, <em>regular</em> identifiers are case-insensitive.
- */
- boolean regularIdentifiersAreCaseSensitive() {
- return this.getFoldingStrategy().regularIdentifiersAreCaseSensitive();
- }
-
- /**
- * 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) {
- return (identifier == null) ?
- null :
- this.identifierIsDelimited(identifier) ?
- StringTools.undelimit(identifier) :
- this.getFoldingStrategy().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);
- }
-
-
- // ********** misc **********
-
- @Override
- public String toString() {
- return this.getDTPVendorName();
- }
-
- /**
- * static convenience method - array null check
- */
- static boolean arrayContains(char[] array, char c) {
- return (array != null) && ArrayTools.contains(array, c);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/CatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/CatalogStrategy.java
deleted file mode 100644
index 9c7a4b59c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/CatalogStrategy.java
+++ /dev/null
@@ -1,38 +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.db.internal.vendor;
-
-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;
-
-/**
- * Handle the variety of catalog (and schema) configurations generated by DTP.
- */
-interface CatalogStrategy {
-
- /**
- * Return whether the DTP database has real catalogs.
- */
- boolean supportsCatalogs(Database database);
-
- /**
- * Return the specified database's catalogs.
- */
- List<Catalog> getCatalogs(Database database);
-
- /**
- * Return the specified database's schemas.
- */
- List<Schema> getSchemas(Database database);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/DB2.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/DB2.java
deleted file mode 100644
index 1dc8a4ae02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/DB2.java
+++ /dev/null
@@ -1,56 +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.db.internal.vendor;
-
-class DB2
- extends AbstractVendor
-{
- private final String dtpVendorName;
-
- private static final Vendor UDB = new DB2("DB2 UDB"); //$NON-NLS-1$
- private static final Vendor UDB_I_SERIES = new DB2("DB2 UDB iSeries"); //$NON-NLS-1$
- private static final Vendor UDB_Z_SERIES = new DB2("DB2 UDB zSeries"); //$NON-NLS-1$
-
- static Vendor udb() {
- return UDB;
- }
-
- static Vendor udbISeries() {
- return UDB_I_SERIES;
- }
-
- static Vendor udbZSeries() {
- return UDB_Z_SERIES;
- }
-
- /**
- * Ensure only static instances.
- */
- private DB2(String dtpVendorName) {
- super();
- this.dtpVendorName = dtpVendorName;
- }
-
- @Override
- public String getDTPVendorName() {
- return this.dtpVendorName;
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return UnknownCatalogStrategy.instance(); // not verified yet...
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Derby.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Derby.java
deleted file mode 100644
index bed448950d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Derby.java
+++ /dev/null
@@ -1,67 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-
-class Derby
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new Derby();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Derby() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "Derby"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return FauxCatalogStrategy.instance();
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(this.buildDefaultSchemaName(userName));
- }
-
- /**
- * The default user name on Derby is "APP" when the user connects without
- * a user name.
- */
- private String buildDefaultSchemaName(String userName) {
- return ((userName != null) && (userName.length() != 0)) ?
- this.convertIdentifierToName(userName) :
- DEFAULT_USER_NAME;
- }
- private static final String DEFAULT_USER_NAME = "APP"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FauxCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FauxCatalogStrategy.java
deleted file mode 100644
index b269cf51b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FauxCatalogStrategy.java
+++ /dev/null
@@ -1,81 +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.db.internal.vendor;
-
-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 databases that build a "virtual" catalog (that has
- * no name) because the underlying JDBC driver does not return any catalogs
- * (e.g. Oracle).
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class FauxCatalogStrategy
- implements CatalogStrategy
-{
- // singleton
- private static final CatalogStrategy INSTANCE = new FauxCatalogStrategy();
-
- /**
- * Return the singleton.
- */
- static CatalogStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private FauxCatalogStrategy() {
- super();
- }
-
- public boolean supportsCatalogs(Database database) {
- return false;
- }
-
- public List<Catalog> getCatalogs(Database database) {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas(Database database) {
- // 308947 - hack to support old IBM DTP/RDB extension for Oracle
- List<Catalog> catalogs = database.getCatalogs();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return database.getSchemas();
- }
-
- // normal logic:
- return this.getFauxCatalog(database.getCatalogs()).getSchemas();
- }
-
- private Catalog getFauxCatalog(List<Catalog> catalogs) {
- if (catalogs == null) {
- throw new IllegalStateException();
- }
- if (catalogs.size() != 1) {
- throw new IllegalStateException("not a single catalog: " + catalogs.size()); //$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;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FoldingStrategy.java
deleted file mode 100644
index 2a80289884..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/FoldingStrategy.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.db.internal.vendor;
-
-/**
- * Handle database-specific identifier-folding issues.
- */
-interface FoldingStrategy {
-
- /**
- * Fold the specified name.
- */
- String fold(String name);
-
- /**
- * Return whether the specified database object name is already folded,
- * meaning, if it has no special characters, it requires no delimiters.
- */
- boolean nameIsFolded(String name);
-
- /**
- * Return whether the database is case-sensitive when using "regular"
- * (i.e. non-delimited) identifiers.
- */
- boolean regularIdentifiersAreCaseSensitive();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/HSQLDB.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/HSQLDB.java
deleted file mode 100644
index 3be0393255..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/HSQLDB.java
+++ /dev/null
@@ -1,57 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-
-class HSQLDB
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new HSQLDB();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private HSQLDB() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "HSQLDB"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return UnknownCatalogStrategy.instance(); // not verified yet...
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "PUBLIC"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Informix.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Informix.java
deleted file mode 100644
index f4de2a9685..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Informix.java
+++ /dev/null
@@ -1,59 +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.db.internal.vendor;
-
-class Informix
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new Informix();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Informix() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "Informix"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return UnknownCatalogStrategy.instance(); // not verified yet...
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- 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[] { '$' };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/LowerCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/LowerCaseFoldingStrategy.java
deleted file mode 100644
index 73e19744bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/LowerCaseFoldingStrategy.java
+++ /dev/null
@@ -1,56 +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.db.internal.vendor;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Fold "normal" identifiers to lower case.
- * Ignore the case of "normal" identifiers.
- */
-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 name) {
- return name.toLowerCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsLowercase(name);
- }
-
- public boolean regularIdentifiersAreCaseSensitive() {
- return false;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MaxDB.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MaxDB.java
deleted file mode 100644
index 4f28782abf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MaxDB.java
+++ /dev/null
@@ -1,53 +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.db.internal.vendor;
-
-class MaxDB
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new MaxDB();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MaxDB() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "MaxDB"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return UnknownCatalogStrategy.instance(); // not verified yet...
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '#', '@', '$' };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MySQL.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MySQL.java
deleted file mode 100644
index 210fea37bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/MySQL.java
+++ /dev/null
@@ -1,109 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-class MySQL
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new MySQL();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private MySQL() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "MySql"; //$NON-NLS-1$
- }
-
- /**
- * 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 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....
- *
- * NB: In MySQL DDL, SCHEMA is a synonym for DATABASE; but the JDBC
- * method DatabaseMetaData.getSchemas() returns an empty list,
- * while getCatalogs() returns a list of the available databases.
- * You can also use the JDBC method Connection.setCatalog(String) to
- * set the default database.
- */
- @Override
- CatalogStrategy getCatalogStrategy() {
- return NoCatalogStrategy.instance();
- }
-
- /**
- * MySQL is a bit unusual, so we force exact matches.
- * (e.g. MySQL folds database and table names to lowercase on Windows
- * by default; but that default can be changed by the
- * 'lower_case_table_names' system variable. This is because databases are
- * stored as directories and tables are stored as files in the underlying
- * O/S; and the case-sensitivity of the names is determined by the behavior
- * of filenames on the O/S. Then, to complicate things,
- * none of the other identifiers, like index and column names, are folded;
- * but they are case-insensitive, unless delimited. See
- * http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html.)
- */
- @Override
- FoldingStrategy getFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(database.getName());
- }
-
- /**
- * MySQL is the only vendor that allows a digit.
- * Although, the name cannnot be *all* digits.
- */
- @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[] { '_', '$' };
-
- /**
- * By default, MySQL delimits identifiers with backticks (`); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsDelimited(identifier, BACKTICK)
- || super.identifierIsDelimited(identifier);
- }
- private static final char BACKTICK = '`';
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NoCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NoCatalogStrategy.java
deleted file mode 100644
index a7fb79d9ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NoCatalogStrategy.java
+++ /dev/null
@@ -1,56 +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.db.internal.vendor;
-
-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 databases that do not have catalogs
- * (e.g. MySQL see bug 249013).
- */
-class NoCatalogStrategy
- implements CatalogStrategy
-{
- // singleton
- private static final CatalogStrategy INSTANCE = new NoCatalogStrategy();
-
- /**
- * Return the singleton.
- */
- static CatalogStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NoCatalogStrategy() {
- super();
- }
-
- public boolean supportsCatalogs(Database database) {
- return false;
- }
-
- public List<Catalog> getCatalogs(Database database) {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas(Database database) {
- return database.getSchemas();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NonFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NonFoldingStrategy.java
deleted file mode 100644
index e943d18ec8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/NonFoldingStrategy.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.db.internal.vendor;
-
-
-/**
- * Do not fold "normal" identifiers.
- * Respect the case of "normal" 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 "folded".
- */
- public String fold(String name) {
- return name;
- }
-
- /**
- * Since identifiers are not folded to upper- or lower-case, the name is
- * already "folded".
- * (Non-folding databases do not require delimiters around mixed-case
- * "normal" identifiers.)
- */
- public boolean nameIsFolded(String name) {
- return true;
- }
-
- public boolean regularIdentifiersAreCaseSensitive() {
- return true;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Oracle.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Oracle.java
deleted file mode 100644
index f6e677692b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Oracle.java
+++ /dev/null
@@ -1,53 +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.db.internal.vendor;
-
-class Oracle
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new Oracle();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Oracle() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "Oracle"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return FauxCatalogStrategy.instance();
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$', '#' };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/PostgreSQL.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/PostgreSQL.java
deleted file mode 100644
index b55f5cb5c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/PostgreSQL.java
+++ /dev/null
@@ -1,97 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-
-class PostgreSQL
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new PostgreSQL();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private PostgreSQL() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "postgres"; //$NON-NLS-1$
- }
-
- /**
- * The PostgreSQL JDBC driver returns a single catalog from the call to
- * 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 getCatalogStrategy() {
- return SimpleCatalogStrategy.instance();
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return LowerCaseFoldingStrategy.instance();
- }
-
- /**
- * The PostgreSQL database holds a single catalog that has the same name as
- * the database.
- */
- @Override
- void addDefaultCatalogNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(this.buildDefaultCatalogName(database));
- }
-
- private String buildDefaultCatalogName(Database database) {
- return ((Catalog) database.getCatalogs().get(0)).getName();
- }
-
- /**
- * PostgreSQL has a "schema search path". The default is:
- * "$user",public
- * If the "$user" schema is not found, use the "public" schema.
- */
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, ArrayList<String> names) {
- super.addDefaultSchemaNamesTo(database, userName, 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[] { '$' };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SQLServer.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SQLServer.java
deleted file mode 100644
index fccef59084..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SQLServer.java
+++ /dev/null
@@ -1,98 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-class SQLServer
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new SQLServer();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SQLServer() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "SQL Server"; //$NON-NLS-1$
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return SimpleCatalogStrategy.instance();
- }
-
- /**
- * By default, SQL Server identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- FoldingStrategy getFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * SQL Server will use the user-requested database; if that database is not
- * found, it will default to 'master'.
- */
- @Override
- void addDefaultCatalogNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(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 'dbo'.
- */
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, 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[] { '$' };
-
- /**
- * By default, SQL Server delimits identifiers with brackets ([]); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java
deleted file mode 100644
index 8a1a04129e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/SimpleCatalogStrategy.java
+++ /dev/null
@@ -1,57 +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.db.internal.vendor;
-
-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 databases that simply model the catalogs returned
- * by the underlying JDBC driver (e.g. Sybase).
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class SimpleCatalogStrategy
- implements CatalogStrategy
-{
- // singleton
- private static final CatalogStrategy INSTANCE = new SimpleCatalogStrategy();
-
- /**
- * Return the singleton.
- */
- static CatalogStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleCatalogStrategy() {
- super();
- }
-
- public boolean supportsCatalogs(Database database) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public List<Catalog> getCatalogs(Database database) {
- return database.getCatalogs();
- }
-
- public List<Schema> getSchemas(Database database) {
- return Collections.emptyList();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Sybase.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Sybase.java
deleted file mode 100644
index e90b9b9a0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Sybase.java
+++ /dev/null
@@ -1,114 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-class Sybase
- extends AbstractVendor
-{
- private final String dtpVendorName;
-
- static final Vendor ASA = new Sybase("Sybase_ASA"); //$NON-NLS-1$
- static final Vendor ASE = new Sybase("Sybase_ASE"); //$NON-NLS-1$
-
- static Vendor asa() {
- return ASA;
- }
-
- static Vendor ase() {
- return ASE;
- }
-
- /**
- * Ensure only static instances.
- */
- private Sybase(String dtpVendorName) {
- super();
- this.dtpVendorName = dtpVendorName;
- }
-
- @Override
- public String getDTPVendorName() {
- return this.dtpVendorName;
- }
-
- @Override
- CatalogStrategy getCatalogStrategy() {
- return SimpleCatalogStrategy.instance();
- }
-
- /**
- * By default, Sybase identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- @Override
- FoldingStrategy getFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * Sybase will use the user-requested database; if that database is not
- * found, it will default to 'master'.
- */
- @Override
- void addDefaultCatalogNamesTo(Database database, String userName, ArrayList<String> names) {
- names.add(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
- * 'dbo'.
- *
- * 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 (dbo). As a result, it's really not possible to specify
- * the "default" schema without knowing the schema object we are
- * looking for.
- *
- * (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 ConnectionProfile#getUserName().)
- */
- @Override
- void addDefaultSchemaNamesTo(Database database, String userName, 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[] { '$', '¥', '£', '#' };
-
- /**
- * By default, Sybase delimits identifiers with brackets ([]); but it
- * can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnknownCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnknownCatalogStrategy.java
deleted file mode 100644
index ea9a729e35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnknownCatalogStrategy.java
+++ /dev/null
@@ -1,87 +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.db.internal.vendor;
-
-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 databases.
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class UnknownCatalogStrategy
- implements CatalogStrategy
-{
- // singleton
- private static final CatalogStrategy INSTANCE = new UnknownCatalogStrategy();
-
- /**
- * Return the singleton.
- */
- static CatalogStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private UnknownCatalogStrategy() {
- super();
- }
-
- @SuppressWarnings("unchecked")
- public boolean supportsCatalogs(Database database) {
- List<Catalog> catalogs = database.getCatalogs();
- if ((catalogs == null) || catalogs.isEmpty()) {
- return false;
- }
-
- return this.getFauxCatalog(catalogs) == null;
- }
-
- @SuppressWarnings("unchecked")
- public List<Catalog> getCatalogs(Database database) {
- List<Catalog> catalogs = database.getCatalogs();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return Collections.emptyList();
- }
-
- Catalog fauxCatalog = this.getFauxCatalog(catalogs);
- return (fauxCatalog == null) ? catalogs : Collections.<Catalog>emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas(Database database) {
- List<Catalog> catalogs = database.getCatalogs();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return database.getSchemas();
- }
-
- Catalog fauxCatalog = this.getFauxCatalog(catalogs);
- return (fauxCatalog != null) ? fauxCatalog.getSchemas() : Collections.emptyList();
- }
-
- private Catalog getFauxCatalog(List<Catalog> catalogs) {
- if (catalogs.size() == 1) {
- Catalog catalog = catalogs.get(0);
- if (catalog.getName().equals("")) { //$NON-NLS-1$
- return catalog;
- }
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnrecognizedVendor.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnrecognizedVendor.java
deleted file mode 100644
index f5751232ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UnrecognizedVendor.java
+++ /dev/null
@@ -1,58 +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.db.internal.vendor;
-
-/**
- *
- */
-class UnrecognizedVendor
- extends AbstractVendor
-{
- // singleton
- private static final Vendor INSTANCE = new UnrecognizedVendor();
-
- /**
- * Return the singleton.
- */
- static Vendor instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private UnrecognizedVendor() {
- super();
- }
-
- @Override
- public String getDTPVendorName() {
- return "Unrecognized Vendor"; //$NON-NLS-1$
- }
-
- /**
- * Not sure what to do here....
- * Assume the DTP database is organized into one or more catalogs and
- * the schemata are contained by those catalogs. This appears to be the
- * default way DTP builds models these days (i.e. a database with at
- * least one catalog, instead of the database holding schemata
- * directly).
- */
- @Override
- CatalogStrategy getCatalogStrategy() {
- return UnknownCatalogStrategy.instance();
- }
-
- @Override
- FoldingStrategy getFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UpperCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UpperCaseFoldingStrategy.java
deleted file mode 100644
index f3e88967d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/UpperCaseFoldingStrategy.java
+++ /dev/null
@@ -1,56 +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.db.internal.vendor;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Fold "normal" identifiers to upper case.
- * Ignore the case of "normal" identifiers.
- */
-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 name) {
- return name.toUpperCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsUppercase(name);
- }
-
- public boolean regularIdentifiersAreCaseSensitive() {
- return false;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Vendor.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Vendor.java
deleted file mode 100644
index d2a2d0a0ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/Vendor.java
+++ /dev/null
@@ -1,86 +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.db.internal.vendor;
-
-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;
-
-/**
- * Delegate vendor-specific behavior to implementations of this interface:<ul>
- * <li>catalog support
- * <li>default catalog and schema
- * <li>converting names to identifiers and vice-versa
- * </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 vendor, it may
- * be case-insensitive).
- */
-public interface Vendor {
-
- /**
- * This must match the DTP vendor name.
- * @see org.eclipse.datatools.modelbase.sql.schema.Database#getVendor()
- */
- String getDTPVendorName();
-
- /**
- * Return whether the vendor supports "real" catalogs (e.g. Sybase).
- */
- boolean supportsCatalogs(Database database);
-
- /**
- * Return the specified database's catalogs.
- */
- List<Catalog> getCatalogs(Database database);
-
- /**
- * Return the specified database's default catalog names for the
- * specified user. The first name in the list that identifies a catalog
- * that exists is "the" default.
- */
- Iterable<String> getDefaultCatalogNames(Database database, String userName);
-
- /**
- * Return the specified database's schemas.
- */
- List<Schema> getSchemas(Database database);
-
- /**
- * Return the specified database's default schema names for the
- * specified user. The first name in the list that identifies a schema
- * that exists is "the" default.
- */
- Iterable<String> getDefaultSchemaNames(Database database, String userName);
-
- /**
- * Convert the specified database object name to a vendor identifier.
- * Return <code>null</code> if the identifier matches the specified default name.
- */
- String convertNameToIdentifier(String name, String defaultName);
-
- /**
- * Convert the specified database object name to a vendor identifier.
- */
- String convertNameToIdentifier(String name);
-
- /**
- * Convert the specified database object identifier to a vendor name.
- */
- String convertIdentifierToName(String identifier);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/VendorRepository.java b/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/VendorRepository.java
deleted file mode 100644
index 468f09ea44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/src/org/eclipse/jpt/db/internal/vendor/VendorRepository.java
+++ /dev/null
@@ -1,78 +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.db.internal.vendor;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class VendorRepository {
- private final Vendor[] vendors;
-
- // singleton
- private static final VendorRepository INSTANCE = new VendorRepository();
-
- /**
- * Return the singleton.
- */
- public static VendorRepository instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private VendorRepository() {
- super();
- this.vendors = this.buildVendors();
- }
-
- private Vendor[] buildVendors() {
- ArrayList<Vendor> list = new ArrayList<Vendor>();
- this.addVendorsTo(list);
- return list.toArray(new Vendor[list.size()]);
- }
-
- private void addVendorsTo(ArrayList<Vendor> list) {
- this.addVendorTo(DB2.udb(), list);
- this.addVendorTo(DB2.udbISeries(), list);
- this.addVendorTo(DB2.udbZSeries(), list);
- this.addVendorTo(Derby.instance(), list);
- this.addVendorTo(HSQLDB.instance(), list);
- this.addVendorTo(Informix.instance(), list);
- this.addVendorTo(MaxDB.instance(), list);
- this.addVendorTo(MySQL.instance(), list);
- this.addVendorTo(Oracle.instance(), list);
- this.addVendorTo(PostgreSQL.instance(), list);
- this.addVendorTo(SQLServer.instance(), list);
- this.addVendorTo(Sybase.asa(), list);
- this.addVendorTo(Sybase.ase(), list);
- }
-
- private void addVendorTo(Vendor vendor, ArrayList<Vendor> list) {
- String name = vendor.getDTPVendorName();
- for (Iterator<Vendor> stream = list.iterator(); stream.hasNext(); ) {
- if (stream.next().getDTPVendorName().equals(name)) {
- throw new IllegalArgumentException("Duplicate vendor: " + name); //$NON-NLS-1$
- }
- }
- list.add(vendor);
- }
-
- public Vendor getVendor(String dtpVendorName) {
- for (int i = this.vendors.length; i-- > 0;) {
- Vendor vendor = this.vendors[i];
- if (vendor.getDTPVendorName().equals(dtpVendorName)) {
- return vendor;
- }
- }
- return UnrecognizedVendor.instance();
- }
-
-}
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 1e7b92a6e3..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.3.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 342c5199d0..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.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/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
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 e29a7c662f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 89f986ed3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.branding;singleton:=true
-Bundle-Version: 2.3.1.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.branding/about.ini b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.branding/about.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/about.properties
deleted file mode 100644
index af0e36f3e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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 Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2009. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/build.properties
deleted file mode 100644
index 8ce4550c10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,17 +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
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/plugin.properties
deleted file mode 100644
index 33c60d39c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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 Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath
deleted file mode 100644
index 21afecb138..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.classpath
+++ /dev/null
@@ -1,8 +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 exported="true" kind="lib" path="lib/persistence.jar" sourcepath="org.eclipse.jpt.eclipselink.core.ddlgensrc.zip"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ No newline at end of file
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 376311f646..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink.core.ddlgen/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 11155f4708..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:54 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8041bc2076..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Wed Apr 30 17:24:41 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.eclipselink.core.ddlgen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
deleted file mode 100644
index 1c78a00704..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/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.eclipselink.core.ddlgen;singleton:=true
-Bundle-Version: 1.0.300.qualifier
-Bundle-ClassPath: lib/persistence.jar
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.jpt.eclipselink.core;bundle-version="[1.0.0,2.0.0)"
-Export-Package: javax.persistence,
- javax.persistence.spi,
- org.eclipse.jpt.eclipselink.core.ddlgen
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.core.ddlgen/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties
deleted file mode 100644
index b73ac1ce72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/build.properties
+++ /dev/null
@@ -1,19 +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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- lib/persistence.jar,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar
deleted file mode 100644
index 1a1b232921..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/lib/persistence.jar
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/plugin.properties
deleted file mode 100644
index 2968d38c1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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 - EclipseLink Support - DDL Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
deleted file mode 100644
index 72f1bfbb17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.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.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.eclipselink.core.context.persistence.schema.generation.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();
- new File(this.appLocation + "/" + this.dropDDLFileName).delete();
- 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);
- }
-
- 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);
- }
-
- private String getEclipseLinkPropertiesPath(String[] args) {
-
- return this.getArgumentValue("-p", args);
- }
-
- private boolean getDebugMode(String[] args) {
-
- return this.argumentExists("-debug", args);
- }
-
- 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 = (String)overrides.get(propertyKey);
- }
- if (value == null){
- value = System.getProperty(propertyKey);
- }
- return value;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.classpath b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.classpath
deleted file mode 100644
index 912395245d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.classpath
+++ /dev/null
@@ -1,14 +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/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.cvsignore
deleted file mode 100644
index 76e64421ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-@dot
-temp.folder
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 7fa880fb4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink.core/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index e3143733ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue Feb 23 16:52:23 EST 2010
-eclipse.preferences.version=1
-encoding//schemas/eclipselink_orm_1_0.xsd=UTF8
-encoding//schemas/eclipselink_orm_1_1.xsd=UTF8
-encoding//schemas/eclipselink_orm_1_2.xsd=UTF8
-encoding//schemas/eclipselink_orm_2_0.xsd=UTF8
-encoding//schemas/eclipselink_orm_2_1.xsd=UTF8
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index dcfa502030..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Sun Feb 24 21:25:34 EST 2008
-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 \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 1c019134c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,88 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.eclipselink.core;singleton:=true
-Bundle-Version: 1.3.1.qualifier
-Bundle-Activator: org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin
-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.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.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.validation;bundle-version="[1.2.0,2.0.0)"
-Export-Package: org.eclipse.jpt.eclipselink.core,
- org.eclipse.jpt.eclipselink.core.context,
- org.eclipse.jpt.eclipselink.core.context.java,
- org.eclipse.jpt.eclipselink.core.context.orm,
- org.eclipse.jpt.eclipselink.core.context.persistence,
- org.eclipse.jpt.eclipselink.core.context.persistence.caching,
- org.eclipse.jpt.eclipselink.core.context.persistence.connection,
- org.eclipse.jpt.eclipselink.core.context.persistence.customization,
- org.eclipse.jpt.eclipselink.core.context.persistence.general,
- org.eclipse.jpt.eclipselink.core.context.persistence.logging,
- org.eclipse.jpt.eclipselink.core.context.persistence.options,
- org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation,
- org.eclipse.jpt.eclipselink.core.internal;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.general;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.options;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.ddlgen;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.resource.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.utility;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_1;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_1.context;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_2;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_2.context.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v1_2.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.connection;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.logging;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.options;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_0.ddlgen;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_1;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_1.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.source;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.resource.java,
- org.eclipse.jpt.eclipselink.core.resource.orm,
- org.eclipse.jpt.eclipselink.core.resource.orm.v1_1,
- org.eclipse.jpt.eclipselink.core.resource.orm.v1_2,
- org.eclipse.jpt.eclipselink.core.resource.orm.v2_0,
- org.eclipse.jpt.eclipselink.core.resource.orm.v2_1,
- org.eclipse.jpt.eclipselink.core.v2_0.context,
- org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.connection,
- org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging,
- org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options,
- org.eclipse.jpt.eclipselink.core.v2_0.resource.java
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.eclipselink.core/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core/build.properties
deleted file mode 100644
index 72abd57022..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/build.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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties,\
- schemas/
-jars.compile.order = .
-src.includes = model/
-src.includes = model/,\
- schemas/
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipseLinkResourceModels.genmodel
deleted file mode 100644
index c1b1ae0b25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipseLinkResourceModels.genmodel
+++ /dev/null
@@ -1,381 +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.eclipselink.core/src"
- creationCommands="false" creationIcons="false" editDirectory="" editorDirectory=""
- modelPluginID="org.eclipse.jpt.eclipselink.core" modelName="EclipseLinkCore" editPluginClass=""
- editorPluginClass="" updateClasspath="false" rootExtendsInterface="org.eclipse.jpt.core.resource.xml.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.core.resource.xml.AbstractJpaEObject" suppressInterfaces="true"
- testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.jpt.core/model/jpaResourceModels.genmodel#//orm ../../org.eclipse.jpt.core/model/jpaResourceModels.genmodel#//xml">
- <foreignModel>eclipselink_orm.ecore</foreignModel>
- <genPackages prefix="EclipseLinkOrm" basePackage="org.eclipse.jpt.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 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#//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#//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#//XmlId"/>
- <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#//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 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#//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#//XmlPersistenceUnitDefaults"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPersistenceUnitMetadata">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPersistenceUnitMetadata/excludeDefaultMappings"/>
- </genClasses>
- <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 image="false" ecoreClass="eclipselink_orm.ecore#//XmlReadOnly">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlReadOnly/readOnly"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlReturnInsert"/>
- <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#//XmlStructConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStructConverter/converter"/>
- </genClasses>
- <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 image="false" ecoreClass="eclipselink_orm.ecore#//XmlVariableOneToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlVersion"/>
- <nestedGenPackages prefix="EclipseLinkOrmV1_1" basePackage="org.eclipse.jpt.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.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.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>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore
deleted file mode 100644
index abbca3a33b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/model/eclipselink_orm.ecore
+++ /dev/null
@@ -1,469 +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.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="XmlAttributeMapping" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeMapping #//XmlAccessMethodsHolder #//XmlPropertyContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//Attributes">
- <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.core/model/orm.ecore#//XmlBasic #//v2_1/XmlBasic_2_1 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping"/>
- <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">
- <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="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="XmlConversionValue">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectValue" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </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/2002/Ecore#//EString"/>
- </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.core/model/orm.ecore#//XmlConvertibleMapping #//XmlConverterHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="convert" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </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/2002/Ecore#//EString"/>
- </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.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlElementCollection #//v2_0/XmlElementCollection_2_0 #//v2_1/XmlElementCollection_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEmbeddable #//v2_1/XmlEmbeddable_2_1 #//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.core/model/orm.ecore#//XmlEmbedded #//v2_1/XmlEmbedded_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEmbeddedId #//v2_1/XmlEmbeddedId_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlEntity #//v1_1/XmlEntity_1_1 #//v2_0/XmlEntity_2_0 #//v2_1/XmlEntity_2_1 #//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.core/model/orm.ecore#//XmlEntityMappings #//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="XmlId" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlId #//v2_1/XmlId_2_1 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping"/>
- <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="XmlManyToMany" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToMany #//v2_0/XmlManyToMany_2_0 #//v2_1/XmlManyToMany_2_1 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlManyToOne #//v2_1/XmlManyToOne_2_1 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlMappedSuperclass #//v1_1/XmlMappedSuperclass_1_1 #//v2_0/XmlMappedSuperclass_2_0 #//v2_1/XmlMappedSuperclass_2_1 #//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="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/2002/Ecore#//EString"/>
- </eClassifiers>
- <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.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/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <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/2002/Ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToMany #//v2_0/XmlOneToMany_2_0 #//v2_1/XmlOneToMany_2_1 #//XmlAttributeMapping #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOneToOne #//v2_1/XmlOneToOne_2_1 #//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.core/model/orm.ecore#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlOrderColumn #//v2_0/XmlOrderColumn_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlPersistenceUnitDefaults #//v2_1/XmlPersistenceUnitDefaults_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata" eSuperTypes="../../org.eclipse.jpt.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="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="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="XmlReturnInsert" eSuperTypes="#//v2_1/XmlReturnInsert_2_1"/>
- <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="XmlStructConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="converter" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
- <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.core/model/orm.ecore#//AbstractXmlAttributeMapping #//v2_1/XmlTransformation_2_1 #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" eSuperTypes="../../org.eclipse.jpt.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/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlVersion #//v2_1/XmlVersion_2_1 #//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.eclipselink.core.resource.orm.v1_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_1_1" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//XmlGeneratorContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="ecore:EClass ../../org.eclipse.jpt.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.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.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/2002/Ecore#//EString"/>
- </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"
- eSuperTypes="../../org.eclipse.jpt.core/model/orm.ecore#//v2_0/XmlEntity_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.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.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.core/model/orm.ecore#//v2_0/XmlCacheable_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.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/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readAll" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readObject" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="report" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="update" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insert" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="delete" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </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.eclipselink.core.resource.orm.v2_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_1" abstract="true" interface="true"
- eSuperTypes="#//v1_1/XmlBasic_1_1">
- <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.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/2002/Ecore#//EString"/>
- </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/2002/Ecore#//EString"/>
- <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.core/model/orm.ecore#//XmlAssociationOverrideContainer ../../org.eclipse.jpt.core/model/orm.ecore#//XmlAttributeOverrideContainer #//v2_1/XmlFetchGroupContainer_2_1 ../../org.eclipse.jpt.core/model/orm.ecore#//XmlGeneratorContainer ../../org.eclipse.jpt.core/model/orm.ecore#//XmlQueryContainer #//XmlQueryContainer #//XmlAccessMethodsHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings"
- upperBound="-1" eType="ecore:EClass ../../org.eclipse.jpt.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>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties
deleted file mode 100644
index 850f6aa1a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,31 +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
-################################################################################
-# ====================================================================
-# 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
-providerName = Eclipse Web Tools Platform
-
-ECLIPSELINK_ORM_XML_CONTENT = EclipseLink XML mapping files
-
-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
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml
deleted file mode 100644
index 519008b1ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,284 +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.eclipselink.core.content.orm"
- name="%ECLIPSELINK_ORM_XML_CONTENT"
- base-type="org.eclipse.jpt.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.core.jpaPlatforms">
-
- <jpaPlatform
- id="org.eclipse.eclipselink.platform"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatformFactory"
- label="%ECLIPSELINK1_0_x_PLATFORM"
- jpaFacetVersion="1.0">
- </jpaPlatform>
-
- <jpaPlatform
- id="eclipselink1_1"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.v1_1.EclipseLink1_1JpaPlatformFactory"
- label="%ECLIPSELINK1_1_x_PLATFORM"
- jpaFacetVersion="1.0">
- </jpaPlatform>
-
- <jpaPlatform
- id="eclipselink1_2"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.v1_2.EclipseLink1_2JpaPlatformFactory"
- label="%ECLIPSELINK1_2_x_PLATFORM"
- jpaFacetVersion="1.0">
- </jpaPlatform>
-
- <jpaPlatform
- id="eclipselink2_0"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformFactory"
- label="%ECLIPSELINK2_0_x_PLATFORM"
- jpaFacetVersion="2.0">
- </jpaPlatform>
-
- <jpaPlatform
- id="eclipselink2_1"
- factoryClass="org.eclipse.jpt.eclipselink.core.internal.v2_1.EclipseLink2_1JpaPlatformFactory"
- label="%ECLIPSELINK2_1_x_PLATFORM"
- jpaFacetVersion="2.0">
- </jpaPlatform>
-
- </extension>
-
-
-
- <!--
- ******************************************
- * 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">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </with>
- </enablement>
- </import-definitions>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider id="jpa-eclipselink1_0-user-library-provider" extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.eclipselink.core.internal.utility.EclipseLinkLibraryValidator"/>
- <param name="validator.param.0" value="version-range:[1.0, 3.0)"/>
- <param name="validator.param.1" value="key-class:javax.persistence.Entity"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="org.eclipse.eclipselink.platform"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- <provider id="jpa-eclipselink1_1-user-library-provider" extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.eclipselink.core.internal.utility.EclipseLinkLibraryValidator"/>
- <param name="validator.param.0" value="version-range:[1.1, 3.0)"/>
- <param name="validator.param.1" value="key-class:javax.persistence.Entity"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="eclipselink1_1"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- <provider id="jpa-eclipselink1_2-user-library-provider" extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.eclipselink.core.internal.utility.EclipseLinkLibraryValidator"/>
- <param name="validator.param.0" value="version-range:[1.2, 3.0)"/>
- <param name="validator.param.1" value="key-class:javax.persistence.Entity"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="eclipselink1_2"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- <provider id="eclipselink2_0-user-library-provider" extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.eclipselink.core.internal.utility.EclipseLinkLibraryValidator"/>
- <param name="validator.param.0" value="version-range:[2.0, 3.0)"/>
- <param name="validator.param.1" value="key-class:javax.persistence.Entity"/>
- <param name="validator.param.2" value="key-class:javax.persistence.ElementCollection"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="eclipselink2_0"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- <provider id="jpa-eclipselink2_1-user-library-provider" extends="wtp-user-library-provider">
- <param name="validator" value="org.eclipse.jpt.eclipselink.core.internal.utility.EclipseLinkLibraryValidator"/>
- <param name="validator.param.0" value="version-range:[2.1, 3.0)"/>
- <param name="validator.param.1" value="key-class:javax.persistence.Entity"/>
- <param name="validator.param.2" value="key-class:javax.persistence.ElementCollection"/>
- <enablement>
- <and>
- <with variable="requestingProjectFacet">
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jpt.jpa" forcePluginActivation="true"/>
- </with>
- <with variable="jpaPlatform">
- <equals value="eclipselink2_1"/>
- </with>
- </and>
- </enablement>
- </provider>
-
- </extension>
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmXmlResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.eclipselink.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </extension>
-
-
- <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_1.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" />
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence/oxm"
- uri="schemas/eclipselink_oxm_2_1.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" />
-
- <public
- publicId="http://www.eclipse.org/eclipselink/xsds/persistence"
- uri="schemas/eclipselink_oxm_2_1.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_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" />
-
- </catalogContribution>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.properties
deleted file mode 100644
index 769befcc3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/eclipselink_jpa_validation.properties
+++ /dev/null
@@ -1,18 +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
-################################################################################
-
-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_IMPLEMENTS_CONVERTER=The converter class \"{0}\" does not implement the org.eclipse.persistence.mappings.converters.Converter interface
-CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER=The customizer class \"{0}\" does not implement the org.eclipse.persistence.config.DescriptorCustomizer interface
-MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE=Multiple object values are specified for the data value \"{0}\"
-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
-BASIC_COLLECTION_MAPPING_DEPRECATED=The type basic-collection is deprecated
-BASIC_MAP_MAPPING_DEPRECATED=The type basic-map is deprecated
-
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/jpt_eclipselink_core.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/jpt_eclipselink_core.properties
deleted file mode 100644
index 778ab9c664..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/property_files/jpt_eclipselink_core.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-################################################################################
-# Copyright (c) 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License 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_invalidJpaLibrary=Selected libraries do not include all required JPA annotation classes.
-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.
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_0.xsd
deleted file mode 100644
index af1d1dadad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_1.xsd
deleted file mode 100644
index 0d3ff1747c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_2.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_1_2.xsd
deleted file mode 100644
index f7c2b26770..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_0.xsd
deleted file mode 100644
index 2aa23acf3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_orm_2_1.xsd
deleted file mode 100644
index 5e3ce57249..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_0.xsd
deleted file mode 100644
index bb10ce4894..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_oxm_2_1.xsd
deleted file mode 100644
index 270f5c66ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.0.xsd
deleted file mode 100644
index 02c6c61c6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.1.xsd
deleted file mode 100644
index 3746ead644..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_1.2.xsd
deleted file mode 100644
index 22a56967a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_persistence_map_2.0.xsd
deleted file mode 100644
index a93b9ea08e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.0.xsd
deleted file mode 100644
index 9831af0a26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.1.xsd
deleted file mode 100644
index d872a1640e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_1.2.xsd
deleted file mode 100644
index b58242768c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.0.xsd
deleted file mode 100644
index c84821e948..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd b/jpa/plugins/org.eclipse.jpt.eclipselink.core/schemas/eclipselink_sessions_2.1.xsd
deleted file mode 100644
index 61697113d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaProject.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaProject.java
deleted file mode 100644
index 0dd8e544f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkJpaProject.java
+++ /dev/null
@@ -1,38 +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.eclipselink.core;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.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.eclipselink.core.internal.JptEclipseLinkCorePlugin#DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH
- * @see org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin#ECLIPSELINK_ORM_XML_CONTENT_TYPE
- */
- JpaXmlResource getDefaultEclipseLinkOrmXmlResource();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java
deleted file mode 100644
index 68e3a96e1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/EclipseLinkMappingKeys.java
+++ /dev/null
@@ -1,28 +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.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";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 05f83e3ef4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapMapping.java
deleted file mode 100644
index 6e4a776096..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapping.java
deleted file mode 100644
index 17a477e306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkBasicMapping.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheCoordinationType.java
deleted file mode 100644
index 70f2f01ed6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core.resource.java.CacheCoordinationType toJavaResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.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.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.eclipselink.core.resource.orm.CacheCoordinationType toOrmResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCacheType.java
deleted file mode 100644
index 1a18d93df5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core.resource.java.CacheType toJavaResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.eclipselink.core.resource.java.CacheType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + cacheType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheType fromOrmResourceModel(org.eclipse.jpt.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.eclipselink.core.resource.orm.CacheType toOrmResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.eclipselink.core.resource.orm.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCaching.java
deleted file mode 100644
index 93a28c1142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCaching.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 EclipseLinkCaching extends JpaContextNode
-{
- //***************** shared ************************
-
- /**
- * This is the combination of defaultShared and specifiedShared.
- * If getSpecifiedShared() returns null, then return isDefaultShared()
- */
- boolean isShared();
-
- boolean isDefaultShared();
- String DEFAULT_SHARED_PROPERTY = "defaultShared"; //$NON-NLS-1$
- boolean DEFAULT_SHARED = true;
-
- Boolean getSpecifiedShared();
-
- /**
- * Setting this to false means that cacheType, cacheSize, alwaysRefresh,
- * refreshOnlyIfNewer, disableHits, cacheCoordinationType will all be set
- * to their default states. These settings do not apply to a cache that is not shared
- * @param newSpecifiedShared
- */
- void setSpecifiedShared(Boolean newSpecifiedShared);
- String SPECIFIED_SHARED_PROPERTY = "specifiedShared"; //$NON-NLS-1$
-
-
- //***************** cache type ************************
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkCacheType getType();
-
- EclipseLinkCacheType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkCacheType DEFAULT_TYPE = EclipseLinkCacheType.SOFT_WEAK;
-
- EclipseLinkCacheType getSpecifiedType();
- void setSpecifiedType(EclipseLinkCacheType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
-
- //***************** size ************************
-
- /**
- * This is the combination of defaultSize and specifiedSize.
- * If getSpecifiedSize() returns null, then return getDefaultSize()
- */
- int getSize();
-
- int getDefaultSize();
- int DEFAULT_SIZE = 100;
- String DEFAULT_SIZE_PROPERTY = "defaultSize"; //$NON-NLS-1$
-
- Integer getSpecifiedSize();
- void setSpecifiedSize(Integer newSpecifiedSize);
- String SPECIFIED_SIZE_PROPERTY = "specifiedSize"; //$NON-NLS-1$
-
- //***************** always refresh ************************
-
- /**
- * This is the combination of defaultAlwaysRefresh and specifiedAlwaysRefresh.
- * If getSpecifiedAlwaysRefresh() returns null, then return isDefaultAlwaysRefresh()
- */
- boolean isAlwaysRefresh();
-
- boolean isDefaultAlwaysRefresh();
- String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefresh"; //$NON-NLS-1$
- boolean DEFAULT_ALWAYS_REFRESH = false;
-
- Boolean getSpecifiedAlwaysRefresh();
- void setSpecifiedAlwaysRefresh(Boolean newSpecifiedAlwaysRefresh);
- String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefresh"; //$NON-NLS-1$
-
-
- //***************** refresh only if newer ************************
-
- /**
- * This is the combination of defaultRefreshOnlyIfNewer and specifiedRefreshOnlyIfNewer.
- * If getSpecifiedRefreshOnlyIfNewer() returns null, then return isDefaultRefreshOnlyIfNewer()
- */
- boolean isRefreshOnlyIfNewer();
-
- boolean isDefaultRefreshOnlyIfNewer();
- String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewer"; //$NON-NLS-1$
- boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
-
- Boolean getSpecifiedRefreshOnlyIfNewer();
- void setSpecifiedRefreshOnlyIfNewer(Boolean newSpecifiedRefreshOnlyIfNewer);
- String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewer"; //$NON-NLS-1$
-
-
- //***************** disable hits ************************
-
- /**
- * This is the combination of defaultDisableHits and specifiedDisableHits.
- * If getSpecifiedDisableHits() returns null, then return getDefaultDisableHits()
- */
- boolean isDisableHits();
-
- boolean isDefaultDisableHits();
- String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHits"; //$NON-NLS-1$
- boolean DEFAULT_DISABLE_HITS = false;
-
- Boolean getSpecifiedDisableHits();
- void setSpecifiedDisableHits(Boolean newSpecifiedDisableHits);
- String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHits"; //$NON-NLS-1$
-
-
- //***************** coordination type ************************
-
- /**
- * This is the combination of defaultCoordinationType and specifiedCoordinationType.
- * If getSpecifiedCoordinationType() returns null, then return getDefaultCoordinationType()
- */
- EclipseLinkCacheCoordinationType getCoordinationType();
-
- EclipseLinkCacheCoordinationType getDefaultCoordinationType();
- String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationType"; //$NON-NLS-1$
- EclipseLinkCacheCoordinationType DEFAULT_COORDINATION_TYPE = EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES;
-
- EclipseLinkCacheCoordinationType getSpecifiedCoordinationType();
- void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType newSpecifiedCoordinationType);
- String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationType"; //$NON-NLS-1$
-
-
- //***************** existence checking ************************
-
- /**
- * This is the combination of defaultExistenceType and specifiedExistenceType.
- * If getSpecifiedExistenceType() returns null, then return getDefaultExistenceType()
- */
- EclipseLinkExistenceType getExistenceType();
-
- EclipseLinkExistenceType getDefaultExistenceType();
- String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceType"; //$NON-NLS-1$
- EclipseLinkExistenceType DEFAULT_EXISTENCE_TYPE = EclipseLinkExistenceType.CHECK_DATABASE;
-
- EclipseLinkExistenceType getSpecifiedExistenceType();
- void setSpecifiedExistenceType(EclipseLinkExistenceType newSpecifiedExistenceType);
- String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceType"; //$NON-NLS-1$
-
-
- //***************** 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
- * @param expiry
- */
- void setExpiry(Integer expiry);
- String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
-
- /**
- * 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.
- */
- EclipseLinkExpiryTimeOfDay getExpiryTimeOfDay();
-
- /**
- * Add Cache expiryTimeOfDay annotation or xml element, this will set
- * Expiry to null as it is not valid to set both expiry and timeOfDayExpiry
- */
- EclipseLinkExpiryTimeOfDay addExpiryTimeOfDay();
-
- /**
- * Removes the Cache expiryTimeOfDay annotation/xml element
- */
- void removeExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTracking.java
deleted file mode 100644
index 5e504c94d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,39 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 EclipseLinkChangeTracking extends JpaContextNode
-{
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkChangeTrackingType getType();
-
- EclipseLinkChangeTrackingType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkChangeTrackingType DEFAULT_TYPE = EclipseLinkChangeTrackingType.AUTO;
-
- EclipseLinkChangeTrackingType getSpecifiedType();
- void setSpecifiedType(EclipseLinkChangeTrackingType newSpecifiedType);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkChangeTrackingType.java
deleted file mode 100644
index 5698dc3680..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.context;
-
-import org.eclipse.jpt.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.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.eclipselink.core.resource.java.ChangeTrackingType toJavaResourceModel(EclipseLinkChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE:
- return org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE;
- case OBJECT:
- return org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType.OBJECT;
- case DEFERRED:
- return org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED;
- case AUTO:
- return org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConversionValue.java
deleted file mode 100644
index e655c56532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConversionValue.java
+++ /dev/null
@@ -1,37 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-/**
- * Corresponds to a ConversionValue 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.1
- * @since 2.1
- */
-public interface EclipseLinkConversionValue extends JpaContextNode
-{
- 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$
-
- EclipseLinkObjectTypeConverter getParent();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConvert.java
deleted file mode 100644
index c2ea62606f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConvert.java
+++ /dev/null
@@ -1,86 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-/**
- * Corresponds to a Convert 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.1
- * @since 2.1
- */
-public interface EclipseLinkConvert extends JpaContextNode, Converter
-{
-
- String ECLIPSE_LINK_CONVERTER = "eclipseLinkConverter"; //$NON-NLS-1$
-
- String getConverterName();
-
- String getDefaultConverterName();
- String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterName"; //$NON-NLS-1$
-
- String getSpecifiedConverterName();
-
- void setSpecifiedConverterName(String converterName);
- String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterName"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying a serialized object converter. In this
- * case there does not need to be a corresponding @CustomConverter defined.
- */
- 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 a no-args constructor
- * In this case there does not need to be a corresponding @CustomConverter defined.
- */
- 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 there does not need to be a corresponding @CustomConverter defined.
- */
- String NO_CONVERTER = "none"; //$NON-NLS-1$
-
- String[] RESERVED_CONVERTER_NAMES = {NO_CONVERTER, CLASS_INSTANCE_CONVERTER, SERIALIZED_CONVERTER};
-
- String DEFAULT_CONVERTER_NAME = NO_CONVERTER;
-
- /**
- * This will return null if there is no converter specified on the mapping
- * @return
- */
- EclipseLinkConverter getConverter();
- String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
-
- /**
- * Possible values for converter type are:
- * {@value EclipseLinkNamedConverter#TYPE_CONVERTER}
- * {@value EclipseLinkNamedConverter#STRUCT_CONVERTER}
- * {@value EclipseLinkNamedConverter#CUSTOM_CONVERTER}
- * {@value EclipseLinkNamedConverter#NO_CONVERTER}
- * {@value EclipseLinkNamedConverter#OBJECT_TYPE_CONVERTER}
- * @param converterType
- */
- void setConverter(String converterType);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.java
deleted file mode 100644
index ad9b3f91f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkConverter.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-/**
- * Corresponds to a *CustomConverter 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.1
- * @since 2.1
- */
-public interface EclipseLinkConverter extends JpaContextNode
-{
- /**
- * Return a string that represents the type of converter.
- * Possibilities are below, NO_CONVERTER, CUSTOM_CONVERTER,
- * OBJECT_TYPE_CONVERTER, STRUCT_CONVERTER, TYPE_CONVERTER
- */
- String getType();
- String NO_CONVERTER = "noConverter"; //$NON-NLS-1$
- String CUSTOM_CONVERTER = "customConverter"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER = "objectTypeConverter"; //$NON-NLS-1$
- String STRUCT_CONVERTER = "structConverter"; //$NON-NLS-1$
- String TYPE_CONVERTER = "typeConverter"; //$NON-NLS-1$
-
- String getName();
- void setName(String name);
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the converter class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getEnclosingTypeSeparator();
-
- /**
- * Return whether the converter definition overrides the definition of the
- * given converter
- * (e.g. a converter defined in orm.xml overrides one defined in java).
- */
- boolean overrides(EclipseLinkConverter converter);
-
- /**
- * Return whether the converter is a duplicate of the given converter.
- * A converter is not a duplicate of another converter if is the same exact converter,
- * if it is a nameless converter (which is an error condition), or if it overrides
- * or is overridden by the other converter.
- */
- boolean duplicates(EclipseLinkConverter converter);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomConverter.java
deleted file mode 100644
index ee6db22a32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,32 +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.eclipselink.core.context;
-
-/**
- * Corresponds to a CustomConverter 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.1
- * @since 2.1
- */
-public interface EclipseLinkCustomConverter extends EclipseLinkConverter
-{
-
- String getConverterClass();
- void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
- String ECLIPSELINK_CONVERTER_CLASS_NAME = "org.eclipse.persistence.mappings.converters.Converter"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomizer.java
deleted file mode 100644
index a07d6e77f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkCustomizer.java
+++ /dev/null
@@ -1,45 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-/**
- * Corresponds to a Customizer 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.1
- * @since 2.1
- */
-public interface EclipseLinkCustomizer extends JpaContextNode
-{
-
- String getCustomizerClass();
-
- String getDefaultCustomizerClass();
- String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClass"; //$NON-NLS-1$
-
- 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$
-
- /**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.java
deleted file mode 100644
index 9b63acfb34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEmbeddable.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 EclipseLinkTypeMapping, Embeddable
-{
- EclipseLinkCustomizer getCustomizer();
-
- EclipseLinkChangeTracking getChangeTracking();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.java
deleted file mode 100644
index 02574128d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkEntity.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 EclipseLinkTypeMapping, Entity
-{
- EclipseLinkCaching getCaching();
-
- EclipseLinkReadOnly getReadOnly();
-
- EclipseLinkCustomizer getCustomizer();
-
- EclipseLinkChangeTracking getChangeTracking();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExistenceType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExistenceType.java
deleted file mode 100644
index 91e428fd95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExistenceType.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.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 EclipseLinkExistenceType {
-
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE;
-
-
- public static EclipseLinkExistenceType fromJavaResourceModel(org.eclipse.jpt.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.eclipselink.core.resource.java.ExistenceType toJavaResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.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.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.eclipselink.core.resource.orm.ExistenceType toOrmResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExpiryTimeOfDay.java
deleted file mode 100644
index 49f520bc22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkExpiryTimeOfDay.java
+++ /dev/null
@@ -1,45 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.JpaContextNode;
-
-/**
- * Corresponds to a TimeOfDay 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.1
- * @since 2.1
- */
-public interface EclipseLinkExpiryTimeOfDay 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkIdMapping.java
deleted file mode 100644
index 4d6d3dab60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkIdMapping.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.IdMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetch.java
deleted file mode 100644
index 88893a0f40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetch.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 newJoinFetchValue);
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
- EclipseLinkJoinFetchType DEFAULT_VALUE = EclipseLinkJoinFetchType.INNER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkJoinFetchType.java
deleted file mode 100644
index 80617f35cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.context;
-
-import org.eclipse.jpt.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.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.eclipselink.core.resource.java.JoinFetchType toJavaResourceModel(EclipseLinkJoinFetchType joinFetchType) {
- if (joinFetchType == null) {
- return null;
- }
- switch (joinFetchType) {
- case INNER:
- return org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER;
- case OUTER:
- return org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.java
deleted file mode 100644
index fbd783ed34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMappedSuperclass.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 EclipseLinkTypeMapping, MappedSuperclass
-{
- EclipseLinkCaching getCaching();
-
- EclipseLinkReadOnly getReadOnly();
-
- EclipseLinkCustomizer getCustomizer();
-
- EclipseLinkChangeTracking getChangeTracking();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMutable.java
deleted file mode 100644
index 35614935aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkMutable.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 isDefaultMutable();
- String DEFAULT_MUTABLE_PROPERTY = "defaultMutable"; //$NON-NLS-1$
-
- Boolean getSpecifiedMutable();
- void setSpecifiedMutable(Boolean newSpecifiedMutable);
- String SPECIFIED_MUTABLE_PROPERTY = "specifiedMutable"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
deleted file mode 100644
index 394d2c3faa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,92 +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.eclipselink.core.context;
-
-import java.util.ListIterator;
-
-/**
- * Corresponds to a ObjectTypeConverter 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.1
- * @since 2.1
- */
-public interface EclipseLinkObjectTypeConverter 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$
-
-
- // **************** conversion values **************************************
-
- /**
- * Return a list iterator of the conversion values.
- * This will not be null.
- */
- <T extends EclipseLinkConversionValue> ListIterator<T> conversionValues();
-
- /**
- * Return the number of conversion values.
- */
- int conversionValuesSize();
-
- /**
- * Add a conversion value to the object type mapping return the object
- * representing it.
- */
- EclipseLinkConversionValue addConversionValue(int index);
-
- /**
- * Add a conversion value to the object type mapping return the object
- * representing it.
- */
- EclipseLinkConversionValue addConversionValue();
-
- /**
- * Remove the conversion value at the given index from the entity.
- */
- void removeConversionValue(int index);
-
- /**
- * Remove the conversion value from the entity.
- */
- void removeConversionValue(EclipseLinkConversionValue conversionValue);
-
- /**
- * Move the conversion values from the source index to the target index.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
-
- /**
- * Returns a ListIterator of the ConversionValue dataValues.
- * @return
- */
- ListIterator<String> dataValues();
-
-
- // **************** default object value **************************************
-
- String getDefaultObjectValue();
- void setDefaultObjectValue(String defaultObjectValue);
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.java
deleted file mode 100644
index 750b853f67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyMapping.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
- EclipseLinkOneToManyRelationshipReference getRelationshipReference();
-
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyRelationshipReference.java
deleted file mode 100644
index 72a62475d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,36 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.JoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.OneToManyRelationshipReference;
-import org.eclipse.jpt.core.context.RelationshipReference;
-
-
-/**
- * Represents the {@link RelationshipReference} of an
- * {@link EclipseLinkOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkOneToManyRelationshipReference
- extends OneToManyRelationshipReference,
- JoinColumnEnabledRelationshipReference
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToOneMapping.java
deleted file mode 100644
index 696e603ad0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkOneToOneMapping.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkPrivateOwned.java
deleted file mode 100644
index e5e15c56cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkPrivateOwned.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.eclipselink.core.context;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkReadOnly.java
deleted file mode 100644
index 6876a39f06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkReadOnly.java
+++ /dev/null
@@ -1,37 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkRelationshipMapping.java
deleted file mode 100644
index 860ddc21c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkRelationshipMapping.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.RelationshipMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
- EclipseLinkJoinFetch getJoinFetch();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkStructConverter.java
deleted file mode 100644
index 7173bfec45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkStructConverter.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.context;
-
-/**
- * Corresponds to a StructConverter 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.1
- * @since 2.1
- */
-public interface EclipseLinkStructConverter extends EclipseLinkConverter
-{
- String getConverterClass();
- void setConverterClass(String converterClass);
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
- String ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME = "org.eclipse.persistence.platform.database.converters.StructConverter"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTransformationMapping.java
deleted file mode 100644
index 5717fdc6d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeConverter.java
deleted file mode 100644
index 9609175338..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.context;
-
-/**
- * Corresponds to a TypeConverter 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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeMapping.java
deleted file mode 100644
index ee7bfa7c51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkTypeMapping.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context;
-
-import org.eclipse.jpt.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
-{
- /**
- * 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();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 4d414c0c5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.AttributeMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.java
deleted file mode 100644
index 6107ee4f8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/EclipseLinkVersionMapping.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.eclipselink.core.context;
-
-import org.eclipse.jpt.core.context.VersionMapping;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkCaching.java
deleted file mode 100644
index aa294eb460..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkCaching.java
+++ /dev/null
@@ -1,52 +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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 hasExistenceChecking();
- void setExistenceChecking(boolean existenceChecking);
- String EXISTENCE_CHECKING_PROPERTY = "existenceChecking"; //$NON-NLS-1$
-
- /**
- * Initialize the EclipseLinkJavaCaching context model object to match the CacheAnnotation
- * resource model object. This should be called immediately after object creation.
- */
- void initialize(JavaResourcePersistentType resourcePersistentType);
-
- /**
- * Update the EclipseLinkJavaCaching context model object to match the CacheAnnotation
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentType resourcePersistentType);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkConverterHolder.java
deleted file mode 100644
index 6d00632852..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkConverterHolder.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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 JavaEclipseLinkConverterHolder extends JavaJpaContextNode
-{
- /**
- * Initialize the JavaConverterHolder context model object to match the JavaResourcePersistentType
- * resource model object. This should be called immediately after object creation.
- */
- void initialize(JavaResourcePersistentType jrpt);
-
- /**
- * Update the JavaConverterHolder context model object to match the JavaResourcePersistentType
- * resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
- */
- void update(JavaResourcePersistentType jrpt);
-
- EclipseLinkCustomConverter getCustomConverter();
- EclipseLinkCustomConverter addCustomConverter();
- void removeCustomConverter();
- String CUSTOM_CONVERTER_PROPERTY = "customConverter"; //$NON-NLS-1$
-
- EclipseLinkObjectTypeConverter getObjectTypeConverter();
- EclipseLinkObjectTypeConverter addObjectTypeConverter();
- void removeObjectTypeConverter();
- String OBJECT_TYPE_CONVERTER_PROPERTY = "objectTypeConverter"; //$NON-NLS-1$
-
- EclipseLinkStructConverter getStructConverter();
- EclipseLinkStructConverter addStructConverter();
- void removeStructConverter();
- String STRUCT_CONVERTER_PROPERTY = "structConverter"; //$NON-NLS-1$
-
- EclipseLinkTypeConverter getTypeConverter();
- EclipseLinkTypeConverter addTypeConverter();
- void removeTypeConverter();
- String TYPE_CONVERTER_PROPERTY = "typeConverter"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
deleted file mode 100644
index 52d3b92c66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEmbeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkEmbeddable, JavaEmbeddable
-{
- JavaEclipseLinkConverterHolder getConverterHolder();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEntity.java
deleted file mode 100644
index ead69e434e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkEntity.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkEntity, JavaEntity
-{
- JavaEclipseLinkConverterHolder getConverterHolder();
-
- JavaEclipseLinkCaching getCaching();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
deleted file mode 100644
index 419c4f707e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkMappedSuperclass, JavaMappedSuperclass
-{
- JavaEclipseLinkConverterHolder getConverterHolder();
-
- //********* covariant overrides ***********
-
- JavaEclipseLinkCaching getCaching();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkConverterHolder.java
deleted file mode 100644
index 4be4ecad6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkConverterHolder.java
+++ /dev/null
@@ -1,164 +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.eclipselink.core.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-
-public interface EclipseLinkConverterHolder extends JpaContextNode
-{
- //************ customConverters *********************
-
- /**
- * Return a list iterator of the custom converters.
- * This will not be null.
- */
- <T extends EclipseLinkCustomConverter> ListIterator<T> customConverters();
-
- /**
- * Return the number of custom converters.
- */
- int customConvertersSize();
-
- /**
- * 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.
- */
- <T extends EclipseLinkObjectTypeConverter> ListIterator<T> objectTypeConverters();
-
- /**
- * Return the number of object type converters.
- */
- int objectTypeConvertersSize();
-
- /**
- * 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.
- */
- <T extends EclipseLinkStructConverter> ListIterator<T> structConverters();
-
- /**
- * Return the number of struct converters.
- */
- int structConvertersSize();
-
- /**
- * 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.
- */
- <T extends EclipseLinkTypeConverter> ListIterator<T> typeConverters();
-
- /**
- * Return the number of type converters.
- */
- int typeConvertersSize();
-
- /**
- * 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$
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkEntityMappings.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
deleted file mode 100644
index f7426d64fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-
-public interface EclipseLinkEntityMappings
- extends EntityMappings
-{
-
- EclipseLinkConverterHolder getConverterHolder();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
deleted file mode 100644
index 20e3916c2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-
-public interface OrmEclipseLinkCaching
- extends EclipseLinkCaching, XmlContextNode
-{
- void update(JavaEclipseLinkCaching javaCaching);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java
deleted file mode 100644
index 493e30ee9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.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.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEmbeddable;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkEmbeddable, OrmEmbeddable
-{
- EclipseLinkConverterHolder getConverterHolder();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
deleted file mode 100644
index f4e9652354..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-
-public interface OrmEclipseLinkEntity extends EclipseLinkEntity, OrmEntity
-{
- EclipseLinkConverterHolder getConverterHolder();
-
- OrmEclipseLinkCaching getCaching();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
deleted file mode 100644
index df8ee7e307..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-
-public interface OrmEclipseLinkMappedSuperclass extends EclipseLinkMappedSuperclass, OrmMappedSuperclass
-{
- EclipseLinkConverterHolder getConverterHolder();
-
- OrmEclipseLinkCaching getCaching();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index e9c89e48cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-
-public interface EclipseLinkPersistenceXmlContextNodeFactory extends PersistenceXmlContextNodeFactory
-{
-
- PersistenceUnitProperties buildLogging(PersistenceUnit parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/CacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/CacheType.java
deleted file mode 100644
index 1df7e9ef58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/CacheType.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.eclipselink.core.context.persistence.caching;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/Caching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/Caching.java
deleted file mode 100644
index 2cf28d3af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/Caching.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.eclipselink.core.context.persistence.caching;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-
-/**
- * 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;
-
-
- ListIterator<Entity> entities();
- Iterator<String> entityNames();
- int entitiesSize();
- boolean entityExists(String entity);
- Entity addEntity(String entity);
- void removeEntity(String entity);
- String ENTITIES_LIST = "entities"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/FlushClearCache.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/FlushClearCache.java
deleted file mode 100644
index f92f5ab70d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/caching/FlushClearCache.java
+++ /dev/null
@@ -1,24 +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.eclipselink.core.context.persistence.caching;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/BatchWriting.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/BatchWriting.java
deleted file mode 100644
index 2f3b8a777e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/BatchWriting.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.eclipselink.core.context.persistence.connection;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/Connection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/Connection.java
deleted file mode 100644
index 650a063250..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/Connection.java
+++ /dev/null
@@ -1,147 +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.eclipselink.core.context.persistence.connection;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/ExclusiveConnectionMode.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/ExclusiveConnectionMode.java
deleted file mode 100644
index 47a9b8d319..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/connection/ExclusiveConnectionMode.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.context.persistence.connection;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Customization.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Customization.java
deleted file mode 100644
index 1b05b16e37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Customization.java
+++ /dev/null
@@ -1,142 +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.eclipselink.core.context.persistence.customization;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-
-/**
- * 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
-
- ListIterator<String> sessionCustomizers();
- int sessionCustomizersSize();
- 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$
-
- ListIterator<Entity> entities();
- Iterator<String> entityNames();
- int entitiesSize();
- boolean entityExists(String entity);
- Entity 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);
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Profiler.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Profiler.java
deleted file mode 100644
index 3cd2f1ce40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Profiler.java
+++ /dev/null
@@ -1,52 +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.eclipselink.core.context.persistence.customization;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Weaving.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Weaving.java
deleted file mode 100644
index 1b7c33733b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/customization/Weaving.java
+++ /dev/null
@@ -1,24 +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.eclipselink.core.context.persistence.customization;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/general/GeneralProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/general/GeneralProperties.java
deleted file mode 100644
index e7818a313e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/general/GeneralProperties.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.context.persistence.general;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logger.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logger.java
deleted file mode 100644
index 601dada583..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logger.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.eclipselink.core.context.persistence.logging;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logging.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logging.java
deleted file mode 100644
index 0d6da4ab93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/Logging.java
+++ /dev/null
@@ -1,78 +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.eclipselink.core.context.persistence.logging;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.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);
- String ECLIPSELINK_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.SessionLog"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/LoggingLevel.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/LoggingLevel.java
deleted file mode 100644
index c563b8c491..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/logging/LoggingLevel.java
+++ /dev/null
@@ -1,36 +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.eclipselink.core.context.persistence.logging;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/Options.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/Options.java
deleted file mode 100644
index ed6a6c89b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/Options.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.context.persistence.options;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetDatabase.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetDatabase.java
deleted file mode 100644
index 9c6412e2ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetDatabase.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.eclipselink.core.context.persistence.options;
-
-/**
- * TargetDatabase
- */
-public enum TargetDatabase {
- attunity,
- auto,
- cloudscape,
- database,
- db2,
- db2mainframe,
- dbase,
- derby,
- hsql,
- informix,
- javadb,
- mysql,
- oracle,
- oracle11,
- oracle10,
- oracle9,
- oracle8,
- pointbase,
- postgresql,
- sqlanywhere,
- sqlserver,
- sybase,
- 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 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 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;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetServer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetServer.java
deleted file mode 100644
index 1190401907..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/options/TargetServer.java
+++ /dev/null
@@ -1,49 +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.eclipselink.core.context.persistence.options;
-
-/**
- * TargetServer
- */
-public enum TargetServer {
- none,
- oc4j,
- sunas9,
- websphere,
- websphere_6_1,
- weblogic,
- weblogic_9,
- weblogic_10,
- jboss;
-
- // 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 WEBLOGIC = "WebLogic";
- static final String WEBLOGIC_9 = "WebLogic_9";
- static final String WEBLOGIC_10 = "WebLogic_10";
- static final String JBOSS = "JBoss";
-
- /**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/DdlGenerationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/DdlGenerationType.java
deleted file mode 100644
index bae6febd2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/DdlGenerationType.java
+++ /dev/null
@@ -1,24 +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.eclipselink.core.context.persistence.schema.generation;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/OutputMode.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/OutputMode.java
deleted file mode 100644
index 9d009c60f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/OutputMode.java
+++ /dev/null
@@ -1,24 +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.eclipselink.core.context.persistence.schema.generation;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/SchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/SchemaGeneration.java
deleted file mode 100644
index 11bc714a56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/context/persistence/schema/generation/SchemaGeneration.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.eclipselink.core.context.persistence.schema.generation;
-
-import org.eclipse.jpt.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.jdbc"; //$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.jdbc"; //$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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
deleted file mode 100644
index a8198e009f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
+++ /dev/null
@@ -1,90 +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.eclipselink.core.internal;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.utility.TextRange;
-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);
- 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
- JptCorePlugin.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
deleted file mode 100644
index b75ce22b91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,95 +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.eclipselink.core.internal;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.AbstractJpaAnnotationDefintionProvider;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 1.0 EclipseLink platform
- */
-public class EclipseLinkJpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
-{
- // 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 addTypeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EclipseLinkCacheAnnotationDefinition.instance());
- definitions.add(EclipseLinkChangeTrackingAnnotationDefinition.instance());
- definitions.add(EclipseLinkConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkCustomizerAnnotationDefinition.instance());
- definitions.add(EclipseLinkExistenceCheckingAnnotationDefinition.instance());
- definitions.add(EclipseLinkObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkPrimaryKeyAnnotationDefinition.instance());
- definitions.add(EclipseLinkReadOnlyAnnotationDefinition.instance());
- definitions.add(EclipseLinkStructConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkTypeConverterAnnotationDefinition.instance());
- }
-
- @Override
- protected void addAttributeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EclipseLinkBasicCollectionAnnotationDefinition.instance());
- definitions.add(EclipseLinkBasicMapAnnotationDefinition.instance());
- definitions.add(EclipseLinkConvertAnnotationDefinition.instance());
- definitions.add(EclipseLinkConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkJoinFetchAnnotationDefinition.instance());
- definitions.add(EclipseLinkMutableAnnotationDefinition.instance());
- definitions.add(EclipseLinkObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkPrivateOwnedAnnotationDefinition.instance());
- definitions.add(EclipseLinkReadTransformerAnnotationDefinition.instance());
- definitions.add(EclipseLinkStructConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkTransformationAnnotationDefinition.instance());
- definitions.add(EclipseLinkTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkVariableOneToOneAnnotationDefinition.instance());
- definitions.add(EclipseLinkWriteTransformerAnnotationDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.java
deleted file mode 100644
index 5e49d08ccf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaFactory.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.eclipselink.core.internal;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkEmbeddableImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkEntityImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkMappedSuperclassImpl;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.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 **********
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
- return new JavaEclipseLinkPersistentAttribute(parent, jrpa);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicMapping(parent);
- }
-
- @Override
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
- return new JavaEclipseLinkEmbeddableImpl(parent);
- }
-
- @Override
- public JavaEclipseLinkEntity buildJavaEntity(JavaPersistentType parent) {
- return new JavaEclipseLinkEntityImpl(parent);
- }
-
- @Override
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkIdMapping(parent);
- }
-
- @Override
- public JavaEclipseLinkMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent) {
- return new JavaEclipseLinkMappedSuperclassImpl(parent);
- }
-
- @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);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
deleted file mode 100644
index 249defa375..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
+++ /dev/null
@@ -1,91 +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.eclipselink.core.internal;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-
-/**
- * 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(),
- buildJpaAnnotationProvider(),
- EclipseLinkJpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_0,
- JptCorePlugin.JPA_FACET_VERSION_1_0
- );
- }
-
- protected JpaAnnotationProvider buildJpaAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- 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 {
- protected final String eclipseLinkVersion;
-
- public EclipseLinkVersion(String eclipseLinkVersion, String jpaVersion) {
- super(jpaVersion);
- this.eclipseLinkVersion = eclipseLinkVersion;
- }
-
- @Override
- public String getVersion() {
- return this.eclipseLinkVersion;
- }
-
- @Override
- public String toString() {
- return super.toString() + " EclipseLink version: " + this.getVersion(); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java
deleted file mode 100644
index f88ba88af5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.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.eclipselink.core.internal;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLinkJpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "org.eclipse.eclipselink.platform"; //$NON-NLS-1$
-
- // 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 JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()};
- }
-
-
- // ********* java type mappings *********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no type mappings specific to eclipselink
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********* java attribute mappings *********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaEclipseLinkBasicCollectionMappingDefinition.instance(),
- JavaEclipseLinkBasicMapMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaEclipseLinkTransformationMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance()};
- }
-
-
- // ********* mapping files *********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- // order should not be important here
- return new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java
deleted file mode 100644
index 99a9f87a3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaProjectImpl.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.eclipselink.core.internal;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.AbstractJpaProject;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-
-/**
- * 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(
- JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH,
- JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java
deleted file mode 100644
index ded1bf530d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkJpaValidationMessages.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.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 CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER = "CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER";
-
- public static final String MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE = "MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE";
-
- public static final String PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING = "PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING";
-
- public static final String BASIC_COLLECTION_MAPPING_DEPRECATED = "BASIC_COLLECTION_MAPPING_DEPRECATED";
- public static final String BASIC_MAP_MAPPING_DEPRECATED = "BASIC_MAP_MAPPING_DEPRECATED";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
deleted file mode 100644
index dfb7a06a33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
+++ /dev/null
@@ -1,52 +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.eclipselink.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.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 JptEclipseLinkCorePlugin.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCoreMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCoreMessages.java
deleted file mode 100644
index 8ebda63495..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCoreMessages.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.eclipselink.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali eclipselink core.
- */
-public class JptEclipseLinkCoreMessages
-{
- public static String EclipseLinkLibraryValidator_invalidJpaLibrary;
- public static String EclipseLinkLibraryValidator_noEclipseLinkVersion;
- public static String EclipseLinkLibraryValidator_multipleEclipseLinkVersions;
- public static String EclipseLinkLibraryValidator_improperEclipseLinkVersion;
-
-
- private static final String BUNDLE_NAME = "jpt_eclipselink_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptEclipseLinkCoreMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptEclipseLinkCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java
deleted file mode 100644
index 5979addca5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/JptEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,162 +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.eclipselink.core.internal;
-
-import org.eclipse.core.resources.IProject;
-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.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JptEclipseLinkCorePlugin extends Plugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.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$
-
- /**
- * 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 JpaResourceType ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE
- = new JpaResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JpaResourceType ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE
- = new JpaResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_1.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JpaResourceType ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE
- = new JpaResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_2.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.0 mapping files
- */
- public static final JpaResourceType ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE
- = new JpaResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_0.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.1 mapping files
- */
- public static final JpaResourceType ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE
- = new JpaResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_1.SCHEMA_VERSION);
-
- public static final String DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH = "META-INF/eclipselink-orm.xml"; //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
- /**
- * Return the default mapping file deployment URI for the specified project.
- * ("WEB-INF/classes/META-INF/eclipselink-orm.xml" for web projects and
- * "META-INF/eclipselink-orm.xml" in other cases)
- */
- public static String getDefaultEclipseLinkOrmXmlDeploymentURI(IProject project) {
- return JptCorePlugin.getDeploymentURI(project, DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- /**
- * 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 JptEclipseLinkCorePlugin() {
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 59fd9116e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkManyToOneMapping.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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaEclipseLinkManyToOneMapping
- extends AbstractJavaManyToOneMapping
- implements EclipseLinkRelationshipMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
-
- protected AbstractJavaEclipseLinkManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.JOIN_FETCH);
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.joinFetch.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.joinFetch.update(this.getResourcePersistentAttribute());
- }
-
- @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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkOneToOneMapping.java
deleted file mode 100644
index 941c83052f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/AbstractJavaEclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,75 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractJavaEclipseLinkOneToOneMapping
- extends AbstractJavaOneToOneMapping
- implements EclipseLinkOneToOneMapping2_0
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkPrivateOwned privateOwned;
-
-
- protected AbstractJavaEclipseLinkOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.privateOwned = new JavaEclipseLinkPrivateOwned(this);
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.JOIN_FETCH);
- names.add(EclipseLink.PRIVATE_OWNED);
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.joinFetch.initialize(this.getResourcePersistentAttribute());
- this.privateOwned.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.joinFetch.update(this.getResourcePersistentAttribute());
- this.privateOwned.update(this.getResourcePersistentAttribute());
- }
-
- @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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 6caf564f45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,49 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.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;
- }
-
- public 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMappingDefinition.java
deleted file mode 100644
index acfa0d8526..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMappingDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-public class JavaEclipseLinkBasicCollectionMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkBasicCollectionMappingDefinition INSTANCE =
- new JavaEclipseLinkBasicCollectionMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkBasicCollectionMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicCollectionMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
deleted file mode 100644
index 9376b9a771..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,62 +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.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.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;
- }
-
- public 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMappingDefinition.java
deleted file mode 100644
index a80ce1ed46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMappingDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-public class JavaEclipseLinkBasicMapMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkBasicMapMappingDefinition INSTANCE =
- new JavaEclipseLinkBasicMapMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkBasicMapMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicMapMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
deleted file mode 100644
index cf99a92aed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,100 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-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);
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.MUTABLE);
- names.add(EclipseLink.CONVERT);
- }
-
- //************** AbstractJavaBasicMapping implementation ***************
-
- @Override
- protected JavaConverter buildConverter(String converterType) {
- JavaConverter javaConverter = super.buildConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new JavaEclipseLinkConvert(this, this.getResourcePersistentAttribute());
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.getResourcePersistentAttribute().getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
- //************ EclipselinkJavaBasicMapping implementation ****************
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mutable.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.mutable.update(this.getResourcePersistentAttribute());
- }
-
-
- //************ 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
deleted file mode 100644
index 13d591ebae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,604 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.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 boolean existenceChecking;
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType;
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
-
- protected Integer expiry;
- protected JavaEclipseLinkExpiryTimeOfDay expiryTimeOfDay;
-
- protected final JavaCacheable2_0 cacheable;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
- public JavaEclipseLinkCachingImpl(JavaTypeMapping parent) {
- super(parent);
- this.cacheable = this.buildCacheable();
- }
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
-
- //query for the cache annotation every time on setters.
- //call one setter and the CacheAnnotation could change.
- //You could call more than one setter before this object has received any notification
- //from the java resource model
- protected EclipseLinkCacheAnnotation getCacheAnnotation() {
- return (EclipseLinkCacheAnnotation) this.resourcePersistentType.
- getNonNullAnnotation(getCacheAnnotationName());
- }
-
- protected EclipseLinkExistenceCheckingAnnotation getExistenceCheckingAnnotation() {
- return (EclipseLinkExistenceCheckingAnnotation) this.resourcePersistentType.
- getAnnotation(getExistenceCheckingAnnotationName());
- }
-
- protected String getCacheAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-
- protected String getExistenceCheckingAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
- public EclipseLinkCacheType getType() {
- return (this.getSpecifiedType() == null) ? this.getDefaultType() : this.getSpecifiedType();
- }
-
- public EclipseLinkCacheType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType newSpecifiedType) {
- EclipseLinkCacheType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- this.getCacheAnnotation().setType(EclipseLinkCacheType.toJavaResourceModel(newSpecifiedType));
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedType_(EclipseLinkCacheType newSpecifiedType) {
- EclipseLinkCacheType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- public int getSize() {
- return (this.getSpecifiedSize() == null) ? getDefaultSize() : this.getSpecifiedSize().intValue();
- }
-
- public int getDefaultSize() {
- return EclipseLinkCaching.DEFAULT_SIZE;
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer newSpecifiedSize) {
- Integer oldSpecifiedSize = this.specifiedSize;
- this.specifiedSize = newSpecifiedSize;
- getCacheAnnotation().setSize(newSpecifiedSize);
- firePropertyChanged(SPECIFIED_SIZE_PROPERTY, oldSpecifiedSize, newSpecifiedSize);
- }
-
- protected void setSpecifiedSize_(Integer newSpecifiedSize) {
- Integer oldSpecifiedSize = this.specifiedSize;
- this.specifiedSize = newSpecifiedSize;
- firePropertyChanged(SPECIFIED_SIZE_PROPERTY, oldSpecifiedSize, newSpecifiedSize);
- }
-
-
- public boolean isShared() {
- return (this.specifiedShared == null) ? this.isDefaultShared() : this.specifiedShared.booleanValue();
- }
-
- public boolean isDefaultShared() {
- return EclipseLinkCaching.DEFAULT_SHARED;
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean newSpecifiedShared) {
- Boolean oldShared = this.specifiedShared;
- this.specifiedShared = newSpecifiedShared;
- this.getCacheAnnotation().setShared(newSpecifiedShared);
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY, oldShared, newSpecifiedShared);
-
- if (newSpecifiedShared == Boolean.FALSE) {
- setSpecifiedType(null);
- setSpecifiedSize(null);
- setSpecifiedAlwaysRefresh(null);
- setSpecifiedRefreshOnlyIfNewer(null);
- setSpecifiedDisableHits(null);
- setSpecifiedCoordinationType(null);
- setExpiry(null);
- if (this.expiryTimeOfDay != null) {
- removeExpiryTimeOfDay();
- }
- }
- }
-
- protected void setSpecifiedShared_(Boolean newSpecifiedShared) {
- Boolean oldSpecifiedShared = this.specifiedShared;
- this.specifiedShared = newSpecifiedShared;
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY, oldSpecifiedShared, newSpecifiedShared);
- }
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh == null) ? this.isDefaultAlwaysRefresh() : this.specifiedAlwaysRefresh.booleanValue();
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return EclipseLinkCaching.DEFAULT_ALWAYS_REFRESH;
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean newSpecifiedAlwaysRefresh) {
- Boolean oldAlwaysRefresh = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = newSpecifiedAlwaysRefresh;
- this.getCacheAnnotation().setAlwaysRefresh(newSpecifiedAlwaysRefresh);
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean newSpecifiedAlwaysRefresh) {
- Boolean oldAlwaysRefresh = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = newSpecifiedAlwaysRefresh;
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer == null) ? this.isDefaultRefreshOnlyIfNewer() : this.specifiedRefreshOnlyIfNewer.booleanValue();
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return EclipseLinkCaching.DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean newSpecifiedRefreshOnlyIfNewer) {
- Boolean oldRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = newSpecifiedRefreshOnlyIfNewer;
- this.getCacheAnnotation().setRefreshOnlyIfNewer(newSpecifiedRefreshOnlyIfNewer);
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean newSpecifiedRefreshOnlyIfNewer) {
- Boolean oldRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = newSpecifiedRefreshOnlyIfNewer;
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits == null) ? this.isDefaultDisableHits() : this.specifiedDisableHits.booleanValue();
- }
-
- public boolean isDefaultDisableHits() {
- return EclipseLinkCaching.DEFAULT_DISABLE_HITS;
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean newSpecifiedDisableHits) {
- Boolean oldDisableHits = this.specifiedDisableHits;
- this.specifiedDisableHits = newSpecifiedDisableHits;
- this.getCacheAnnotation().setDisableHits(newSpecifiedDisableHits);
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY, oldDisableHits, newSpecifiedDisableHits);
- }
-
- protected void setSpecifiedDisableHits_(Boolean newSpecifiedDisableHits) {
- Boolean oldDisableHits = this.specifiedDisableHits;
- this.specifiedDisableHits = newSpecifiedDisableHits;
- firePropertyChanged(EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY, oldDisableHits, newSpecifiedDisableHits);
- }
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.getSpecifiedCoordinationType() == null) ? this.getDefaultCoordinationType() : this.getSpecifiedCoordinationType();
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return DEFAULT_COORDINATION_TYPE;
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType newSpecifiedCoordinationType) {
- EclipseLinkCacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- this.getCacheAnnotation().setCoordinationType(EclipseLinkCacheCoordinationType.toJavaResourceModel(newSpecifiedCoordinationType));
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType newSpecifiedCoordinationType) {
- EclipseLinkCacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- public boolean hasExistenceChecking() {
- return this.existenceChecking;
- }
-
- public void setExistenceChecking(boolean newExistenceChecking) {
- boolean oldExistenceChecking = this.existenceChecking;
- this.existenceChecking = newExistenceChecking;
- if (newExistenceChecking) {
- this.resourcePersistentType.addAnnotation(getExistenceCheckingAnnotationName());
- }
- else {
- this.resourcePersistentType.removeAnnotation(getExistenceCheckingAnnotationName());
- }
- firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, oldExistenceChecking, newExistenceChecking);
- setDefaultExistenceType(caclulateDefaultExistenceType());
- }
-
- protected void setExistenceChecking_(boolean newExistenceChecking) {
- boolean oldExistenceChecking = this.existenceChecking;
- this.existenceChecking = newExistenceChecking;
- firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, oldExistenceChecking, newExistenceChecking);
- }
-
- protected EclipseLinkExistenceType caclulateDefaultExistenceType() {
- if (hasExistenceChecking()) {
- return EclipseLinkExistenceType.CHECK_CACHE;
- }
- return DEFAULT_EXISTENCE_TYPE;
- }
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.getSpecifiedExistenceType() == null) ? this.getDefaultExistenceType() : this.getSpecifiedExistenceType();
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType newDefaultExistenceType) {
- EclipseLinkExistenceType oldDefaultExistenceType = this.defaultExistenceType;
- this.defaultExistenceType = newDefaultExistenceType;
- firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, oldDefaultExistenceType, newDefaultExistenceType);
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType newSpecifiedExistenceType) {
- if (!hasExistenceChecking()) {
- if (newSpecifiedExistenceType != null) {
- setExistenceChecking(true);
- }
- else {
- return;
- }
- }
- EclipseLinkExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- this.getExistenceCheckingAnnotation().setValue(EclipseLinkExistenceType.toJavaResourceModel(newSpecifiedExistenceType));
- firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, oldSpecifiedExistenceType, newSpecifiedExistenceType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedExistenceType_(EclipseLinkExistenceType newSpecifiedExistenceType) {
- EclipseLinkExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, oldSpecifiedExistenceType, newSpecifiedExistenceType);
- }
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer newExpiry) {
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- getCacheAnnotation().setExpiry(newExpiry);
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- if (newExpiry != null && this.expiryTimeOfDay != null) {
- removeExpiryTimeOfDay();
- }
- }
-
- protected void setExpiry_(Integer newExpiry) {
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- }
-
- public EclipseLinkExpiryTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkExpiryTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiryTimeOfDay already exists, use getExpiryTimeOfDay()"); //$NON-NLS-1$
- }
- if (this.resourcePersistentType.getAnnotation(getCacheAnnotationName()) == null) {
- this.resourcePersistentType.addAnnotation(getCacheAnnotationName());
- }
- JavaEclipseLinkExpiryTimeOfDay newExpiryTimeOfDay = new JavaEclipseLinkExpiryTimeOfDay(this);
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation = getCacheAnnotation().addExpiryTimeOfDay();
- newExpiryTimeOfDay.initialize(timeOfDayAnnotation);
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, null, newExpiryTimeOfDay);
- setExpiry(null);
- return newExpiryTimeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("timeOfDayExpiry does not exist"); //$NON-NLS-1$
- }
- EclipseLinkExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- getCacheAnnotation().removeExpiryTimeOfDay();
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, null);
- }
-
- protected void setExpiryTimeOfDay(JavaEclipseLinkExpiryTimeOfDay newExpiryTimeOfDay) {
- JavaEclipseLinkExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- }
-
- protected JavaCacheable2_0 buildCacheable() {
- return this.isJpa2_0Compatible() ?
- ((JpaFactory2_0) this.getJpaFactory()).buildJavaCacheable(this) :
- new NullJavaCacheable2_0(this);
- }
-
- public JavaCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- CacheableHolder2_0 cacheableHolder = getCacheableSuperPersistentType(getParent().getPersistentType());
- if (cacheableHolder != null) {
- return cacheableHolder.getCacheable().isCacheable();
- }
- return ((PersistenceUnit2_0) getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType != null) {
- if (superPersistentType.getMapping() instanceof CacheableHolder2_0) {
- return (CacheableHolder2_0) superPersistentType.getMapping();
- }
- return getCacheableSuperPersistentType(superPersistentType);
- }
- return null;
- }
-
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- initialize(getCacheAnnotation());
- initialize(getExistenceCheckingAnnotation());
- this.cacheable.initialize(resourcePersistentType);
- }
-
- protected void initialize(EclipseLinkCacheAnnotation cache) {
- this.specifiedType = this.specifiedType(cache);
- this.specifiedSize = this.specifiedSize(cache);
- this.specifiedShared = this.specifiedShared(cache);
- this.specifiedAlwaysRefresh = this.specifiedAlwaysRefresh(cache);
- this.specifiedRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer(cache);
- this.specifiedDisableHits = this.specifiedDisableHits(cache);
- this.specifiedCoordinationType = this.specifiedCoordinationType(cache);
- this.initializeExpiry(cache);
- }
-
- protected void initialize(EclipseLinkExistenceCheckingAnnotation existenceChecking) {
- this.existenceChecking = existenceChecking != null;
- this.specifiedExistenceType = specifiedExistenceType(existenceChecking);
- this.defaultExistenceType = this.caclulateDefaultExistenceType();
- }
-
- protected void initializeExpiry(EclipseLinkCacheAnnotation cache) {
- if (cache.getExpiryTimeOfDay() == null) {
- this.expiry = cache.getExpiry();
- }
- else {
- if (cache.getExpiry() == null) { //handle with validation if both expiry and expiryTimeOfDay are set
- this.expiryTimeOfDay = new JavaEclipseLinkExpiryTimeOfDay(this);
- this.expiryTimeOfDay.initialize(cache.getExpiryTimeOfDay());
- }
- }
- }
-
- public void update(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- update(getCacheAnnotation());
- update(getExistenceCheckingAnnotation());
- updateExpiry(getCacheAnnotation());
- this.cacheable.update(resourcePersistentType);
- }
-
- protected void update(EclipseLinkCacheAnnotation cache) {
- setSpecifiedType_(this.specifiedType(cache));
- setSpecifiedSize_(this.specifiedSize(cache));
- setSpecifiedShared_(this.specifiedShared(cache));
- setSpecifiedAlwaysRefresh_(this.specifiedAlwaysRefresh(cache));
- setSpecifiedRefreshOnlyIfNewer_(this.specifiedRefreshOnlyIfNewer(cache));
- setSpecifiedDisableHits_(this.specifiedDisableHits(cache));
- setSpecifiedCoordinationType_(this.specifiedCoordinationType(cache));
- }
-
- protected void update(EclipseLinkExistenceCheckingAnnotation existenceChecking) {
- setExistenceChecking_(existenceChecking != null);
- setSpecifiedExistenceType_(specifiedExistenceType(existenceChecking));
- setDefaultExistenceType(caclulateDefaultExistenceType());
- }
-
- protected void updateExpiry(EclipseLinkCacheAnnotation cache) {
- if (cache.getExpiryTimeOfDay() == null) {
- setExpiryTimeOfDay(null);
- setExpiry_(cache.getExpiry());
- }
- else {
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update(cache.getExpiryTimeOfDay());
- }
- else if (cache.getExpiry() == null){
- setExpiryTimeOfDay(new JavaEclipseLinkExpiryTimeOfDay(this));
- this.expiryTimeOfDay.initialize(cache.getExpiryTimeOfDay());
- }
- else { //handle with validation if both expiry and expiryTimeOfDay are set
- setExpiryTimeOfDay(null);
- }
- }
- }
-
- protected EclipseLinkCacheType specifiedType(EclipseLinkCacheAnnotation cache) {
- return EclipseLinkCacheType.fromJavaResourceModel(cache.getType());
- }
-
- protected Integer specifiedSize(EclipseLinkCacheAnnotation cache) {
- return cache.getSize();
- }
-
- protected Boolean specifiedShared(EclipseLinkCacheAnnotation cache) {
- return cache.getShared();
- }
-
- protected Boolean specifiedAlwaysRefresh(EclipseLinkCacheAnnotation cache) {
- return cache.getAlwaysRefresh();
- }
-
- protected Boolean specifiedRefreshOnlyIfNewer(EclipseLinkCacheAnnotation cache) {
- return cache.getRefreshOnlyIfNewer();
- }
-
- protected Boolean specifiedDisableHits(EclipseLinkCacheAnnotation cache) {
- return cache.getDisableHits();
- }
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType(EclipseLinkCacheAnnotation cache) {
- return EclipseLinkCacheCoordinationType.fromJavaResourceModel(cache.getCoordinationType());
- }
-
- protected Integer expiry(EclipseLinkCacheAnnotation cache) {
- return cache.getExpiry();
- }
-
- protected EclipseLinkExistenceType specifiedExistenceType(EclipseLinkExistenceCheckingAnnotation existenceChecking) {
- if (existenceChecking == null) {
- return null;
- }
- return EclipseLinkExistenceType.fromJavaResourceModel(existenceChecking.getValue());
- }
-
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = getCacheAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- @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) {
- EclipseLinkCacheAnnotation cache = getCacheAnnotation();
- if (cache.getExpiry() != null && cache.getExpiryTimeOfDay() != null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED,
- new String[] {this.getParent().getPersistentType().getName()},
- this,
- getValidationTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
deleted file mode 100644
index 1a8428fa99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,134 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-public class JavaEclipseLinkChangeTracking extends AbstractJavaJpaContextNode implements EclipseLinkChangeTracking
-{
- protected JavaResourcePersistentType resourcePersistentType;
-
- protected EclipseLinkChangeTrackingType specifiedType;
-
-
- public JavaEclipseLinkChangeTracking(JavaTypeMapping parent) {
- super(parent);
- }
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
- @Override
- protected EclipseLinkJpaFactory getJpaFactory() {
- return (EclipseLinkJpaFactory) super.getJpaFactory();
- }
-
- protected String getChangeTrackingAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkChangeTrackingAnnotation getChangeTrackingAnnotation() {
- return (EclipseLinkChangeTrackingAnnotation) this.resourcePersistentType.getAnnotation(getChangeTrackingAnnotationName());
- }
-
- protected void addChangeTrackingAnnotation() {
- this.resourcePersistentType.addAnnotation(getChangeTrackingAnnotationName());
- }
-
- protected void removeChangeTrackingAnnotation() {
- this.resourcePersistentType.removeAnnotation(getChangeTrackingAnnotationName());
- }
-
- public EclipseLinkChangeTrackingType getType() {
- return (this.getSpecifiedType() != null) ? this.getSpecifiedType() : this.getDefaultType();
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType newSpecifiedType) {
- if (this.specifiedType == newSpecifiedType) {
- return;
- }
-
- EclipseLinkChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
-
- if (newSpecifiedType != null) {
- if (getChangeTrackingAnnotation() == null) {
- addChangeTrackingAnnotation();
- }
- getChangeTrackingAnnotation().setValue(EclipseLinkChangeTrackingType.toJavaResourceModel(newSpecifiedType));
- }
- else {
- if (getChangeTrackingAnnotation() != null) {
- removeChangeTrackingAnnotation();
- }
- }
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType newSpecifiedType) {
- EclipseLinkChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- public void initialize(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- EclipseLinkChangeTrackingAnnotation changeTrackingAnnotation = this.getChangeTrackingAnnotation();
- this.specifiedType = changeTrackingType(changeTrackingAnnotation);
- }
-
- public void update(JavaResourcePersistentType resourcePersistentType) {
- this.resourcePersistentType = resourcePersistentType;
- EclipseLinkChangeTrackingAnnotation changeTrackingAnnotation = this.getChangeTrackingAnnotation();
- this.setSpecifiedType_(changeTrackingType(changeTrackingAnnotation));
- }
-
- protected EclipseLinkChangeTrackingType changeTrackingType(EclipseLinkChangeTrackingAnnotation changeTracking) {
- if (changeTracking == null) {
- return null;
- }
- else if (changeTracking.getValue() == null) {
- return EclipseLinkChangeTracking.DEFAULT_TYPE;
- }
- else {
- return EclipseLinkChangeTrackingType.fromJavaResourceModel(changeTracking.getValue());
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- EclipseLinkChangeTrackingAnnotation changeTrackingAnnotation = getChangeTrackingAnnotation();
- TextRange textRange = changeTrackingAnnotation == null ? null : changeTrackingAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
deleted file mode 100644
index 2cc8b86a3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,132 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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 EclipseLinkConversionValueAnnotation resourceConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
- public JavaEclipseLinkConversionValue(JavaEclipseLinkObjectTypeConverter parent) {
- super(parent);
- }
-
- @Override
- public JavaEclipseLinkObjectTypeConverter getParent() {
- return (JavaEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- protected String getAnnotationName() {
- return EclipseLinkConversionValueAnnotation.ANNOTATION_NAME;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourceConversionValue.getTextRange(astRoot);
- }
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String newDataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = newDataValue;
- this.resourceConversionValue.setDataValue(newDataValue);
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, newDataValue);
- }
-
- protected void setDataValue_(String newDataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = newDataValue;
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, newDataValue);
- }
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String newObjectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = newObjectValue;
- this.resourceConversionValue.setObjectValue(newObjectValue);
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, newObjectValue);
- }
-
- protected void setObjectValue_(String newObjectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = newObjectValue;
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, newObjectValue);
- }
-
- public void initialize(EclipseLinkConversionValueAnnotation resourceConversionValue) {
- this.resourceConversionValue = resourceConversionValue;
- this.dataValue = this.dataValue();
- this.objectValue = this.objectValue();
- }
-
- public void update(EclipseLinkConversionValueAnnotation resourceConversionValue) {
- this.resourceConversionValue = resourceConversionValue;
- this.setDataValue_(this.dataValue());
- this.setObjectValue_(this.objectValue());
- }
-
- protected String dataValue() {
- return this.resourceConversionValue.getDataValue();
- }
-
- protected String objectValue() {
- return this.resourceConversionValue.getObjectValue();
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- return this.resourceConversionValue.getDataValueTextRange(astRoot);
- }
-
- public TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- return this.resourceConversionValue.getObjectValueTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateDataValuesUnique(messages, astRoot);
- }
-
- protected void validateDataValuesUnique(List<IMessage> messages, CompilationUnit astRoot) {
- List<String> dataValues = CollectionTools.list(getParent().dataValues());
- dataValues.remove(this.dataValue);
- if (dataValues.contains(this.dataValue)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {this.dataValue},
- this,
- this.getDataValueTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
deleted file mode 100644
index 562960da30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
+++ /dev/null
@@ -1,276 +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.eclipselink.core.internal.context.java;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConvert extends AbstractJavaJpaContextNode implements EclipseLinkConvert, JavaConverter
-{
- private String specifiedConverterName;
-
- private JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- private JavaEclipseLinkConverter converter;
-
- public JavaEclipseLinkConvert(JavaAttributeMapping parent, JavaResourcePersistentAttribute jrpa) {
- super(parent);
- this.initialize(jrpa);
- }
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
-
- protected String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-
- public void addToResourceModel() {
- this.resourcePersistentAttribute.addAnnotation(getAnnotationName());
- }
-
- public void removeFromResourceModel() {
- this.resourcePersistentAttribute.removeAnnotation(getAnnotationName());
- if (getConverter() != null) {
- this.resourcePersistentAttribute.removeAnnotation(getConverter().getAnnotationName());
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceConvert().getTextRange(astRoot);
- }
-
- protected EclipseLinkConvertAnnotation getResourceConvert() {
- return (EclipseLinkConvertAnnotation) this.resourcePersistentAttribute.getAnnotation(getAnnotationName());
- }
-
- public String getConverterName() {
- return getSpecifiedConverterName() == null ? getDefaultConverterName() : getSpecifiedConverterName();
- }
-
- public String getDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String newSpecifiedConverterName) {
- String oldSpecifiedConverterName = this.specifiedConverterName;
- this.specifiedConverterName = newSpecifiedConverterName;
- getResourceConvert().setValue(newSpecifiedConverterName);
- firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, oldSpecifiedConverterName, newSpecifiedConverterName);
- }
-
- protected void setSpecifiedConverterName_(String newSpecifiedConverterName) {
- String oldSpecifiedConverterName = this.specifiedConverterName;
- this.specifiedConverterName = newSpecifiedConverterName;
- firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, oldSpecifiedConverterName, newSpecifiedConverterName);
- }
-
- public JavaEclipseLinkConverter getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- if (this.converter == null) {
- return EclipseLinkConverter.NO_CONVERTER;
- }
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (getConverterType() == converterType) {
- return;
- }
- JavaEclipseLinkConverter oldConverter = this.converter;
- JavaEclipseLinkConverter newConverter = buildConverter(converterType);
- this.converter = null;
- if (oldConverter != null) {
- this.resourcePersistentAttribute.removeAnnotation(oldConverter.getAnnotationName());
- }
- this.converter = newConverter;
- if (newConverter != null) {
- this.resourcePersistentAttribute.addAnnotation(newConverter.getAnnotationName());
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void setConverter(JavaEclipseLinkConverter newConverter) {
- JavaEclipseLinkConverter oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.specifiedConverterName = this.getResourceConverterName();
- this.converter = this.buildConverter(this.getResourceConverterType());
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.setSpecifiedConverterName_(this.getResourceConverterName());
- if (getResourceConverterType() == getConverterType()) {
- getConverter().update(this.resourcePersistentAttribute);
- }
- else {
- JavaEclipseLinkConverter javaConverter = buildConverter(getResourceConverterType());
- setConverter(javaConverter);
- }
- }
-
- protected String getResourceConverterName() {
- EclipseLinkConvertAnnotation resourceConvert = getResourceConvert();
- return resourceConvert == null ? null : resourceConvert.getValue();
- }
-
-
- protected JavaEclipseLinkConverter buildConverter(String converterType) {
- if (converterType == EclipseLinkConverter.NO_CONVERTER) {
- return null;
- }
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return buildCustomConverter();
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return buildTypeConverter();
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return buildObjectTypeConverter();
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return buildStructConverter();
- }
- return null;
- }
-
- protected JavaEclipseLinkCustomConverter buildCustomConverter() {
- JavaEclipseLinkCustomConverter contextConverter = new JavaEclipseLinkCustomConverter(this);
- contextConverter.initialize(this.resourcePersistentAttribute);
- return contextConverter;
- }
-
- protected JavaEclipseLinkTypeConverter buildTypeConverter() {
- JavaEclipseLinkTypeConverter contextConverter = new JavaEclipseLinkTypeConverter(this);
- contextConverter.initialize(this.resourcePersistentAttribute);
- return contextConverter;
- }
-
- protected JavaEclipseLinkObjectTypeConverter buildObjectTypeConverter() {
- JavaEclipseLinkObjectTypeConverter contextConverter = new JavaEclipseLinkObjectTypeConverter(this);
- contextConverter.initialize(this.resourcePersistentAttribute);
- return contextConverter;
- }
-
- protected JavaEclipseLinkStructConverter buildStructConverter() {
- JavaEclipseLinkStructConverter contextConverter = new JavaEclipseLinkStructConverter(this);
- contextConverter.initialize(this.resourcePersistentAttribute);
- return contextConverter;
- }
-
- protected String getResourceConverterType() {
- if (this.resourcePersistentAttribute.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
- else if (this.resourcePersistentAttribute.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
- else if (this.resourcePersistentAttribute.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
- else if (this.resourcePersistentAttribute.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- return null;
- }
-
- //*************** code assist ******************
-
- @Override
- public Iterator<String> javaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterator<String> result = super.javaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.convertValueTouches(pos, astRoot)) {
- result = this.persistenceConvertersNames(filter);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- protected boolean convertValueTouches(int pos, CompilationUnit astRoot) {
- if (getResourceConvert() != null) {
- return this.getResourceConvert().valueTouches(pos, astRoot);
- }
- return false;
- }
-
- protected Iterator<String> persistenceConvertersNames() {
- if(this.getEclipseLinkPersistenceUnit().convertersSize() == 0) {
- return EmptyIterator.<String> instance();
- }
- return CollectionTools.iterator(this.getEclipseLinkPersistenceUnit().uniqueConverterNames());
- }
-
- private Iterator<String> convertersNames(Filter<String> filter) {
- return new FilteringIterator<String>(this.persistenceConvertersNames(), filter);
- }
-
- protected Iterator<String> persistenceConvertersNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.convertersNames(filter));
- }
-
- protected EclipseLinkPersistenceUnit getEclipseLinkPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) this.getPersistenceUnit();
- }
-
- //****************** validation ********************
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getConverter() != null) {
- getConverter().validate(messages, reporter, astRoot);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java
deleted file mode 100644
index 85da0c2a56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public abstract class JavaEclipseLinkConverter extends AbstractJavaJpaContextNode
- implements EclipseLinkConverter
-{
- private JavaResourcePersistentMember resourcePersistentMember;
-
- private String name;
-
-
- protected JavaEclipseLinkConverter(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
- protected EclipseLinkNamedConverterAnnotation getAnnotation() {
- return (EclipseLinkNamedConverterAnnotation) this.resourcePersistentMember.getAnnotation(getAnnotationName());
- }
-
- protected abstract String getAnnotationName();
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- public char getEnclosingTypeSeparator() {
- return '.';
- }
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- getAnnotation().setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** resource interaction ***********************************
-
- protected void initialize(JavaResourcePersistentMember jrpm) {
- this.resourcePersistentMember = jrpm;
- this.name = this.name(getAnnotation());
- }
-
- protected void update(JavaResourcePersistentMember jrpm) {
- this.resourcePersistentMember = jrpm;
- this.setName_(this.name(getAnnotation()));
- getPersistenceUnit().addConverter(this);
- }
-
- protected String name(EclipseLinkNamedConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getName();
- }
-
-
- // **************** validation *********************************************
-
- public boolean overrides(EclipseLinkConverter converter) {
- // java is at the base of the tree
- return false;
- }
-
- public boolean duplicates(EclipseLinkConverter converter) {
- return (this != converter)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(converter.getName())
- && ! this.overrides(converter)
- && ! converter.overrides(this);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getAnnotation().getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverterHolderImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverterHolderImpl.java
deleted file mode 100644
index e26c0d7f6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkConverterHolderImpl.java
+++ /dev/null
@@ -1,369 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConverterHolderImpl extends AbstractJavaJpaContextNode implements JavaEclipseLinkConverterHolder
-{
- protected JavaResourcePersistentType resourcePersistentType;
-
- protected JavaEclipseLinkCustomConverter customConverter;
- protected JavaEclipseLinkObjectTypeConverter objectTypeConverter;
- protected JavaEclipseLinkStructConverter structConverter;
- protected JavaEclipseLinkTypeConverter typeConverter;
-
- public JavaEclipseLinkConverterHolderImpl(JavaTypeMapping parent) {
- super(parent);
- }
-
- //************** converter *************
- public EclipseLinkCustomConverter getCustomConverter() {
- return this.customConverter;
- }
-
- public EclipseLinkCustomConverter addCustomConverter() {
- if (this.customConverter != null) {
- throw new IllegalStateException("custom converter already exists"); //$NON-NLS-1$
- }
- this.customConverter = buildCustomConverter();
- this.resourcePersistentType.addAnnotation(this.customConverter.getAnnotationName());
- firePropertyChanged(CUSTOM_CONVERTER_PROPERTY, null, this.customConverter);
- return this.customConverter;
- }
-
- protected void addCustomConverter_() {
- this.customConverter = buildCustomConverter();
- firePropertyChanged(CUSTOM_CONVERTER_PROPERTY, null, this.customConverter);
- }
-
- public void removeCustomConverter() {
- if (this.customConverter == null) {
- throw new IllegalStateException("converter is null"); //$NON-NLS-1$
- }
- JavaEclipseLinkCustomConverter oldConverter = this.customConverter;
- this.customConverter = null;
- this.resourcePersistentType.removeAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(CUSTOM_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeCustomConverter_() {
- this.customConverter = null;
- firePropertyChanged(CUSTOM_CONVERTER_PROPERTY, this.customConverter, null);
- }
-
- protected String getConverterAnnotationName() {
- return EclipseLinkConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkConverterAnnotation getResourceConverter() {
- return (EclipseLinkConverterAnnotation) this.resourcePersistentType.getAnnotation(getConverterAnnotationName());
- }
-
-
- //************** object type converter *************
- public EclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.objectTypeConverter;
- }
-
- public EclipseLinkObjectTypeConverter addObjectTypeConverter() {
- if (this.objectTypeConverter != null) {
- throw new IllegalStateException("object type converter already exists"); //$NON-NLS-1$
- }
- this.objectTypeConverter = buildObjectTypeConverter();
- this.resourcePersistentType.addAnnotation(this.objectTypeConverter.getAnnotationName());
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, null, this.objectTypeConverter);
- return this.objectTypeConverter;
- }
-
- protected void addObjectTypeConverter_() {
- this.objectTypeConverter = buildObjectTypeConverter();
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, null, this.objectTypeConverter);
- }
-
- public void removeObjectTypeConverter() {
- if (this.objectTypeConverter == null) {
- throw new IllegalStateException("object type converter is null"); //$NON-NLS-1$
- }
- JavaEclipseLinkObjectTypeConverter oldConverter = this.objectTypeConverter;
- this.objectTypeConverter = null;
- this.resourcePersistentType.removeAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeObjectTypeConverter_() {
- EclipseLinkObjectTypeConverter oldConverter = this.objectTypeConverter;
- this.objectTypeConverter = null;
- firePropertyChanged(OBJECT_TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getObjectTypeConverterAnnotationName() {
- return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkObjectTypeConverterAnnotation getResourceObjectTypeConverter() {
- return (EclipseLinkObjectTypeConverterAnnotation) this.resourcePersistentType.getAnnotation(getObjectTypeConverterAnnotationName());
- }
-
-
- //************** type converter *************
- public EclipseLinkTypeConverter getTypeConverter() {
- return this.typeConverter;
- }
-
- public EclipseLinkTypeConverter addTypeConverter() {
- if (this.typeConverter != null) {
- throw new IllegalStateException("type converter already exists"); //$NON-NLS-1$
- }
- this.typeConverter = buildTypeConverter();
- this.resourcePersistentType.addAnnotation(this.typeConverter.getAnnotationName());
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, null, this.typeConverter);
- return this.typeConverter;
- }
-
- protected void addTypeConverter_() {
- this.typeConverter = buildTypeConverter();
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, null, this.typeConverter);
- }
-
- public void removeTypeConverter() {
- if (this.typeConverter == null) {
- throw new IllegalStateException("type converter is null"); //$NON-NLS-1$
- }
- JavaEclipseLinkTypeConverter oldConverter = this.typeConverter;
- this.typeConverter = null;
- this.resourcePersistentType.removeAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeTypeConverter_() {
- EclipseLinkTypeConverter oldConverter = this.typeConverter;
- this.typeConverter = null;
- firePropertyChanged(TYPE_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getTypeConverterAnnotationName() {
- return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkTypeConverterAnnotation getResourceTypeConverter() {
- return (EclipseLinkTypeConverterAnnotation) this.resourcePersistentType.getAnnotation(getTypeConverterAnnotationName());
- }
-
-
- //************** struct converter *************
- public EclipseLinkStructConverter getStructConverter() {
- return this.structConverter;
- }
-
- public EclipseLinkStructConverter addStructConverter() {
- if (this.structConverter != null) {
- throw new IllegalStateException("struct converter already exists"); //$NON-NLS-1$
- }
- this.structConverter = buildStructConverter();
- this.resourcePersistentType.addAnnotation(this.structConverter.getAnnotationName());
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, null, this.structConverter);
- return this.structConverter;
- }
-
- protected void addStructConverter_() {
- this.structConverter = buildStructConverter();
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, null, this.structConverter);
- }
-
- public void removeStructConverter() {
- if (this.structConverter == null) {
- throw new IllegalStateException("struct converter is null"); //$NON-NLS-1$
- }
- JavaEclipseLinkStructConverter oldConverter = this.structConverter;
- this.structConverter = null;
- this.resourcePersistentType.removeAnnotation(oldConverter.getAnnotationName());
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected void removeStructConverter_() {
- EclipseLinkStructConverter oldConverter = this.structConverter;
- this.structConverter = null;
- firePropertyChanged(STRUCT_CONVERTER_PROPERTY, oldConverter, null);
- }
-
- protected String getStructConverterAnnotationName() {
- return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkStructConverterAnnotation getResourceStructConverter() {
- return (EclipseLinkStructConverterAnnotation) this.resourcePersistentType.getAnnotation(getStructConverterAnnotationName());
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.updateCustomConverter();
- this.updateObjectTypeConverter();
- this.updateTypeConverter();
- this.updateStructConverter();
- }
-
- protected void updateCustomConverter() {
- if (getResourceConverter() != null) {
- if (this.customConverter != null) {
- this.customConverter.update(this.resourcePersistentType);
- }
- else {
- addCustomConverter_();
- }
- }
- else {
- if (this.customConverter != null) {
- removeCustomConverter_();
- }
- }
- }
-
- protected void updateObjectTypeConverter() {
- if (getResourceObjectTypeConverter() != null) {
- if (this.objectTypeConverter != null) {
- this.objectTypeConverter.update(this.resourcePersistentType);
- }
- else {
- addObjectTypeConverter_();
- }
- }
- else {
- if (this.objectTypeConverter != null) {
- removeObjectTypeConverter_();
- }
- }
- }
-
- protected void updateTypeConverter() {
- if (getResourceTypeConverter() != null) {
- if (this.typeConverter != null) {
- this.typeConverter.update(this.resourcePersistentType);
- }
- else {
- addTypeConverter_();
- }
- }
- else {
- if (this.typeConverter != null) {
- removeTypeConverter();
- }
- }
- }
-
- protected void updateStructConverter() {
- if (getResourceStructConverter() != null) {
- if (this.structConverter != null) {
- this.structConverter.update(this.resourcePersistentType);
- }
- else {
- addStructConverter_();
- }
- }
- else {
- if (this.structConverter != null) {
- removeStructConverter_();
- }
- }
- }
-
- public void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.initializeCustomConverter();
- this.initializeObjectTypeConverter();
- this.initializeTypeConverter();
- this.initializeStructConverter();
- }
-
- protected void initializeCustomConverter() {
- if (getResourceConverter() != null) {
- this.customConverter = buildCustomConverter();
- }
- }
-
- protected void initializeObjectTypeConverter() {
- if (getResourceObjectTypeConverter() != null) {
- this.objectTypeConverter = buildObjectTypeConverter();
- }
- }
-
- protected void initializeTypeConverter() {
- if (getResourceTypeConverter() != null) {
- this.typeConverter = buildTypeConverter();
- }
- }
-
- protected void initializeStructConverter() {
- if (getResourceStructConverter() != null) {
- this.structConverter = buildStructConverter();
- }
- }
- protected JavaEclipseLinkCustomConverter buildCustomConverter() {
- JavaEclipseLinkCustomConverter contextConverter = new JavaEclipseLinkCustomConverter(this);
- contextConverter.initialize(this.resourcePersistentType);
- return contextConverter;
- }
-
- protected JavaEclipseLinkTypeConverter buildTypeConverter() {
- JavaEclipseLinkTypeConverter contextConverter = new JavaEclipseLinkTypeConverter(this);
- contextConverter.initialize(this.resourcePersistentType);
- return contextConverter;
- }
-
- protected JavaEclipseLinkObjectTypeConverter buildObjectTypeConverter() {
- JavaEclipseLinkObjectTypeConverter contextConverter = new JavaEclipseLinkObjectTypeConverter(this);
- contextConverter.initialize(this.resourcePersistentType);
- return contextConverter;
- }
-
- protected JavaEclipseLinkStructConverter buildStructConverter() {
- JavaEclipseLinkStructConverter contextConverter = new JavaEclipseLinkStructConverter(this);
- contextConverter.initialize(this.resourcePersistentType);
- return contextConverter;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.resourcePersistentType.getTextRange(astRoot);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (this.customConverter != null) {
- this.customConverter.validate(messages, reporter, astRoot);
- }
- if (this.objectTypeConverter != null) {
- this.objectTypeConverter.validate(messages, reporter, astRoot);
- }
- if (this.typeConverter != null) {
- this.typeConverter.validate(messages, reporter, astRoot);
- }
- if (this.structConverter != null) {
- this.structConverter.validate(messages, reporter, astRoot);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
deleted file mode 100644
index a718ae3e47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,141 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkCustomConverter extends JavaEclipseLinkConverter
- implements EclipseLinkCustomConverter
-{
- private String converterClass;
-
- private String fullyQualifiedConverterClass;
- public static final String FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY = "fullyQualifiedConverterClass"; //$NON-NLS-1$
-
- public JavaEclipseLinkCustomConverter(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
-
- @Override
- public String getAnnotationName() {
- return EclipseLinkConverterAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkConverterAnnotation getAnnotation() {
- return (EclipseLinkConverterAnnotation) super.getAnnotation();
- }
-
-
- // **************** converter class ****************************************
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- getAnnotation().setConverterClass(newConverterClass);
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- 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);
- }
-
- protected String buildFullyQualifiedConverterClass(EclipseLinkConverterAnnotation resourceConverter) {
- return resourceConverter == null ?
- null :
- resourceConverter.getFullyQualifiedConverterClassName();
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- EclipseLinkConverterAnnotation resourceConverter = getAnnotation();
- this.converterClass = this.converterClass(resourceConverter);
- this.fullyQualifiedConverterClass = this.buildFullyQualifiedConverterClass(resourceConverter);
- }
-
- @Override
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- EclipseLinkConverterAnnotation resourceConverter = getAnnotation();
- this.setConverterClass_(this.converterClass(resourceConverter));
- this.setFullyQualifiedConverterClass(this.buildFullyQualifiedConverterClass(resourceConverter));
- }
-
- protected String converterClass(EclipseLinkConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getConverterClass();
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return getAnnotation().getConverterClassTextRange(astRoot);
- }
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.converterClass == null) {
- //Annotation itself will have compile error if converter class not defined
- return;
- }
- if (! getAnnotation().converterClassImplementsInterface(ECLIPSELINK_CONVERTER_CLASS_NAME, astRoot)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER,
- new String[] {this.converterClass},
- this,
- getConverterClassTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
deleted file mode 100644
index 7d657381b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,164 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.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 JavaResourcePersistentType resourcePersistentType;
-
- private String customizerClass;
-
- private String fullyQualifiedCustomizerClass;
- public static final String FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY = "fullyQualifiedCustomizerClass"; //$NON-NLS-1$
-
- public JavaEclipseLinkCustomizer(JavaJpaContextNode parent) {
- super(parent);
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '.';
- }
-
- @Override
- protected EclipseLinkJpaFactory getJpaFactory() {
- return (EclipseLinkJpaFactory) super.getJpaFactory();
- }
-
- protected String getAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-
- protected void addResourceCustomizer() {
- this.resourcePersistentType.addAnnotation(getAnnotationName());
- }
-
- protected void removeResourceCustomizer() {
- this.resourcePersistentType.removeAnnotation(getAnnotationName());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return getResourceCustomizer().getTextRange(astRoot);
- }
-
- protected EclipseLinkCustomizerAnnotation getResourceCustomizer() {
- return (EclipseLinkCustomizerAnnotation) this.resourcePersistentType.getAnnotation(getAnnotationName());
- }
-
- public String getCustomizerClass() {
- return getSpecifiedCustomizerClass();
- }
-
- public String getDefaultCustomizerClass() {
- return null;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.customizerClass;
- }
-
- 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 resourceCustomizer) {
- return resourceCustomizer == null ?
- null :
- resourceCustomizer.getFullyQualifiedCustomizerClassName();
- }
-
- public void setSpecifiedCustomizerClass(String newCustomizerClass) {
- if (attributeValueHasNotChanged(this.customizerClass, newCustomizerClass)) {
- return;
- }
- String oldCustomizerClass = this.customizerClass;
- this.customizerClass = newCustomizerClass;
- if (this.customizerClass != null) {
- addResourceCustomizer();
- }
- else {
- removeResourceCustomizer();
- }
- if (newCustomizerClass != null) {
- getResourceCustomizer().setValue(newCustomizerClass);
- }
- firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, oldCustomizerClass, newCustomizerClass);
- }
-
- protected void setCustomizerClass_(String newCustomizerClass) {
- String oldCustomizerClass = this.customizerClass;
- this.customizerClass = newCustomizerClass;
- firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, oldCustomizerClass, newCustomizerClass);
- }
-
- public void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- EclipseLinkCustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- this.customizerClass = this.customizerClass(resourceCustomizer);
- this.fullyQualifiedCustomizerClass = this.buildFullyQualifiedCustomizerClass(resourceCustomizer);
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- EclipseLinkCustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- this.setCustomizerClass_(this.customizerClass(resourceCustomizer));
- this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass(resourceCustomizer));
- }
-
- protected String customizerClass(EclipseLinkCustomizerAnnotation resourceCustomizer) {
- return resourceCustomizer == null ? null : resourceCustomizer.getValue();
- }
-
- public TextRange getCustomizerClassTextRange(CompilationUnit astRoot) {
- return getResourceCustomizer().getValueTextRange(astRoot);
- }
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- EclipseLinkCustomizerAnnotation resourceCustomizer = getResourceCustomizer();
- if (resourceCustomizer != null && !resourceCustomizer.customizerClassImplementsInterface(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME, astRoot)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER,
- new String[] {this.customizerClass},
- this,
- getCustomizerClassTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index fd5a3844e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEmbeddable;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkEmbeddableImpl
- extends AbstractJavaEmbeddable
- implements JavaEclipseLinkEmbeddable
-{
- protected final JavaEclipseLinkConverterHolder converterHolder;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
-
- public JavaEclipseLinkEmbeddableImpl(JavaPersistentType parent) {
- super(parent);
- this.converterHolder = new JavaEclipseLinkConverterHolderImpl(this);
- this.customizer = new JavaEclipseLinkCustomizer(this);
- this.changeTracking = new JavaEclipseLinkChangeTracking(this);
- }
-
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
- public JavaEclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- @Override
- public void initialize(JavaResourcePersistentType jrpt) {
- super.initialize(jrpt);
- this.converterHolder.initialize(jrpt);
- this.customizer.initialize(jrpt);
- this.changeTracking.initialize(jrpt);
- }
-
- @Override
- public void update(JavaResourcePersistentType jrpt) {
- super.update(jrpt);
- this.converterHolder.update(jrpt);
- this.customizer.update(jrpt);
- this.changeTracking.update(jrpt);
- }
-
-
- //********** Validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.converterHolder.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
deleted file mode 100644
index 9300e417f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,139 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.v2_0.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkEntityImpl
- extends AbstractJavaEntity
- implements JavaEclipseLinkEntity
-{
- protected final JavaEclipseLinkCaching eclipseLinkCaching;
-
- protected final JavaEclipseLinkConverterHolder converterHolder;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
-
- public JavaEclipseLinkEntityImpl(JavaPersistentType parent) {
- super(parent);
- this.eclipseLinkCaching = new JavaEclipseLinkCachingImpl(this);
- this.converterHolder = new JavaEclipseLinkConverterHolderImpl(this);
- this.readOnly = new JavaEclipseLinkReadOnly(this);
- this.changeTracking = new JavaEclipseLinkChangeTracking(this);
- this.customizer = new JavaEclipseLinkCustomizer(this);
- }
-
-
- public boolean usesPrimaryKeyColumns() {
- return getResourcePersistentType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public JavaEclipseLinkCaching getCaching() {
- return this.eclipseLinkCaching;
- }
-
- public JavaEclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public JavaCacheable2_0 getCacheable() {
- return ((JavaCacheableHolder2_0) getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((JavaCacheableHolder2_0) getCaching()).calculateDefaultCacheable();
- }
-
- @Override
- public void initialize(JavaResourcePersistentType jrpt) {
- super.initialize(jrpt);
- this.eclipseLinkCaching.initialize(jrpt);
- this.converterHolder.initialize(jrpt);
- this.readOnly.initialize(jrpt);
- this.customizer.initialize(jrpt);
- this.changeTracking.initialize(jrpt);
- }
-
- @Override
- public void update(JavaResourcePersistentType jrpt) {
- super.update(jrpt);
- this.eclipseLinkCaching.update(jrpt);
- this.converterHolder.update(jrpt);
- this.readOnly.update(jrpt);
- this.customizer.update(jrpt);
- this.changeTracking.update(jrpt);
- }
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && !classExtractorIsUsed();
- }
-
- protected boolean classExtractorIsUsed() {
- return getClassExtractorAnnotation() != null;
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- return (EclipseLinkClassExtractorAnnotation2_1)
- getResourcePersistentType().getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
-
- //********** Validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.eclipseLinkCaching.validate(messages, reporter, astRoot);
- this.converterHolder.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected PrimaryKeyValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkEntityPrimaryKeyValidator(this, buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkExpiryTimeOfDay.java
deleted file mode 100644
index dc80e07078..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkExpiryTimeOfDay.java
+++ /dev/null
@@ -1,137 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-public class JavaEclipseLinkExpiryTimeOfDay extends AbstractJavaJpaContextNode
- implements EclipseLinkExpiryTimeOfDay
-{
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
- protected EclipseLinkTimeOfDayAnnotation timeOfDay;
-
- public JavaEclipseLinkExpiryTimeOfDay(EclipseLinkCaching parent) {
- super(parent);
- }
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer newHour) {
- Integer oldHour = this.hour;
- this.hour = newHour;
- this.timeOfDay.setHour(newHour);
- firePropertyChanged(HOUR_PROPERTY, oldHour, newHour);
- }
-
- protected void setHour_(Integer newHour) {
- Integer oldHour = this.hour;
- this.hour = newHour;
- firePropertyChanged(HOUR_PROPERTY, oldHour, newHour);
- }
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- this.timeOfDay.setMinute(newMinute);
- firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- protected void setMinute_(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- this.timeOfDay.setSecond(newSecond);
- firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- protected void setSecond_(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- this.timeOfDay.setMillisecond(newMillisecond);
- firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- protected void setMillisecond_(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return this.timeOfDay.getTextRange(astRoot);
- }
-
- public void initialize(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- this.timeOfDay = timeOfDay;
- this.hour = getHour(timeOfDay);
- this.minute = getMinute(timeOfDay);
- this.second = getSecond(timeOfDay);
- this.millisecond = getMillisecond(timeOfDay);
- }
-
- public void update(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- this.timeOfDay = timeOfDay;
- this.setHour_(getHour(timeOfDay));
- this.setMinute_(getMinute(timeOfDay));
- this.setSecond_(getSecond(timeOfDay));
- this.setMillisecond_(getMillisecond(timeOfDay));
- }
-
- protected Integer getHour(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getHour();
- }
-
- protected Integer getMinute(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getMinute();
- }
-
- protected Integer getSecond(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getSecond();
- }
-
- protected Integer getMillisecond(EclipseLinkTimeOfDayAnnotation timeOfDay) {
- return timeOfDay.getMillisecond();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
deleted file mode 100644
index 613b05d9cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
+++ /dev/null
@@ -1,101 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-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);
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.MUTABLE);
- names.add(EclipseLink.CONVERT);
- }
-
-
- //************** AbstractJavaIdMapping overrides ***************
-
- @Override
- protected JavaConverter buildConverter(String converterType) {
- JavaConverter javaConverter = super.buildConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new JavaEclipseLinkConvert(this, this.getResourcePersistentAttribute());
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.getResourcePersistentAttribute().getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
-
- //************ EclipselinkIdMapping implementation ****************
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mutable.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.mutable.update(this.getResourcePersistentAttribute());
- }
-
-
- //************ 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
deleted file mode 100644
index 45aac07dae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,120 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-public class JavaEclipseLinkJoinFetch
- extends AbstractJavaJpaContextNode
- implements EclipseLinkJoinFetch
-{
- protected EclipseLinkJoinFetchType joinFetchValue;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
-
- public JavaEclipseLinkJoinFetch(JavaAttributeMapping parent) {
- super(parent);
- }
-
-
- protected String getJoinFetchAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkJoinFetchAnnotation getResourceJoinFetch() {
- return (EclipseLinkJoinFetchAnnotation) this.resourcePersistentAttribute.getAnnotation(getJoinFetchAnnotationName());
- }
-
- protected void addResourceJoinFetch() {
- this.resourcePersistentAttribute.addAnnotation(getJoinFetchAnnotationName());
- }
-
- protected void removeResourceJoinFetch() {
- this.resourcePersistentAttribute.removeAnnotation(getJoinFetchAnnotationName());
- }
-
- public EclipseLinkJoinFetchType getValue() {
- return this.joinFetchValue;
- }
-
- protected EclipseLinkJoinFetchType getDefaultValue() {
- return EclipseLinkJoinFetch.DEFAULT_VALUE;
- }
-
- public void setValue(EclipseLinkJoinFetchType newJoinFetchValue) {
- if (this.joinFetchValue == newJoinFetchValue) {
- return;
- }
-
- EclipseLinkJoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
-
- if (newJoinFetchValue != null) {
- if (getResourceJoinFetch() == null) {
- addResourceJoinFetch();
- }
- getResourceJoinFetch().setValue(EclipseLinkJoinFetchType.toJavaResourceModel(newJoinFetchValue));
- }
- else {
- if (getResourceJoinFetch() != null) {
- removeResourceJoinFetch();
- }
- }
- firePropertyChanged(EclipseLinkJoinFetch.VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
- /**
- * internal setter used only for updating from the resource model.
- * There were problems with InvalidThreadAccess exceptions in the UI
- * when you set a value from the UI and the annotation doesn't exist yet.
- * Adding the annotation causes an update to occur and then the exception.
- */
- protected void setValue_(EclipseLinkJoinFetchType newJoinFetchValue) {
- EclipseLinkJoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- firePropertyChanged(EclipseLinkJoinFetch.VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- EclipseLinkJoinFetchAnnotation resourceJoinFetch = this.getResourceJoinFetch();
- this.joinFetchValue = this.joinFetch(resourceJoinFetch);
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- EclipseLinkJoinFetchAnnotation resourceJoinFetch = this.getResourceJoinFetch();
- setValue_(joinFetch(resourceJoinFetch));
- }
-
- private EclipseLinkJoinFetchType joinFetch(EclipseLinkJoinFetchAnnotation resourceJoinFetch) {
- if (resourceJoinFetch == null) {
- return null;
- }
- if (resourceJoinFetch.getValue() == null) {
- // @JoinFetch is equivalent to @JoinFetch(JoinFetch.INNER)
- return getDefaultValue();
- }
- return EclipseLinkJoinFetchType.fromJavaResourceModel(resourceJoinFetch.getValue());
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- EclipseLinkJoinFetchAnnotation resourceJoinFetch = this.getResourceJoinFetch();
- return resourceJoinFetch == null ? null : resourceJoinFetch.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java
deleted file mode 100644
index 7c01655ec7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-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);
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.JOIN_FETCH);
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.joinFetch.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.joinFetch.update(this.getResourcePersistentAttribute());
- }
-
- @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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 34e21ffb58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-
-public class JavaEclipseLinkManyToOneMapping
- extends AbstractJavaEclipseLinkManyToOneMapping
-{
- public JavaEclipseLinkManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaManyToOneRelationshipReference(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index 618ffadc75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,125 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaMappedSuperclass;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkMappedSuperclassImpl
- extends AbstractJavaMappedSuperclass
- implements JavaEclipseLinkMappedSuperclass, CacheableHolder2_0
-{
- protected JavaEclipseLinkCaching eclipseLinkCaching;
-
- protected final JavaEclipseLinkConverterHolder converterHolder;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
-
- public JavaEclipseLinkMappedSuperclassImpl(JavaPersistentType parent) {
- super(parent);
- this.eclipseLinkCaching = new JavaEclipseLinkCachingImpl(this);
- this.converterHolder = new JavaEclipseLinkConverterHolderImpl(this);
- this.readOnly = new JavaEclipseLinkReadOnly(this);
- this.customizer = new JavaEclipseLinkCustomizer(this);
- this.changeTracking = new JavaEclipseLinkChangeTracking(this);
- }
-
-
- public boolean usesPrimaryKeyColumns() {
- return getResourcePersistentType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public JavaEclipseLinkCaching getCaching() {
- return this.eclipseLinkCaching;
- }
-
- public JavaEclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public Cacheable2_0 getCacheable() {
- return ((CacheableHolder2_0) getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((CacheableHolder2_0) getCaching()).calculateDefaultCacheable();
- }
-
- @Override
- public void initialize(JavaResourcePersistentType jrpt) {
- super.initialize(jrpt);
- this.eclipseLinkCaching.initialize(jrpt);
- this.converterHolder.initialize(jrpt);
- this.readOnly.initialize(jrpt);
- this.customizer.initialize(jrpt);
- this.changeTracking.initialize(jrpt);
- }
-
- @Override
- public void update(JavaResourcePersistentType jrpt) {
- super.update(jrpt);
- this.eclipseLinkCaching.update(jrpt);
- this.converterHolder.update(jrpt);
- this.readOnly.update(jrpt);
- this.customizer.update(jrpt);
- this.changeTracking.update(jrpt);
- }
-
-
- //********** Validation ********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.eclipseLinkCaching.validate(messages, reporter, astRoot);
- this.converterHolder.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected PrimaryKeyValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
deleted file mode 100644
index 07983c6654..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
+++ /dev/null
@@ -1,145 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-public class JavaEclipseLinkMutable extends AbstractJavaJpaContextNode implements EclipseLinkMutable
-{
- protected boolean defaultMutable;
- protected Boolean specifiedMutable;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public JavaEclipseLinkMutable(JavaAttributeMapping parent) {
- super(parent);
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return (JavaAttributeMapping) this.getParent();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected String getMutableAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkMutableAnnotation getResourceMutable() {
- return (EclipseLinkMutableAnnotation) this.resourcePersistentAttribute.getAnnotation(getMutableAnnotationName());
- }
-
- protected void addResourceMutable() {
- this.resourcePersistentAttribute.addAnnotation(getMutableAnnotationName());
- }
-
- protected void removeResourceMutable() {
- this.resourcePersistentAttribute.removeAnnotation(getMutableAnnotationName());
- }
-
- protected boolean calculateDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute();
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean persistenceUnitDefaultMutable = this.getPersistenceUnit().getOptions().getTemporalMutable();
- return persistenceUnitDefaultMutable == null ? false : persistenceUnitDefaultMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
- public boolean isMutable() {
- return this.specifiedMutable != null ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean newDefaultMutable) {
- boolean oldDefaultMutable = this.defaultMutable;
- this.defaultMutable = newDefaultMutable;
- firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, oldDefaultMutable, newDefaultMutable);
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean newSpecifiedMutable) {
- if (this.specifiedMutable == newSpecifiedMutable) {
- return;
- }
- Boolean oldSpecifiedMutable = this.specifiedMutable;
- this.specifiedMutable = newSpecifiedMutable;
-
- if (newSpecifiedMutable != null) {
- if (getResourceMutable() == null) {
- addResourceMutable();
- }
- if (newSpecifiedMutable.booleanValue()) {
- if (getResourceMutable().getValue() == Boolean.FALSE) {
- getResourceMutable().setValue(null);
- }
- }
- else {
- getResourceMutable().setValue(Boolean.FALSE);
- }
- }
- else {
- removeResourceMutable();
- }
- firePropertyChanged(EclipseLinkMutable.SPECIFIED_MUTABLE_PROPERTY, oldSpecifiedMutable, newSpecifiedMutable);
- }
-
- protected void setSpecifiedMutable_(Boolean newSpecifiedMutable) {
- Boolean oldSpecifiedMutable = this.specifiedMutable;
- this.specifiedMutable = newSpecifiedMutable;
- firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, oldSpecifiedMutable, newSpecifiedMutable);
- }
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- EclipseLinkMutableAnnotation resourceMutable = this.getResourceMutable();
- this.specifiedMutable = this.specifiedMutable(resourceMutable);
- this.defaultMutable = this.calculateDefaultMutable();
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- EclipseLinkMutableAnnotation resourceMutable = this.getResourceMutable();
- this.setSpecifiedMutable_(this.specifiedMutable(resourceMutable));
- this.setDefaultMutable(this.calculateDefaultMutable());
- }
-
- private Boolean specifiedMutable(EclipseLinkMutableAnnotation resourceMutable) {
- if (resourceMutable == null) {
- return null;
- }
- if (resourceMutable.getValue() == null) { //@Mutable is equivalent to @Mutable(true)
- return Boolean.TRUE;
- }
- return resourceMutable.getValue();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- EclipseLinkMutableAnnotation resourceMutable = this.getResourceMutable();
- return resourceMutable == null ? null : resourceMutable.getTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index 4f6d383f91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,303 +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.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkObjectTypeConverter extends JavaEclipseLinkConverter
- 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$
-
- private String defaultObjectValue;
-
- private final List<JavaEclipseLinkConversionValue> conversionValues;
-
-
- public JavaEclipseLinkObjectTypeConverter(JavaJpaContextNode parent) {
- super(parent);
- this.conversionValues = new ArrayList<JavaEclipseLinkConversionValue>();
- }
-
-
- public String getType() {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
-
- @Override
- public String getAnnotationName() {
- return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkObjectTypeConverterAnnotation getAnnotation() {
- return (EclipseLinkObjectTypeConverterAnnotation) super.getAnnotation();
- }
-
-
- // **************** data type **********************************************
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- getAnnotation().setDataType(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- protected void setDataType_(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- 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);
- }
-
- protected String buildFullyQualifiedDataType(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ?
- null :
- resourceConverter.getFullyQualifiedDataType();
- }
-
-
- // **************** object type ********************************************
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- getAnnotation().setObjectType(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- protected void setObjectType_(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- 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);
- }
-
- protected String buildFullyQualifiedObjectType(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ?
- null :
- resourceConverter.getFullyQualifiedObjectType();
- }
-
-
- // **************** conversion values **************************************
-
- public ListIterator<JavaEclipseLinkConversionValue> conversionValues() {
- return new CloneListIterator<JavaEclipseLinkConversionValue>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public JavaEclipseLinkConversionValue addConversionValue(int index) {
- JavaEclipseLinkConversionValue conversionValue = new JavaEclipseLinkConversionValue(this);
- this.conversionValues.add(index, conversionValue);
- EclipseLinkConversionValueAnnotation resourceConversionValue = getAnnotation().addConversionValue(index);
- conversionValue.initialize(resourceConversionValue);
- fireItemAdded(CONVERSION_VALUES_LIST, index, conversionValue);
- return conversionValue;
- }
-
- public JavaEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.conversionValues.size());
- }
-
- protected void addConversionValue(int index, JavaEclipseLinkConversionValue conversionValue) {
- addItemToList(index, conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- protected void addConversionValue(JavaEclipseLinkConversionValue conversionValue) {
- this.addConversionValue(this.conversionValues.size(), conversionValue);
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValues.indexOf(conversionValue));
- }
-
- public void removeConversionValue(int index) {
- JavaEclipseLinkConversionValue removedConversionValue = this.conversionValues.remove(index);
- getAnnotation().removeConversionValue(index);
- fireItemRemoved(CONVERSION_VALUES_LIST, index, removedConversionValue);
- }
-
- protected void removeConversionValue_(JavaEclipseLinkConversionValue conversionValue) {
- removeItemFromList(conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.conversionValues, targetIndex, sourceIndex);
- getAnnotation().moveConversionValue(targetIndex, sourceIndex);
- fireItemMoved(CONVERSION_VALUES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<String> dataValues() {
- return new TransformationListIterator<JavaEclipseLinkConversionValue, String>(conversionValues()) {
- @Override
- protected String transform(JavaEclipseLinkConversionValue next) {
- return next.getDataValue();
- }
- };
- }
-
-
- // **************** default object value ***********************************
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String newDefaultObjectValue) {
- String oldDefaultObjectValue = this.defaultObjectValue;
- this.defaultObjectValue = newDefaultObjectValue;
- getAnnotation().setDefaultObjectValue(newDefaultObjectValue);
- firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, oldDefaultObjectValue, newDefaultObjectValue);
- }
-
- protected void setDefaultObjectValue_(String newDefaultObjectValue) {
- String oldDefaultObjectValue = this.defaultObjectValue;
- this.defaultObjectValue = newDefaultObjectValue;
- firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, oldDefaultObjectValue, newDefaultObjectValue);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- EclipseLinkObjectTypeConverterAnnotation resourceConverter = getAnnotation();
- this.dataType = this.dataType(resourceConverter);
- this.fullyQualifiedDataType = this.buildFullyQualifiedDataType(resourceConverter);
- this.objectType = this.objectType(resourceConverter);
- this.fullyQualifiedObjectType = this.buildFullyQualifiedObjectType(resourceConverter);
- this.defaultObjectValue = this.defaultObjectValue(resourceConverter);
- this.initializeConversionValues(resourceConverter);
- }
-
- protected void initializeConversionValues(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- if (resourceConverter == null) {
- return;
- }
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = resourceConverter.conversionValues();
-
- while(resourceConversionValues.hasNext()) {
- this.conversionValues.add(buildConversionValue(resourceConversionValues.next()));
- }
- }
-
- protected JavaEclipseLinkConversionValue buildConversionValue(EclipseLinkConversionValueAnnotation resourceConversionValue) {
- JavaEclipseLinkConversionValue conversionValue = new JavaEclipseLinkConversionValue(this);
- conversionValue.initialize(resourceConversionValue);
- return conversionValue;
- }
-
- @Override
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- EclipseLinkObjectTypeConverterAnnotation resourceConverter = getAnnotation();
- this.setDataType_(this.dataType(resourceConverter));
- this.setFullyQualifiedDataType(this.buildFullyQualifiedDataType(resourceConverter));
- this.setObjectType_(this.objectType(resourceConverter));
- this.setFullyQualifiedObjectType(this.buildFullyQualifiedObjectType(resourceConverter));
- this.setDefaultObjectValue_(this.defaultObjectValue(resourceConverter));
- this.updateConversionValues(resourceConverter);
- }
-
- protected void updateConversionValues(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- ListIterator<JavaEclipseLinkConversionValue> contextConversionValues = conversionValues();
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = resourceConverter.conversionValues();
- while (contextConversionValues.hasNext()) {
- JavaEclipseLinkConversionValue conversionValues = contextConversionValues.next();
- if (resourceConversionValues.hasNext()) {
- conversionValues.update(resourceConversionValues.next());
- }
- else {
- removeConversionValue_(conversionValues);
- }
- }
-
- while (resourceConversionValues.hasNext()) {
- addConversionValue(buildConversionValue(resourceConversionValues.next()));
- }
- }
-
- protected String dataType(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDataType();
- }
-
- protected String objectType(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getObjectType();
- }
-
- protected String defaultObjectValue(EclipseLinkObjectTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDefaultObjectValue();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- for (Iterator<JavaEclipseLinkConversionValue> stream = conversionValues(); stream.hasNext();) {
- stream.next().validate(messages, reporter, astRoot);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 839db74e62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,115 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaRelationshipReference;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkOneToManyMapping
- extends AbstractJavaOneToManyMapping<OneToMany2_0Annotation>
- 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);
- }
-
- @Override
- protected JavaRelationshipReference buildRelationshipReference() {
- return new JavaEclipseLinkOneToManyRelationshipReference(this);
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.JOIN_FETCH);
- names.add(EclipseLink.PRIVATE_OWNED);
- }
-
- @Override
- public JavaEclipseLinkOneToManyRelationshipReference getRelationshipReference() {
- return (JavaEclipseLinkOneToManyRelationshipReference) super.getRelationshipReference();
- }
-
-
- // **************** private owned ******************************************
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- protected String getPrivateOwnedAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkPrivateOwnedAnnotation getResourcePrivateOwned() {
- return (EclipseLinkPrivateOwnedAnnotation) this.getResourcePersistentAttribute().getAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void addResourcePrivateOwned() {
- this.getResourcePersistentAttribute().addAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void removeResourcePrivateOwned() {
- this.getResourcePersistentAttribute().removeAnnotation(getPrivateOwnedAnnotationName());
- }
-
-
- // **************** join fetch *********************************************
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource -> context ************************************
-
- @Override
- protected void initialize() {
- super.initialize();
- this.joinFetch.initialize(this.getResourcePersistentAttribute());
- this.privateOwned.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.joinFetch.update(this.getResourcePersistentAttribute());
- this.privateOwned.update(this.getResourcePersistentAttribute());
- }
-
-
- // **************** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMappingDefinition.java
deleted file mode 100644
index 9b7c74b988..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMappingDefinition.java
+++ /dev/null
@@ -1,61 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingDefinition;
-
-public class JavaEclipseLinkOneToManyMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkOneToManyMappingDefinition INSTANCE =
- new JavaEclipseLinkOneToManyMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkOneToManyMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return JavaOneToManyMappingDefinition.instance().getKey();
- }
-
- public String getAnnotationName() {
- return JavaOneToManyMappingDefinition.instance().getAnnotationName();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return JavaOneToManyMappingDefinition.instance().buildMapping(parent, factory);
- }
-
- @Override
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getMultiReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyRelationshipReference.java
deleted file mode 100644
index 5263a8fe45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,63 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.java.JavaJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaOneToManyRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyRelationshipReference2_0;
-
-public class JavaEclipseLinkOneToManyRelationshipReference
- extends AbstractJavaOneToManyRelationshipReference
- implements EclipseLinkOneToManyRelationshipReference2_0
-{
- public JavaEclipseLinkOneToManyRelationshipReference(
- JavaEclipseLinkOneToManyMapping parent) {
- super(parent);
- }
-
-
- @Override
- protected JavaJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericJavaTargetForiegnKeyJoinColumnJoiningStrategy(this);
- }
-
- @Override
- public JavaEclipseLinkOneToManyMapping getRelationshipMapping() {
- return (JavaEclipseLinkOneToManyMapping) getParent();
- }
-
-
- @Override
- protected JoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- else {
- return this.joinTableJoiningStrategy;
- }
- }
-
-
- // **************** mapped by **********************************************
-
- @Override
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return super.mayBeMappedBy(mappedByMapping) ||
- mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
deleted file mode 100644
index 6feaf74a8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.GenericJavaOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-
-public class JavaEclipseLinkOneToOneMapping
- extends AbstractJavaEclipseLinkOneToOneMapping
-{
-
- public JavaEclipseLinkOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaOneToOneRelationshipReference(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMappingDefinition.java
deleted file mode 100644
index 63736d29b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,61 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
-
-public class JavaEclipseLinkOneToOneMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkOneToOneMappingDefinition INSTANCE =
- new JavaEclipseLinkOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return JavaOneToOneMappingDefinition.instance().getKey();
- }
-
- public String getAnnotationName() {
- return JavaOneToOneMappingDefinition.instance().getAnnotationName();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return JavaOneToOneMappingDefinition.instance().buildMapping(parent, factory);
- }
-
- @Override
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getSingleReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java
deleted file mode 100644
index 465f7146d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,70 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-
-/**
- * EclipseLink Java persistent attribute
- */
-public class JavaEclipseLinkPersistentAttribute
- extends AbstractJavaPersistentAttribute
- implements JavaPersistentAttribute2_0
-{
- public JavaEclipseLinkPersistentAttribute(PersistentType parent, JavaResourcePersistentAttribute jrpa) {
- super(parent, jrpa);
- }
-
-
- // ********** AccessHolder implementation **********
-
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return whether the specified type is a subclass of java.util.Date or java.util.Calendar.
- */
- public boolean typeIsDateOrCalendar() {
- return this.resourcePersistentAttribute.typeIsSubTypeOf(DATE_TYPE_NAME)
- || this.resourcePersistentAttribute.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.resourcePersistentAttribute.typeIsVariablePrimitive()
- || this.resourcePersistentAttribute.typeIsSubTypeOf(SERIALIZABLE_TYPE_NAME);
- }
-
- public boolean typeIsValidForVariableOneToOne() {
- return this.resourcePersistentAttribute.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$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java
deleted file mode 100644
index b78910b26b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-public class JavaEclipseLinkPrivateOwned
- extends AbstractJavaJpaContextNode
- implements EclipseLinkPrivateOwned
-{
- protected boolean privateOwned;
-
- protected JavaResourcePersistentAttribute resourcePersistentAttribute;
-
- public JavaEclipseLinkPrivateOwned(JavaAttributeMapping parent) {
- super(parent);
- }
-
- protected String getPrivateOwnedAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkPrivateOwnedAnnotation getResourcePrivateOwned() {
- return (EclipseLinkPrivateOwnedAnnotation) this.resourcePersistentAttribute.getAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void addResourcePrivateOwned() {
- this.resourcePersistentAttribute.addAnnotation(getPrivateOwnedAnnotationName());
- }
-
- protected void removeResourcePrivateOwned() {
- this.resourcePersistentAttribute.removeAnnotation(getPrivateOwnedAnnotationName());
- }
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean newPrivateOwned) {
- if (this.privateOwned == newPrivateOwned) {
- return;
- }
- boolean oldPrivateOwned = this.privateOwned;
- this.privateOwned = newPrivateOwned;
-
- if (newPrivateOwned) {
- addResourcePrivateOwned();
- }
- else {
- //have to check if annotation exists in case the change is from false to null or vice versa
- if (getResourcePrivateOwned() != null) {
- removeResourcePrivateOwned();
- }
- }
- firePropertyChanged(PRIVATE_OWNED_PROPERTY, oldPrivateOwned, newPrivateOwned);
- }
-
- protected void setPrivateOwned_(boolean newPrivateOwned) {
- boolean oldPrivateOwned = this.privateOwned;
- this.privateOwned = newPrivateOwned;
- firePropertyChanged(PRIVATE_OWNED_PROPERTY, oldPrivateOwned, newPrivateOwned);
- }
-
- public void initialize(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.privateOwned = privateOwned();
- }
-
- public void update(JavaResourcePersistentAttribute jrpa) {
- this.resourcePersistentAttribute = jrpa;
- this.setPrivateOwned_(privateOwned());
- }
-
- private boolean privateOwned() {
- return getResourcePrivateOwned() != null;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- EclipseLinkPrivateOwnedAnnotation resourcePrivateOwned = this.getResourcePrivateOwned();
- return resourcePrivateOwned == null ? null : resourcePrivateOwned.getTextRange(astRoot);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
deleted file mode 100644
index 6c68a9c0a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,103 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-public class JavaEclipseLinkReadOnly extends AbstractJavaJpaContextNode implements EclipseLinkReadOnly
-{
- protected Boolean specifiedReadOnly;
-
- protected JavaResourcePersistentType resourcePersistentType;
-
-
- public JavaEclipseLinkReadOnly(JavaTypeMapping parent) {
- super(parent);
- }
-
-
- protected String getReadOnlyAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-
- protected EclipseLinkReadOnlyAnnotation getResourceReadOnly() {
- return (EclipseLinkReadOnlyAnnotation) this.resourcePersistentType.getAnnotation(getReadOnlyAnnotationName());
- }
-
- protected void addResourceReadOnly() {
- this.resourcePersistentType.addAnnotation(getReadOnlyAnnotationName());
- }
-
- protected void removeResourceReadOnly() {
- this.resourcePersistentType.removeAnnotation(getReadOnlyAnnotationName());
- }
-
- public boolean isReadOnly() {
- return (this.getSpecifiedReadOnly() != null) ? this.getSpecifiedReadOnly().booleanValue() : this.isDefaultReadOnly();
- }
-
- public boolean isDefaultReadOnly() {
- return EclipseLinkReadOnly.DEFAULT_READ_ONLY;
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean newReadOnly) {
- if (this.specifiedReadOnly == newReadOnly) {
- return;
- }
- Boolean oldReadOnly = this.specifiedReadOnly;
- this.specifiedReadOnly = newReadOnly;
-
- if (newReadOnly != null && newReadOnly.booleanValue()) {
- addResourceReadOnly();
- }
- else {
- //have to check if annotation exists in case the change is from false to null or vice versa
- if (getResourceReadOnly() != null) {
- removeResourceReadOnly();
- }
- }
- firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, oldReadOnly, newReadOnly);
- }
-
- protected void setSpecifiedReadOnly_(Boolean newReadOnly) {
- Boolean oldReadOnly = this.specifiedReadOnly;
- this.specifiedReadOnly = newReadOnly;
- firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, oldReadOnly, newReadOnly);
- }
-
- public void initialize(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.specifiedReadOnly = readOnly();
- }
-
- public void update(JavaResourcePersistentType jrpt) {
- this.resourcePersistentType = jrpt;
- this.setSpecifiedReadOnly_(readOnly());
- }
-
- private Boolean readOnly() {
- return getResourceReadOnly() == null ? null : Boolean.TRUE;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- EclipseLinkReadOnlyAnnotation resourceReadOnly = this.getResourceReadOnly();
- return resourceReadOnly == null ? null : resourceReadOnly.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
deleted file mode 100644
index 97a78f2ac1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-public class JavaEclipseLinkStructConverter extends JavaEclipseLinkConverter
- implements EclipseLinkStructConverter
-{
- private String converterClass;
-
-
- public JavaEclipseLinkStructConverter(JavaJpaContextNode parent) {
- super(parent);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- @Override
- public String getAnnotationName() {
- return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkStructConverterAnnotation getAnnotation() {
- return (EclipseLinkStructConverterAnnotation) super.getAnnotation();
- }
-
-
- // **************** converter class ****************************************
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- getAnnotation().setConverter(newConverterClass);
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- this.converterClass = this.converterClass(getAnnotation());
- }
-
- @Override
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- this.setConverterClass_(this.converterClass(getAnnotation()));
- }
-
- protected String converterClass(EclipseLinkStructConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getConverter();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
deleted file mode 100644
index b154fb38fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.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;
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMappingDefinition.java
deleted file mode 100644
index 5f87f1ebd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMappingDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-public class JavaEclipseLinkTransformationMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkTransformationMappingDefinition INSTANCE =
- new JavaEclipseLinkTransformationMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkTransformationMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkTransformationMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
deleted file mode 100644
index 3272f77dae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,150 +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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class JavaEclipseLinkTypeConverter extends JavaEclipseLinkConverter
- 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) {
- super(parent);
- }
-
- public String getType() {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
-
- @Override
- public String getAnnotationName() {
- return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkTypeConverterAnnotation getAnnotation() {
- return (EclipseLinkTypeConverterAnnotation) super.getAnnotation();
- }
-
-
- // **************** data type **********************************************
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- getAnnotation().setDataType(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- protected void setDataType_(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- 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);
- }
-
- protected String buildFullyQualifiedDataType(EclipseLinkTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ?
- null :
- resourceConverter.getFullyQualifiedDataType();
- }
-
-
- // **************** object type ********************************************
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- getAnnotation().setObjectType(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- protected void setObjectType_(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- 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);
- }
-
- protected String buildFullyQualifiedObjectType(EclipseLinkTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ?
- null :
- resourceConverter.getFullyQualifiedObjectType();
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(JavaResourcePersistentMember jrpm) {
- super.initialize(jrpm);
- EclipseLinkTypeConverterAnnotation resourceConverter = getAnnotation();
- this.dataType = this.dataType(resourceConverter);
- this.fullyQualifiedDataType = this.buildFullyQualifiedDataType(resourceConverter);
- this.objectType = this.objectType(resourceConverter);
- this.fullyQualifiedObjectType = this.buildFullyQualifiedObjectType(resourceConverter);
- }
-
- @Override
- public void update(JavaResourcePersistentMember jrpm) {
- super.update(jrpm);
- EclipseLinkTypeConverterAnnotation resourceConverter = getAnnotation();
- this.setDataType_(this.dataType(resourceConverter));
- this.setFullyQualifiedDataType(this.buildFullyQualifiedDataType(resourceConverter));
- this.setObjectType_(this.objectType(resourceConverter));
- this.setFullyQualifiedObjectType(this.buildFullyQualifiedObjectType(resourceConverter));
- }
-
- protected String dataType(EclipseLinkTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getDataType();
- }
-
- protected String objectType(EclipseLinkTypeConverterAnnotation resourceConverter) {
- return resourceConverter == null ? null : resourceConverter.getObjectType();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index c270c6a4bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.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;
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMappingDefinition.java
deleted file mode 100644
index 920e605f3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMappingDefinition.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.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-public class JavaEclipseLinkVariableOneToOneMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaEclipseLinkVariableOneToOneMappingDefinition INSTANCE =
- new JavaEclipseLinkVariableOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkVariableOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkVariableOneToOneMapping(parent);
- }
-
- @Override
- public boolean testDefault(JavaPersistentAttribute persistentAttribute) {
- return ((JavaEclipseLinkPersistentAttribute) persistentAttribute).typeIsValidForVariableOneToOne();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
deleted file mode 100644
index 819869a04b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,101 +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.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaConverter;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-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);
- }
-
- //************** JavaAttributeMapping implementation ***************
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.MUTABLE);
- names.add(EclipseLink.CONVERT);
- }
-
-
- //************** EclipseLinkVersionMapping overrides ***************
-
- @Override
- protected JavaConverter buildConverter(String converterType) {
- JavaConverter javaConverter = super.buildConverter(converterType);
- if (javaConverter != null) {
- return javaConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new JavaEclipseLinkConvert(this, this.getResourcePersistentAttribute());
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.getResourcePersistentAttribute().getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME) != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
-
- //************ EclipselinkVersionMapping implementation ****************
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- //************ initialization/update ****************
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mutable.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.mutable.update(this.getResourcePersistentAttribute());
- }
-
- //************ 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index 7aa95d2c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-public abstract class AbstractEclipseLinkOrmXmlDefinition
- extends AbstractOrmXmlDefinition
-{
-
- /**
- * zero-argument constructor
- */
- protected AbstractEclipseLinkOrmXmlDefinition() {
- super();
- }
-
-
- public EFactory getResourceNodeFactory() {
- return EclipseLinkOrmFactory.eINSTANCE;
- }
-
-
- // ********* ORM type mappings *********
-
- @Override
- protected OrmTypeMappingDefinition[] buildOrmTypeMappingDefinitions() {
- // order should not matter here, but we'll use the same order as for java
- // @see {@link EclipseLinkJpaPlatformProvider}
- 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 EclipseLinkJpaPlatformProvider}
- return 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 038be63126..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public abstract class AbstractOrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmAttributeMapping<XmlBasicCollection>
- implements EclipseLinkBasicCollectionMapping
-{
- protected AbstractOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().remove(this.resourceAttributeMapping);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index 3fb959dc2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-
-public abstract class AbstractOrmEclipseLinkBasicMapMapping
- extends AbstractOrmAttributeMapping<XmlBasicMap>
- implements EclipseLinkBasicMapMapping
-{
- protected AbstractOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().remove(this.resourceAttributeMapping);
- }
-
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 6c34a02de7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkManyToOneMapping.java
+++ /dev/null
@@ -1,55 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmEclipseLinkManyToOneMapping extends AbstractOrmManyToOneMapping<XmlManyToOne>
- implements EclipseLinkRelationshipMapping
-{
- protected OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected AbstractOrmEclipseLinkManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- super(parent, resourceMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkOneToOneMapping.java
deleted file mode 100644
index 5096f933d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkOneToOneMapping.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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class AbstractOrmEclipseLinkOneToOneMapping extends AbstractOrmOneToOneMapping<XmlOneToOne>
- implements EclipseLinkOneToOneMapping
-{
- protected OrmEclipseLinkPrivateOwned privateOwned;
-
- protected OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected AbstractOrmEclipseLinkOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- super(parent, resourceMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this, this.resourceAttributeMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
deleted file mode 100644
index e4134f2d81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
+++ /dev/null
@@ -1,60 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.internal.context.orm.AbstractEntityMappings;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-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 OrmEclipseLinkConverterHolder converterHolder;
-
- public EclipseLinkEntityMappingsImpl(OrmXml parent, XmlEntityMappings resource) {
- super(parent, resource);
- this.converterHolder = new OrmEclipseLinkConverterHolder(this, (XmlEntityMappings) this.xmlEntityMappings);
- }
-
- // **************** EclipseLinkEntityMappings impl **********************************
-
- public EclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
-
- @Override
- public void update() {
- super.update();
- this.converterHolder.update();
- }
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.converterHolder.validate(messages, reporter);
- }
-
- @Override
- protected String latestDocumentVersion() {
- return getJpaPlatform().getMostRecentSupportedResourceType(
- JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE).getVersion();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
deleted file mode 100644
index ba40727125..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,220 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmXml;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-
-public class EclipseLinkOrmXmlContextNodeFactory extends AbstractOrmXmlContextNodeFactory
-{
-
- // ********** EclipseLink-specific ORM Context Model **********
-
- @Override
- public EntityMappings buildEntityMappings(OrmXml parent, org.eclipse.jpt.core.resource.orm.XmlEntityMappings xmlEntityMappings) {
- return new EclipseLinkEntityMappingsImpl(parent, (XmlEntityMappings) xmlEntityMappings);
- }
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, org.eclipse.jpt.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new OrmEclipseLinkPersistentAttribute(parent, owner, resourceMapping);
- }
-
- @Override
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType type, org.eclipse.jpt.core.resource.orm.XmlEmbeddable resourceMapping) {
- return new OrmEclipseLinkEmbeddableImpl(type, (XmlEmbeddable) resourceMapping);
- }
-
- @Override
- public OrmEntity buildOrmEntity(OrmPersistentType type, org.eclipse.jpt.core.resource.orm.XmlEntity resourceMapping) {
- return new OrmEclipseLinkEntityImpl(type, (XmlEntity) resourceMapping);
- }
-
- @Override
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType type, org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass resourceMapping) {
- return new OrmEclipseLinkMappedSuperclassImpl(type, (XmlMappedSuperclass) resourceMapping);
- }
-
- @Override
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlBasic resourceMapping) {
- return new OrmEclipseLinkBasicMapping(parent, (XmlBasic) resourceMapping);
- }
-
- @Override
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlId resourceMapping) {
- return new OrmEclipseLinkIdMapping(parent, (XmlId) resourceMapping);
- }
-
- @Override
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlManyToMany resourceMapping) {
- return new OrmEclipseLinkManyToManyMapping(parent, (XmlManyToMany) resourceMapping);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlManyToOne resourceMapping) {
- return new OrmEclipseLinkManyToOneMapping(parent, (XmlManyToOne) resourceMapping);
- }
-
- @Override
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlOneToMany resourceMapping) {
- return new OrmEclipseLinkOneToManyMapping(parent, (XmlOneToMany) resourceMapping);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlOneToOne resourceMapping) {
- return new OrmEclipseLinkOneToOneMapping(parent, (XmlOneToOne) resourceMapping);
- }
-
- @Override
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent, org.eclipse.jpt.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);
- }
-
-
- // ********** EclipseLink-specific ORM Virtual Resource Model **********
-
-
- @Override
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- return new VirtualEclipseLinkXmlBasic(ormTypeMapping, javaBasicMapping);
- }
-
- @Override
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- return new VirtualEclipseLinkXmlId(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- return new VirtualEclipseLinkXmlEmbeddedId(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- return new VirtualEclipseLinkXmlEmbedded(ormTypeMapping, javaEmbeddedMapping);
- }
-
- @Override
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- return new VirtualEclipseLinkXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
-
- @Override
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- return new VirtualEclipseLinkXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
-
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualEclipseLinkXmlOneToMany(ormTypeMapping, (JavaEclipseLinkOneToManyMapping) javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, (JavaEclipseLinkOneToOneMapping) javaOneToOneMapping);
- }
-
- @Override
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- return new VirtualEclipseLinkXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
- @Override
- public XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- return new VirtualEclipseLinkXmlTransient(ormTypeMapping, javaTransientMapping);
- }
-
- public XmlBasicCollection buildVirtualEclipseLinkXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicCollectionMapping javaBasicCollectionMapping) {
- return new VirtualEclipseLinkXmlBasicCollection(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- public XmlBasicMap buildVirtualEclipseLinkXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicMapMapping javaBasicMapMapping) {
- return new VirtualEclipseLinkXmlBasicMap(ormTypeMapping, javaBasicMapMapping);
- }
-
- public XmlTransformation buildVirtualEclipseLinkXmlTransformation(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTransformationMapping javaTransformationMapping) {
- return new VirtualEclipseLinkXmlTransformation(ormTypeMapping, javaTransformationMapping);
- }
-
- public XmlVariableOneToOne buildVirtualEclipseLinkXmlVariableOneToOne(OrmTypeMapping ormTypeMapping, JavaEclipseLinkVariableOneToOneMapping javaVariableOneToOneMapping) {
- return new VirtualEclipseLinkXmlVariableOneToOne(ormTypeMapping, javaVariableOneToOneMapping);
- }
-
- @Override
- public XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtualEclipseLinkXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index bd05becebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-
-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();
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 4467271e84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmEclipseLinkBasicCollectionMapping
-{
- public OrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- super(parent, resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java
deleted file mode 100644
index cdbff1b4a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.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);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildVirtualEclipseLinkXmlBasicCollection(ormTypeMapping, (JavaEclipseLinkBasicCollectionMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index b1a0a9f41e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmEclipseLinkBasicMapMapping
- extends AbstractOrmEclipseLinkBasicMapMapping
-{
- public OrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- super(parent, resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java
deleted file mode 100644
index 9a89a095d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.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);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildVirtualEclipseLinkXmlBasicMap(ormTypeMapping, (JavaEclipseLinkBasicMapMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
deleted file mode 100644
index bf2e942cfb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,78 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.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 OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkBasicMapping(OrmPersistentAttribute parent, XmlBasic resourceMapping) {
- super(parent, resourceMapping);
- this.mutable = new OrmEclipseLinkMutable(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildConverter(String converterType) {
- OrmConverter ormConverter = super.buildConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new OrmEclipseLinkConvert(this, this.resourceAttributeMapping);
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.resourceAttributeMapping.getConvert() != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
deleted file mode 100644
index ad50a83c0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,710 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class OrmEclipseLinkCachingImpl
- extends AbstractOrmXmlContextNode
- implements
- OrmEclipseLinkCaching,
- OrmCacheableHolder2_0
-{
- protected final XmlCacheHolder resource;
-
- protected int defaultSize;
- protected Integer specifiedSize;
-
- protected boolean defaultShared;
- protected Boolean specifiedShared;
-
- protected EclipseLinkCacheType defaultType;
- protected EclipseLinkCacheType specifiedType;
-
- protected boolean defaultAlwaysRefresh;
- protected Boolean specifiedAlwaysRefresh;
-
- protected boolean defaultRefreshOnlyIfNewer;
- protected Boolean specifiedRefreshOnlyIfNewer;
-
- protected boolean defaultDisableHits;
- protected Boolean specifiedDisableHits;
-
- protected EclipseLinkCacheCoordinationType defaultCoordinationType;
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
-
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType;
-
- protected Integer expiry;
- protected OrmEclipseLinkExpiryTimeOfDay expiryTimeOfDay;
-
- protected final OrmCacheable2_0 cacheable;
-
- public OrmEclipseLinkCachingImpl(OrmTypeMapping parent, XmlCacheHolder resource, XmlCacheable_2_0 cacheableResource, JavaEclipseLinkCaching javaCaching) {
- super(parent);
- this.resource = resource;
- XmlCache resourceCache = getResourceCache();
- this.defaultSize = this.defaultSize(javaCaching);
- this.specifiedSize = getResourceSize(resourceCache);
- this.defaultShared = this.defaultShared(javaCaching);
- this.specifiedShared = this.getResourceShared(resourceCache);
- this.defaultAlwaysRefresh = this.defaultAlwaysRefresh(javaCaching);
- this.specifiedAlwaysRefresh = this.getResourceAlwaysRefresh(resourceCache);
- this.defaultRefreshOnlyIfNewer = this.defaultRefreshOnlyIfNewer(javaCaching);
- this.specifiedRefreshOnlyIfNewer = this.getResourceRefreshOnlyIfNewer(resourceCache);
- this.defaultDisableHits = this.defaultDisableHits(javaCaching);
- this.specifiedDisableHits = this.getResourceDisableHits(resourceCache);
- this.defaultType = this.defaultType(javaCaching);
- this.specifiedType = this.getResourceType(resourceCache);
- this.defaultCoordinationType = this.defaultCoordinationType(javaCaching);
- this.specifiedCoordinationType = this.getResourceCoordinationType(resourceCache);
- this.defaultExistenceType = this.defaultExistenceType(javaCaching);
- this.specifiedExistenceType = this.getResourceExistenceChecking();
- this.initializeExpiry(resourceCache);
- this.cacheable = ((OrmXml2_0ContextNodeFactory) getXmlContextNodeFactory()).buildOrmCacheable(this, cacheableResource);
- }
-
- @Override
- public OrmTypeMapping getParent() {
- return (OrmTypeMapping) super.getParent();
- }
-
- public int getSize() {
- return (this.specifiedSize == null) ? this.defaultSize : this.specifiedSize.intValue();
- }
-
- public int getDefaultSize() {
- return this.defaultSize;
- }
-
- protected void setDefaultSize(int newSize) {
- int oldSize = this.defaultSize;
- this.defaultSize = newSize;
- firePropertyChanged(DEFAULT_SIZE_PROPERTY, oldSize, newSize);
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer newSpecifiedSize) {
- Integer oldSpecifiedSize = this.specifiedSize;
- this.specifiedSize = newSpecifiedSize;
- if (oldSpecifiedSize != newSpecifiedSize) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setSize(newSpecifiedSize);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedSize != null) {
- addResourceCache();
- getResourceCache().setSize(newSpecifiedSize);
- }
- }
- firePropertyChanged(SPECIFIED_SIZE_PROPERTY, oldSpecifiedSize, newSpecifiedSize);
- }
-
- protected void setSpecifiedSize_(Integer newSpecifiedSize) {
- Integer oldSpecifiedSize = this.specifiedSize;
- this.specifiedSize = newSpecifiedSize;
- firePropertyChanged(SPECIFIED_SIZE_PROPERTY, oldSpecifiedSize, newSpecifiedSize);
- }
-
-
- public boolean isShared() {
- return (this.specifiedShared == null) ? this.defaultShared : this.specifiedShared.booleanValue();
- }
-
- public boolean isDefaultShared() {
- return this.defaultShared;
- }
-
- protected void setDefaultShared(boolean newDefaultShared) {
- boolean oldDefaultShared = this.defaultShared;
- this.defaultShared = newDefaultShared;
- firePropertyChanged(DEFAULT_SHARED_PROPERTY, oldDefaultShared, newDefaultShared);
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean newSpecifiedShared) {
- Boolean oldSpecifiedShared = this.specifiedShared;
- this.specifiedShared = newSpecifiedShared;
- if (oldSpecifiedShared != newSpecifiedShared) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setShared(newSpecifiedShared);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedShared != null) {
- addResourceCache();
- getResourceCache().setShared(newSpecifiedShared);
- }
- }
- firePropertyChanged(SPECIFIED_SHARED_PROPERTY, oldSpecifiedShared, newSpecifiedShared);
- if (newSpecifiedShared == Boolean.FALSE) {
- setSpecifiedType(null);
- setSpecifiedSize(null);
- setSpecifiedAlwaysRefresh(null);
- setSpecifiedRefreshOnlyIfNewer(null);
- setSpecifiedDisableHits(null);
- setSpecifiedCoordinationType(null);
- setExpiry(null);
- if (this.expiryTimeOfDay != null) {
- removeExpiryTimeOfDay();
- }
- }
- }
-
- protected void setSpecifiedShared_(Boolean newSpecifiedShared) {
- Boolean oldSpecifiedShared = this.specifiedShared;
- this.specifiedShared = newSpecifiedShared;
- firePropertyChanged(SPECIFIED_SHARED_PROPERTY, oldSpecifiedShared, newSpecifiedShared);
- }
-
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh == null) ? this.defaultAlwaysRefresh : this.specifiedAlwaysRefresh.booleanValue();
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return this.defaultAlwaysRefresh;
- }
-
- protected void setDefaultAlwaysRefresh(boolean newDefaultAlwaysRefresh) {
- boolean oldDefaultAlwaysRefresh = this.defaultAlwaysRefresh;
- this.defaultAlwaysRefresh = newDefaultAlwaysRefresh;
- firePropertyChanged(DEFAULT_ALWAYS_REFRESH_PROPERTY, oldDefaultAlwaysRefresh, newDefaultAlwaysRefresh);
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean newSpecifiedAlwaysRefresh) {
- Boolean oldSpecifiedAlwaysRefresh = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = newSpecifiedAlwaysRefresh;
- if (oldSpecifiedAlwaysRefresh != newSpecifiedAlwaysRefresh) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setAlwaysRefresh(newSpecifiedAlwaysRefresh);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedAlwaysRefresh != null) {
- addResourceCache();
- getResourceCache().setAlwaysRefresh(newSpecifiedAlwaysRefresh);
- }
- }
- firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldSpecifiedAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean newSpecifiedAlwaysRefresh) {
- Boolean oldSpecifiedAlwaysRefresh = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = newSpecifiedAlwaysRefresh;
- firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, oldSpecifiedAlwaysRefresh, newSpecifiedAlwaysRefresh);
- }
-
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer == null) ? this.defaultRefreshOnlyIfNewer : this.specifiedRefreshOnlyIfNewer.booleanValue();
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return this.defaultRefreshOnlyIfNewer;
- }
-
- protected void setDefaultRefreshOnlyIfNewer(boolean newDefaultRefreshOnlyIfNewer) {
- boolean oldDefaultRefreshOnlyIfNewer = this.defaultRefreshOnlyIfNewer;
- this.defaultRefreshOnlyIfNewer = newDefaultRefreshOnlyIfNewer;
- firePropertyChanged(DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY, oldDefaultRefreshOnlyIfNewer, newDefaultRefreshOnlyIfNewer);
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean newSpecifiedRefreshOnlyIfNewer) {
- Boolean oldSpecifiedRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = newSpecifiedRefreshOnlyIfNewer;
- if (oldSpecifiedRefreshOnlyIfNewer != newSpecifiedRefreshOnlyIfNewer) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setRefreshOnlyIfNewer(newSpecifiedRefreshOnlyIfNewer);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedRefreshOnlyIfNewer != null) {
- addResourceCache();
- getResourceCache().setRefreshOnlyIfNewer(newSpecifiedRefreshOnlyIfNewer);
- }
- }
- firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldSpecifiedRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean newSpecifiedRefreshOnlyIfNewer) {
- Boolean oldSpecifiedRefreshOnlyIfNewer = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = newSpecifiedRefreshOnlyIfNewer;
- firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, oldSpecifiedRefreshOnlyIfNewer, newSpecifiedRefreshOnlyIfNewer);
- }
-
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits == null) ? this.defaultDisableHits : this.specifiedDisableHits.booleanValue();
- }
-
- public boolean isDefaultDisableHits() {
- return this.defaultDisableHits;
- }
-
- protected void setDefaultDisableHits(boolean newDefaultDisableHits) {
- boolean oldDefaultDisableHits = this.defaultDisableHits;
- this.defaultDisableHits = newDefaultDisableHits;
- firePropertyChanged(DEFAULT_DISABLE_HITS_PROPERTY, oldDefaultDisableHits, newDefaultDisableHits);
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean newSpecifiedDisableHits) {
- Boolean oldSpecifiedDisableHits = this.specifiedDisableHits;
- this.specifiedDisableHits = newSpecifiedDisableHits;
- if (oldSpecifiedDisableHits != newSpecifiedDisableHits) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setDisableHits(newSpecifiedDisableHits);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedDisableHits != null) {
- addResourceCache();
- getResourceCache().setDisableHits(newSpecifiedDisableHits);
- }
- }
- firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, oldSpecifiedDisableHits, newSpecifiedDisableHits);
- }
-
- protected void setSpecifiedDisableHits_(Boolean newSpecifiedDisableHits) {
- Boolean oldSpecifiedDisableHits = this.specifiedDisableHits;
- this.specifiedDisableHits = newSpecifiedDisableHits;
- firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, oldSpecifiedDisableHits, newSpecifiedDisableHits);
- }
-
- public EclipseLinkCacheType getType() {
- return (this.specifiedType == null) ? this.defaultType : this.specifiedType;
- }
-
- public EclipseLinkCacheType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkCacheType newDefaultType) {
- EclipseLinkCacheType oldDefaultType= this.defaultType;
- this.defaultType = newDefaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, newDefaultType);
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType newSpecifiedType) {
- EclipseLinkCacheType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- if (oldSpecifiedType != newSpecifiedType) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setType(EclipseLinkCacheType.toOrmResourceModel(newSpecifiedType));
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedType != null) {
- addResourceCache();
- getResourceCache().setType(EclipseLinkCacheType.toOrmResourceModel(newSpecifiedType));
- }
- }
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- protected void setSpecifiedType_(EclipseLinkCacheType newSpecifiedType) {
- EclipseLinkCacheType oldSpecifiedType= this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType == null) ? this.defaultCoordinationType : this.specifiedCoordinationType;
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return this.defaultCoordinationType;
- }
-
- protected void setDefaultCoordinationType(EclipseLinkCacheCoordinationType newDefaultcCoordinationType) {
- EclipseLinkCacheCoordinationType oldDefaultcCoordinationType= this.defaultCoordinationType;
- this.defaultCoordinationType = newDefaultcCoordinationType;
- firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, oldDefaultcCoordinationType, newDefaultcCoordinationType);
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType newSpecifiedCoordinationType) {
- EclipseLinkCacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- if (oldSpecifiedCoordinationType != newSpecifiedCoordinationType) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setCoordinationType(EclipseLinkCacheCoordinationType.toOrmResourceModel(newSpecifiedCoordinationType));
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newSpecifiedCoordinationType != null) {
- addResourceCache();
- getResourceCache().setCoordinationType(EclipseLinkCacheCoordinationType.toOrmResourceModel(newSpecifiedCoordinationType));
- }
- }
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType newSpecifiedCoordinationType) {
- EclipseLinkCacheCoordinationType oldSpecifiedCoordinationType = this.specifiedCoordinationType;
- this.specifiedCoordinationType = newSpecifiedCoordinationType;
- firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, oldSpecifiedCoordinationType, newSpecifiedCoordinationType);
- }
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.specifiedExistenceType == null) ? this.defaultExistenceType : this.specifiedExistenceType;
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType newDefaultExistenceType) {
- EclipseLinkExistenceType oldDefaultExistenceType = this.defaultExistenceType;
- this.defaultExistenceType = newDefaultExistenceType;
- firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, oldDefaultExistenceType, newDefaultExistenceType);
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType newSpecifiedExistenceType) {
- EclipseLinkExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- this.resource.setExistenceChecking(EclipseLinkExistenceType.toOrmResourceModel(newSpecifiedExistenceType));
- firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, oldSpecifiedExistenceType, newSpecifiedExistenceType);
- }
-
- protected void setSpecifiedExistenceType_(EclipseLinkExistenceType newSpecifiedExistenceType) {
- EclipseLinkExistenceType oldSpecifiedExistenceType = this.specifiedExistenceType;
- this.specifiedExistenceType = newSpecifiedExistenceType;
- firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, oldSpecifiedExistenceType, newSpecifiedExistenceType);
- }
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer newExpiry) {
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- if (oldExpiry != newExpiry) {
- if (this.getResourceCache() != null) {
- this.getResourceCache().setExpiry(newExpiry);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- }
- else if (newExpiry != null) {
- addResourceCache();
- this.getResourceCache().setExpiry(newExpiry);
- }
- }
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- if (newExpiry != null && this.expiryTimeOfDay != null) {
- removeExpiryTimeOfDay();
- }
- }
-
- protected void setExpiry_(Integer newExpiry) {
- Integer oldExpiry = this.expiry;
- this.expiry = newExpiry;
- firePropertyChanged(EXPIRY_PROPERTY, oldExpiry, newExpiry);
- }
-
- public EclipseLinkExpiryTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkExpiryTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiryTimeOfDay already exists, use getExpiryTimeOfDay()"); //$NON-NLS-1$
- }
- if (getResourceCache() == null) {
- addResourceCache();
- }
- OrmEclipseLinkExpiryTimeOfDay newExpiryTimeOfDay = new OrmEclipseLinkExpiryTimeOfDay(this);
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- XmlTimeOfDay resourceTimeOfDay = EclipseLinkOrmFactory.eINSTANCE.createXmlTimeOfDay();
- newExpiryTimeOfDay.initialize(resourceTimeOfDay);
- getResourceCache().setExpiryTimeOfDay(resourceTimeOfDay);
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, null, newExpiryTimeOfDay);
- setExpiry(null);
- return newExpiryTimeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("timeOfDayExpiry does not exist"); //$NON-NLS-1$
- }
- EclipseLinkExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- getResourceCache().setExpiryTimeOfDay(null);
- if (this.getResourceCache().isUnset()) {
- removeResourceCache();
- }
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, null);
- }
-
- protected void setExpiryTimeOfDay(OrmEclipseLinkExpiryTimeOfDay newExpiryTimeOfDay) {
- OrmEclipseLinkExpiryTimeOfDay oldExpiryTimeOfDay = this.expiryTimeOfDay;
- this.expiryTimeOfDay = newExpiryTimeOfDay;
- firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- }
-
- protected XmlCache getResourceCache() {
- return this.resource.getCache();
- }
-
- protected void addResourceCache() {
- this.resource.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- }
-
- protected void removeResourceCache() {
- this.resource.setCache(null);
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- if (!getParent().isMetadataComplete()) {
- JavaPersistentType javaPersistentType = getParent().getPersistentType().getJavaPersistentType();
- if (javaPersistentType != null && javaPersistentType.getMapping() instanceof CacheableHolder2_0) {
- return ((CacheableHolder2_0) javaPersistentType.getMapping()).getCacheable().isCacheable();
- }
- }
- CacheableHolder2_0 cacheableHolder = getCacheableSuperPersistentType(getParent().getPersistentType());
- if (cacheableHolder != null) {
- return cacheableHolder.getCacheable().isCacheable();
- }
- return ((PersistenceUnit2_0) getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType != null) {
- if (superPersistentType.getMapping() instanceof CacheableHolder2_0) {
- return (CacheableHolder2_0) superPersistentType.getMapping();
- }
- return getCacheableSuperPersistentType(superPersistentType);
- }
- return null;
- }
-
- // **************** initialize/update **************************************
-
- protected void initializeExpiry(XmlCache resourceCache) {
- if (resourceCache == null) {
- return;
- }
- if (resourceCache.getExpiryTimeOfDay() == null) {
- this.expiry = resourceCache.getExpiry();
- }
- else {
- if (resourceCache.getExpiry() == null) { //handle with validation if both expiry and expiryTimeOfDay are set
- this.expiryTimeOfDay = new OrmEclipseLinkExpiryTimeOfDay(this);
- this.expiryTimeOfDay.initialize(resourceCache.getExpiryTimeOfDay());
- }
- }
- }
-
- public void update(JavaEclipseLinkCaching javaCaching) {
- XmlCache resourceCache = getResourceCache();
- setDefaultSize(this.defaultSize(javaCaching));
- setSpecifiedSize_(this.getResourceSize(resourceCache));
- setDefaultShared(this.defaultShared(javaCaching));
- setSpecifiedShared_(this.getResourceShared(resourceCache));
- setDefaultAlwaysRefresh(this.defaultAlwaysRefresh(javaCaching));
- setSpecifiedAlwaysRefresh_(this.getResourceAlwaysRefresh(resourceCache));
- setDefaultRefreshOnlyIfNewer(this.defaultRefreshOnlyIfNewer(javaCaching));
- setSpecifiedRefreshOnlyIfNewer_(this.getResourceRefreshOnlyIfNewer(resourceCache));
- setDefaultDisableHits(this.defaultDisableHits(javaCaching));
- setSpecifiedDisableHits_(this.getResourceDisableHits(resourceCache));
- setDefaultType(this.defaultType(javaCaching));
- setSpecifiedType_(this.getResourceType(resourceCache));
- setDefaultCoordinationType(this.defaultCoordinationType(javaCaching));
- setSpecifiedCoordinationType_(this.getResourceCoordinationType(resourceCache));
- setDefaultExistenceType(this.defaultExistenceType(javaCaching));
- setSpecifiedExistenceType_(this.getResourceExistenceChecking());
- this.updateExpiry(resourceCache);
- this.cacheable.update();
- }
-
- protected void updateExpiry(XmlCache resourceCache) {
- if (resourceCache == null) {
- setExpiryTimeOfDay(null);
- setExpiry_(null);
- return;
- }
- if (resourceCache.getExpiryTimeOfDay() == null) {
- setExpiryTimeOfDay(null);
- setExpiry_(resourceCache.getExpiry());
- }
- else {
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update(resourceCache.getExpiryTimeOfDay());
- }
- else if (resourceCache.getExpiry() == null){
- setExpiryTimeOfDay(new OrmEclipseLinkExpiryTimeOfDay(this));
- this.expiryTimeOfDay.initialize(resourceCache.getExpiryTimeOfDay());
- }
- else { //handle with validation if both expiry and expiryTimeOfDay are set
- setExpiryTimeOfDay(null);
- }
- }
- }
-
- protected int defaultSize(JavaEclipseLinkCaching javaCaching) {
- return (javaCaching == null) ? DEFAULT_SIZE : javaCaching.getSize();
- }
-
- protected Integer getResourceSize(XmlCache resource) {
- return (resource == null) ? null : resource.getSize();
- }
-
- protected boolean defaultShared(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_SHARED;
- }
- return getResourceCache() == null ? javaCaching.isShared() : DEFAULT_SHARED;
- }
-
- protected Boolean getResourceShared(XmlCache resource) {
- return (resource == null) ? null : resource.getShared();
- }
-
- protected boolean defaultAlwaysRefresh(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_ALWAYS_REFRESH;
- }
- return getResourceCache() == null ? javaCaching.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH;
- }
-
- protected Boolean getResourceAlwaysRefresh(XmlCache resource) {
- return (resource == null) ? null : resource.getAlwaysRefresh();
- }
-
- protected boolean defaultRefreshOnlyIfNewer(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
- return getResourceCache() == null ? javaCaching.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
-
- protected Boolean getResourceRefreshOnlyIfNewer(XmlCache resource) {
- return (resource == null) ? null : resource.getRefreshOnlyIfNewer();
- }
-
- protected boolean defaultDisableHits(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_DISABLE_HITS;
- }
- return getResourceCache() == null ? javaCaching.isDisableHits() : DEFAULT_DISABLE_HITS;
- }
-
- protected Boolean getResourceDisableHits(XmlCache resource) {
- return (resource == null) ? null : resource.getDisableHits();
- }
-
- protected EclipseLinkCacheType defaultType(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_TYPE;
- }
- return getResourceCache() == null ? javaCaching.getType() : DEFAULT_TYPE;
- }
-
- protected EclipseLinkCacheType getResourceType(XmlCache resource) {
- return (resource == null) ? null : EclipseLinkCacheType.fromOrmResourceModel(resource.getType());
- }
-
- protected EclipseLinkCacheCoordinationType defaultCoordinationType(JavaEclipseLinkCaching javaCaching) {
- if (javaCaching == null) {
- return DEFAULT_COORDINATION_TYPE;
- }
- return getResourceCache() == null ? javaCaching.getCoordinationType() : DEFAULT_COORDINATION_TYPE;
- }
-
- protected EclipseLinkCacheCoordinationType getResourceCoordinationType(XmlCache resource) {
- return (resource == null) ? null : EclipseLinkCacheCoordinationType.fromOrmResourceModel(resource.getCoordinationType());
- }
-
- protected EclipseLinkExistenceType defaultExistenceType(JavaEclipseLinkCaching javaCaching) {
- return (javaCaching == null) ? DEFAULT_EXISTENCE_TYPE : javaCaching.getExistenceType();
- }
-
- protected EclipseLinkExistenceType getResourceExistenceChecking() {
- return (this.resource == null) ? null : EclipseLinkExistenceType.fromOrmResourceModel(this.resource.getExistenceChecking());
- }
-
- protected Integer getResourceExpiry(XmlCache resource) {
- return (resource == null) ? null : resource.getExpiry();
- }
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- XmlCache resource = getResourceCache();
- return resource == null ? null : resource.getValidationTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
deleted file mode 100644
index 5d2b5b45ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,104 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTracking;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-
-public class OrmEclipseLinkChangeTracking extends AbstractOrmXmlContextNode
- implements EclipseLinkChangeTracking
-{
- protected final XmlChangeTrackingHolder resource;
-
- protected EclipseLinkChangeTrackingType defaultType;
-
- protected EclipseLinkChangeTrackingType specifiedType;
-
-
- public OrmEclipseLinkChangeTracking(OrmTypeMapping parent, XmlChangeTrackingHolder resource, EclipseLinkChangeTracking javaChangeTracking) {
- super(parent);
- this.resource = resource;
- this.defaultType = calculateDefaultType(javaChangeTracking);
- this.specifiedType = getResourceChangeTracking();
- }
-
-
- public EclipseLinkChangeTrackingType getType() {
- return (getSpecifiedType() != null) ? getSpecifiedType() : getDefaultType();
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType_(EclipseLinkChangeTrackingType newDefaultType) {
- EclipseLinkChangeTrackingType oldDefaultType = this.defaultType;
- this.defaultType = newDefaultType;
- firePropertyChanged(DEFAULT_TYPE_PROPERTY, oldDefaultType, newDefaultType);
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType newSpecifiedType) {
- EclipseLinkChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
-
- if (newSpecifiedType == null) {
- this.resource.setChangeTracking(null);
- }
- else {
- if (this.resource.getChangeTracking() == null) {
- this.resource.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- }
- this.resource.getChangeTracking().setType(EclipseLinkChangeTrackingType.toOrmResourceModel(newSpecifiedType));
- }
-
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType newSpecifiedType) {
- EclipseLinkChangeTrackingType oldSpecifiedType = this.specifiedType;
- this.specifiedType = newSpecifiedType;
- firePropertyChanged(SPECIFIED_TYPE_PROPERTY, oldSpecifiedType, newSpecifiedType);
- }
-
-
- // **************** updating **************************************
-
- protected void update(EclipseLinkChangeTracking javaChangeTracking) {
- setDefaultType_(calculateDefaultType(javaChangeTracking));
- setSpecifiedType_(getResourceChangeTracking());
- }
-
- protected EclipseLinkChangeTrackingType calculateDefaultType(EclipseLinkChangeTracking javaChangeTracking) {
- return (javaChangeTracking != null) ? javaChangeTracking.getType() : EclipseLinkChangeTracking.DEFAULT_TYPE;
- }
-
- protected EclipseLinkChangeTrackingType getResourceChangeTracking() {
- XmlChangeTracking xmlChangeTracking = this.resource.getChangeTracking();
- return (xmlChangeTracking != null) ? EclipseLinkChangeTrackingType.fromOrmResourceModel(xmlChangeTracking.getType()) : null;
- }
-
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
deleted file mode 100644
index c71a71daa7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,127 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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 XmlConversionValue resourceConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
- public OrmEclipseLinkConversionValue(OrmEclipseLinkObjectTypeConverter parent) {
- super(parent);
- }
-
- @Override
- public OrmEclipseLinkObjectTypeConverter getParent() {
- return (OrmEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceConversionValue.getValidationTextRange();
- }
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String newDataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = newDataValue;
- this.resourceConversionValue.setDataValue(newDataValue);
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, newDataValue);
- }
-
- protected void setDataValue_(String newDataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = newDataValue;
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, newDataValue);
- }
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String newObjectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = newObjectValue;
- this.resourceConversionValue.setObjectValue(newObjectValue);
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, newObjectValue);
- }
-
- protected void setObjectValue_(String newObjectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = newObjectValue;
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, newObjectValue);
- }
-
- public void initialize(XmlConversionValue resourceConversionValue) {
- this.resourceConversionValue = resourceConversionValue;
- this.dataValue = this.getResourceDataValue();
- this.objectValue = this.getResourceObjectValue();
- }
-
- public void update(XmlConversionValue resourceConversionValue) {
- this.resourceConversionValue = resourceConversionValue;
- this.setDataValue_(this.getResourceDataValue());
- this.setObjectValue_(this.getResourceObjectValue());
- }
-
- protected String getResourceDataValue() {
- return this.resourceConversionValue.getDataValue();
- }
-
- protected String getResourceObjectValue() {
- return this.resourceConversionValue.getObjectValue();
- }
-
- public TextRange getDataValueTextRange() {
- return this.resourceConversionValue.getDataValueTextRange();
- }
-
- public TextRange getObjectValueTextRange() {
- return this.resourceConversionValue.getObjectValueTextRange();
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateDataValuesUnique(messages);
- }
-
- protected void validateDataValuesUnique(List<IMessage> messages) {
- List<String> dataValues = CollectionTools.list(getParent().dataValues());
- dataValues.remove(this.dataValue);
- if (dataValues.contains(this.dataValue)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {this.dataValue},
- this,
- this.getDataValueTextRange()
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
deleted file mode 100644
index 1a9a8c62b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
+++ /dev/null
@@ -1,274 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConvert extends AbstractOrmXmlContextNode implements EclipseLinkConvert, OrmConverter
-{
- protected String specifiedConverterName;
-
- protected XmlConvertibleMapping resourceMapping;
-
- protected OrmEclipseLinkConverter<?> converter;
-
- public OrmEclipseLinkConvert(OrmAttributeMapping parent, XmlConvertibleMapping resourceMapping) {
- super(parent);
- this.initialize(resourceMapping);
- }
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- public String getType() {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
-
- public void addToResourceModel() {
- this.resourceMapping.setConvert(""); //$NON-NLS-1$
- }
-
- public void removeFromResourceModel() {
- this.resourceMapping.setConvert(null);
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceMapping.getConvertTextRange();
- }
-
- public String getConverterName() {
- return getSpecifiedConverterName() == null ? getDefaultConverterName() : getSpecifiedConverterName();
- }
-
- public String getDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String newSpecifiedConverterName) {
- String oldSpecifiedConverterName = this.specifiedConverterName;
- this.specifiedConverterName = newSpecifiedConverterName;
- this.resourceMapping.setConvert(newSpecifiedConverterName);
- firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, oldSpecifiedConverterName, newSpecifiedConverterName);
- }
-
- protected void setSpecifiedConverterName_(String newSpecifiedConverterName) {
- String oldSpecifiedConverterName = this.specifiedConverterName;
- this.specifiedConverterName = newSpecifiedConverterName;
- firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, oldSpecifiedConverterName, newSpecifiedConverterName);
- }
-
- public OrmEclipseLinkConverter<?> getConverter() {
- return this.converter;
- }
-
- protected String getConverterType() {
- if (this.converter == null) {
- return EclipseLinkConverter.NO_CONVERTER;
- }
- return this.converter.getType();
- }
-
- public void setConverter(String converterType) {
- if (getConverterType() == converterType) {
- return;
- }
- OrmEclipseLinkConverter<?> oldConverter = this.converter;
- if (oldConverter != null) {
- this.converter = null; //set to null now to avoid update triggering events
- removeConverter(oldConverter.getType());
- }
- JpaEObject resourceConverter = buildResourceConverter(converterType);
- OrmEclipseLinkConverter<?> newConverter = buildConverter(converterType, resourceConverter);
- this.converter = newConverter;
- if (newConverter != null) {
- addConverter(converterType, resourceConverter);
- }
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- //TODO yes, i know, many if/else type checks in the methods below.
- //will look at factoring this out when I have time after M3! Also EclipseLinkJavaConvert
- protected void removeConverter(String converterType) {
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- this.resourceMapping.setConverter(null);
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- this.resourceMapping.setTypeConverter(null);
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- this.resourceMapping.setObjectTypeConverter(null);
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- this.resourceMapping.setStructConverter(null);
- }
- }
-
- protected JpaEObject buildResourceConverter(String converterType) {
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- }
- return null;
- }
-
- protected void addConverter(String converterType, JpaEObject resourceConverter) {
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- this.resourceMapping.setConverter((XmlConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- this.resourceMapping.setTypeConverter((XmlTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- this.resourceMapping.setObjectTypeConverter((XmlObjectTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- this.resourceMapping.setStructConverter((XmlStructConverter) resourceConverter);
- }
- }
-
- protected OrmEclipseLinkConverter<?> buildConverter(String converterType, JpaEObject resourceConverter) {
- if (converterType == EclipseLinkConverter.NO_CONVERTER) {
- return null;
- }
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return buildCustomConverter((XmlConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- return buildTypeConverter((XmlTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return buildObjectTypeConverter((XmlObjectTypeConverter) resourceConverter);
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- return buildStructConverter((XmlStructConverter) resourceConverter);
- }
- return null;
- }
-
- protected void setConverter(OrmEclipseLinkConverter<?> newConverter) {
- OrmEclipseLinkConverter<?> oldConverter = this.converter;
- this.converter = newConverter;
- firePropertyChanged(CONVERTER_PROPERTY, oldConverter, newConverter);
- }
-
- protected void initialize(XmlConvertibleMapping resourceMapping) {
- this.resourceMapping = resourceMapping;
- this.specifiedConverterName = this.getResourceConvert();
- this.converter = this.buildConverter();
- }
-
- public void update() {
- this.setSpecifiedConverterName_(this.getResourceConvert());
- if (getResourceConverterType() == getConverterType()) {
- this.converter.update();
- }
- else {
- setConverter(buildConverter());
- }
- }
-
- protected String getResourceConvert() {
- return this.resourceMapping == null ? null : this.resourceMapping.getConvert();
- }
-
- protected String getResourceConverterType() {
- if (this.resourceMapping.getConverter() != null) {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
- else if (this.resourceMapping.getTypeConverter() != null) {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
- else if (this.resourceMapping.getObjectTypeConverter() != null) {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
- else if (this.resourceMapping.getStructConverter() != null) {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
- return null;
- }
- protected OrmEclipseLinkConverter<?> buildConverter() {
- if (this.resourceMapping.getConverter() != null) {
- return buildCustomConverter(this.resourceMapping.getConverter());
- }
- else if (this.resourceMapping.getTypeConverter() != null) {
- return buildTypeConverter(this.resourceMapping.getTypeConverter());
- }
- else if (this.resourceMapping.getObjectTypeConverter() != null) {
- return buildObjectTypeConverter(this.resourceMapping.getObjectTypeConverter());
- }
- else if (this.resourceMapping.getStructConverter() != null) {
- return buildStructConverter(this.resourceMapping.getStructConverter());
- }
-
- return null;
- }
-
- protected OrmEclipseLinkCustomConverter buildCustomConverter(XmlConverter resourceConverter) {
- OrmEclipseLinkCustomConverter contextConverter = new OrmEclipseLinkCustomConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkTypeConverter buildTypeConverter(XmlTypeConverter resourceConverter) {
- OrmEclipseLinkTypeConverter contextConverter = new OrmEclipseLinkTypeConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkObjectTypeConverter buildObjectTypeConverter(XmlObjectTypeConverter resourceConverter) {
- OrmEclipseLinkObjectTypeConverter contextConverter = new OrmEclipseLinkObjectTypeConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkStructConverter buildStructConverter(XmlStructConverter resourceConverter) {
- OrmEclipseLinkStructConverter contextConverter = new OrmEclipseLinkStructConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (getConverter() != null) {
- getConverter().validate(messages, reporter);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java
deleted file mode 100644
index b02945f566..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public abstract class OrmEclipseLinkConverter<T extends XmlNamedConverter>
- extends AbstractOrmXmlContextNode implements EclipseLinkConverter
-{
- protected T resourceConverter;
-
- protected String name;
-
-
- protected OrmEclipseLinkConverter(XmlContextNode parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- protected T getXmlResource() {
- return this.resourceConverter;
- }
-
- public char getEnclosingTypeSeparator() {
- return '$';
- }
-
- // **************** name ***************************************************
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- this.resourceConverter.setName(newName);
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- protected void setName_(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
-
- // **************** resource interaction ***********************************
-
- protected void initialize(T resource) {
- this.resourceConverter = resource;
- this.name = getResourceName();
- }
-
- public void update() {
- this.setName_(getResourceName());
- getPersistenceUnit().addConverter(this);
- }
-
- protected String getResourceName() {
- return this.resourceConverter.getName();
- }
-
-
- // **************** validation *********************************************
-
- public boolean overrides(EclipseLinkConverter converter) {
- if (getName() == null) {
- return false;
- }
- // this isn't ideal, but it will have to do until we have further adopter input
- return this.getName().equals(converter.getName()) && converter instanceof JavaEclipseLinkConverter;
- }
-
- public boolean duplicates(EclipseLinkConverter converter) {
- return (this != converter)
- && ! StringTools.stringIsEmpty(this.name)
- && this.name.equals(converter.getName())
- && ! this.overrides(converter)
- && ! converter.overrides(this);
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceConverter.getValidationTextRange();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterHolder.java
deleted file mode 100644
index d071f3011f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterHolder.java
+++ /dev/null
@@ -1,452 +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.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConverterHolder extends AbstractOrmXmlContextNode implements EclipseLinkConverterHolder
-{
- private final XmlConvertersHolder resourceConvertersHolder;
-
- protected final List<OrmEclipseLinkCustomConverter> customConverters;
- protected final List<OrmEclipseLinkObjectTypeConverter> objectTypeConverters;
- protected final List<OrmEclipseLinkStructConverter> structConverters;
- protected final List<OrmEclipseLinkTypeConverter> typeConverters;
-
- public OrmEclipseLinkConverterHolder(XmlContextNode parent, XmlConvertersHolder resourceConvertersHolder) {
- super(parent);
- this.resourceConvertersHolder = resourceConvertersHolder;
- this.customConverters = new ArrayList<OrmEclipseLinkCustomConverter>();
- this.objectTypeConverters = new ArrayList<OrmEclipseLinkObjectTypeConverter>();
- this.structConverters = new ArrayList<OrmEclipseLinkStructConverter>();
- this.typeConverters = new ArrayList<OrmEclipseLinkTypeConverter>();
- this.initializeCustomConverters();
- this.initializeObjectTypeConverters();
- this.initializeStructConverters();
- this.initializeTypeConverters();
- }
-
- public ListIterator<OrmEclipseLinkCustomConverter> customConverters() {
- return this.customConverters.listIterator();
- }
-
- public int customConvertersSize() {
- return this.customConverters.size();
- }
-
- public EclipseLinkCustomConverter addCustomConverter(int index) {
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- OrmEclipseLinkCustomConverter contextConverter = this.buildCustomConverter(resourceConverter);
- this.customConverters.add(index, contextConverter);
- this.resourceConvertersHolder.getConverters().add(index, resourceConverter);
- this.fireItemAdded(CUSTOM_CONVERTERS_LIST, index, contextConverter);
- return contextConverter;
- }
-
- protected void addCustomConverter(int index, OrmEclipseLinkCustomConverter converter) {
- addItemToList(index, converter, this.customConverters, CUSTOM_CONVERTERS_LIST);
- }
-
- protected void addCustomConverter(OrmEclipseLinkCustomConverter converter) {
- this.addCustomConverter(this.customConverters.size(), converter);
- }
-
- public void removeCustomConverter(int index) {
- OrmEclipseLinkCustomConverter removedConverter = this.customConverters.remove(index);
- this.resourceConvertersHolder.getConverters().remove(index);
- fireItemRemoved(CUSTOM_CONVERTERS_LIST, index, removedConverter);
- }
-
- public void removeCustomConverter(EclipseLinkCustomConverter converter) {
- this.removeCustomConverter(this.customConverters.indexOf(converter));
- }
-
- protected void removeConverter_(EclipseLinkCustomConverter converter) {
- removeItemFromList(converter, this.customConverters, CUSTOM_CONVERTERS_LIST);
- }
-
- public void moveCustomConverter(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.customConverters, targetIndex, sourceIndex);
- this.resourceConvertersHolder.getConverters().move(targetIndex, sourceIndex);
- fireItemMoved(CUSTOM_CONVERTERS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveCustomConverter_(int index, OrmEclipseLinkCustomConverter converter) {
- moveItemInList(index, this.customConverters.indexOf(converter), this.customConverters, CUSTOM_CONVERTERS_LIST);
- }
-
- public ListIterator<OrmEclipseLinkObjectTypeConverter> objectTypeConverters() {
- return this.objectTypeConverters.listIterator();
- }
-
- public int objectTypeConvertersSize() {
- return this.objectTypeConverters.size();
- }
-
- public EclipseLinkObjectTypeConverter addObjectTypeConverter(int index) {
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- OrmEclipseLinkObjectTypeConverter contextObjectTypeConverter = this.buildObjectTypeConverter(resourceObjectTypeConverter);
- this.objectTypeConverters.add(index, contextObjectTypeConverter);
- this.resourceConvertersHolder.getObjectTypeConverters().add(index, resourceObjectTypeConverter);
- this.fireItemAdded(OBJECT_TYPE_CONVERTERS_LIST, index, contextObjectTypeConverter);
- return contextObjectTypeConverter;
- }
-
- protected void addObjectTypeConverter(int index, OrmEclipseLinkObjectTypeConverter converter) {
- addItemToList(index, converter, this.objectTypeConverters, OBJECT_TYPE_CONVERTERS_LIST);
- }
-
- protected void addObjectTypeConverter(OrmEclipseLinkObjectTypeConverter converter) {
- this.addObjectTypeConverter(this.objectTypeConverters.size(), converter);
- }
-
- public void removeObjectTypeConverter(int index) {
- OrmEclipseLinkObjectTypeConverter removedObjectTypeConverter = this.objectTypeConverters.remove(index);
- this.resourceConvertersHolder.getObjectTypeConverters().remove(index);
- fireItemRemoved(OBJECT_TYPE_CONVERTERS_LIST, index, removedObjectTypeConverter);
- }
-
- public void removeObjectTypeConverter(EclipseLinkObjectTypeConverter converter) {
- this.removeObjectTypeConverter(this.objectTypeConverters.indexOf(converter));
- }
-
- protected void removeObjectTypeConverter_(EclipseLinkObjectTypeConverter converter) {
- removeItemFromList(converter, this.objectTypeConverters, OBJECT_TYPE_CONVERTERS_LIST);
- }
-
- public void moveObjectTypeConverter(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.objectTypeConverters, targetIndex, sourceIndex);
- this.resourceConvertersHolder.getObjectTypeConverters().move(targetIndex, sourceIndex);
- fireItemMoved(OBJECT_TYPE_CONVERTERS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveObjectTypeConverter_(int index, OrmEclipseLinkObjectTypeConverter converter) {
- moveItemInList(index, this.objectTypeConverters.indexOf(converter), this.objectTypeConverters, OBJECT_TYPE_CONVERTERS_LIST);
- }
-
- public ListIterator<OrmEclipseLinkStructConverter> structConverters() {
- return this.structConverters.listIterator();
- }
-
- public int structConvertersSize() {
- return this.structConverters.size();
- }
-
- public EclipseLinkStructConverter addStructConverter(int index) {
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- OrmEclipseLinkStructConverter contextStructConverter = this.buildStructConverter(resourceStructConverter);
- this.structConverters.add(index, contextStructConverter);
- this.resourceConvertersHolder.getStructConverters().add(index, resourceStructConverter);
- this.fireItemAdded(STRUCT_CONVERTERS_LIST, index, contextStructConverter);
- return contextStructConverter;
- }
-
- protected void addStructConverter(int index, OrmEclipseLinkStructConverter converter) {
- addItemToList(index, converter, this.structConverters, STRUCT_CONVERTERS_LIST);
- }
-
- protected void addStructConverter(OrmEclipseLinkStructConverter converter) {
- this.addStructConverter(this.structConverters.size(), converter);
- }
-
- public void removeStructConverter(int index) {
- OrmEclipseLinkStructConverter removedStructConverter = this.structConverters.remove(index);
- this.resourceConvertersHolder.getStructConverters().remove(index);
- fireItemRemoved(STRUCT_CONVERTERS_LIST, index, removedStructConverter);
- }
-
- public void removeStructConverter(EclipseLinkStructConverter converter) {
- this.removeStructConverter(this.structConverters.indexOf(converter));
- }
-
- protected void removeStructConverter_(EclipseLinkStructConverter converter) {
- removeItemFromList(converter, this.structConverters, STRUCT_CONVERTERS_LIST);
- }
-
- public void moveStructConverter(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.structConverters, targetIndex, sourceIndex);
- this.resourceConvertersHolder.getStructConverters().move(targetIndex, sourceIndex);
- fireItemMoved(STRUCT_CONVERTERS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveStructConverter_(int index, OrmEclipseLinkStructConverter converter) {
- moveItemInList(index, this.structConverters.indexOf(converter), this.structConverters, STRUCT_CONVERTERS_LIST);
- }
-
-
- public ListIterator<OrmEclipseLinkTypeConverter> typeConverters() {
- return this.typeConverters.listIterator();
- }
-
- public int typeConvertersSize() {
- return this.typeConverters.size();
- }
-
- public EclipseLinkTypeConverter addTypeConverter(int index) {
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- OrmEclipseLinkTypeConverter contextTypeConverter = this.buildTypeConverter(resourceTypeConverter);
- this.typeConverters.add(index, contextTypeConverter);
- this.resourceConvertersHolder.getTypeConverters().add(index, resourceTypeConverter);
- this.fireItemAdded(TYPE_CONVERTERS_LIST, index, contextTypeConverter);
- return contextTypeConverter;
- }
-
- protected void addTypeConverter(int index, OrmEclipseLinkTypeConverter converter) {
- addItemToList(index, converter, this.typeConverters, TYPE_CONVERTERS_LIST);
- }
-
- protected void addTypeConverter(OrmEclipseLinkTypeConverter converter) {
- this.addTypeConverter(this.typeConverters.size(), converter);
- }
-
- public void removeTypeConverter(int index) {
- OrmEclipseLinkTypeConverter removedTypeConverter = this.typeConverters.remove(index);
- this.resourceConvertersHolder.getTypeConverters().remove(index);
- fireItemRemoved(TYPE_CONVERTERS_LIST, index, removedTypeConverter);
- }
-
- public void removeTypeConverter(EclipseLinkTypeConverter converter) {
- this.removeTypeConverter(this.typeConverters.indexOf(converter));
- }
-
- protected void removeTypeConverter_(EclipseLinkTypeConverter converter) {
- removeItemFromList(converter, this.typeConverters, TYPE_CONVERTERS_LIST);
- }
-
- public void moveTypeConverter(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.typeConverters, targetIndex, sourceIndex);
- this.resourceConvertersHolder.getTypeConverters().move(targetIndex, sourceIndex);
- fireItemMoved(TYPE_CONVERTERS_LIST, targetIndex, sourceIndex);
- }
-
- protected void moveTypeConverter_(int index, OrmEclipseLinkTypeConverter converter) {
- moveItemInList(index, this.typeConverters.indexOf(converter), this.typeConverters, TYPE_CONVERTERS_LIST);
- }
-
- protected void initializeCustomConverters() {
- for (XmlConverter resourceConverter : this.resourceConvertersHolder.getConverters()) {
- this.customConverters.add(this.buildCustomConverter(resourceConverter));
- }
- }
-
- protected void initializeObjectTypeConverters() {
- for (XmlObjectTypeConverter resourceConverter : this.resourceConvertersHolder.getObjectTypeConverters()) {
- this.objectTypeConverters.add(this.buildObjectTypeConverter(resourceConverter));
- }
- }
-
- protected void initializeStructConverters() {
- for (XmlStructConverter resourceConverter : this.resourceConvertersHolder.getStructConverters()) {
- this.structConverters.add(this.buildStructConverter(resourceConverter));
- }
- }
-
- protected void initializeTypeConverters() {
- for (XmlTypeConverter resourceConverter : this.resourceConvertersHolder.getTypeConverters()) {
- this.typeConverters.add(this.buildTypeConverter(resourceConverter));
- }
- }
-
- protected OrmEclipseLinkCustomConverter buildCustomConverter(XmlConverter resourceConverter) {
- OrmEclipseLinkCustomConverter contextConverter = new OrmEclipseLinkCustomConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkTypeConverter buildTypeConverter(XmlTypeConverter resourceConverter) {
- OrmEclipseLinkTypeConverter contextConverter = new OrmEclipseLinkTypeConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkObjectTypeConverter buildObjectTypeConverter(XmlObjectTypeConverter resourceConverter) {
- OrmEclipseLinkObjectTypeConverter contextConverter = new OrmEclipseLinkObjectTypeConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- protected OrmEclipseLinkStructConverter buildStructConverter(XmlStructConverter resourceConverter) {
- OrmEclipseLinkStructConverter contextConverter = new OrmEclipseLinkStructConverter(this);
- contextConverter.initialize(resourceConverter);
- return contextConverter;
- }
-
- public void update() {
- this.updateCustomConverters();
- this.updateObjectTypeConverters();
- this.updateStructConverters();
- this.updateTypeConverters();
- }
-
- protected void updateCustomConverters() {
- Collection<OrmEclipseLinkCustomConverter> contextConvertersToRemove = CollectionTools.collection(customConverters());
- Collection<OrmEclipseLinkCustomConverter> contextConvertersToUpdate = new ArrayList<OrmEclipseLinkCustomConverter>();
- int resourceIndex = 0;
-
- // make a copy of the XML conversion values (to prevent ConcurrentModificationException)
- List<XmlConverter> xmlConverters = this.resourceConvertersHolder.getConverters();
- for (XmlConverter resourceConverter : xmlConverters.toArray(new XmlConverter[xmlConverters.size()])) {
- boolean contextConverterFound = false;
- for (OrmEclipseLinkCustomConverter contextConverter : contextConvertersToRemove) {
- if (contextConverter.getXmlResource() == resourceConverter) {
- moveCustomConverter_(resourceIndex, contextConverter);
- contextConvertersToRemove.remove(contextConverter);
- contextConvertersToUpdate.add(contextConverter);
- contextConverterFound = true;
- break;
- }
- }
- if (!contextConverterFound) {
- addCustomConverter(this.buildCustomConverter(resourceConverter));
- }
- resourceIndex++;
- }
- for (OrmEclipseLinkCustomConverter contextConverter : contextConvertersToRemove) {
- removeConverter_(contextConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (OrmEclipseLinkCustomConverter contextConverter : contextConvertersToUpdate) {
- contextConverter.update();
- }
- }
-
- protected void updateObjectTypeConverters() {
- Collection<OrmEclipseLinkObjectTypeConverter> contextConvertersToRemove = CollectionTools.collection(objectTypeConverters());
- Collection<OrmEclipseLinkObjectTypeConverter> contextConvertersToUpdate = new ArrayList<OrmEclipseLinkObjectTypeConverter>();
- int resourceIndex = 0;
-
- // make a copy of the XML converters (to prevent ConcurrentModificationException)
- List<XmlObjectTypeConverter> xmlConverters = this.resourceConvertersHolder.getObjectTypeConverters();
- for (XmlObjectTypeConverter xmlConverter : xmlConverters.toArray(new XmlObjectTypeConverter[xmlConverters.size()])) {
- boolean contextConverterFound = false;
- for (OrmEclipseLinkObjectTypeConverter contextObjectTypeConverter : contextConvertersToRemove) {
- if (contextObjectTypeConverter.getXmlResource() == xmlConverter) {
- moveObjectTypeConverter_(resourceIndex, contextObjectTypeConverter);
- contextConvertersToRemove.remove(contextObjectTypeConverter);
- contextConvertersToUpdate.add(contextObjectTypeConverter);
- contextConverterFound = true;
- break;
- }
- }
- if (!contextConverterFound) {
- addObjectTypeConverter(this.buildObjectTypeConverter(xmlConverter));
- }
- resourceIndex++;
- }
- for (OrmEclipseLinkObjectTypeConverter contextObjectTypeConverter : contextConvertersToRemove) {
- removeObjectTypeConverter_(contextObjectTypeConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (OrmEclipseLinkObjectTypeConverter contextObjectTypeConverter : contextConvertersToUpdate) {
- contextObjectTypeConverter.update();
- }
- }
-
- protected void updateTypeConverters() {
- Collection<OrmEclipseLinkTypeConverter> contextConvertersToRemove = CollectionTools.collection(typeConverters());
- Collection<OrmEclipseLinkTypeConverter> contextConvertersToUpdate = new ArrayList<OrmEclipseLinkTypeConverter>();
- int resourceIndex = 0;
-
- List<XmlTypeConverter> xmlConverters = this.resourceConvertersHolder.getTypeConverters();
- for (XmlTypeConverter xmlConverter : xmlConverters.toArray(new XmlTypeConverter[xmlConverters.size()])) {
- boolean contextTypeConverterFound = false;
- for (OrmEclipseLinkTypeConverter contextTypeConverter : contextConvertersToRemove) {
- if (contextTypeConverter.getXmlResource() == xmlConverter) {
- moveTypeConverter_(resourceIndex, contextTypeConverter);
- contextConvertersToRemove.remove(contextTypeConverter);
- contextConvertersToUpdate.add(contextTypeConverter);
- contextTypeConverterFound = true;
- break;
- }
- }
- if (!contextTypeConverterFound) {
- addTypeConverter(this.buildTypeConverter(xmlConverter));
- }
- resourceIndex++;
- }
- for (OrmEclipseLinkTypeConverter contextTypeConverter : contextConvertersToRemove) {
- removeTypeConverter_(contextTypeConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (OrmEclipseLinkTypeConverter contextTypeConverter : contextConvertersToUpdate) {
- contextTypeConverter.update();
- }
- }
-
- protected void updateStructConverters() {
- Collection<OrmEclipseLinkStructConverter> contextConvertersToRemove = CollectionTools.collection(structConverters());
- Collection<OrmEclipseLinkStructConverter> contextConvertersToUpdate = new ArrayList<OrmEclipseLinkStructConverter>();
- int resourceIndex = 0;
-
- // make a copy of the XML converters (to prevent ConcurrentModificationException)
- List<XmlStructConverter> xmlConverters = this.resourceConvertersHolder.getStructConverters();
- for (XmlStructConverter resourceStructConverter : xmlConverters.toArray(new XmlStructConverter[xmlConverters.size()])) {
- boolean contextStructConverterFound = false;
- for (OrmEclipseLinkStructConverter contextStructConverter : contextConvertersToRemove) {
- if (contextStructConverter.getXmlResource() == resourceStructConverter) {
- moveStructConverter_(resourceIndex, contextStructConverter);
- contextConvertersToRemove.remove(contextStructConverter);
- contextConvertersToUpdate.add(contextStructConverter);
- contextStructConverterFound = true;
- break;
- }
- }
- if (!contextStructConverterFound) {
- addStructConverter(this.buildStructConverter(resourceStructConverter));
- }
- resourceIndex++;
- }
- for (OrmEclipseLinkStructConverter contextStructConverter : contextConvertersToRemove) {
- removeStructConverter_(contextStructConverter);
- }
- //first handle adding/removing of the converters, then update the others last,
- //this causes less churn in the update process
- for (OrmEclipseLinkStructConverter contextStructConverter : contextConvertersToUpdate) {
- contextStructConverter.update();
- }
- }
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- }
-
-
- public TextRange getValidationTextRange() {
- return this.resourceConvertersHolder.getValidationTextRange();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
deleted file mode 100644
index ed5772f18a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,100 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkCustomConverter extends OrmEclipseLinkConverter<XmlConverter>
- implements EclipseLinkCustomConverter
-{
- private String converterClass;
-
-
- public OrmEclipseLinkCustomConverter(XmlContextNode parent) {
- super(parent);
- }
-
-
- public String getType() {
- return EclipseLinkConverter.CUSTOM_CONVERTER;
- }
-
-
- // **************** converter class ****************************************
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- this.resourceConverter.setClassName(newConverterClass);
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(XmlConverter xmlResource) {
- super.initialize(xmlResource);
- this.converterClass = getResourceClassName();
- }
-
- @Override
- public void update() {
- super.update();
- setConverterClass_(getResourceClassName());
- }
-
- protected String getResourceClassName() {
- return this.resourceConverter.getClassName();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateConverterClass(messages);
- }
-//TODO validate converter class
- protected void validateConverterClass(List<IMessage> messages) {
-// if (!getResourceConverter().implementsConverter()) {
-// messages.add(
-// DefaultEclipseLinkJpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER,
-// new String[] {this.converterClass},
-// this,
-// getConverterClassTextRange()
-// )
-// );
-// }
- }
-
-// public TextRange getConverterClassTextRange() {
-// return getResourceConverter().getClassNameTextRange();
-// }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
deleted file mode 100644
index 401c821822..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,120 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
-
-public class OrmEclipseLinkCustomizer extends AbstractOrmXmlContextNode
- implements EclipseLinkCustomizer
-{
- protected final XmlCustomizerHolder resource;
-
- protected String specifiedCustomizerClass;
-
- protected String defaultCustomizerClass;
-
- public OrmEclipseLinkCustomizer(OrmTypeMapping parent, XmlCustomizerHolder resource, JavaEclipseLinkCustomizer javaCustomizer) {
- super(parent);
- this.resource = resource;
- this.defaultCustomizerClass = getJavaCustomizerClass(javaCustomizer);
- this.specifiedCustomizerClass = getResourceCustomizerClass();
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '$';
- }
-
- public String getCustomizerClass() {
- return this.specifiedCustomizerClass == null ? this.defaultCustomizerClass : this.specifiedCustomizerClass;
- }
-
- public String getDefaultCustomizerClass() {
- return this.defaultCustomizerClass;
- }
-
- protected void setDefaultCustomizerClass(String newDefaultCustomizerClass) {
- String oldDefaultCustomizerClass = this.defaultCustomizerClass;
- this.defaultCustomizerClass = newDefaultCustomizerClass;
- firePropertyChanged(DEFAULT_CUSTOMIZER_CLASS_PROPERTY, oldDefaultCustomizerClass, newDefaultCustomizerClass);
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.specifiedCustomizerClass;
- }
-
- public void setSpecifiedCustomizerClass(String newCustomizerClass) {
- String oldCustomizerClass = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = newCustomizerClass;
- if (oldCustomizerClass != newCustomizerClass) {
- if (this.getResourceCustomizer() != null) {
- this.getResourceCustomizer().setClassName(newCustomizerClass);
- if (this.getResourceCustomizer().isUnset()) {
- removeResourceCustomizer();
- }
- }
- else if (newCustomizerClass != null) {
- addResourceCustomizer();
- getResourceCustomizer().setClassName(newCustomizerClass);
- }
- }
- firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, oldCustomizerClass, newCustomizerClass);
- }
-
- protected void setSpecifiedCustomizerClass_(String newCustomizerClass) {
- String oldCustomizerClass = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = newCustomizerClass;
- firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, oldCustomizerClass, newCustomizerClass);
- }
-
- protected XmlClassReference getResourceCustomizer() {
- return this.resource.getCustomizer();
- }
-
- protected void addResourceCustomizer() {
- this.resource.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- }
-
- protected void removeResourceCustomizer() {
- this.resource.setCustomizer(null);
- }
-
-
- // **************** updating **************************************
-
- protected void update(JavaEclipseLinkCustomizer javaCustomizer) {
- setDefaultCustomizerClass(getJavaCustomizerClass(javaCustomizer));
- setSpecifiedCustomizerClass_(getResourceCustomizerClass());
- }
-
- protected String getJavaCustomizerClass(JavaEclipseLinkCustomizer javaCustomizer) {
- return (javaCustomizer == null) ? null : javaCustomizer.getFullyQualifiedCustomizerClass();
- }
-
- protected String getResourceCustomizerClass() {
- XmlClassReference resource = getResourceCustomizer();
- return (resource == null) ? null : resource.getClassName();
- }
-
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- XmlClassReference resource = getResourceCustomizer();
- return resource == null ? null : resource.getClassNameTextRange();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index 9abd0ce78d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
+++ /dev/null
@@ -1,105 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkEmbeddableImpl
- extends AbstractOrmEmbeddable
- implements OrmEclipseLinkEmbeddable
-{
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkConverterHolder converterHolder;
-
-
- public OrmEclipseLinkEmbeddableImpl(OrmPersistentType parent, XmlEmbeddable resourceMapping) {
- super(parent, resourceMapping);
- this.customizer = new OrmEclipseLinkCustomizer(this, (XmlCustomizerHolder) this.resourceTypeMapping, getJavaCustomizer());
- this.changeTracking = new OrmEclipseLinkChangeTracking(this, (XmlChangeTrackingHolder) this.resourceTypeMapping, getJavaChangeTracking());
- this.converterHolder = new OrmEclipseLinkConverterHolder(this, (XmlConvertersHolder) this.resourceTypeMapping);
- }
-
-
- @Override
- public XmlEmbeddable getResourceTypeMapping() {
- return (XmlEmbeddable) super.getResourceTypeMapping();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public EclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.customizer.update(getJavaCustomizer());
- this.changeTracking.update(getJavaChangeTracking());
- this.converterHolder.update();
- }
-
- @Override
- protected JavaEclipseLinkEmbeddable getJavaEmbeddableForDefaults() {
- return (JavaEclipseLinkEmbeddable) super.getJavaEmbeddableForDefaults();
- }
-
-
- protected JavaEclipseLinkCustomizer getJavaCustomizer() {
- JavaEclipseLinkEmbeddable javaEmbeddable = getJavaEmbeddableForDefaults();
- return (javaEmbeddable == null) ? null : (JavaEclipseLinkCustomizer) javaEmbeddable.getCustomizer();
- }
-
- protected EclipseLinkChangeTracking getJavaChangeTracking() {
- JavaEclipseLinkEmbeddable javaEmbeddable = getJavaEmbeddableForDefaults();
- return (javaEmbeddable == null) ? null : javaEmbeddable.getChangeTracking();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
deleted file mode 100644
index 84a911a1ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,185 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmEntity;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly;
-import org.eclipse.jpt.eclipselink.core.v2_0.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkEntityImpl
- extends AbstractOrmEntity
- implements OrmEclipseLinkEntity
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterHolder converterHolder;
-
-
- public OrmEclipseLinkEntityImpl(OrmPersistentType parent, XmlEntity resourceMapping) {
- super(parent, resourceMapping);
- this.readOnly = new OrmEclipseLinkReadOnly(this, (XmlReadOnly) this.resourceTypeMapping, getJavaReadOnly());
- this.customizer = new OrmEclipseLinkCustomizer(this, (XmlCustomizerHolder) this.resourceTypeMapping, getJavaCustomizer());
- this.changeTracking = new OrmEclipseLinkChangeTracking(this, (XmlChangeTrackingHolder) this.resourceTypeMapping, getJavaChangeTracking());
- this.caching = new OrmEclipseLinkCachingImpl(this, (XmlCacheHolder) this.resourceTypeMapping, (XmlCacheable_2_0) this.resourceTypeMapping, getJavaCaching());
- this.converterHolder = new OrmEclipseLinkConverterHolder(this, (XmlConvertersHolder) this.resourceTypeMapping);
- }
-
-
- @Override
- public XmlEntity getResourceTypeMapping() {
- return (XmlEntity) super.getResourceTypeMapping();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return getResourceTypeMapping().getPrimaryKey() != null
- || usesJavaPrimaryKeyColumns();
- }
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public EclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public OrmCacheable2_0 getCacheable() {
- return ((OrmCacheableHolder2_0) getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((CacheableHolder2_0) getCaching()).calculateDefaultCacheable();
- }
-
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && !classExtractorIsUsed();
- }
-
- protected boolean classExtractorIsUsed() {
- return getResourceClassExtractor() != null || getClassExtractorAnnotation() != null;
- }
-
- protected XmlClassReference getResourceClassExtractor() {
- return getResourceTypeMapping().getClassExtractor();
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- if (getJavaEntityForDefaults() != null) {
- JavaResourcePersistentType jrpt = getJavaPersistentType().getResourcePersistentType();
- return (EclipseLinkClassExtractorAnnotation2_1) jrpt.getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
- return null;
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.readOnly.update(getJavaReadOnly());
- this.customizer.update(getJavaCustomizer());
- this.changeTracking.update(getJavaChangeTracking());
- this.caching.update(getJavaCaching());
- this.converterHolder.update();
- }
-
- @Override
- protected JavaEclipseLinkEntity getJavaEntityForDefaults() {
- return (JavaEclipseLinkEntity) super.getJavaEntityForDefaults();
- }
-
- protected EclipseLinkReadOnly getJavaReadOnly() {
- JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getReadOnly();
- }
-
- protected JavaEclipseLinkCustomizer getJavaCustomizer() {
- JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : (JavaEclipseLinkCustomizer) javaEntity.getCustomizer();
- }
-
- protected EclipseLinkChangeTracking getJavaChangeTracking() {
- JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getChangeTracking();
- }
-
- protected JavaEclipseLinkCaching getJavaCaching() {
- JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? null : javaEntity.getCaching();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkEntity javaEntity = getJavaEntityForDefaults();
- return (javaEntity == null) ? false : javaEntity.usesPrimaryKeyColumns();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.caching.validate(messages, reporter);
- }
-
- @Override
- protected PrimaryKeyValidator buildPrimaryKeyValidator() {
- return new EclipseLinkEntityPrimaryKeyValidator(this, buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkExpiryTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkExpiryTimeOfDay.java
deleted file mode 100644
index 00cf3d386c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkExpiryTimeOfDay.java
+++ /dev/null
@@ -1,137 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class OrmEclipseLinkExpiryTimeOfDay extends AbstractOrmXmlContextNode
- implements EclipseLinkExpiryTimeOfDay
-{
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
- protected XmlTimeOfDay resourceTimeOfDay;
-
- public OrmEclipseLinkExpiryTimeOfDay(OrmEclipseLinkCaching parent) {
- super(parent);
- }
-
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer newHour) {
- Integer oldHour = this.hour;
- this.hour = newHour;
- this.resourceTimeOfDay.setHour(newHour);
- firePropertyChanged(HOUR_PROPERTY, oldHour, newHour);
- }
-
- protected void setHour_(Integer newHour) {
- Integer oldHour = this.hour;
- this.hour = newHour;
- firePropertyChanged(HOUR_PROPERTY, oldHour, newHour);
- }
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- this.resourceTimeOfDay.setMinute(newMinute);
- firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- protected void setMinute_(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- this.resourceTimeOfDay.setSecond(newSecond);
- firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- protected void setSecond_(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- this.resourceTimeOfDay.setMillisecond(newMillisecond);
- firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- protected void setMillisecond_(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- public TextRange getValidationTextRange() {
- return this.resourceTimeOfDay.getValidationTextRange();
- }
-
- public void initialize(XmlTimeOfDay resource) {
- this.resourceTimeOfDay = resource;
- this.hour = getResourceHour();
- this.minute = getResourceMinute();
- this.second = getResourceSecond();
- this.millisecond = getResourceMillisecond();
- }
-
- public void update(XmlTimeOfDay resource) {
- this.resourceTimeOfDay = resource;
- this.setHour_(getResourceHour());
- this.setMinute_(getResourceMinute());
- this.setSecond_(getResourceSecond());
- this.setMillisecond_(getResourceMillisecond());
- }
-
- protected Integer getResourceHour() {
- return this.resourceTimeOfDay.getHour();
- }
-
- protected Integer getResourceMinute() {
- return this.resourceTimeOfDay.getMinute();
- }
-
- protected Integer getResourceSecond() {
- return this.resourceTimeOfDay.getSecond();
- }
-
- protected Integer getResourceMillisecond() {
- return this.resourceTimeOfDay.getMillisecond();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java
deleted file mode 100644
index 3309095a1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.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 OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkIdMapping(OrmPersistentAttribute parent, XmlId resourceMapping) {
- super(parent, resourceMapping);
- this.mutable = new OrmEclipseLinkMutable(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildConverter(String converterType) {
- OrmConverter ormConverter = super.buildConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new OrmEclipseLinkConvert(this, this.resourceAttributeMapping);
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.resourceAttributeMapping.getConvert() != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
deleted file mode 100644
index 9fc80af4cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,68 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch;
-
-public class OrmEclipseLinkJoinFetch extends AbstractOrmXmlContextNode
- implements EclipseLinkJoinFetch
-{
- protected XmlJoinFetch resource;
-
- protected EclipseLinkJoinFetchType joinFetchValue;
-
-
- public OrmEclipseLinkJoinFetch(OrmAttributeMapping parent, XmlJoinFetch resource) {
- super(parent);
- this.resource = resource;
- this.joinFetchValue = getResourceJoinFetch();
- }
-
-
- public EclipseLinkJoinFetchType getValue() {
- return this.joinFetchValue;
- }
-
- public void setValue(EclipseLinkJoinFetchType newJoinFetchValue) {
- EclipseLinkJoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- this.resource.setJoinFetch(EclipseLinkJoinFetchType.toOrmResourceModel(newJoinFetchValue));
- firePropertyChanged(VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
- protected void setValue_(EclipseLinkJoinFetchType newJoinFetchValue) {
- EclipseLinkJoinFetchType oldJoinFetchValue = this.joinFetchValue;
- this.joinFetchValue = newJoinFetchValue;
- firePropertyChanged(VALUE_PROPERTY, oldJoinFetchValue, newJoinFetchValue);
- }
-
-
- // **************** initialize/update **************************************
-
- public void update() {
- setValue_(getResourceJoinFetch());
- }
-
- protected EclipseLinkJoinFetchType getResourceJoinFetch() {
- return EclipseLinkJoinFetchType.fromOrmResourceModel(this.resource.getJoinFetch());
- }
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getJoinFetchTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java
deleted file mode 100644
index e55cd31347..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.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 OrmEclipseLinkJoinFetch joinFetch;
-
-
- public OrmEclipseLinkManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany resourceMapping) {
- super(parent, resourceMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java
deleted file mode 100644
index a0ea932317..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmManyToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-
-public class OrmEclipseLinkManyToOneMapping extends AbstractOrmEclipseLinkManyToOneMapping
-{
- public OrmEclipseLinkManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmManyToOneRelationshipReference(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index d90b9b5976..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,159 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmMappedSuperclass;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkMappedSuperclassImpl
- extends AbstractOrmMappedSuperclass
- implements OrmEclipseLinkMappedSuperclass, CacheableHolder2_0
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterHolder converterHolder;
-
-
- public OrmEclipseLinkMappedSuperclassImpl(OrmPersistentType parent, XmlMappedSuperclass resourceMapping) {
- super(parent, resourceMapping);
- this.readOnly = new OrmEclipseLinkReadOnly(this, (XmlReadOnly) this.resourceTypeMapping, getJavaReadOnly());
- this.customizer = new OrmEclipseLinkCustomizer(this, (XmlCustomizerHolder) this.resourceTypeMapping, getJavaCustomizer());
- this.changeTracking = new OrmEclipseLinkChangeTracking(this, (XmlChangeTrackingHolder) this.resourceTypeMapping, getJavaChangeTracking());
- this.caching = new OrmEclipseLinkCachingImpl(this, (XmlCacheHolder) this.resourceTypeMapping, (XmlCacheable_2_0) this.resourceTypeMapping, getJavaCaching());
- this.converterHolder = new OrmEclipseLinkConverterHolder(this, (XmlConvertersHolder) this.resourceTypeMapping);
- }
-
-
- @Override
- public XmlMappedSuperclass getResourceTypeMapping() {
- return (XmlMappedSuperclass) super.getResourceTypeMapping();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return getResourceTypeMapping().getPrimaryKey() != null
- || usesJavaPrimaryKeyColumns();
- }
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- public EclipseLinkConverterHolder getConverterHolder() {
- return this.converterHolder;
- }
-
- public Cacheable2_0 getCacheable() {
- return ((CacheableHolder2_0) getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((CacheableHolder2_0) getCaching()).calculateDefaultCacheable();
- }
-
- // **************** resource-context interaction ***************************
-
- @Override
- public void update() {
- super.update();
- this.readOnly.update(getJavaReadOnly());
- this.customizer.update(getJavaCustomizer());
- this.changeTracking.update(getJavaChangeTracking());
- this.caching.update(getJavaCaching());
- this.converterHolder.update();
- }
-
- @Override
- protected JavaEclipseLinkMappedSuperclass getJavaMappedSuperclassForDefaults() {
- return (JavaEclipseLinkMappedSuperclass) super.getJavaMappedSuperclassForDefaults();
- }
-
- protected EclipseLinkReadOnly getJavaReadOnly() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getReadOnly();
- }
-
- protected JavaEclipseLinkCustomizer getJavaCustomizer() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : (JavaEclipseLinkCustomizer) javaMappedSuperclass.getCustomizer();
- }
-
- protected EclipseLinkChangeTracking getJavaChangeTracking() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getChangeTracking();
- }
-
- protected JavaEclipseLinkCaching getJavaCaching() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getCaching();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = getJavaMappedSuperclassForDefaults();
- return (javaMappedSuperclass == null) ? false : javaMappedSuperclass.usesPrimaryKeyColumns();
- }
-
-
- // **************** validation **************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.caching.validate(messages, reporter);
- }
-
- @Override
- protected PrimaryKeyValidator buildPrimaryKeyValidator() {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java
deleted file mode 100644
index 3689979525..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable;
-
-public class OrmEclipseLinkMutable extends AbstractOrmXmlContextNode
- implements EclipseLinkMutable
-{
- protected final XmlMutable resource;
-
- protected boolean defaultMutable;
-
- protected Boolean specifiedMutable;
-
-
- public OrmEclipseLinkMutable(OrmAttributeMapping parent, XmlMutable resource) {
- super(parent);
- this.resource = resource;
- this.defaultMutable = this.calculateDefaultMutable();
- this.specifiedMutable = this.getResourceMutable();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return (OrmAttributeMapping) getParent();
- }
-
- public boolean isMutable() {
- return (this.specifiedMutable != null) ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean newDefaultMutable) {
- boolean oldDefaultMutable = this.defaultMutable;
- this.defaultMutable = newDefaultMutable;
- firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, oldDefaultMutable, newDefaultMutable);
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean newSpecifiedMutable) {
- Boolean oldSpecifiedMutable = this.specifiedMutable;
- this.specifiedMutable = newSpecifiedMutable;
- this.resource.setMutable(newSpecifiedMutable);
- firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, oldSpecifiedMutable, newSpecifiedMutable);
- }
-
- protected void setSpecifiedMutable_(Boolean newSpecifiedMutable) {
- Boolean oldSpecifiedMutable = this.specifiedMutable;
- this.specifiedMutable = newSpecifiedMutable;
- firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, oldSpecifiedMutable, newSpecifiedMutable);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void update() {
- setDefaultMutable(this.calculateDefaultMutable());
- setSpecifiedMutable_(this.getResourceMutable());
- }
-
- protected Boolean getResourceMutable() {
- return this.resource.getMutable();
- }
-
- protected boolean calculateDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute().getJavaPersistentAttribute();
- if (javaAttribute == null) {
- return false;
- }
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean persistenceUnitDefaultMutable = getPersistenceUnit().getOptions().getTemporalMutable();
- return persistenceUnitDefaultMutable == null ? false : persistenceUnitDefaultMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getMutableTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index f0ecdf9341..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,245 +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.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-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;
-
- private final List<OrmEclipseLinkConversionValue> conversionValues;
-
- private String defaultObjectValue;
-
-
- public OrmEclipseLinkObjectTypeConverter(XmlContextNode parent) {
- super(parent);
- this.conversionValues = new ArrayList<OrmEclipseLinkConversionValue>();
- }
-
- public String getType() {
- return EclipseLinkConverter.OBJECT_TYPE_CONVERTER;
- }
-
- // **************** data type **********************************************
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- getXmlResource().setDataType(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- protected void setDataType_(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
-
- // **************** object type ********************************************
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- getXmlResource().setObjectType(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- protected void setObjectType_(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
-
- // **************** conversion values **************************************
-
- public ListIterator<OrmEclipseLinkConversionValue> conversionValues() {
- return new CloneListIterator<OrmEclipseLinkConversionValue>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public OrmEclipseLinkConversionValue addConversionValue(int index) {
- XmlConversionValue resourceConversionValue = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- OrmEclipseLinkConversionValue contextConversionValue = buildConversionValue(resourceConversionValue);
- this.conversionValues.add(index, contextConversionValue);
- getXmlResource().getConversionValues().add(index, resourceConversionValue);
- fireItemAdded(CONVERSION_VALUES_LIST, index, contextConversionValue);
- return contextConversionValue;
- }
-
- public OrmEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.conversionValues.size());
- }
-
- protected void addConversionValue(int index, OrmEclipseLinkConversionValue conversionValue) {
- addItemToList(index, conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- protected void addConversionValue(OrmEclipseLinkConversionValue conversionValue) {
- this.addConversionValue(this.conversionValues.size(), conversionValue);
- }
-
- public void removeConversionValue(int index) {
- OrmEclipseLinkConversionValue removedJoinColumn = this.conversionValues.remove(index);
- getXmlResource().getConversionValues().remove(index);
- fireItemRemoved(CONVERSION_VALUES_LIST, index, removedJoinColumn);
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValues.indexOf(conversionValue));
- }
-
- protected void removeConversionValue_(EclipseLinkConversionValue conversionValue) {
- removeItemFromList(conversionValue, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- CollectionTools.move(this.conversionValues, targetIndex, sourceIndex);
- getXmlResource().getConversionValues().move(targetIndex, sourceIndex);
- fireItemMoved(CONVERSION_VALUES_LIST, targetIndex, sourceIndex);
- }
-
- public ListIterator<String> dataValues() {
- return new TransformationListIterator<OrmEclipseLinkConversionValue, String>(conversionValues()) {
- @Override
- protected String transform(OrmEclipseLinkConversionValue next) {
- return next.getDataValue();
- }
- };
- }
-
-
- // **************** default object value ***********************************
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String newDefaultObjectValue) {
- String oldDefaultObjectValue = this.defaultObjectValue;
- this.defaultObjectValue = newDefaultObjectValue;
- getXmlResource().setDefaultObjectValue(newDefaultObjectValue);
- firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, oldDefaultObjectValue, newDefaultObjectValue);
- }
-
- protected void setDefaultObjectValue_(String newDefaultObjectValue) {
- String oldDefaultObjectValue = this.defaultObjectValue;
- this.defaultObjectValue = newDefaultObjectValue;
- firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, oldDefaultObjectValue, newDefaultObjectValue);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(XmlObjectTypeConverter xmlResource) {
- super.initialize(xmlResource);
- this.dataType = this.getResourceDataType();
- this.objectType = this.getResourceObjectType();
- this.defaultObjectValue = this.getResourceDefaultObjectValue();
- this.initializeConversionValues();
- }
-
- protected void initializeConversionValues() {
- for (XmlConversionValue resourceConversionValue : getXmlResource().getConversionValues()) {
- this.conversionValues.add(buildConversionValue(resourceConversionValue));
- }
- }
-
- @Override
- public void update() {
- super.update();
- setDataType_(getResourceDataType());
- setObjectType_(getResourceObjectType());
- setDefaultObjectValue_(getResourceDefaultObjectValue());
- updateConversionValues();
- }
-
- protected void updateConversionValues( ) {
- // make a copy of the XML conversion values (to prevent ConcurrentModificationException)
- Iterator<XmlConversionValue> xmlConversionValues = new CloneIterator<XmlConversionValue>(this.getXmlResource().getConversionValues());
-
- for (Iterator<OrmEclipseLinkConversionValue> contextConversionValues = this.conversionValues(); contextConversionValues.hasNext(); ) {
- OrmEclipseLinkConversionValue contextConversionValue = contextConversionValues.next();
- if (xmlConversionValues.hasNext()) {
- contextConversionValue.update(xmlConversionValues.next());
- }
- else {
- removeConversionValue_(contextConversionValue);
- }
- }
-
- while (xmlConversionValues.hasNext()) {
- addConversionValue(buildConversionValue(xmlConversionValues.next()));
- }
- }
-
- protected OrmEclipseLinkConversionValue buildConversionValue(XmlConversionValue resourceConversionValue) {
- OrmEclipseLinkConversionValue conversionValue = new OrmEclipseLinkConversionValue(this);
- conversionValue.initialize(resourceConversionValue);
- return conversionValue;
- }
-
- protected String getResourceDataType() {
- return this.resourceConverter.getDataType();
- }
-
- protected String getResourceObjectType() {
- return this.resourceConverter.getObjectType();
- }
-
- protected String getResourceDefaultObjectValue() {
- return this.resourceConverter.getDefaultObjectValue();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- for (Iterator<OrmEclipseLinkConversionValue> stream = conversionValues(); stream.hasNext();) {
- stream.next().validate(messages, reporter);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 627e9993bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyMapping2_0;
-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 OrmEclipseLinkPrivateOwned privateOwned;
-
- protected OrmEclipseLinkJoinFetch joinFetch;
-
-
- public OrmEclipseLinkOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany resourceMapping) {
- super(parent, resourceMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this, this.resourceAttributeMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this, this.resourceAttributeMapping);
- }
-
-
- @Override
- protected OrmRelationshipReference buildRelationshipReference() {
- return new OrmEclipseLinkOneToManyRelationshipReference(this, this.resourceAttributeMapping);
- }
-
- @Override
- public OrmEclipseLinkOneToManyRelationshipReference getRelationshipReference() {
- return (OrmEclipseLinkOneToManyRelationshipReference) super.getRelationshipReference();
- }
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // **************** resource -> context ************************************
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // **************** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyRelationshipReference.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyRelationshipReference.java
deleted file mode 100644
index 2d3782c727..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyRelationshipReference.java
+++ /dev/null
@@ -1,87 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnEnabledRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumnJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmJoiningStrategy;
-import org.eclipse.jpt.core.context.orm.OrmRelationshipReference;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmOneToManyRelationshipReference;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkOneToManyRelationshipReference2_0;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-public class OrmEclipseLinkOneToManyRelationshipReference
- extends AbstractOrmOneToManyRelationshipReference
- implements EclipseLinkOneToManyRelationshipReference2_0
-{
-
- public OrmEclipseLinkOneToManyRelationshipReference(
- OrmEclipseLinkOneToManyMapping parent, XmlOneToMany resource) {
- super(parent, resource);
- }
-
- @Override
- protected OrmJoinColumnJoiningStrategy buildJoinColumnJoiningStrategy() {
- return new GenericOrmTargetForiegnKeyJoinColumnJoiningStrategy(this, getResourceMapping());
- }
-
- @Override
- public void initializeOn(OrmRelationshipReference newRelationshipReference) {
- super.initializeOn(newRelationshipReference);
- newRelationshipReference.initializeFromJoinColumnEnabledRelationshipReference(this);
- }
-
- @Override
- public void initializeFromJoinColumnEnabledRelationshipReference(
- OrmJoinColumnEnabledRelationshipReference oldRelationshipReference) {
- super.initializeFromJoinColumnEnabledRelationshipReference(oldRelationshipReference);
- int index = 0;
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- oldRelationshipReference.getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- OrmJoinColumn newJoinColumn = this.joinColumnJoiningStrategy.addSpecifiedJoinColumn(index++);
- newJoinColumn.initializeFrom(joinColumn);
- }
- }
-
- @Override
- public XmlOneToMany getResourceMapping() {
- return (XmlOneToMany) super.getResourceMapping();
- }
-
- @Override
- protected OrmJoiningStrategy calculatePredominantJoiningStrategy() {
- if (this.mappedByJoiningStrategy.getMappedByAttribute() != null) {
- return this.mappedByJoiningStrategy;
- }
- else if (this.joinColumnJoiningStrategy.hasSpecifiedJoinColumns()) {
- return this.joinColumnJoiningStrategy;
- }
- else {
- return this.joinTableJoiningStrategy;
- }
- }
-
-
- // **************** mapped by **********************************************
-
- @Override
- public boolean mayBeMappedBy(AttributeMapping mappedByMapping) {
- return super.mayBeMappedBy(mappedByMapping) ||
- mappedByMapping.getKey() == MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java
deleted file mode 100644
index ec6a31467e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.GenericOrmOneToOneRelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-
-public class OrmEclipseLinkOneToOneMapping extends AbstractOrmEclipseLinkOneToOneMapping
-{
-
- public OrmEclipseLinkOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmOneToOneRelationshipReference(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
deleted file mode 100644
index bf776d3ed2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,38 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmPersistentAttribute;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-
-
-public class OrmEclipseLinkPersistentAttribute extends AbstractOrmPersistentAttribute
-{
-
- public OrmEclipseLinkPersistentAttribute(OrmPersistentType parent, Owner owner, XmlAttributeMapping resourceMapping) {
- super(parent, owner, resourceMapping);
- }
-
- //****************** AccessHolder implementation *******************
-
- /**
- * EclipseLinkOrmPersistentAttribute does not support specified access (no access element in 1.0), so we return null
- */
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- throw new UnsupportedOperationException("specifiedAccess is not supported for OrmEclipseLinkPersistentAttribute"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
deleted file mode 100644
index 882f7be169..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,67 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned;
-
-public class OrmEclipseLinkPrivateOwned extends AbstractOrmXmlContextNode
- implements EclipseLinkPrivateOwned
-{
- protected final XmlPrivateOwned resource;
-
- protected boolean privateOwned;
-
-
- public OrmEclipseLinkPrivateOwned(OrmAttributeMapping parent, XmlPrivateOwned resource) {
- super(parent);
- this.resource = resource;
- this.privateOwned = this.getResourcePrivateOwned();
- }
-
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean newPrivateOwned) {
- boolean oldPrivateOwned = this.privateOwned;
- this.privateOwned = newPrivateOwned;
- this.resource.setPrivateOwned(newPrivateOwned);
- firePropertyChanged(PRIVATE_OWNED_PROPERTY, oldPrivateOwned, newPrivateOwned);
- }
-
- protected void setPrivateOwned_(boolean newPrivateOwned) {
- boolean oldPrivateOwned = this.privateOwned;
- this.privateOwned = newPrivateOwned;
- firePropertyChanged(PRIVATE_OWNED_PROPERTY, oldPrivateOwned, newPrivateOwned);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void update() {
- setPrivateOwned_(this.getResourcePrivateOwned());
- }
-
- protected boolean getResourcePrivateOwned() {
- return this.resource.isPrivateOwned();
- }
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getPrivateOwnedTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
deleted file mode 100644
index 6469cb3c1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,83 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly;
-
-public class OrmEclipseLinkReadOnly extends AbstractOrmXmlContextNode
- implements EclipseLinkReadOnly
-{
- protected final XmlReadOnly resource;
-
- protected boolean defaultReadOnly;
-
- protected Boolean specifiedReadOnly;
-
-
- public OrmEclipseLinkReadOnly(OrmTypeMapping parent, XmlReadOnly resource, EclipseLinkReadOnly javaReadOnly) {
- super(parent);
- this.resource = resource;
- this.defaultReadOnly = this.getJavaReadOnly(javaReadOnly);
- this.specifiedReadOnly = this.getResourceReadOnly();
- }
-
-
- public boolean isReadOnly() {
- return (this.specifiedReadOnly == null) ? this.defaultReadOnly : this.specifiedReadOnly.booleanValue();
- }
-
- public boolean isDefaultReadOnly() {
- return this.defaultReadOnly;
- }
-
- public void setDefaultReadOnly(boolean newValue) {
- boolean oldValue = this.defaultReadOnly;
- this.defaultReadOnly = newValue;
- firePropertyChanged(DEFAULT_READ_ONLY_PROPERTY, oldValue, newValue);
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean newSpecifiedReadOnly) {
- Boolean oldSpecifiedReadOnly = this.specifiedReadOnly;
- this.specifiedReadOnly = newSpecifiedReadOnly;
- this.resource.setReadOnly(newSpecifiedReadOnly);
- firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, oldSpecifiedReadOnly, newSpecifiedReadOnly);
- }
-
-
- // **************** initialize/update **************************************
-
- protected void update(EclipseLinkReadOnly javaReadOnly) {
- setDefaultReadOnly(this.getJavaReadOnly(javaReadOnly));
- setSpecifiedReadOnly(this.getResourceReadOnly());
- }
-
- protected boolean getJavaReadOnly(EclipseLinkReadOnly javaReadOnly) {
- return (javaReadOnly == null) ? false : javaReadOnly.isReadOnly();
- }
-
- protected Boolean getResourceReadOnly() {
- return this.resource.getReadOnly();
- }
-
- // **************** validation **************************************
-
- public TextRange getValidationTextRange() {
- return this.resource.getReadOnlyTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
deleted file mode 100644
index 24f4b1f5ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,100 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkStructConverter extends OrmEclipseLinkConverter<XmlStructConverter>
- implements EclipseLinkStructConverter
-{
- private String converterClass;
-
-
- public OrmEclipseLinkStructConverter(XmlContextNode parent) {
- super(parent);
- }
-
- public String getType() {
- return EclipseLinkConverter.STRUCT_CONVERTER;
- }
-
-
- // **************** converter class ****************************************
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- getXmlResource().setConverter(newConverterClass);
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(XmlStructConverter xmlResource) {
- super.initialize(xmlResource);
- this.converterClass = getResourceConverterClass();
- }
-
- @Override
- public void update() {
- super.update();
- setConverterClass_(getResourceConverterClass());
- }
-
- protected String getResourceConverterClass() {
- return this.resourceConverter.getConverter();
- }
-
-
- // **************** validation *********************************************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- validateConverterClass(messages);
- }
-
-//TODO validate converter class
- protected void validateConverterClass(List<IMessage> messages) {
-// if (!getResourceConverter().implementsConverter()) {
-// messages.add(
-// DefaultEclipseLinkJpaValidationMessages.buildMessage(
-// IMessage.HIGH_SEVERITY,
-// EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER,
-// new String[] {this.converterClass},
-// this,
-// getConverterClassTextRange()
-// )
-// );
-// }
- }
-
-// public TextRange getConverterClassTextRange() {
-// return getResourceConverter().getClassNameTextRange();
-// }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
deleted file mode 100644
index c20cde44d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,48 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmEclipseLinkTransformationMapping
- extends AbstractOrmAttributeMapping<XmlTransformation>
- implements EclipseLinkTransformationMapping
-{
- public OrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getTransformations().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getTransformations().remove(this.resourceAttributeMapping);
- }
-
-
- public int getXmlSequence() {
- return 85;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java
deleted file mode 100644
index 7fec83b655..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.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);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildVirtualEclipseLinkXmlTransformation(ormTypeMapping, (JavaEclipseLinkTransformationMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java
deleted file mode 100644
index 5d94c4ecde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-public class OrmEclipseLinkTypeConverter extends OrmEclipseLinkConverter<XmlTypeConverter>
- implements EclipseLinkTypeConverter
-{
- private String dataType;
-
- private String objectType;
-
-
- public OrmEclipseLinkTypeConverter(XmlContextNode parent) {
- super(parent);
- }
-
- public String getType() {
- return EclipseLinkConverter.TYPE_CONVERTER;
- }
-
- // **************** data type **********************************************
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- getXmlResource().setDataType(newDataType);
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
- protected void setDataType_(String newDataType) {
- String oldDataType = this.dataType;
- this.dataType = newDataType;
- firePropertyChanged(DATA_TYPE_PROPERTY, oldDataType, newDataType);
- }
-
-
- // **************** object type ********************************************
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- getXmlResource().setObjectType(newObjectType);
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
- protected void setObjectType_(String newObjectType) {
- String oldObjectType = this.objectType;
- this.objectType = newObjectType;
- firePropertyChanged(OBJECT_TYPE_PROPERTY, oldObjectType, newObjectType);
- }
-
-
- // **************** resource interaction ***********************************
-
- @Override
- protected void initialize(XmlTypeConverter xmlResource) {
- super.initialize(xmlResource);
- this.dataType = getResourceDataType();
- this.objectType = getResourceObjectType();
- }
-
- @Override
- public void update() {
- super.update();
- setDataType_(getResourceDataType());
- setObjectType_(getResourceObjectType());
- }
-
- protected String getResourceDataType() {
- return this.resourceConverter.getDataType();
- }
-
- protected String getResourceObjectType() {
- return this.resourceConverter.getObjectType();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 5550c36f47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-public class OrmEclipseLinkVariableOneToOneMapping
- extends AbstractOrmAttributeMapping<XmlVariableOneToOne>
- implements EclipseLinkVariableOneToOneMapping
-{
- public OrmEclipseLinkVariableOneToOneMapping(OrmPersistentAttribute parent, XmlVariableOneToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addToResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getVariableOneToOnes().add(this.resourceAttributeMapping);
- }
-
- public void removeFromResourceModel(org.eclipse.jpt.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getVariableOneToOnes().remove(this.resourceAttributeMapping);
- }
-
- public int getXmlSequence() {
- return 65;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
deleted file mode 100644
index c1b0a9a1a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,76 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.xml.EmfTools;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.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);
- }
-
- public XmlAttributeMapping buildVirtualResourceMapping(
- OrmTypeMapping ormTypeMapping,
- JavaAttributeMapping javaAttributeMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildVirtualEclipseLinkXmlVariableOneToOne(ormTypeMapping, (JavaEclipseLinkVariableOneToOneMapping) javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
deleted file mode 100644
index 1a66d0890c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,78 +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.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmConverter;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.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 OrmEclipseLinkMutable mutable;
-
-
- public OrmEclipseLinkVersionMapping(OrmPersistentAttribute parent, XmlVersion resourceMapping) {
- super(parent, resourceMapping);
- this.mutable = new OrmEclipseLinkMutable(this, this.resourceAttributeMapping);
- }
-
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
- @Override
- protected OrmConverter buildConverter(String converterType) {
- OrmConverter ormConverter = super.buildConverter(converterType);
- if (ormConverter != null) {
- return ormConverter;
- }
- if (this.valuesAreEqual(converterType, EclipseLinkConvert.ECLIPSE_LINK_CONVERTER)) {
- return new OrmEclipseLinkConvert(this, this.resourceAttributeMapping);
- }
- throw new IllegalArgumentException();
- }
-
- @Override
- protected String getResourceConverterType() {
- //check @Convert first, this is the order that EclipseLink searches
- if (this.resourceAttributeMapping.getConvert() != null) {
- return EclipseLinkConvert.ECLIPSE_LINK_CONVERTER;
- }
- return super.getResourceConverterType();
- }
-
- // **************** resource-context interaction ***************************
-
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- }
-
-
- // **************** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasic.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasic.java
deleted file mode 100644
index 5dfb136b37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasic.java
+++ /dev/null
@@ -1,284 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlBasic;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasic extends XmlBasic
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaBasicMapping javaAttributeMapping;
-
- protected final VirtualXmlBasic virtualXmlBasic;
-
- public VirtualEclipseLinkXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapping;
- this.virtualXmlBasic = new VirtualXmlBasic(ormTypeMapping, javaBasicMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlBasic.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlBasic.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlBasic.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlBasic.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlBasic.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlBasic.setColumn(value);
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlBasic.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlBasic.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlBasic.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlBasic.setOptional(newOptional);
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlBasic.isLob();
- }
-
- @Override
- public void setLob(boolean newLob) {
- this.virtualXmlBasic.setLob(newLob);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlBasic.getLobTextRange();
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlBasic.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType setTemporal){
- this.virtualXmlBasic.setTemporal(setTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlBasic.getTemporalTextRange();
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlBasic.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType setEnumerated) {
- this.virtualXmlBasic.setEnumerated(setEnumerated);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public Boolean getMutable() {
- if (isOrmMetadataComplete()) {
- return Boolean.valueOf(((EclipseLinkBasicMapping) this.javaAttributeMapping).getMutable().isDefaultMutable());
- }
- return Boolean.valueOf(((EclipseLinkBasicMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- @Override
- public void setMutable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return null;
- }
-
- @Override
- public String getConvert() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- return ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- @Override
- public void setConvert(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return null;
- }
-
- @Override
- public XmlConverter getConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new VirtualEclipseLinkXmlConverter(this.ormTypeMapping, (JavaEclipseLinkCustomConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlObjectTypeConverter(this.ormTypeMapping, (JavaEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new VirtualEclipseLinkXmlStructConverter(this.ormTypeMapping, (JavaEclipseLinkStructConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlTypeConverter(this.ormTypeMapping, (JavaEclipseLinkTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicCollection.java
deleted file mode 100644
index ae8c31a6ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicCollection.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasicCollection extends XmlBasicCollection
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkBasicCollectionMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualEclipseLinkXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicCollectionMapping javaBasicCollectionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicCollectionMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicMap.java
deleted file mode 100644
index 5acbb242d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlBasicMap.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasicMap extends XmlBasicMap
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkBasicMapMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualEclipseLinkXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicMapMapping javaBasicMapMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaBasicMapMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConversionValue.java
deleted file mode 100644
index e86b9abdee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConversionValue.java
+++ /dev/null
@@ -1,72 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlConversionValue extends XmlConversionValue
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected EclipseLinkConversionValue javaConversionValue;
-
- public VirtualEclipseLinkXmlConversionValue(OrmTypeMapping ormTypeMapping, EclipseLinkConversionValue javaConversionValue) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConversionValue = javaConversionValue;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getDataValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConversionValue.getDataValue();
- }
-
- @Override
- public void setDataValue(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getObjectValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConversionValue.getObjectValue();
- }
-
- @Override
- public void setObjectValue(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getDataValueTextRange() {
- return null;
- }
-
- @Override
- public TextRange getObjectValueTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConverter.java
deleted file mode 100644
index 5514cc65cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlConverter.java
+++ /dev/null
@@ -1,61 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlConverter extends XmlConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected JavaEclipseLinkCustomConverter javaConverter;
-
- public VirtualEclipseLinkXmlConverter(OrmTypeMapping ormTypeMapping, JavaEclipseLinkCustomConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getClassName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getFullyQualifiedConverterClass();
- }
-
- @Override
- public void setClassName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbedded.java
deleted file mode 100644
index 0828c62ca7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbedded.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbedded;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlEmbedded extends XmlEmbedded
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedMapping javaAttributeMapping;
-
- protected final VirtualXmlEmbedded virtualXmlEmbedded;
-
- public VirtualEclipseLinkXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedMapping;
- this.virtualXmlEmbedded = new VirtualXmlEmbedded(ormTypeMapping, javaEmbeddedMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbedded.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbedded.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbedded.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbedded.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbedded.getAttributeOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbeddedId.java
deleted file mode 100644
index 2668d37f82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlEmbeddedId.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlEmbeddedId;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlEmbeddedId extends XmlEmbeddedId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedIdMapping javaAttributeMapping;
-
- protected final VirtualXmlEmbeddedId virtualXmlEmbeddedId;
-
- public VirtualEclipseLinkXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedIdMapping;
- this.virtualXmlEmbeddedId = new VirtualXmlEmbeddedId(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbeddedId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbeddedId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbeddedId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbeddedId.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbeddedId.getAttributeOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlId.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlId.java
deleted file mode 100644
index f0848785fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlId.java
+++ /dev/null
@@ -1,282 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlId;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlId extends XmlId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaIdMapping javaAttributeMapping;
-
- protected final VirtualXmlId virtualXmlId;
-
- public VirtualEclipseLinkXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaIdMapping;
- this.virtualXmlId = new VirtualXmlId(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlId.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlId.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlId.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlId.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- this.virtualXmlId.setTemporal(newTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlId.getTemporalTextRange();
- }
-
- @Override
- public XmlGeneratedValue getGeneratedValue() {
- return this.virtualXmlId.getGeneratedValue();
- }
-
- @Override
- public void setGeneratedValue(XmlGeneratedValue value) {
- this.virtualXmlId.setGeneratedValue(value);
- }
-
- @Override
- public XmlSequenceGenerator getSequenceGenerator() {
- return this.virtualXmlId.getSequenceGenerator();
- }
-
- @Override
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- this.virtualXmlId.setSequenceGenerator(value);
- }
-
- @Override
- public XmlTableGenerator getTableGenerator() {
- return this.virtualXmlId.getTableGenerator();
- }
-
- @Override
- public void setTableGenerator(XmlTableGenerator value) {
- this.virtualXmlId.setTableGenerator(value);
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlId.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- this.virtualXmlId.setEnumerated(value);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlId.getEnumeratedTextRange();
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlId.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- this.virtualXmlId.setLob(value);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlId.getLobTextRange();
- }
-
-
- @Override
- public Boolean getMutable() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- return Boolean.valueOf(((EclipseLinkIdMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- @Override
- public void setMutable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getConvert() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- return ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- @Override
- public void setConvert(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlConverter getConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new VirtualEclipseLinkXmlConverter(this.ormTypeMapping, (JavaEclipseLinkCustomConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlObjectTypeConverter(this.ormTypeMapping, (JavaEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new VirtualEclipseLinkXmlStructConverter(this.ormTypeMapping, (JavaEclipseLinkStructConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlTypeConverter(this.ormTypeMapping, (JavaEclipseLinkTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return null;
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java
deleted file mode 100644
index 9c6acf41da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToMany.java
+++ /dev/null
@@ -1,191 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToMany;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlManyToMany extends XmlManyToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToManyMapping javaAttributeMapping;
-
- protected final VirtualXmlManyToMany virtualXmlManyToMany;
-
- public VirtualEclipseLinkXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToManyMapping;
- this.virtualXmlManyToMany = new VirtualXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlManyToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlManyToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlManyToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlManyToMany.setMapKey(value);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlManyToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlManyToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlManyToMany.getOrderColumn();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlManyToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToMany.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return null; //don't return default value, it only applies for an empty @JoinFetch
- }
- return EclipseLinkJoinFetchType.toOrmResourceModel(((JavaEclipseLinkManyToManyMapping) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToOne.java
deleted file mode 100644
index 49dd467309..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlManyToOne.java
+++ /dev/null
@@ -1,164 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.AbstractJavaEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlManyToOne extends XmlManyToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToOneMapping javaAttributeMapping;
-
- protected final VirtualXmlManyToOne virtualXmlManyToOne;
-
- public VirtualEclipseLinkXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToOneMapping;
- this.virtualXmlManyToOne = new VirtualXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlManyToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlManyToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlManyToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToOne.setTargetEntity(value);
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return null; //don't return default value, it only applies for an empty @JoinFetch
- }
- return EclipseLinkJoinFetchType.toOrmResourceModel(((AbstractJavaEclipseLinkManyToOneMapping) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlNullAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlNullAttributeMapping.java
deleted file mode 100644
index d50cc97b83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlNullAttributeMapping.java
+++ /dev/null
@@ -1,77 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtualEclipseLinkXmlNullAttributeMapping extends XmlNullAttributeMapping implements XmlAttributeMapping
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaAttributeMapping javaAttributeMapping;
-
- protected final VirtualXmlNullAttributeMapping virtualXmlNullAttributeMapping;
-
- public VirtualEclipseLinkXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- this.virtualXmlNullAttributeMapping = new VirtualXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getMappingKey() {
- return this.virtualXmlNullAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlNullAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlNullAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlNullAttributeMapping.getNameTextRange();
- }
-
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- public EList<XmlProperty> getProperties() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlObjectTypeConverter.java
deleted file mode 100644
index f0ecfd953a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlObjectTypeConverter.java
+++ /dev/null
@@ -1,107 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlObjectTypeConverter extends XmlObjectTypeConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected JavaEclipseLinkObjectTypeConverter javaConverter;
-
- public VirtualEclipseLinkXmlObjectTypeConverter(OrmTypeMapping ormTypeMapping, JavaEclipseLinkObjectTypeConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getDataType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getFullyQualifiedDataType();
- }
-
- @Override
- public void setDataType(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getObjectType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getFullyQualifiedObjectType();
- }
-
- @Override
- public void setObjectType(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getDefaultObjectValue() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getDefaultObjectValue();
- }
-
- @Override
- public void setDefaultObjectValue(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlConversionValue> getConversionValues() {
- EList<XmlConversionValue> conversionValues = new EObjectContainmentEList<XmlConversionValue>(XmlConversionValue.class, this, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- if (isOrmMetadataComplete()) {
- return conversionValues;
- }
- for (EclipseLinkConversionValue javaConversionValue : CollectionTools.iterable(this.javaConverter.conversionValues())) {
- XmlConversionValue xmlConversionValue = new VirtualEclipseLinkXmlConversionValue(this.ormTypeMapping, javaConversionValue);
- conversionValues.add(xmlConversionValue);
- }
- return conversionValues;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java
deleted file mode 100644
index 6abceed371..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToMany.java
+++ /dev/null
@@ -1,253 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlJoinColumn;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToMany;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlOneToMany extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToManyMapping javaAttributeMapping;
-
- protected final VirtualXmlOneToMany virtualXmlOneToMany;
-
- public VirtualEclipseLinkXmlOneToMany(
- OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToManyMapping javaOneToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.virtualXmlOneToMany = new VirtualXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlOneToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlOneToMany.setMapKey(value);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlOneToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlOneToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlOneToMany.getOrderColumn();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToMany.getTargetEntityTextRange();
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- EList<XmlJoinColumn> joinColumns = new EObjectContainmentEList<XmlJoinColumn>(XmlJoinColumn.class, this, OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS);
- if (isOrmMetadataComplete()) {
- return joinColumns;
- }
- for (JoinColumn joinColumn :
- CollectionTools.iterable(
- this.javaAttributeMapping.getRelationshipReference().
- getJoinColumnJoiningStrategy().specifiedJoinColumns())) {
- XmlJoinColumn xmlJoinColumn = new VirtualXmlJoinColumn(joinColumn, isOrmMetadataComplete());
- joinColumns.add(xmlJoinColumn);
- }
- return joinColumns;
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return null; //don't return default value, it only applies for an empty @JoinFetch
- }
- return EclipseLinkJoinFetchType.toOrmResourceModel(this.javaAttributeMapping.getJoinFetch().getValue());
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isPrivateOwned() {
- if (isOrmMetadataComplete()) {
- return false;
- }
- return this.javaAttributeMapping.getPrivateOwned().isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return null;
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
- }
- return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java
deleted file mode 100644
index 545ed5f50d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlOneToOne.java
+++ /dev/null
@@ -1,225 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlOneToOne;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.AbstractJavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlOneToOne extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final AbstractJavaEclipseLinkOneToOneMapping javaAttributeMapping;
-
- protected final VirtualXmlOneToOne virtualXmlOneToOne;
-
- public VirtualEclipseLinkXmlOneToOne(OrmTypeMapping ormTypeMapping, AbstractJavaEclipseLinkOneToOneMapping javaOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.virtualXmlOneToOne = new VirtualXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlOneToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlOneToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToOne.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToOne.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToOne.setMappedBy(value);
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- return this.virtualXmlOneToOne.getPrimaryKeyJoinColumns();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToOne.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return null; //don't return default value, it only applies for an empty @JoinFetch
- }
- return EclipseLinkJoinFetchType.toOrmResourceModel((this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isPrivateOwned() {
- if (isOrmMetadataComplete()) {
- return false;
- }
- return (this.javaAttributeMapping).getPrivateOwned().isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return null;
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return null;
- }
-
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(this.javaAttributeMapping);
- if (this.isOrmMetadataComplete()) {
- return Boolean.valueOf(mappingsOrphanRemoval.isDefaultOrphanRemoval());
- }
- return Boolean.valueOf(mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlStructConverter.java
deleted file mode 100644
index 40d8a5291d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlStructConverter.java
+++ /dev/null
@@ -1,61 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlStructConverter extends XmlStructConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected EclipseLinkStructConverter javaConverter;
-
- public VirtualEclipseLinkXmlStructConverter(OrmTypeMapping ormTypeMapping, EclipseLinkStructConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getConverter() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getConverterClass();
- }
-
- @Override
- public void setConverter(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransformation.java
deleted file mode 100644
index 12cdd9c436..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransformation.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlTransformation extends XmlTransformation
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkTransformationMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualEclipseLinkXmlTransformation(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTransformationMapping javaTransformationMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransformationMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaTransformationMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransient.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransient.java
deleted file mode 100644
index 01e83fbbd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTransient.java
+++ /dev/null
@@ -1,73 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlTransient;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlTransient extends XmlTransient
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaTransientMapping javaAttributeMapping;
-
- protected final VirtualXmlTransient virtualXmlTransient;
-
- public VirtualEclipseLinkXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransientMapping;
- this.virtualXmlTransient = new VirtualXmlTransient(ormTypeMapping, javaTransientMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlTransient.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlTransient.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlTransient.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlTransient.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods newAccessMethods) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTypeConverter.java
deleted file mode 100644
index 95a8c7b919..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlTypeConverter.java
+++ /dev/null
@@ -1,74 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlTypeConverter extends XmlTypeConverter
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected JavaEclipseLinkTypeConverter javaConverter;
-
- public VirtualEclipseLinkXmlTypeConverter(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTypeConverter javaConverter) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaConverter = javaConverter;
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getName() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getName();
- }
-
- @Override
- public void setName(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getDataType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getFullyQualifiedDataType();
- }
-
- @Override
- public void setDataType(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getObjectType() {
- if (isOrmMetadataComplete()) {
- return null;
- }
- return this.javaConverter.getFullyQualifiedObjectType();
- }
-
- @Override
- public void setObjectType(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVariableOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVariableOneToOne.java
deleted file mode 100644
index 52bd0c28a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVariableOneToOne.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlVariableOneToOne extends XmlVariableOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkVariableOneToOneMapping javaAttributeMapping;
-
- protected final VirtualXmlAttributeMapping virtualXmlAttributeMapping;
-
- public VirtualEclipseLinkXmlVariableOneToOne(OrmTypeMapping ormTypeMapping, JavaEclipseLinkVariableOneToOneMapping javaVariableOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVariableOneToOneMapping;
- this.virtualXmlAttributeMapping = new VirtualXmlAttributeMapping(ormTypeMapping, javaVariableOneToOneMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlAttributeMapping.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVersion.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVersion.java
deleted file mode 100644
index 95c30cf954..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/orm/VirtualEclipseLinkXmlVersion.java
+++ /dev/null
@@ -1,254 +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.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.context.orm.VirtualXmlVersion;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlVersion extends XmlVersion
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaVersionMapping javaAttributeMapping;
-
- protected final VirtualXmlVersion virtualXmlVersion;
-
- public VirtualEclipseLinkXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVersionMapping;
- this.virtualXmlVersion = new VirtualXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlVersion.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlVersion.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlVersion.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlVersion.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlVersion.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlVersion.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlVersion.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlVersion.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlVersion.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlVersion.getEnumeratedTextRange();
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlVersion.getLobTextRange();
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlVersion.getTemporalTextRange();
- }
-
- @Override
- public Boolean getMutable() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- return Boolean.valueOf(((EclipseLinkVersionMapping) this.javaAttributeMapping).getMutable().isMutable());
- }
-
- @Override
- public void setMutable(Boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public String getConvert() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- return ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverterName();
- }
- return null;
- }
-
- @Override
- public void setConvert(String value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return null;
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return null;
- }
-
- @Override
- public XmlConverter getConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return new VirtualEclipseLinkXmlConverter(this.ormTypeMapping, (JavaEclipseLinkCustomConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlObjectTypeConverter(this.ormTypeMapping, (JavaEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return new VirtualEclipseLinkXmlStructConverter(this.ormTypeMapping, (JavaEclipseLinkStructConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- //don't need isOrmMetadataComplete() check because there is no default Id mapping
- if (this.javaAttributeMapping.getConverter().getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) {
- EclipseLinkConverter converter = ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter();
- if (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return new VirtualEclipseLinkXmlTypeConverter(this.ormTypeMapping, (JavaEclipseLinkTypeConverter) ((EclipseLinkConvert) this.javaAttributeMapping.getConverter()).getConverter());
- }
- }
- return null;
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
deleted file mode 100644
index da7f13e5e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-
-public class EclipseLinkJarFileRef
- extends AbstractJarFileRef
-{
- public EclipseLinkJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- super(parent, xmlJarFileRef);
- }
-
- @Override
- protected IPath[] resolveDeploymentJarFilePathWeb(IPath root, IPath jarFilePath) {
- IPath[] genericPath = super.resolveDeploymentJarFilePathWeb(root, jarFilePath);
- return ArrayTools.removeLast(genericPath);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java
deleted file mode 100644
index 10e262b6ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnit.java
+++ /dev/null
@@ -1,464 +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.eclipselink.core.internal.context.persistence;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.core.internal.jpa1.context.persistence.ImpliedMappingFileRef;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.EclipseLinkCustomization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.general.EclipseLinkGeneralProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.schema.generation.EclipseLinkSchemaGeneration;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-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;
-
- 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 List<EclipseLinkConverter> converters = new ArrayList<EclipseLinkConverter>();
-
-
- // ********** constructors/initialization **********
- public EclipseLinkPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- super(parent, xmlPersistenceUnit);
- }
-
- @Override
- public EclipseLinkPersistenceXmlContextNodeFactory getContextNodeFactory() {
- return (EclipseLinkPersistenceXmlContextNodeFactory) super.getContextNodeFactory();
- }
-
- @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
- protected void addNonUpdateAspectNamesTo(Set<String> nonUpdateAspectNames) {
- super.addNonUpdateAspectNamesTo(nonUpdateAspectNames);
- nonUpdateAspectNames.add(CONVERTERS_LIST);
- }
-
- @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);
- }
-
- @Override
- protected SharedCacheMode buildDefaultSharedCacheMode() {
- return SharedCacheMode.DISABLE_SELECTIVE;
- }
-
- @Override
- public boolean calculateDefaultCacheable() {
- switch (getSharedCacheMode()) {
- case NONE:
- case ENABLE_SELECTIVE:
- return false;
- case ALL:
- case DISABLE_SELECTIVE:
- case UNSPECIFIED:
- return true;
- }
- return true;//null
- }
-
- // **************** mapping file refs **************************************
-
- @Override
- protected ListIterable<MappingFileRef> getMappingFileRefs() {
- return (this.impliedEclipseLinkMappingFileRef == null) ? super.getMappingFileRefs() : this.getCombinedEclipseLinkMappingFileRefs();
- }
-
- protected ListIterable<MappingFileRef> getCombinedEclipseLinkMappingFileRefs() {
- return new CompositeListIterable<MappingFileRef>(super.getMappingFileRefs(), this.impliedEclipseLinkMappingFileRef);
- }
-
- @Override
- public int mappingFileRefsSize() {
- return this.impliedEclipseLinkMappingFileRef == null ? super.mappingFileRefsSize() : combinedEclipseLinkMappingFileRefsSize();
- }
-
- protected int combinedEclipseLinkMappingFileRefsSize() {
- return super.mappingFileRefsSize() + 1;
- }
-
-
- // **************** implied eclipselink mapping file ref *******************
-
- /**
- * String constant associated with changes to the implied eclipselink mapping file ref
- */
- public final static String IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY = "impliedEclipseLinkMappingFileRef"; //$NON-NLS-1$
-
-
- public MappingFileRef getImpliedEclipseLinkMappingFileRef() {
- return this.impliedEclipseLinkMappingFileRef;
- }
-
- protected MappingFileRef setImpliedEclipseLinkMappingFileRef() {
- if (this.impliedEclipseLinkMappingFileRef != null) {
- throw new IllegalStateException("The implied eclipselink mapping file ref is already set."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = buildEclipseLinkImpliedMappingFileRef();
- this.impliedEclipseLinkMappingFileRef = mappingFileRef;
- this.firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, null, mappingFileRef);
- return mappingFileRef;
- }
-
- protected void unsetImpliedEclipseLinkMappingFileRef() {
- if (this.impliedEclipseLinkMappingFileRef == null) {
- throw new IllegalStateException("The implied eclipselink mapping file ref is already unset."); //$NON-NLS-1$
- }
- MappingFileRef mappingFileRef = this.impliedEclipseLinkMappingFileRef;
- this.impliedEclipseLinkMappingFileRef.dispose();
- this.impliedEclipseLinkMappingFileRef = null;
- this.firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, mappingFileRef, null);
- }
-
-
- // **************** factory methods *********************************************
-
- 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);
- }
-
-
- // **************** 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 Logging getLogging() {
- return this.logging;
- }
-
- @Override
- public Options getOptions() {
- return (Options) super.getOptions();
- }
-
- public SchemaGeneration getSchemaGeneration() {
- return this.schemaGeneration;
- }
-
-
- // **************** converters *********************************************
-
- /**
- * Identifier for changes to the list of global converter definitions.
- * Note that there are no granular changes to this list. There is only
- * notification that the entire list has changed.
- */
- public static final String CONVERTERS_LIST = "converters"; //$NON-NLS-1$
-
- /**
- * Add the converter definition (defined elsewhere) to the list of converters
- * defined within this persistence unit.
- * Note that this should only be called during the process of updating the
- * local converter definition.
- * No change notification accompanies this action specifically.
- */
- public void addConverter(EclipseLinkConverter converter) {
- this.converters.add(converter);
- }
-
- /**
- * Return an iterator on all converters defined within this persistence unit,
- * included duplicately named converters definitions.
- */
- public ListIterator<EclipseLinkConverter> allConverters() {
- return new CloneListIterator<EclipseLinkConverter>(this.converters);
- }
-
- public int convertersSize() {
- return this.converters.size();
- }
-
- /**
- * Return an array of the names of the converters defined in the persistence
- * unit, with duplicates removed.
- */
- public String[] uniqueConverterNames() {
- HashSet<String> names = CollectionTools.set(this.allNonNullConverterNames());
- return names.toArray(new String[names.size()]);
- }
-
- protected Iterator<String> allNonNullConverterNames() {
- return new FilteringIterator<String>(this.allConverterNames()) {
- @Override
- protected boolean accept(String converterName) {
- return converterName != null;
- }
- };
- }
-
- protected Iterator<String> allConverterNames() {
- return new TransformationIterator<EclipseLinkConverter, String>(this.allConverters()) {
- @Override
- protected String transform(EclipseLinkConverter converter) {
- return converter.getName();
- }
- };
- }
-
-
- // **************** updating ***********************************************
-
- @Override
- public void update(XmlPersistenceUnit persistenceUnit) {
- this.converters.clear();
- super.update(persistenceUnit);
- convertersUpdated();
- }
-
- @Override
- public void postUpdate() {
- super.postUpdate();
- if (this.impliedEclipseLinkMappingFileRef != null) {
- this.impliedEclipseLinkMappingFileRef.postUpdate();
- }
- }
-
- @Override
- protected void initializeMappingFileRefs() {
- super.initializeMappingFileRefs();
-
- // use implied mapping file if
- // a) properties does not exclude it
- // b) it isn't otherwise specified
- // c) the file actually exists
- if (! impliedEclipseLinkMappingFileIsExcluded()
- && ! impliedEclipseLinkMappingFileIsSpecified()
- && impliedEclipseLinkMappingFileExists()) {
-
- this.impliedEclipseLinkMappingFileRef = buildEclipseLinkImpliedMappingFileRef();
- }
- }
-
- private ImpliedMappingFileRef buildEclipseLinkImpliedMappingFileRef() {
- return new ImpliedMappingFileRef(this, JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- @Override
- protected void updateMappingFileRefs() {
- super.updateMappingFileRefs();
-
- // use implied mapping file if
- // a) properties does not exclude it
- // b) it isn't otherwise specified
- // c) the file actually exists
- if (! impliedEclipseLinkMappingFileIsExcluded()
- && ! impliedEclipseLinkMappingFileIsSpecified()
- && impliedEclipseLinkMappingFileExists()) {
-
- if (this.impliedEclipseLinkMappingFileRef == null) {
- setImpliedEclipseLinkMappingFileRef();
- }
- getImpliedEclipseLinkMappingFileRef().update(null);
- }
- else if (this.impliedEclipseLinkMappingFileRef != null) {
- unsetImpliedEclipseLinkMappingFileRef();
- }
- }
-
- protected boolean impliedEclipseLinkMappingFileIsExcluded() {
- return getGeneralProperties().getExcludeEclipselinkOrm() == Boolean.TRUE;
- }
-
- protected boolean impliedEclipseLinkMappingFileIsSpecified() {
- String impliedMappingFile = JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH;
- for (Iterator<MappingFileRef> stream = specifiedMappingFileRefs(); stream.hasNext(); ) {
- if (impliedMappingFile.equals(stream.next().getFileName())) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- protected boolean impliedEclipseLinkMappingFileExists() {
- return getJpaProject().getDefaultEclipseLinkOrmXmlResource() != null;
- }
-
- // This is called after the persistence unit has been updated to ensure
- // we catch all added converters
- protected void convertersUpdated() {
- fireListChanged(CONVERTERS_LIST, this.converters);
- }
-
- // ********** validation **********
-
- @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()
- )
- );
- }
- }
- }
-
- 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;
- }
-
- /**
- * Returns all Shared Cache Properties, including Entity and default.
- */
- private Iterable<Property> getSharedCacheProperties() {
- return CollectionTools.iterable(this.propertiesWithNamePrefix("eclipselink.cache.shared.")); //$NON-NLS-1$
- }
-
- /**
- * Returns Entity Cache Size Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheSizeProperties() {
- return this.getEntityPropertiesWithPrefix("eclipselink.cache.size."); //$NON-NLS-1$
- }
-
- /**
- * Returns Entity Cache Type Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheTypeProperties() {
- return this.getEntityPropertiesWithPrefix("eclipselink.cache.type."); //$NON-NLS-1$
- }
-
- /**
- * Returns Entity Properties with the given prefix,
- * excluding Entity which name equals "default".
- */
- private Iterable<Property> getEntityPropertiesWithPrefix(String prefix) {
- return new FilteringIterable<Property>(
- CollectionTools.iterable(this.propertiesWithNamePrefix(prefix))) { //$NON-NLS-1$
- @Override
- protected boolean accept(Property next) {
- return ! next.getName().endsWith("default"); //$NON-NLS-1$
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
deleted file mode 100644
index 20ebeeff03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.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.eclipselink.core.internal.context.persistence;
-
-import java.util.Set;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * 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().propertiesWithNamePrefix(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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 98f332b7e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,50 +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.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.EclipseLinkConnection;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.EclipseLinkLogging;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.options.EclipseLinkOptions;
-
-
-public class EclipseLinkPersistenceXmlContextNodeFactory
- extends AbstractPersistenceXmlContextNodeFactory
- implements org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
deleted file mode 100644
index f01bdc30d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.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 EFactory getResourceNodeFactory() {
- return PersistenceFactory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkPersistenceXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java
deleted file mode 100644
index 8587fbc214..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/EclipseLinkCaching.java
+++ /dev/null
@@ -1,581 +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.eclipselink.core.internal.context.persistence.caching;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.FlushClearCache;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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<Entity> 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<Entity>();
- 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());
- }
-
- public Entity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Entity " + entityName + " already exists.");
- }
- Entity newEntity = this.buildEntity(entityName);
- this.entities.add(newEntity);
- this.fireListChanged(ENTITIES_LIST, this.entities);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- Entity entity = this.getEntityNamed(entityName);
- this.clearEntity(entity);
- this.removeEntity(entity);
- }
-
- // ********** CacheType **********
- public CacheType getCacheTypeOf(String entityName) {
- Entity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheType();
- }
-
- public void setCacheTypeOf(String entityName, CacheType newCacheType) {
- Entity 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)) {
- Entity 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) {
- Entity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheSize();
- }
-
- public void setCacheSizeOf(String entityName, Integer newCacheSize) {
- Entity 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)) {
- Entity 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) {
- Entity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.cacheIsShared();
- }
-
- public void setSharedCacheOf(String entityName, Boolean newSharedCache) {
- Entity 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)) {
- Entity 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 Entity 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 Entity setEntityCacheTypeOf(String entityName, CacheType cacheType) {
- Entity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheTypeOf(entity, cacheType);
- }
-
- /**
- * Returns the old Entity
- */
- private Entity setEntityCacheTypeOf(Entity entity, CacheType cacheType) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- Entity 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 Entity 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 Entity setEntityCacheSizeOf(String entityName, Integer size) {
- Entity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheSizeOf(entity, size);
- }
-
- /**
- * Returns the old Entity
- */
- private Entity setEntityCacheSizeOf(Entity entity, Integer size) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- Entity 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 Entity 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 Entity setEntitySharedCacheOf(String entityName, Boolean sharedCache) {
- Entity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntitySharedCacheOf(entity, sharedCache);
- }
-
- /**
- * Returns the old Entity
- */
- private Entity setEntitySharedCacheOf(Entity entity, Boolean sharedCache) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- Entity 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(Entity 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 Entity getEntityNamed(String name) {
- for(Entity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private Entity buildEntity(String name) {
- return new Entity(this, name);
- }
-
- private void removeEntity(Entity entity) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- this.entities.remove(entity);
- this.fireListChanged(ENTITIES_LIST, this.entities);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(Entity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** entities list *******
-
- public ListIterator<Entity> entities() {
- return new CloneListIterator<Entity>(this.entities);
- }
-
- public Iterator<String> entityNames() {
- return new TransformationIterator<Entity, String>(this.entities()) {
- @Override
- protected String transform(Entity entity) {
- return entity.getName();
- }
- };
- }
-
- public int entitiesSize() {
- return this.entities.size();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Entity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Entity.java
deleted file mode 100644
index df59739fc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/caching/Entity.java
+++ /dev/null
@@ -1,143 +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.eclipselink.core.internal.context.persistence.caching;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class Entity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Caching parent;
-
- public static final String CACHE_TYPE_PROPERTY = Caching.CACHE_TYPE_PROPERTY; //$NON-NLS-1$
- public static final String CACHE_SIZE_PROPERTY = Caching.CACHE_SIZE_PROPERTY; //$NON-NLS-1$
- public static final String SHARED_CACHE_PROPERTY = Caching.SHARED_CACHE_PROPERTY; //$NON-NLS-1$
-
- // ********** EclipseLink properties **********
- private CacheType cacheType;
- private Integer cacheSize;
- private Boolean cacheIsShared;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public Entity(Caching parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private Entity(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 == null) {
- return false;
- }
- Entity entity = (Entity) o;
- return (
- (this.cacheType == null ?
- entity.cacheType == null : this.cacheType.equals(entity.cacheType)) &&
- (this.cacheIsShared == null ?
- entity.cacheIsShared == null : this.cacheIsShared.equals(entity.cacheIsShared)) &&
- (this.cacheSize == null ?
- entity.cacheSize == null : this.cacheSize.equals(entity.cacheSize)));
- }
-
- @Override
- public Entity clone() {
- try {
- return (Entity)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 name;
- }
-
- // ********** cacheType **********
- protected CacheType getCacheType() {
- return this.cacheType;
- }
-
- protected void setCacheType(CacheType cacheType) {
- CacheType old = this.cacheType;
- this.cacheType = cacheType;
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, cacheType);
- }
-
- // ********** cacheSize **********
- protected Integer getCacheSize() {
- return this.cacheSize;
- }
-
- protected void setCacheSize(Integer cacheSize) {
- Integer old = this.cacheSize;
- this.cacheSize = cacheSize;
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, cacheSize);
- }
-
- // ********** cacheIsShared **********
- protected Boolean cacheIsShared() {
- return this.cacheIsShared;
- }
-
- protected void setSharedCache(Boolean isShared) {
- Boolean old = this.cacheIsShared;
- this.cacheIsShared = isShared;
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, isShared);
- }
-
- public void toString(StringBuilder sb) {
- sb.append("name: ");
- sb.append(this.name);
- sb.append(", cacheType: ");
- sb.append(this.cacheType);
- sb.append(", cacheSize: ");
- sb.append(this.cacheSize);
- sb.append(", cacheIsShared: ");
- sb.append(this.cacheIsShared);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java
deleted file mode 100644
index 768f533dc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/connection/EclipseLinkConnection.java
+++ /dev/null
@@ -1,677 +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.eclipselink.core.internal.context.persistence.connection;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.BatchWriting;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.ExclusiveConnectionMode;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java
deleted file mode 100644
index 1affa8f1af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/EclipseLinkCustomization.java
+++ /dev/null
@@ -1,798 +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.eclipselink.core.internal.context.persistence.customization;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Profiler;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Weaving;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * 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<Entity> 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<Entity>();
-
- 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() {
- Set<PersistenceUnit.Property> properties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_SESSION_CUSTOMIZER);
-
- this.sessionCustomizers = new ArrayList<String>(properties.size());
- this.initializeSessionCustomizersWith(properties);
- }
-
- private void initializeSessionCustomizersWith(Set<PersistenceUnit.Property> properties) {
- for (PersistenceUnit.Property property : properties) {
- this.sessionCustomizers.add(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 Entity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Entity " + entityName + " already exists.");
- }
- Entity newEntity = this.buildEntity(entityName);
- this.entities.add(newEntity);
- this.fireListChanged(ENTITIES_LIST, this.entities);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- Entity 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 ListIterator<String> sessionCustomizers(){
- return new CloneListIterator<String>(this.sessionCustomizers);
- }
-
- public int sessionCustomizersSize(){
- 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.sessionCustomizers.add(newSessionCustomizerClassName);
- this.putProperty(SESSION_CUSTOMIZER_PROPERTY, newSessionCustomizerClassName, true);
- this.fireListChanged(SESSION_CUSTOMIZER_LIST, this.sessionCustomizers);
- return newSessionCustomizerClassName;
- }
- return null;
- }
-
- public void removeSessionCustomizer(String className){
-
- if(this.removeSessionCustomizer_(className) != null) {
- this.removeProperty(SESSION_CUSTOMIZER_PROPERTY, className);
- this.fireListChanged(SESSION_CUSTOMIZER_LIST, this.sessionCustomizers);
- }
- }
-
- private String removeSessionCustomizer_(String className){
-
- for ( ListIterator<String> i = this.sessionCustomizers(); i.hasNext();) {
- String sessionCustomizer = i.next();
- if(sessionCustomizer.equals(className)) {
- this.sessionCustomizers.remove(sessionCustomizer);
- return sessionCustomizer;
- }
- }
- return null;
- }
-
- private void sessionCustomizersChanged() {
-
- this.initializeSessionCustomizersFromPersistenceUnit();
- this.fireListChanged(SESSION_CUSTOMIZER_LIST, this.sessionCustomizers);
- }
-
- // ********** 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) {
- Entity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getDescriptorCustomizer();
- }
-
- public void setDescriptorCustomizerOf(String entityName, String newDescriptorCustomizer) {
- Entity 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)) {
- Entity 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 Entity 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;
- }
- Entity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityDescriptorCustomizerOf(entity, descriptorCustomizerClassName);
- }
-
- /**
- * Returns the old Entity
- */
- private Entity setEntityDescriptorCustomizerOf(Entity entity, String descriptorCustomizerClassName) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- Entity old = entity.clone();
- entity.setDescriptorCustomizer(descriptorCustomizerClassName);
- return old;
- }
-
- /**
- * Convenience method to update the descriptorCustomizerClassName in entities.
- * Returns the old Entity
- */
- private Entity 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(Entity entity) {
- if(entity.isEmpty()) {
- return;
- }
- String entityName = entity.getName();
- this.setDescriptorCustomizerOf(entityName, null);
- }
-
- /**
- * Returns the Entity with the given name.
- */
- private Entity getEntityNamed(String name) {
- for(Entity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private Entity buildEntity(String name) {
- return new Entity(this, name);
- }
-
- private void removeEntity(Entity entity) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- this.entities.remove(entity);
- this.fireListChanged(ENTITIES_LIST, this.entities);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(Entity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** entities list *******
-
- public ListIterator<Entity> entities() {
- return new CloneListIterator<Entity>(this.entities);
- }
-
- public Iterator<String> entityNames() {
- return new TransformationIterator<Entity, String>(this.entities()) {
- @Override
- protected String transform(Entity entity) {
- return entity.getName();
- }
- };
- }
-
- public int entitiesSize() {
- return this.entities.size();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Entity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Entity.java
deleted file mode 100644
index 71f899435e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/customization/Entity.java
+++ /dev/null
@@ -1,106 +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.eclipselink.core.internal.context.persistence.customization;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class Entity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Customization parent;
-
- public static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = Customization.DESCRIPTOR_CUSTOMIZER_PROPERTY; //$NON-NLS-1$
-
- // ********** EclipseLink properties **********
- private String descriptorCustomizer;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public Entity(Customization parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private Entity(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 == null) {
- return false;
- }
- Entity customizer = (Entity) o;
- return (
- (this.descriptorCustomizer == null ?
- customizer.descriptorCustomizer == null :
- this.descriptorCustomizer.equals(customizer.descriptorCustomizer)));
- }
-
- @Override
- public Entity clone() {
- try {
- return (Entity)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;
- }
-
- protected String getDescriptorCustomizer() {
- return this.descriptorCustomizer;
- }
-
- protected void setDescriptorCustomizer(String descriptorCustomizer) {
- String old = this.descriptorCustomizer;
- this.descriptorCustomizer = descriptorCustomizer;
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, descriptorCustomizer);
- }
-
- public void toString(StringBuilder sb) {
- sb.append("name: ");
- sb.append(this.name);
- sb.append(", descriptorCustomizer: ");
- sb.append(this.descriptorCustomizer);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/EclipseLinkGeneralProperties.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/EclipseLinkGeneralProperties.java
deleted file mode 100644
index d647b03bd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/general/EclipseLinkGeneralProperties.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.eclipselink.core.internal.context.persistence.general;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java
deleted file mode 100644
index 6b1f41d01d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/logging/EclipseLinkLogging.java
+++ /dev/null
@@ -1,361 +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.eclipselink.core.internal.context.persistence.logging;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logger;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * 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;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java
deleted file mode 100644
index 95783f0f39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/options/EclipseLinkOptions.java
+++ /dev/null
@@ -1,399 +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.eclipselink.core.internal.context.persistence.options;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetDatabase;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetServer;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-
-/**
- * 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;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/EclipseLinkSchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/EclipseLinkSchemaGeneration.java
deleted file mode 100644
index d092d037f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/context/persistence/schema/generation/EclipseLinkSchemaGeneration.java
+++ /dev/null
@@ -1,232 +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.eclipselink.core.internal.context.persistence.schema.generation;
-
-import java.util.Map;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnitProperties;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
deleted file mode 100644
index bd2e593e9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,668 +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.eclipselink.core.internal.ddlgen;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-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.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-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.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.core.internal.SynchronousJpaProjectUpdater;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-/**
- * EclipseLinkDLLGenerator launches the EclipseLink DDL generator in a separate VM.
- * For this it will create a Java Configuration named "EclipseLink"
- * 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.eclipselink.core.ddlgen.jar in ECLIPSE_HOME/plugins
- */
-public class EclipseLinkDDLGenerator
-{
- static public String ECLIPSELINK_DDL_GEN_JAR_VERSION = "1.0.100"; //$NON-NLS-1$
- static public String LAUNCH_CONFIG_NAME = "EclipseLink"; //$NON-NLS-1$
- static public String DDL_GEN_PACKAGE_NAME = "org.eclipse.jpt.eclipselink.core.ddlgen"; //$NON-NLS-1$
- static public String ECLIPSELINK_DDL_GEN_CLASS = DDL_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- static public String ECLIPSELINK_DDL_GEN_JAR = DDL_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- static public String BUNDLE_CLASSPATH = "Bundle-ClassPath"; //$NON-NLS-1$
- static public String PROPERTIES_FILE_NAME = "login.properties"; //$NON-NLS-1$
- static public String PLUGINS_DIR = "plugins/"; //$NON-NLS-1$
- static public String TRUE = "true"; //$NON-NLS-1$
- static public String FALSE = "false"; //$NON-NLS-1$
- static public String NONE = "NONE"; //$NON-NLS-1$
- private IVMInstall jre;
- private ILaunchConfigurationWorkingCopy launchConfig;
- private ILaunch launch;
-
- private String puName;
- private JpaProject jpaProject;
- private String projectLocation;
- private boolean isDebug = false;
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLinkDDLGenerator(puName, project, projectLocation, monitor).generate();
- }
-
- protected EclipseLinkDDLGenerator(String puName, JpaProject jpaProject, String projectLocation, @SuppressWarnings("unused") IProgressMonitor monitor) {
- super();
- this.puName = puName;
- this.jpaProject = jpaProject;
- this.projectLocation = projectLocation;
- this.initialize();
- }
-
- // ********** behavior **********
-
- protected void initialize() {
- try {
- this.jre = this.getProjectJRE();
- if (this.jre == null) {
- String message = "Could not identify the VM.";
- throw new RuntimeException(message);
- }
- this.launchConfig = this.buildLaunchConfiguration();
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- protected void generate() {
- this.preGenerate();
- String propertiesFile = this.projectLocation + "/" + PROPERTIES_FILE_NAME; //$NON-NLS-1$
-
- this.initializeLaunchConfiguration(this.projectLocation, propertiesFile);
-
- this.saveLoginProperties(this.projectLocation, propertiesFile);
-
- this.addLaunchListener();
- this.launch = this.saveAndLaunchConfig();
- }
-
- private void initializeLaunchConfiguration(String projectLocation, String propertiesFile) {
-
- this.specifyJRE(this.jre.getName(), this.jre.getVMInstallType().getId());
-
- this.specifyProject(this.getJpaProject().getProject().getName());
- this.specifyMainType(ECLIPSELINK_DDL_GEN_CLASS);
-
- this.specifyProgramArguments(this.puName, propertiesFile); // -pu & -p
- this.specifyWorkingDir(projectLocation);
-
- this.specifyClasspathProperties(this.getJpaProject(), this.buildJdbcJarPath(), this.buildBootstrapJarPath());
- }
-
- private void addLaunchListener() {
-
- this.getLaunchManager().addLaunchListener(this.buildLaunchListener());
- }
-
- protected void preGenerate() {
- //disconnect since the runtime provider will need to connect to generate the tables
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.disconnect();
- }
- }
-
- protected void postGenerate() {
- try {
- if ( ! this.isDebug) {
- this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
- }
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- this.reconnect();
- this.validateProject();
- }
-
- //reconnect since we disconnected in preGenerate(),
- //use the synchronous JPA project updater so we can ensure
- //the project is fully updated before validating. bug 277236
- protected void reconnect() {
- JpaProject.Updater updater = getJpaProject().getUpdater();
- getJpaProject().setUpdater(new SynchronousJpaProjectUpdater(getJpaProject()));
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.connect();
- }
- getJpaProject().setUpdater(updater);
- }
-
- protected void validateProject() {
- IProject project = this.getJpaProject().getProject();
- ValidateJob job = new ValidateJob(project);
- job.setRule(project);
- job.schedule();
- }
-
- /**
- * 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$
- }
-
- private IPath buildBootstrapJarPath() {
- try {
- File jarInstallDir = this.getBundleParentDir(JptEclipseLinkCorePlugin.PLUGIN_ID);
-
- List<File> result = new ArrayList<File>();
- this.findFile(ECLIPSELINK_DDL_GEN_JAR, jarInstallDir, result);
- if (result.isEmpty()) {
- throw new RuntimeException("Could not find: " + DDL_GEN_PACKAGE_NAME + ".jar in: " + jarInstallDir);
- }
- File ddlGenJarFile = result.get(0);
- String ddlGenJarPath = ddlGenJarFile.getCanonicalPath();
- return new Path(ddlGenJarPath);
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void findFile(String fileName, File directory, List<? super File> list) {
- if(directory.listFiles() == null) {
- throw new RuntimeException("Could not find directory: " + directory);
- }
- for (File file : directory.listFiles()) {
- if (file.getName().startsWith(fileName)) {
- list.add(file);
- }
- if (file.isDirectory()) {
- this.findFile(fileName, file, list);
- }
- }
- }
-
- 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 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(EclipseLinkDDLGenerator.this.getLaunch())) {
-
- EclipseLinkDDLGenerator.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 **********
-
- private void specifyJRE(String jreName, String vmId) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreName);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmId);
- }
-
- private void specifyProject(String projectName) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
- }
-
- private void specifyMainType(String mainType) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainType);
- }
-
- private void specifyProgramArguments(String puName, String propertiesPath) {
-
- StringBuffer programArguments = new StringBuffer();
- programArguments.append(this.buildPuNameArgument(puName));
- programArguments.append(this.buildPropertiesFileArgument(propertiesPath));
- programArguments.append(this.buildDebugArgument());
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- private void specifyClasspathProperties(JpaProject project, IPath jdbcJar, IPath bootstrapJar) {
- List<String> classpath = new ArrayList<String>();
- try {
- // DDL_GEN jar
- classpath.add(this.getArchiveClasspathEntry(bootstrapJar).getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry(project.getJavaProject()).getMemento());
- // Osgi Bundles
- classpath.addAll(this.getPersistenceOsgiBundlesMemento());
- // JDBC jar
- classpath.add(this.getArchiveClasspathEntry(jdbcJar).getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- }
- catch (CoreException e) {
- throw new RuntimeException("An error occurs generating a memento", e);
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- }
-
- private void specifyWorkingDir(String projectLocation) {
-
- File workingDir = new Path(projectLocation).toFile();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDir.getAbsolutePath());
- }
-
- // ********** ClasspathEntry **********
-
- private IRuntimeClasspathEntry getSystemLibraryClasspathEntry() throws CoreException {
-
- IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
- return JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
- }
-
- private IRuntimeClasspathEntry getDefaultProjectClasspathEntry(IJavaProject project) {
-
- IRuntimeClasspathEntry projectEntry = JavaRuntime.newDefaultProjectClasspathEntry(project);
- projectEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return projectEntry;
- }
-
- private IRuntimeClasspathEntry getArchiveClasspathEntry(IPath archivePath) {
-
- IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(archivePath);
- archiveEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return archiveEntry;
- }
-
- private IRuntimeClasspathEntry getBundleClasspathEntry(String bundleId) {
-
- IPath persistClasspath = this.getBundleClasspath(bundleId);
- IRuntimeClasspathEntry bundleEntry = this.getArchiveClasspathEntry(persistClasspath);
-
- return bundleEntry;
- }
-
- // ********** LaunchConfig **********
-
- private ILaunch saveAndLaunchConfig() {
- ILaunchConfiguration configuration = null;
- ILaunch result = null;
- try {
- configuration = this.launchConfig.doSave();
- }
- catch (CoreException saveException) {
- throw new RuntimeException("Could not save LaunchConfig", saveException);
- }
- try {
- result = configuration.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
- }
- catch (CoreException lauchException) {
- throw new RuntimeException("An error occured during launch", lauchException);
- }
- return result;
- }
-
- private ILaunchConfigurationWorkingCopy buildLaunchConfiguration() throws CoreException {
- ILaunchConfigurationWorkingCopy launchConfig = null;
- this.removeLaunchConfiguration( LAUNCH_CONFIG_NAME);
-
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
-
- launchConfig = type.newInstance(null, LAUNCH_CONFIG_NAME);
- return launchConfig;
- }
-
- private void removeLaunchConfiguration(String launchConfigurationName) 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(launchConfigurationName)) {
- configuration.delete();
- break;
- }
- }
- }
-
- // ********** EclipseLink properties **********
-
- private void buildProjectLocationProperty(Properties properties, String location) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION,
- location);
- }
-
- private void buildDDLModeProperties(Properties properties) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- DdlGenerationType.DROP_AND_CREATE_TABLES);
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- OutputMode.DATABASE);
- }
-
- protected void buildConnectionProperties(Properties properties) {
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- Connection.ECLIPSELINK_BIND_PARAMETERS,
- FALSE);
- this.putProperty(properties,
- Connection.ECLIPSELINK_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName());
- this.putProperty(properties,
- Connection.ECLIPSELINK_URL,
- (cp == null) ? "" : cp.getURL());
- this.putProperty(properties,
- Connection.ECLIPSELINK_USER,
- (cp == null) ? "" : cp.getUserName());
- this.putProperty(properties,
- Connection.ECLIPSELINK_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword());
- }
-
- private void buildConnectionPoolingProperties(Properties properties) {
- this.putProperty(properties,
- Connection.ECLIPSELINK_READ_CONNECTIONS_SHARED,
- TRUE);
- }
-
- 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$
- }
-
- protected void buildAllProperties(Properties properties, String projectLocation) {
-
- this.buildConnectionProperties(properties);
-
- this.buildConnectionPoolingProperties(properties);
-
- this.buildLoggingProperties(properties);
-
- this.buildCustomizationProperties(properties);
-
- this.buildDDLModeProperties(properties);
-
- this.buildProjectLocationProperty(properties, projectLocation);
- }
-
- private void saveLoginProperties(String projectLocation, String propertiesFile) {
- Properties elProperties = new Properties();
-
- this.buildAllProperties(elProperties, projectLocation);
-
- try {
- File file = new File(propertiesFile);
- if (!file.exists() && ! file.createNewFile()) {
- throw new RuntimeException("createNewFile() failed: " + file); //$NON-NLS-1$
- }
- FileOutputStream stream = new FileOutputStream(file);
- elProperties.store(stream, null);
- stream.close();
- }
- catch (Exception e) {
- String message = "Error saving: " + propertiesFile;
- throw new RuntimeException(message, e);
- }
- }
-
- // ********** Main arguments **********
-
- private String buildPuNameArgument(String puName) {
- return " -pu \"" + puName + "\""; //$NON-NLS-1$
- }
-
- private String buildPropertiesFileArgument(String propertiesFile) {
- return " -p \"" + propertiesFile + "\""; //$NON-NLS-1$
- }
-
- private String buildDebugArgument() {
- return (this.isDebug) ? " -debug" : ""; //$NON-NLS-1$
- }
-
- // ********** Queries **********
-
- protected JpaPlatform getPlatform() {
- return this.getJpaProject().getJpaPlatform();
- }
-
- protected JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
-
- protected ConnectionProfile getConnectionProfile() {
- return this.getJpaProject().getConnectionProfile();
- }
-
- protected ILaunch getLaunch() {
- return this.launch;
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- private IVMInstall getProjectJRE() throws CoreException {
- return JavaRuntime.getVMInstall(this.getJpaProject().getJavaProject());
- }
-
- // ********** 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");
- }
- return this.getClassPath(bundle);
- }
-
- private IPath getClassPath(Bundle bundle) {
- String path = (String) 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);
- }
- 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);
- }
- }
- }
- }
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
deleted file mode 100644
index 1c6c59a5b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,84 +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.eclipselink.core.internal.operations;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.EclipseLink1_1JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.EclipseLink1_2JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.v2_1.EclipseLink2_1JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-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
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(FILE_PATH)) {
- return new Path(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH).toPortableString();
- }
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- protected String getDefaultVersion() {
- if (getProject() == null) {
- return null;
- }
- return getJpaProject().getJpaPlatform().getMostRecentSupportedResourceType(
- JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE).getVersion();
- }
-
- @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);
- }
-
- @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) {
- return id.equals(EclipseLinkJpaPlatformProvider.ID)
- || id.equals(EclipseLink1_1JpaPlatformProvider.ID)
- || id.equals(EclipseLink1_2JpaPlatformProvider.ID)
- || id.equals(EclipseLink2_0JpaPlatformProvider.ID)
- || id.equals(EclipseLink2_1JpaPlatformProvider.ID);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
deleted file mode 100644
index 1dd88e0f81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.internal.operations;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationOperation;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java
deleted file mode 100644
index 114103cc1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkBasicCollectionAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicCollectionAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java
deleted file mode 100644
index 6cb395f51a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkBasicMapAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicMapAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java
deleted file mode 100644
index a978013270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCacheAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java
deleted file mode 100644
index 4e12074f45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkChangeTrackingAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkChangeTrackingAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java
deleted file mode 100644
index 76a469bf9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkConvertAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkConvertAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java
deleted file mode 100644
index 6ef7e4bd31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkConverterAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkConverterAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java
deleted file mode 100644
index bd4cb337f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkCustomizerAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCustomizerAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java
deleted file mode 100644
index 2fd4a71e5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkExistenceCheckingAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkExistenceCheckingAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java
deleted file mode 100644
index e74ae64cb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkJoinFetchAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java
deleted file mode 100644
index 8b69fbd85f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkMutableAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMutableAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java
deleted file mode 100644
index d808dcac6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkObjectTypeConverterAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkObjectTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java
deleted file mode 100644
index bfdd0d997b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkPrimaryKeyAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrimaryKeyAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrimaryKeyAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java
deleted file mode 100644
index 44b4e06bfe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkPrivateOwnedAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrivateOwnedAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java
deleted file mode 100644
index eae819a55f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkReadOnlyAnnotation((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadOnlyAnnotation((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java
deleted file mode 100644
index 2edc4ed3ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkReadTransformerAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadTransformerAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadTransformerAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java
deleted file mode 100644
index a370f1e634..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkStructConverterAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkStructConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkStructConverterAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java
deleted file mode 100644
index 1908362bcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkTransformationAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java
deleted file mode 100644
index 275528e984..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkTypeConverterAnnotation(parent, member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java
deleted file mode 100644
index fea99e00e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- return new NullEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent);
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkVariableOneToOneAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java
deleted file mode 100644
index 5993a8fe13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.source.SourceEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkWriteTransformerAnnotation((JavaResourcePersistentAttribute) parent, (Attribute) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkWriteTransformerAnnotation((JavaResourcePersistentAttribute) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkWriteTransformerAnnotation.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
deleted file mode 100644
index de2eb61fee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,179 +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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public class NullEclipseLinkCacheAnnotation
- extends NullAnnotation
- implements EclipseLinkCacheAnnotation
-{
-
- protected NullEclipseLinkCacheAnnotation(JavaResourcePersistentType parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkCacheAnnotation addAnnotation() {
- return (EclipseLinkCacheAnnotation) super.addAnnotation();
- }
-
- // ***** 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;
- }
-
- // ***** 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;
- }
-
- // ***** 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;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index a54e42a3d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,54 +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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public class NullEclipseLinkJoinFetchAnnotation
- extends NullAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- protected NullEclipseLinkJoinFetchAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkJoinFetchAnnotation addAnnotation() {
- return (EclipseLinkJoinFetchAnnotation) super.addAnnotation();
- }
-
- // ***** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index f08f045eb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public class NullEclipseLinkTransformationAnnotation
- extends NullAnnotation
- implements EclipseLinkTransformationAnnotation
-{
- protected NullEclipseLinkTransformationAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkTransformationAnnotation addAnnotation() {
- return (EclipseLinkTransformationAnnotation) super.addAnnotation();
- }
-
- // ***** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 3a3fe83e65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkVariableOneToOneAnnotation.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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class NullEclipseLinkVariableOneToOneAnnotation
- extends NullAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- protected NullEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected EclipseLinkVariableOneToOneAnnotation addAnnotation() {
- return (EclipseLinkVariableOneToOneAnnotation) super.addAnnotation();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
deleted file mode 100644
index c35e60ca8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.core.internal.resource.java.NullColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * javax.persistence.Column
- */
-public 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index c892e91d7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryBaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,104 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.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(JavaResourcePersistentMember 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index fa347a9abb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,32 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class BinaryEclipseLinkBasicCollectionAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicCollectionAnnotation
-{
- public BinaryEclipseLinkBasicCollectionAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 1595c2f343..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,32 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class BinaryEclipseLinkBasicMapAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicMapAnnotation
-{
- public BinaryEclipseLinkBasicMapAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
deleted file mode 100644
index a7fa58bceb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,311 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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;
-
-
- public BinaryEclipseLinkCacheAnnotation(JavaResourcePersistentType 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();
- }
-
- 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());
- }
-
-
- // ********** 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();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index 21c8ff091f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,73 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public final class BinaryEclipseLinkChangeTrackingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkChangeTrackingAnnotation
-{
- private ChangeTrackingType value;
-
-
- public BinaryEclipseLinkChangeTrackingAnnotation(JavaResourcePersistentType 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index 8868c555e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,97 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 8c1d409fb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public final class BinaryEclipseLinkConvertAnnotation
- extends BinaryAnnotation
- implements EclipseLinkConvertAnnotation
-{
- private String value;
-
- public BinaryEclipseLinkConvertAnnotation(JavaResourcePersistentAttribute 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());
- }
-
-
- // ********** 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(EclipseLink.CONVERT__VALUE);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
deleted file mode 100644
index 06dec938cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,85 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- */
-public final class BinaryEclipseLinkConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkConverterAnnotation
-{
- private String converterClass;
-
-
- public BinaryEclipseLinkConverterAnnotation(JavaResourcePersistentMember 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index 27e5758a23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,80 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public final class BinaryEclipseLinkCustomizerAnnotation
- extends BinaryAnnotation
- implements EclipseLinkCustomizerAnnotation
-{
- private String value;
-
-
- public BinaryEclipseLinkCustomizerAnnotation(JavaResourcePersistentType 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index 5f4add2b68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,72 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public final class BinaryEclipseLinkExistenceCheckingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkExistenceCheckingAnnotation
-{
- private ExistenceType value;
-
-
- public BinaryEclipseLinkExistenceCheckingAnnotation(JavaResourcePersistentType 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index a772ff26e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,72 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public final class BinaryEclipseLinkJoinFetchAnnotation
- extends BinaryAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- private JoinFetchType value;
-
-
- public BinaryEclipseLinkJoinFetchAnnotation(JavaResourcePersistentAttribute 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java
deleted file mode 100644
index 50deeb43a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public final class BinaryEclipseLinkMutableAnnotation
- extends BinaryAnnotation
- implements EclipseLinkMutableAnnotation
-{
- private Boolean value;
-
-
- public BinaryEclipseLinkMutableAnnotation(JavaResourcePersistentAttribute 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index b49f177ef4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,75 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.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(JavaResourcePersistentMember 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index 4b23b13af6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,140 +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.eclipselink.core.internal.resource.java.binary;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-public final class BinaryEclipseLinkObjectTypeConverterAnnotation
- extends BinaryBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkObjectTypeConverterAnnotation
-{
- private String defaultObjectValue;
- private final Vector<EclipseLinkConversionValueAnnotation> conversionValues;
-
-
- public BinaryEclipseLinkObjectTypeConverterAnnotation(JavaResourcePersistentMember 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 ListIterator<EclipseLinkConversionValueAnnotation> conversionValues() {
- return new CloneListIterator<EclipseLinkConversionValueAnnotation>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public EclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValues.get(index);
- }
-
- public int indexOfConversionValue(EclipseLinkConversionValueAnnotation conversionValue) {
- return this.conversionValues.indexOf(conversionValue);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 3621a9353d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class BinaryEclipseLinkPrimaryKeyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrimaryKeyAnnotation
-{
- public BinaryEclipseLinkPrimaryKeyAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index fe59bed405..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class BinaryEclipseLinkPrivateOwnedAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrivateOwnedAnnotation
-{
-
- public BinaryEclipseLinkPrivateOwnedAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index 5a60f96635..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class BinaryEclipseLinkReadOnlyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkReadOnlyAnnotation
-{
-
- public BinaryEclipseLinkReadOnlyAnnotation(JavaResourcePersistentType parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index f8b37ade18..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public final class BinaryEclipseLinkReadTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkReadTransformerAnnotation
-{
-
- public BinaryEclipseLinkReadTransformerAnnotation(JavaResourcePersistentAttribute 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index a2d9654131..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,78 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.StructConverter
- */
-public final class BinaryEclipseLinkStructConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkStructConverterAnnotation
-{
- private String converter;
-
-
- public BinaryEclipseLinkStructConverterAnnotation(JavaResourcePersistentMember 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index bde9507d1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,149 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index ae2c60afb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,98 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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(JavaResourcePersistentAttribute 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index bf6f16fb69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,97 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.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(JavaResourcePersistentAttribute 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index d266c8c157..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,53 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- */
-public final class BinaryEclipseLinkTypeConverterAnnotation
- extends BinaryBaseEclipseLinkTypeConverterAnnotation
- implements EclipseLinkTypeConverterAnnotation
-{
- public BinaryEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index f8a2ffdb93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,32 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class BinaryEclipseLinkVariableOneToOneAnnotation
- extends BinaryAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- public BinaryEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 5cf7dfc322..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,118 +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.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public class BinaryEclipseLinkWriteTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkWriteTransformerAnnotation
-{
- private ColumnAnnotation column;
-
-
- public BinaryEclipseLinkWriteTransformerAnnotation(JavaResourcePersistentAttribute parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.column = this.buildColumn();
- }
-
- 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 : new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- 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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index ba702eb069..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceBaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,164 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.TypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.BaseEclipseLinkTypeConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-abstract class SourceBaseEclipseLinkTypeConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements BaseEclipseLinkTypeConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> dataTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> dataTypeAdapter;
- String dataType;
- String fullyQualifiedDataType;
-
- final DeclarationAnnotationElementAdapter<String> objectTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> objectTypeAdapter;
- String objectType;
- String fullyQualifiedObjectType;
-
- SourceBaseEclipseLinkTypeConverterAnnotation(JavaResourcePersistentMember parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.dataTypeDeclarationAdapter = this.buildTypeAdapter(this.getDataTypeElementName());
- this.dataTypeAdapter = new MemberAnnotationElementAdapter<String>(this.member, this.dataTypeDeclarationAdapter);
-
- this.objectTypeDeclarationAdapter = this.buildTypeAdapter(this.getObjectTypeElementName());
- this.objectTypeAdapter = new MemberAnnotationElementAdapter<String>(this.member, this.objectTypeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(String elementName) {
- // false = do not remove annotation when empty
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, elementName, false, TypeStringExpressionConverter.instance());
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.dataType = this.buildDataType(astRoot);
- this.fullyQualifiedDataType = this.buildFullyQualifiedDataType(astRoot);
- this.objectType = this.buildObjectType(astRoot);
- this.fullyQualifiedObjectType = this.buildFullyQualifiedObjectType(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncDataType(this.buildDataType(astRoot));
- this.syncFullyQualifiedDataType(this.buildFullyQualifiedDataType(astRoot));
- this.syncObjectType(this.buildObjectType(astRoot));
- this.syncFullyQualifiedObjectType(this.buildFullyQualifiedObjectType(astRoot));
- }
-
-
- // ********** 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.dataTypeAdapter.setValue(dataType);
- }
- }
-
- private void syncDataType(String astDataType) {
- String old = this.dataType;
- this.dataType = astDataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, astDataType);
- }
-
- private String buildDataType(CompilationUnit astRoot) {
- return this.dataTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getDataTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getDataTypeElementName();
-
- // ***** fully-qualified data type
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- private void syncFullyQualifiedDataType(String name) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = name;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedDataType(CompilationUnit astRoot) {
- return (this.dataType == null) ? null : ASTTools.resolveFullyQualifiedName(this.dataTypeAdapter.getExpression(astRoot));
- }
-
- // ***** object type
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- if (this.attributeValueHasChanged(this.objectType, objectType)) {
- this.objectType = objectType;
- this.objectTypeAdapter.setValue(objectType);
- }
- }
-
- private void syncObjectType(String astObjectType) {
- String old = this.objectType;
- this.objectType = astObjectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, astObjectType);
- }
-
- private String buildObjectType(CompilationUnit astRoot) {
- return this.objectTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getObjectTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getObjectTypeElementName();
-
- // ***** fully-qualified object type
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- private void syncFullyQualifiedObjectType(String name) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = name;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedObjectType(CompilationUnit astRoot) {
- return (this.objectType == null) ? null : ASTTools.resolveFullyQualifiedName(this.objectTypeAdapter.getExpression(astRoot));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index efe884329a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class SourceEclipseLinkBasicCollectionAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkBasicCollectionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicCollectionAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 307855c110..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class SourceEclipseLinkBasicMapAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkBasicMapAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicMapAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
deleted file mode 100644
index 1e553f4b02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,433 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public final class SourceEclipseLinkCacheAnnotation
- extends SourceAnnotation<Type>
- 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<Integer> EXPIRY_ADAPTER = buildExpiryAdapter();
- private final AnnotationElementAdapter<Integer> expiryAdapter;
- private Integer expiry;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> ALWAYS_REFRESH_ADAPTER = buildAlwaysRefreshAdapter();
- private final AnnotationElementAdapter<Boolean> alwaysRefreshAdapter;
- private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> REFRESH_ONLY_IF_NEWER_ADAPTER = buildRefreshOnlyIfNewerAdapter();
- private final AnnotationElementAdapter<Boolean> refreshOnlyIfNewerAdapter;
- private Boolean alwaysRefresh;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> DISABLE_HITS_ADAPTER = buildDisableHitsAdapter();
- private final AnnotationElementAdapter<Boolean> disableHitsAdapter;
- private Boolean refreshOnlyIfNewer;
-
- private static final DeclarationAnnotationElementAdapter<String> COORDINATION_TYPE_ADAPTER = buildCoordinationTypeAdapter();
- private final AnnotationElementAdapter<String> coordinationTypeAdapter;
- private Boolean disableHits;
-
- private static final NestedDeclarationAnnotationAdapter EXPIRY_TIME_OF_DAY_ADAPTER = buildExpiryTimeOfDayAdapter();
- private final MemberAnnotationAdapter expiryTimeOfDayAdapter;
- private CacheCoordinationType coordinationType;
-
-
- public SourceEclipseLinkCacheAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.typeAdapter = new MemberAnnotationElementAdapter<String>(type, TYPE_ADAPTER);
- this.sizeAdapter = new MemberAnnotationElementAdapter<Integer>(type, SIZE_ADAPTER);
- this.sharedAdapter = new MemberAnnotationElementAdapter<Boolean>(type, SHARED_ADAPTER);
- this.expiryAdapter = new MemberAnnotationElementAdapter<Integer>(type, EXPIRY_ADAPTER);
- this.alwaysRefreshAdapter = new MemberAnnotationElementAdapter<Boolean>(type, ALWAYS_REFRESH_ADAPTER);
- this.refreshOnlyIfNewerAdapter = new MemberAnnotationElementAdapter<Boolean>(type, REFRESH_ONLY_IF_NEWER_ADAPTER);
- this.disableHitsAdapter = new MemberAnnotationElementAdapter<Boolean>(type, DISABLE_HITS_ADAPTER);
- this.coordinationTypeAdapter = new MemberAnnotationElementAdapter<String>(type, COORDINATION_TYPE_ADAPTER);
- this.expiryTimeOfDayAdapter = new MemberAnnotationAdapter(type, EXPIRY_TIME_OF_DAY_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.expiry = this.buildExpiry(astRoot);
- this.initializeExpiryTimeOfDay(astRoot);
- this.alwaysRefresh = this.buildAlwaysRefresh(astRoot);
- this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer(astRoot);
- this.disableHits = this.buildDisableHits(astRoot);
- this.coordinationType = this.buildCoordinationType(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.syncExpiry(this.buildExpiry(astRoot));
- this.syncExpiryTimeOfDay(astRoot);
- this.syncAlwaysRefresh(this.buildAlwaysRefresh(astRoot));
- this.syncRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer(astRoot));
- this.syncDisableHits(this.buildDisableHits(astRoot));
- this.syncCoordinationType(this.buildCoordinationType(astRoot));
- }
-
- @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);
- }
-
- // ***** 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$
- }
- this.expiryTimeOfDay.removeAnnotation();
- this.expiryTimeOfDay = null;
- }
-
- private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() {
- return new SourceEclipseLinkTimeOfDayAnnotation(this, this.member, 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 null;//TODO return this.getElementTextRange(EXPIRY_TIME_OF_DAY_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);
- }
-
-
- // ********** 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index 575ed10b48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,99 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public final class SourceEclipseLinkChangeTrackingAnnotation
- extends SourceAnnotation<Type>
- 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(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, 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 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, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index f1b803486a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,171 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberIndexedAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.NestableEclipseLinkConversionValueAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ConversionValue
- */
-final class SourceEclipseLinkConversionValueAnnotation
- extends SourceAnnotation<Member>
- implements NestableEclipseLinkConversionValueAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> dataValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> dataValueAdapter;
- private String dataValue;
-
- private final DeclarationAnnotationElementAdapter<String> objectValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> objectValueAdapter;
- private String objectValue;
-
-
- SourceEclipseLinkConversionValueAnnotation(EclipseLinkObjectTypeConverterAnnotation parent, Member member, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, member, idaa, new MemberIndexedAnnotationAdapter(member, idaa));
- this.dataValueDeclarationAdapter = this.buildDataValueAdapter(idaa);
- this.dataValueAdapter = this.buildAdapter(this.dataValueDeclarationAdapter);
- this.objectValueDeclarationAdapter = this.buildObjectValueAdapter(idaa);
- this.objectValueAdapter = this.buildAdapter(this.objectValueDeclarationAdapter);
- }
-
- private AnnotationElementAdapter<String> buildAdapter(DeclarationAnnotationElementAdapter<String> daea) {
- return new MemberAnnotationElementAdapter<String>(this.member, daea);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDataValueAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, EclipseLink.CONVERSION_VALUE__DATA_VALUE, false);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildObjectValueAdapter(DeclarationAnnotationAdapter declarationAnnotationAdapter) {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(declarationAnnotationAdapter, EclipseLink.CONVERSION_VALUE__OBJECT_VALUE, false);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.dataValue = this.buildDataValue(astRoot);
- this.objectValue = this.buildObjectValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncDataValue(this.buildDataValue(astRoot));
- this.syncObjectValue(this.buildObjectValue(astRoot));
- }
-
- public IndexedAnnotationAdapter getIndexedAnnotationAdapter() {
- return (IndexedAnnotationAdapter) this.annotationAdapter;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.dataValue);
- sb.append("=>"); //$NON-NLS-1$
- sb.append(this.objectValue);
- }
-
-
- // ********** 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.getElementTextRange(this.dataValueDeclarationAdapter, astRoot);
- }
-
- // ***** 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.getElementTextRange(this.objectValueDeclarationAdapter, astRoot);
- }
-
-
- //************ NestableAnnotation implementation
-
- public void initializeFrom(NestableAnnotation oldAnnotation) {
- EclipseLinkConversionValueAnnotation oldConversionValue = (EclipseLinkConversionValueAnnotation) oldAnnotation;
- this.setDataValue(oldConversionValue.getDataValue());
- this.setObjectValue(oldConversionValue.getObjectValue());
- }
-
- public void moveAnnotation(int newIndex) {
- this.getIndexedAnnotationAdapter().moveAnnotation(newIndex);
- }
-
-
- // ********** static methods **********
-
- static NestableEclipseLinkConversionValueAnnotation createConversionValue(EclipseLinkObjectTypeConverterAnnotation parent, Member member, DeclarationAnnotationAdapter daa, int index) {
- return new SourceEclipseLinkConversionValueAnnotation(parent, member, buildConversionValueAnnotationAdapter(daa, index));
- }
-
- private static IndexedDeclarationAnnotationAdapter buildConversionValueAnnotationAdapter(DeclarationAnnotationAdapter daa, int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(daa, EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES, index, EclipseLink.CONVERSION_VALUE, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 68deb5fe47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,103 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public final class SourceEclipseLinkConvertAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkConvertAnnotation
-{
- 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;
-
-
- public SourceEclipseLinkConvertAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, 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 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(VALUE_ADAPTER, astRoot);
- }
-
- public boolean valueTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(VALUE_ADAPTER, pos, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CONVERT__VALUE, false, StringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
deleted file mode 100644
index 31ec25a7f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,129 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- */
-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 String fullyQualifiedConverterClassName;
-
- public SourceEclipseLinkConverterAnnotation(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.converterClassAdapter = new MemberAnnotationElementAdapter<String>(member, CONVERTER_CLASS_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converterClass = this.buildConverterClass(astRoot);
- this.fullyQualifiedConverterClassName = this.buildFullyQualifiedConverterClassName(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverterClass(this.buildConverterClass(astRoot));
- this.syncFullyQualifiedConverterClassName(this.buildFullyQualifiedConverterClassName(astRoot));
- }
-
-
- // ********** 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.converterClassAdapter.setValue(converterClass);
- }
- }
-
- private void syncConverterClass(String astConverterClass) {
- String old = this.converterClass;
- this.converterClass = astConverterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, astConverterClass);
- }
-
- private String buildConverterClass(CompilationUnit astRoot) {
- return this.converterClassAdapter.getValue(astRoot);
- }
-
- public TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(CONVERTER_CLASS_ADAPTER, astRoot);
- }
-
- public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.converterClass != null)
- && ASTTools.typeIsSubTypeOf(this.converterClassAdapter.getExpression(astRoot), interfaceName);
- }
-
- // ***** fully-qualified converter class name
- public String getFullyQualifiedConverterClassName() {
- return this.fullyQualifiedConverterClassName;
- }
-
- private void syncFullyQualifiedConverterClassName(String name) {
- String old = this.fullyQualifiedConverterClassName;
- this.fullyQualifiedConverterClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_CONVERTER_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedConverterClassName(CompilationUnit astRoot) {
- return (this.converterClass == null) ? null : ASTTools.resolveFullyQualifiedName(this.converterClassAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CONVERTER__CONVERTER_CLASS, false, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index 43f3486df2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,124 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public final class SourceEclipseLinkCustomizerAnnotation
- extends SourceAnnotation<Type>
- 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;
-
- private String fullyQualifiedCustomizerClassName;
-
- public SourceEclipseLinkCustomizerAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedCustomizerClassName = this.buildFullyQualifiedCustomizerClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedCustomizerClassName(this.buildFullyQualifiedCustomizerClassName(astRoot));
- }
-
- @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.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 customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.value != null)
- && ASTTools.typeIsSubTypeOf(this.valueAdapter.getExpression(astRoot), interfaceName);
- }
-
-
- // ***** fully-qualified customizer class name
- public String getFullyQualifiedCustomizerClassName() {
- return this.fullyQualifiedCustomizerClassName;
- }
-
- private void syncFullyQualifiedCustomizerClassName(String name) {
- String old = this.fullyQualifiedCustomizerClassName;
- this.fullyQualifiedCustomizerClassName = name;
- this.firePropertyChanged(FULLY_QUALIFIED_CUSTOMIZER_CLASS_NAME_PROPERTY, old, name);
- }
-
- private String buildFullyQualifiedCustomizerClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CUSTOMIZER__VALUE, false, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index bae9012793..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,99 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public final class SourceEclipseLinkExistenceCheckingAnnotation
- extends SourceAnnotation<Type>
- 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(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, 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 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, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 604a9af93b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,99 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public final class SourceEclipseLinkJoinFetchAnnotation
- extends SourceAnnotation<Attribute>
- 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(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(attribute, 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 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, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
deleted file mode 100644
index 62832e81ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,99 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public final class SourceEclipseLinkMutableAnnotation
- extends SourceAnnotation<Attribute>
- 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(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<Boolean>(attribute, 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 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, false, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 244d24f4b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,96 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.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 SourceEclipseLinkNamedConverterAnnotation
- extends SourceAnnotation<Member>
- implements EclipseLinkNamedConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
-
-
- // ********** construction/initialization **********
-
- SourceEclipseLinkNamedConverterAnnotation(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter daa) {
- super(parent, member, daa);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName(), false); // false = do not remove annotation when empty
- this.nameAdapter = new MemberAnnotationElementAdapter<String>(this.member, this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- }
-
- @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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index f89b76434e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,262 +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.eclipselink.core.internal.resource.java.source;
-
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.AnnotationContainer;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.NestableEclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-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 final Vector<NestableEclipseLinkConversionValueAnnotation> conversionValues = new Vector<NestableEclipseLinkConversionValueAnnotation>();
- private final ConversionValuesAnnotationContainer conversionValuesContainer = new ConversionValuesAnnotationContainer();
-
-
- public SourceEclipseLinkObjectTypeConverterAnnotation(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.defaultObjectValueAdapter = new MemberAnnotationElementAdapter<String>(member, DEFAULT_OBJECT_VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.defaultObjectValue = this.buildDefaultObjectValue(astRoot);
- AnnotationContainerTools.initialize(this.conversionValuesContainer, astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncDefaultObjectValue(this.buildDefaultObjectValue(astRoot));
- AnnotationContainerTools.synchronize(this.conversionValuesContainer, astRoot);
- }
-
-
- // ********** 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.getElementTextRange(DEFAULT_OBJECT_VALUE_ADAPTER, astRoot);
- }
-
- // ***** conversion values
- public ListIterator<EclipseLinkConversionValueAnnotation> conversionValues() {
- return new CloneListIterator<EclipseLinkConversionValueAnnotation>(this.conversionValues);
- }
-
- Iterable<NestableEclipseLinkConversionValueAnnotation> getNestableConversionValues() {
- return new LiveCloneIterable<NestableEclipseLinkConversionValueAnnotation>(this.conversionValues);
- }
-
- public int conversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public NestableEclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValues.get(index);
- }
-
- public int indexOfConversionValue(EclipseLinkConversionValueAnnotation conversionValue) {
- return this.conversionValues.indexOf(conversionValue);
- }
-
- public NestableEclipseLinkConversionValueAnnotation addConversionValue(int index) {
- return (NestableEclipseLinkConversionValueAnnotation) AnnotationContainerTools.addNestedAnnotation(index, this.conversionValuesContainer);
- }
-
- NestableEclipseLinkConversionValueAnnotation addConversionValue_() {
- return this.addConversionValue_(this.conversionValues.size());
- }
-
- private NestableEclipseLinkConversionValueAnnotation addConversionValue_(int index) {
- NestableEclipseLinkConversionValueAnnotation conversionValue = this.buildConversionValue(index);
- this.conversionValues.add(conversionValue);
- return conversionValue;
- }
-
- void syncAddConversionValue(org.eclipse.jdt.core.dom.Annotation astAnnotation) {
- int index = this.conversionValues.size();
- NestableEclipseLinkConversionValueAnnotation conversionValue = this.addConversionValue_(index);
- conversionValue.initialize((CompilationUnit) astAnnotation.getRoot());
- this.fireItemAdded(CONVERSION_VALUES_LIST, index, conversionValue);
- }
-
- private NestableEclipseLinkConversionValueAnnotation buildConversionValue(int index) {
- return SourceEclipseLinkConversionValueAnnotation.createConversionValue(this, this.member, this.daa, index);
- }
-
- void conversionValueAdded(int index, NestableEclipseLinkConversionValueAnnotation conversionValue) {
- this.fireItemAdded(CONVERSION_VALUES_LIST, index, conversionValue);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- AnnotationContainerTools.moveNestedAnnotation(targetIndex, sourceIndex, this.conversionValuesContainer);
- }
-
- NestableEclipseLinkConversionValueAnnotation moveConversionValue_(int targetIndex, int sourceIndex) {
- return CollectionTools.move(this.conversionValues, targetIndex, sourceIndex).get(targetIndex);
- }
-
- public void removeConversionValue(int index) {
- AnnotationContainerTools.removeNestedAnnotation(index, this.conversionValuesContainer);
- }
-
- NestableEclipseLinkConversionValueAnnotation removeConversionValue_(int index) {
- return this.conversionValues.remove(index);
- }
-
- void syncRemoveConversionValues(int index) {
- this.removeItemsFromList(index, this.conversionValues, CONVERSION_VALUES_LIST);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildDefaultObjectValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, false, StringExpressionConverter.instance());
- }
-
-
- // ********** conversion value container **********
-
- /**
- * adapt the AnnotationContainer interface to the object type converter's
- * conversion values
- */
- class ConversionValuesAnnotationContainer
- implements AnnotationContainer<NestableEclipseLinkConversionValueAnnotation>
- {
- public org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.getAstAnnotation(astRoot);
- }
-
- public String getElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES;
- }
-
- public String getNestedAnnotationName() {
- return EclipseLinkConversionValueAnnotation.ANNOTATION_NAME;
- }
-
- public Iterable<NestableEclipseLinkConversionValueAnnotation> getNestedAnnotations() {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.getNestableConversionValues();
- }
-
- public int getNestedAnnotationsSize() {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.conversionValuesSize();
- }
-
- public NestableEclipseLinkConversionValueAnnotation addNestedAnnotation() {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.addConversionValue_();
- }
-
- public void syncAddNestedAnnotation(Annotation astAnnotation) {
- SourceEclipseLinkObjectTypeConverterAnnotation.this.syncAddConversionValue(astAnnotation);
- }
-
- public NestableEclipseLinkConversionValueAnnotation moveNestedAnnotation(int targetIndex, int sourceIndex) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.moveConversionValue_(targetIndex, sourceIndex);
- }
-
- public NestableEclipseLinkConversionValueAnnotation removeNestedAnnotation(int index) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.removeConversionValue_(index);
- }
-
- public void syncRemoveNestedAnnotations(int index) {
- SourceEclipseLinkObjectTypeConverterAnnotation.this.syncRemoveConversionValues(index);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 3bbb21a23d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class SourceEclipseLinkPrimaryKeyAnnotation
- extends SourceAnnotation<Type>
- implements EclipseLinkPrimaryKeyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrimaryKeyAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index d6446f9519..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class SourceEclipseLinkPrivateOwnedAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkPrivateOwnedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrivateOwnedAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index 112039d734..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class SourceEclipseLinkReadOnlyAnnotation
- extends SourceAnnotation<Type>
- implements EclipseLinkReadOnlyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkReadOnlyAnnotation(JavaResourcePersistentType parent, Type type) {
- super(parent, type, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index c2274c4378..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,50 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index f2fabfae0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,105 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.StructConverter
- */
-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;
-
-
- public SourceEclipseLinkStructConverterAnnotation(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, DECLARATION_ANNOTATION_ADAPTER);
- this.converterAdapter = new MemberAnnotationElementAdapter<String>(member, CONVERTER_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converter = this.buildConverter(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverter(this.buildConverter(astRoot));
- }
-
-
- // ********** 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.getElementTextRange(CONVERTER_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildConverterAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.STRUCT_CONVERTER__CONVERTER, false, StringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index d9a563b267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,206 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TimeOfDay
- */
-public final class SourceEclipseLinkTimeOfDayAnnotation
- extends SourceAnnotation<Type>
- 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, Type type, DeclarationAnnotationAdapter daa) {
- super(parent, type, daa);
- this.hourDeclarationAdapter = buildHourAdapter(daa);
- this.hourAdapter = new MemberAnnotationElementAdapter<Integer>(type, this.hourDeclarationAdapter);
- this.minuteDeclarationAdapter = buildMinuteAdapter(daa);
- this.minuteAdapter = new MemberAnnotationElementAdapter<Integer>(type, this.minuteDeclarationAdapter);
- this.secondDeclarationAdapter = buildSecondAdapter(daa);
- this.secondAdapter = new MemberAnnotationElementAdapter<Integer>(type, this.secondDeclarationAdapter);
- this.millisecondDeclarationAdapter = buildMillisecondAdapter(daa);
- this.millisecondAdapter = new MemberAnnotationElementAdapter<Integer>(type, 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));
- }
-
-
- // ********** 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, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMinuteAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MINUTE, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__SECOND, false, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMillisecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MILLISECOND, false, NumberIntegerExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 2927b6f3db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,138 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public final class SourceEclipseLinkTransformationAnnotation
- extends SourceAnnotation<Attribute>
- 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(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.fetchAdapter = new MemberAnnotationElementAdapter<String>(attribute, FETCH_ADAPTER);
- this.optionalAdapter = new MemberAnnotationElementAdapter<Boolean>(attribute, OPTIONAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.optional = this.buildOptional(astRoot);
- this.fetch = this.buildFetch(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncOptional(this.buildOptional(astRoot));
- this.syncFetch(this.buildFetch(astRoot));
- }
-
- @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, false, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__FETCH, false);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index e50c25eb6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,125 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-abstract class SourceEclipseLinkTransformerAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkTransformerAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> transformerClassDeclarationAdapter;
- final AnnotationElementAdapter<String> transformerClassAdapter;
- String transformerClass;
-
- final DeclarationAnnotationElementAdapter<String> methodDeclarationAdapter;
- final AnnotationElementAdapter<String> methodAdapter;
- String method;
-
-
- SourceEclipseLinkTransformerAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute, DeclarationAnnotationAdapter daa) {
- super(parent, attribute, daa);
- this.transformerClassDeclarationAdapter = new ConversionDeclarationAnnotationElementAdapter<String>(daa, this.getTransformerClassElementName(), false, SimpleTypeStringExpressionConverter.instance());
- this.transformerClassAdapter = new MemberAnnotationElementAdapter<String>(attribute, this.transformerClassDeclarationAdapter);
-
- this.methodDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getMethodElementName(), false);
- this.methodAdapter = new MemberAnnotationElementAdapter<String>(attribute, 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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index e6f7670b1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,58 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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(JavaResourcePersistentMember parent, Member member) {
- super(parent, member, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 5b542e2cbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,46 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public final class SourceEclipseLinkVariableOneToOneAnnotation
- extends SourceAnnotation<Attribute>
- implements EclipseLinkVariableOneToOneAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkVariableOneToOneAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index cc71ce6b66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,146 +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.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceColumnAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.Attribute;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.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 MemberAnnotationAdapter columnAdapter;
- private ColumnAnnotation column;
-
-
- public SourceEclipseLinkWriteTransformerAnnotation(JavaResourcePersistentAttribute parent, Attribute attribute) {
- super(parent, attribute, DECLARATION_ANNOTATION_ADAPTER);
- this.columnAdapter = new MemberAnnotationAdapter(this.member, buildColumnAnnotationAdapter(this.daa));
- }
-
- 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.member, this.daa);
- this.column.initialize(astRoot);
- }
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncColumn(astRoot);
- }
-
-
- // ********** 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 : new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- public ColumnAnnotation addColumn() {
- if (this.column != null) {
- throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$
- }
- this.column = createColumn(this, this.member, 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$
- }
- this.column.removeAnnotation();
- this.column = null;
- }
-
- private void syncColumn(CompilationUnit astRoot) {
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.syncColumn_(null);
- } else {
- if (this.column == null) {
- ColumnAnnotation col = createColumn(this, this.member, 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);
- }
-
- 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, false);
- }
-
- private static ColumnAnnotation createColumn(JavaResourceNode parent, Member member, DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new SourceColumnAnnotation(parent, member, buildColumnAnnotationAdapter(writeTransformerAnnotationAdapter));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
deleted file mode 100644
index d0c1e5706d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
+++ /dev/null
@@ -1,87 +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.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.core.runtime.Path;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.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().toString());
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the specified deploy location
- */
- public static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider(IProject project, String deployLocation) {
- return getXmlResourceProvider_(project, JptCorePlugin.getDeploymentURI(project, deployLocation));
-
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the default deploy location
- */
- public static EclipseLinkOrmXmlResourceProvider getDefaultXmlResourceProvider(IProject project) {
- return getXmlResourceProvider(project, JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- private static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider_(IProject project, String location) {
- return new EclipseLinkOrmXmlResourceProvider(project, new Path(location));
- }
-
-
- public EclipseLinkOrmXmlResourceProvider(IProject project) {
- this(project, new Path(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH));
- }
-
- public EclipseLinkOrmXmlResourceProvider(IProject project, IPath filePath) {
- super(project, filePath, JptEclipseLinkCorePlugin.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 = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- puMetadata.setPersistenceUnitDefaults(puDefaults);
- puDefaults.setAccess(defaultAccess);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/utility/EclipseLinkLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/utility/EclipseLinkLibraryValidator.java
deleted file mode 100644
index 9f4ac41c33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/utility/EclipseLinkLibraryValidator.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.eclipselink.core.internal.utility;
-
-import java.util.ArrayList;
-import java.util.List;
-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.core.internal.utility.KeyClassesValidator;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCoreMessages;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
-import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryValidator;
-import org.eclipse.osgi.service.resolver.VersionRange;
-import org.osgi.framework.Version;
-
-/**
- * Library validator for EclipseLink user libraries.
- *
- * This has two facets:
- * - eclipselink version: In order to validate that the correct eclipselink.jar is present in the
- * user library, the extension using this should specify none or more version ranges using a
- * standard library provider param expression, but with the prefix "version-range". The actual
- * version of the eclipselink build will be checked against the union of these version ranges.
- * (e.g. <param name="validator.param.0" value="version-range:[2.0, 3.0)"/> )
- * - jpa key classes: In order to validate that the correct jpa.jar is present in the user
- * library (since version of that jar is impossible to check,) the extension using this should
- * specify none or more key classes using a standard library provider param expression, but
- * with the prefix "key-class". The user library will check that all specified key classes
- * are present.
- * (e.g. <param name="validator.param.1" value="key-class:javax.persistence.Entity"/> )
- */
-public class EclipseLinkLibraryValidator
- extends UserLibraryValidator
-{
- private final static String VERSION_CLASS_PATH = "org/eclipse/persistence/Version.class";
-
- private final static String VERSION_FIELD_NAME = "version";
-
- private final static String VERSION_RANGE_PREFIX = "version-range:";
-
- private final static String KEY_CLASS_PREFIX = "key-class:";
-
- private final List<VersionRange> versionRanges = new ArrayList<VersionRange>();
-
- private final List<String> keyClasses = new ArrayList<String>();
-
-
- private final KeyClassesValidator keyClassesValidator = new KeyClassesValidator();
-
-
- public EclipseLinkLibraryValidator() {
- super();
- }
-
-
- @Override
- public void init(final List<String> params) {
- for (String param : params) {
- if (param.startsWith(VERSION_RANGE_PREFIX)) {
- versionRanges.add(new VersionRange(param.replaceFirst(VERSION_RANGE_PREFIX, "")));
- }
- else if (param.startsWith(KEY_CLASS_PREFIX)) {
- keyClasses.add(param.replaceFirst(KEY_CLASS_PREFIX, ""));
- }
- }
- this.keyClassesValidator.init(this.keyClasses);
- }
-
- @Override
- public IStatus validate(UserLibraryProviderInstallOperationConfig config) {
- if (! this.keyClassesValidator.validate(config).isOK()) {
- return new Status(
- IStatus.ERROR, JptEclipseLinkCorePlugin.PLUGIN_ID,
- JptEclipseLinkCoreMessages.EclipseLinkLibraryValidator_invalidJpaLibrary);
- }
-
- Version version = null;
- for (IClasspathEntry cpe : config.resolve()) {
- String versionString = null;
- if (cpe.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
- IClassFileReader classReader =
- ToolFactory.createDefaultClassFileReader(
- cpe.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, JptEclipseLinkCorePlugin.PLUGIN_ID,
- JptEclipseLinkCoreMessages.EclipseLinkLibraryValidator_multipleEclipseLinkVersions);
- }
- else {
- version = new Version(versionString);
- }
- }
- }
- }
-
- if (version == null) {
- return new Status(
- IStatus.ERROR, JptEclipseLinkCorePlugin.PLUGIN_ID,
- JptEclipseLinkCoreMessages.EclipseLinkLibraryValidator_noEclipseLinkVersion);
- }
-
- for (VersionRange versionRange : this.versionRanges) {
- if (! versionRange.isIncluded(version)) {
- return new Status(
- IStatus.ERROR, JptEclipseLinkCorePlugin.PLUGIN_ID,
- JptEclipseLinkCoreMessages.EclipseLinkLibraryValidator_improperEclipseLinkVersion);
- }
- }
-
- return Status.OK_STATUS;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformFactory.java
deleted file mode 100644
index 930d413654..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformFactory.java
+++ /dev/null
@@ -1,73 +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.eclipselink.core.internal.v1_1;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.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(),
- buildJpaAnnotationProvider(),
- EclipseLink1_1JpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- protected JpaAnnotationProvider buildJpaAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- 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(
- JptEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_1,
- JptCorePlugin.JPA_FACET_VERSION_1_0
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformProvider.java
deleted file mode 100644
index 314943e1c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/EclipseLink1_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,173 +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.eclipselink.core.internal.v1_1;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkOrmResourceModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.EclipseLinkOrmXml1_1Definition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_1JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "eclipselink1_1"; //$NON-NLS-1$
-
- // 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 JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()};
- }
-
-
- // ********* java type mappings *********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no type mappings specific to eclipselink
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********* java attribute mappings *********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaEclipseLinkBasicCollectionMappingDefinition.instance(),
- JavaEclipseLinkBasicMapMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaEclipseLinkTransformationMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance()};
- }
-
-
- // ********* mapping files *********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- // order should not be important here
- return new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkEntityPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkEntityPrimaryKeyValidator.java
deleted file mode 100644
index b12d908a0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkEntityPrimaryKeyValidator.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.eclipselink.core.internal.v1_1.context;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericEntityPrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.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 GenericEntityPrimaryKeyValidator
-{
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
deleted file mode 100644
index c194a10992..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.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.eclipselink.core.internal.v1_1.context;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.core.internal.jpa1.context.GenericMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.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 GenericMappedSuperclassPrimaryKeyValidator
-{
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java
deleted file mode 100644
index 768b0e1827..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1ContextNodeFactory.java
+++ /dev/null
@@ -1,138 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlContextNodeFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-
-
-public class EclipseLinkOrmXml1_1ContextNodeFactory extends EclipseLinkOrmXmlContextNodeFactory
-{
-
- // ********** EclipseLink1.1-specific ORM Context Model **********
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, org.eclipse.jpt.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new OrmEclipseLinkPersistentAttribute1_1(parent, owner, (XmlAttributeMapping) resourceMapping);
- }
-
-
- // ********** EclipseLink-specific ORM Virtual Resource Model **********
-
- @Override
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- return new VirtualEclipseLinkXmlBasic1_1(ormTypeMapping, javaBasicMapping);
- }
-
- @Override
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- return new VirtualEclipseLinkXmlId1_1(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- return new VirtualEclipseLinkXmlEmbeddedId1_1(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- return new VirtualEclipseLinkXmlEmbedded1_1(ormTypeMapping, javaEmbeddedMapping);
- }
-
- @Override
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- return new VirtualEclipseLinkXmlManyToMany1_1(ormTypeMapping, javaManyToManyMapping);
- }
-
- @Override
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- return new VirtualEclipseLinkXmlManyToOne1_1(ormTypeMapping, javaManyToOneMapping);
- }
-
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualEclipseLinkXmlOneToMany1_1(ormTypeMapping, (JavaEclipseLinkOneToManyMapping) javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne1_1(ormTypeMapping, (JavaEclipseLinkOneToOneMapping) javaOneToOneMapping);
- }
-
- @Override
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- return new VirtualEclipseLinkXmlVersion1_1(ormTypeMapping, javaVersionMapping);
- }
-
- @Override
- public XmlBasicCollection buildVirtualEclipseLinkXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicCollectionMapping javaBasicCollectionMapping) {
- return new VirtualEclipseLinkXmlBasicCollection1_1(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- @Override
- public XmlBasicMap buildVirtualEclipseLinkXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicMapMapping javaBasicMapMapping) {
- return new VirtualEclipseLinkXmlBasicMap1_1(ormTypeMapping, javaBasicMapMapping);
- }
-
- @Override
- public XmlTransformation buildVirtualEclipseLinkXmlTransformation(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTransformationMapping javaTransformationMapping) {
- return new VirtualEclipseLinkXmlTransformation1_1(ormTypeMapping, javaTransformationMapping);
- }
-
- @Override
- public XmlVariableOneToOne buildVirtualEclipseLinkXmlVariableOneToOne(OrmTypeMapping ormTypeMapping, JavaEclipseLinkVariableOneToOneMapping javaVariableOneToOneMapping) {
- return new VirtualEclipseLinkXmlVariableOneToOne1_1(ormTypeMapping, javaVariableOneToOneMapping);
- }
-
- @Override
- public XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaAttributeMapping) {
- return new VirtualEclipseLinkXmlTransient1_1(ormTypeMapping, javaAttributeMapping);
- }
-
- @Override
- public XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtuaEclipseLinklXmlNullAttributeMapping1_1(ormTypeMapping, javaAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1Definition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1Definition.java
deleted file mode 100644
index fbbcd4f44c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/EclipseLinkOrmXml1_1Definition.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractEclipseLinkOrmXmlDefinition;
-
-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();
- }
-
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml1_1ContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/OrmEclipseLinkPersistentAttribute1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/OrmEclipseLinkPersistentAttribute1_1.java
deleted file mode 100644
index af446f8a42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/OrmEclipseLinkPersistentAttribute1_1.java
+++ /dev/null
@@ -1,61 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-
-
-public class OrmEclipseLinkPersistentAttribute1_1
- extends AbstractOrmPersistentAttribute
-{
-
- protected AccessType specifiedAccess;
-
- public OrmEclipseLinkPersistentAttribute1_1(OrmPersistentType parent, Owner owner, XmlAttributeMapping resourceMapping) {
- super(parent, owner, resourceMapping);
- this.specifiedAccess = getResourceAccess();
- }
-
- @Override
- public XmlAttributeMapping getResourceAttributeMapping() {
- return (XmlAttributeMapping) super.getResourceAttributeMapping();
- }
-
- public AccessType getSpecifiedAccess() {
- return this.specifiedAccess;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- AccessType oldAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- this.getResourceAttributeMapping().setAccess(AccessType.toOrmResourceModel(newSpecifiedAccess));
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldAccess, newSpecifiedAccess);
- }
-
- protected void setSpecifiedAccess_(AccessType newSpecifiedAccess) {
- AccessType oldAccess = this.specifiedAccess;
- this.specifiedAccess = newSpecifiedAccess;
- firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldAccess, newSpecifiedAccess);
- }
-
- @Override
- public void update() {
- super.update();
- setSpecifiedAccess_(getResourceAccess());
- }
-
- protected AccessType getResourceAccess() {
- return AccessType.fromOrmResourceModel(getResourceAttributeMapping().getAccess());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtuaEclipseLinklXmlNullAttributeMapping1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtuaEclipseLinklXmlNullAttributeMapping1_1.java
deleted file mode 100644
index 3f817b968b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtuaEclipseLinklXmlNullAttributeMapping1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlNullAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualVersion is an implementation of Version used when there is
- * no tag in the orm.xml and an underlying javaVersionMapping exists.
- */
-public class VirtuaEclipseLinklXmlNullAttributeMapping1_1
- extends XmlNullAttributeMapping
- implements XmlAttributeMapping
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaAttributeMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlNullAttributeMapping virtualXmlNullAttributeMapping;
-
- public VirtuaEclipseLinklXmlNullAttributeMapping1_1(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaAttributeMapping;
- this.virtualXmlNullAttributeMapping = new VirtualEclipseLinkXmlNullAttributeMapping(ormTypeMapping, javaAttributeMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- public String getMappingKey() {
- return this.virtualXmlNullAttributeMapping.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlNullAttributeMapping.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlNullAttributeMapping.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlNullAttributeMapping.getNameTextRange();
- }
-
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlNullAttributeMapping.getAccessMethods();
- }
-
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlNullAttributeMapping.setAccessMethods(value);
- }
-
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlNullAttributeMapping.getProperties();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasic1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasic1_1.java
deleted file mode 100644
index 7c7f3d46a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasic1_1.java
+++ /dev/null
@@ -1,281 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasic1_1 extends XmlBasic
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaBasicMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlBasic virtualXmlBasic;
-
- public VirtualEclipseLinkXmlBasic1_1(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapping;
- this.virtualXmlBasic = new VirtualEclipseLinkXmlBasic(ormTypeMapping, javaBasicMapping);
- }
- protected boolean isOrmMetadataComplete() {
- return this.virtualXmlBasic.isOrmMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlBasic.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlBasic.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlBasic.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlBasic.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlBasic.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlBasic.setColumn(value);
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlBasic.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlBasic.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlBasic.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlBasic.setOptional(newOptional);
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlBasic.isLob();
- }
-
- @Override
- public void setLob(boolean newLob) {
- this.virtualXmlBasic.setLob(newLob);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlBasic.getLobTextRange();
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlBasic.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType setTemporal){
- this.virtualXmlBasic.setTemporal(setTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlBasic.getTemporalTextRange();
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlBasic.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType setEnumerated) {
- this.virtualXmlBasic.setEnumerated(setEnumerated);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return null;
- }
-
- @Override
- public Boolean getMutable() {
- return this.virtualXmlBasic.getMutable();
- }
-
- @Override
- public void setMutable(Boolean value) {
- this.virtualXmlBasic.setMutable(value);
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return this.virtualXmlBasic.getMutableTextRange();
- }
-
- @Override
- public String getConvert() {
- return this.virtualXmlBasic.getConvert();
- }
-
- @Override
- public void setConvert(String value) {
- this.virtualXmlBasic.setConvert(value);
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return this.virtualXmlBasic.getConvertTextRange();
- }
-
- @Override
- public XmlConverter getConverter() {
- return this.virtualXmlBasic.getConverter();
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- this.virtualXmlBasic.setConverter(value);
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- return this.virtualXmlBasic.getObjectTypeConverter();
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- this.virtualXmlBasic.setObjectTypeConverter(value);
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- return this.virtualXmlBasic.getStructConverter();
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- this.virtualXmlBasic.setStructConverter(value);
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- return this.virtualXmlBasic.getTypeConverter();
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- this.virtualXmlBasic.setTypeConverter(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlBasic.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlBasic.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlBasic.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public XmlTableGenerator getTableGenerator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setTableGenerator(XmlTableGenerator value) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public XmlSequenceGenerator getSequenceGenerator() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public XmlGeneratedValue getGeneratedValue() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void setGeneratedValue(XmlGeneratedValue value) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicCollection1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicCollection1_1.java
deleted file mode 100644
index 04131fd64a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicCollection1_1.java
+++ /dev/null
@@ -1,92 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasicCollection1_1 extends XmlBasicCollection
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkBasicCollectionMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlBasicCollection virtualXmlBasicCollection;
-
- public VirtualEclipseLinkXmlBasicCollection1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicCollectionMapping javaBasicCollectionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicCollectionMapping;
- this.virtualXmlBasicCollection = new VirtualEclipseLinkXmlBasicCollection(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlBasicCollection.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlBasicCollection.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlBasicCollection.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlBasicCollection.getNameTextRange();
- }
-
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlBasicCollection.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlBasicCollection.setAccessMethods(value);
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlBasicCollection.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicMap1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicMap1_1.java
deleted file mode 100644
index 2619dab249..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlBasicMap1_1.java
+++ /dev/null
@@ -1,91 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlBasicMap1_1 extends XmlBasicMap
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkBasicMapMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlBasicMap virtualXmlBasicMap;
-
- public VirtualEclipseLinkXmlBasicMap1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicMapMapping javaBasicMapMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaBasicMapMapping;
- this.virtualXmlBasicMap = new VirtualEclipseLinkXmlBasicMap(ormTypeMapping, javaBasicMapMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlBasicMap.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlBasicMap.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlBasicMap.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlBasicMap.getNameTextRange();
- }
-
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlBasicMap.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlBasicMap.setAccessMethods(value);
- }
-
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlBasicMap.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbedded1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbedded1_1.java
deleted file mode 100644
index 0aea45ef0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbedded1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlEmbedded1_1 extends XmlEmbedded
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlEmbedded virtualXmlEmbedded;
-
- public VirtualEclipseLinkXmlEmbedded1_1(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedMapping;
- this.virtualXmlEmbedded = new VirtualEclipseLinkXmlEmbedded(ormTypeMapping, javaEmbeddedMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbedded.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbedded.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbedded.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbedded.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbedded.getAttributeOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlEmbedded.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlEmbedded.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlEmbedded.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbeddedId1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbeddedId1_1.java
deleted file mode 100644
index 9a59a6c9fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlEmbeddedId1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlEmbeddedId1_1 extends XmlEmbeddedId
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedIdMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlEmbeddedId virtualXmlEmbeddedId;
-
- public VirtualEclipseLinkXmlEmbeddedId1_1(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedIdMapping;
- this.virtualXmlEmbeddedId = new VirtualEclipseLinkXmlEmbeddedId(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbeddedId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbeddedId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbeddedId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbeddedId.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbeddedId.getAttributeOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlEmbeddedId.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlEmbeddedId.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlEmbeddedId.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlId1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlId1_1.java
deleted file mode 100644
index 1fc5c04407..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlId1_1.java
+++ /dev/null
@@ -1,251 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlId1_1 extends XmlId
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaIdMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlId virtualXmlId;
-
- public VirtualEclipseLinkXmlId1_1(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaIdMapping;
- this.virtualXmlId = new VirtualEclipseLinkXmlId(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlId.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlId.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlId.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlId.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlId.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlId.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlId.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- this.virtualXmlId.setTemporal(newTemporal);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlId.getTemporalTextRange();
- }
-
- @Override
- public XmlGeneratedValue getGeneratedValue() {
- return this.virtualXmlId.getGeneratedValue();
- }
-
- @Override
- public void setGeneratedValue(XmlGeneratedValue value) {
- this.virtualXmlId.setGeneratedValue(value);
- }
-
- @Override
- public XmlSequenceGenerator getSequenceGenerator() {
- return this.virtualXmlId.getSequenceGenerator();
- }
-
- @Override
- public void setSequenceGenerator(XmlSequenceGenerator value) {
- this.virtualXmlId.setSequenceGenerator(value);
- }
-
- @Override
- public XmlTableGenerator getTableGenerator() {
- return this.virtualXmlId.getTableGenerator();
- }
-
- @Override
- public void setTableGenerator(XmlTableGenerator value) {
- this.virtualXmlId.setTableGenerator(value);
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlId.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- this.virtualXmlId.setEnumerated(value);
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlId.getEnumeratedTextRange();
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlId.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- this.virtualXmlId.setLob(value);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlId.getLobTextRange();
- }
-
- @Override
- public Boolean getMutable() {
- return this.virtualXmlId.getMutable();
- }
-
- @Override
- public void setMutable(Boolean value) {
- this.virtualXmlId.setMutable(value);
- }
-
- @Override
- public String getConvert() {
- return this.virtualXmlId.getConvert();
- }
-
- @Override
- public void setConvert(String value) {
- this.virtualXmlId.setConvert(value);
- }
-
- @Override
- public XmlConverter getConverter() {
- return this.virtualXmlId.getConverter();
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- this.virtualXmlId.setConverter(value);
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- return this.virtualXmlId.getObjectTypeConverter();
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- this.virtualXmlId.setObjectTypeConverter(value);
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- return this.virtualXmlId.getStructConverter();
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- this.virtualXmlId.setStructConverter(value);
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- return this.virtualXmlId.getTypeConverter();
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- this.virtualXmlId.setTypeConverter(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlId.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlId.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlId.getProperties();
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return this.virtualXmlId.getMutableTextRange();
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return this.virtualXmlId.getConvertTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.java
deleted file mode 100644
index b0eb048edf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToMany1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlManyToMany1_1 extends XmlManyToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToManyMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlManyToMany virtualXmlManyToMany;
-
- public VirtualEclipseLinkXmlManyToMany1_1(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToManyMapping;
- this.virtualXmlManyToMany = new VirtualEclipseLinkXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlManyToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlManyToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlManyToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlManyToMany.setMapKey(value);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlManyToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlManyToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlManyToMany.getOrderColumn();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlManyToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToMany.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlManyToMany.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlManyToMany.setJoinFetch(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlManyToMany.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlManyToMany.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlManyToMany.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlManyToMany.getJoinFetchTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToOne1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToOne1_1.java
deleted file mode 100644
index 89af79c433..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlManyToOne1_1.java
+++ /dev/null
@@ -1,169 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlManyToOne1_1 extends XmlManyToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToOneMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlManyToOne virtualXmlManyToOne;
-
- public VirtualEclipseLinkXmlManyToOne1_1(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToOneMapping;
- this.virtualXmlManyToOne = new VirtualEclipseLinkXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlManyToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlManyToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlManyToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToOne.setTargetEntity(value);
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlManyToOne.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlManyToOne.setJoinFetch(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlManyToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlManyToOne.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlManyToOne.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlManyToOne.getJoinFetchTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.java
deleted file mode 100644
index 1eae804a0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToMany1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlOneToMany1_1 extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToManyMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToMany virtualXmlOneToMany;
-
- public VirtualEclipseLinkXmlOneToMany1_1(
- OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToManyMapping javaOneToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.virtualXmlOneToMany = new VirtualEclipseLinkXmlOneToMany(ormTypeMapping, javaOneToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlOneToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlOneToMany.setMapKey(value);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlOneToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlOneToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlOneToMany.getOrderColumn();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToMany.getTargetEntityTextRange();
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToMany.getJoinColumns();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlOneToMany.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlOneToMany.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.virtualXmlOneToMany.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.virtualXmlOneToMany.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlOneToMany.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlOneToMany.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlOneToMany.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlOneToMany.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.virtualXmlOneToMany.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.java
deleted file mode 100644
index 63cde7bdfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlOneToOne1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlOneToOne1_1 extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToOneMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToOne virtualXmlOneToOne;
-
- public VirtualEclipseLinkXmlOneToOne1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToOneMapping javaOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.virtualXmlOneToOne = new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlOneToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlOneToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToOne.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToOne.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToOne.setMappedBy(value);
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- return this.virtualXmlOneToOne.getPrimaryKeyJoinColumns();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToOne.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.virtualXmlOneToOne.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.virtualXmlOneToOne.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.virtualXmlOneToOne.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.virtualXmlOneToOne.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlOneToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlOneToOne.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlOneToOne.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.virtualXmlOneToOne.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.virtualXmlOneToOne.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransformation1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransformation1_1.java
deleted file mode 100644
index a30d2e0c48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransformation1_1.java
+++ /dev/null
@@ -1,90 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlTransformation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlTransformation1_1 extends XmlTransformation
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkTransformationMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlTransformation virtualXmlTransformation;
-
- public VirtualEclipseLinkXmlTransformation1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTransformationMapping javaTransformationMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransformationMapping;
- this.virtualXmlTransformation = new VirtualEclipseLinkXmlTransformation(ormTypeMapping, javaTransformationMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlTransformation.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlTransformation.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlTransformation.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlTransformation.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlTransformation.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlTransformation.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlTransformation.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransient1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransient1_1.java
deleted file mode 100644
index 3736b40f63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlTransient1_1.java
+++ /dev/null
@@ -1,82 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlTransient;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlTransient1_1 extends XmlTransient
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaTransientMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlTransient virtualXmlTransient;
-
- public VirtualEclipseLinkXmlTransient1_1(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaTransientMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaTransientMapping;
- this.virtualXmlTransient = new VirtualEclipseLinkXmlTransient(ormTypeMapping, javaTransientMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlTransient.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlTransient.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlTransient.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlTransient.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlTransient.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods newAccessMethods) {
- this.virtualXmlTransient.setAccessMethods(newAccessMethods);
- }
-
- @Override
- public AccessType getAccess() {
- return null;
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVariableOneToOne1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVariableOneToOne1_1.java
deleted file mode 100644
index 4d911492bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVariableOneToOne1_1.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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlVariableOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlVariableOneToOne1_1 extends XmlVariableOneToOne
-{
-
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkVariableOneToOneMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlVariableOneToOne virtualXmlVariableOneToOne;
-
- public VirtualEclipseLinkXmlVariableOneToOne1_1(OrmTypeMapping ormTypeMapping, JavaEclipseLinkVariableOneToOneMapping javaVariableOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVariableOneToOneMapping;
- this.virtualXmlVariableOneToOne = new VirtualEclipseLinkXmlVariableOneToOne(ormTypeMapping, javaVariableOneToOneMapping);
- }
-
- public boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlVariableOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlVariableOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlVariableOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlVariableOneToOne.getNameTextRange();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlVariableOneToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlVariableOneToOne.setAccessMethods(value);
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVersion1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVersion1_1.java
deleted file mode 100644
index 9ac713b1e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_1/context/orm/VirtualEclipseLinkXmlVersion1_1.java
+++ /dev/null
@@ -1,221 +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.eclipselink.core.internal.v1_1.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlVersion;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlVersion1_1 extends XmlVersion
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaVersionMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlVersion virtualXmlVersion;
-
- public VirtualEclipseLinkXmlVersion1_1(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaVersionMapping;
- this.virtualXmlVersion = new VirtualEclipseLinkXmlVersion(ormTypeMapping, javaVersionMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlVersion.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlVersion.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlVersion.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlVersion.getNameTextRange();
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlVersion.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlVersion.setColumn(value);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlVersion.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlVersion.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlVersion.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlVersion.getEnumeratedTextRange();
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlVersion.getLobTextRange();
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlVersion.getTemporalTextRange();
- }
-
- @Override
- public Boolean getMutable() {
- return this.virtualXmlVersion.getMutable();
- }
-
- @Override
- public void setMutable(Boolean value) {
- this.virtualXmlVersion.setMutable(value);
- }
-
- @Override
- public String getConvert() {
- return this.virtualXmlVersion.getConvert();
- }
-
- @Override
- public void setConvert(String value) {
- this.virtualXmlVersion.setConvert(value);
- }
-
- @Override
- public TextRange getMutableTextRange() {
- return this.virtualXmlVersion.getMutableTextRange();
- }
-
- @Override
- public TextRange getConvertTextRange() {
- return this.virtualXmlVersion.getConvertTextRange();
- }
-
- @Override
- public XmlConverter getConverter() {
- return this.virtualXmlVersion.getConverter();
- }
-
- @Override
- public void setConverter(XmlConverter value) {
- this.virtualXmlVersion.setConverter(value);
- }
-
- @Override
- public XmlObjectTypeConverter getObjectTypeConverter() {
- return this.virtualXmlVersion.getObjectTypeConverter();
- }
-
- @Override
- public void setObjectTypeConverter(XmlObjectTypeConverter value) {
- this.virtualXmlVersion.setObjectTypeConverter(value);
- }
-
- @Override
- public XmlStructConverter getStructConverter() {
- return this.virtualXmlVersion.getStructConverter();
- }
-
- @Override
- public void setStructConverter(XmlStructConverter value) {
- this.virtualXmlVersion.setStructConverter(value);
- }
-
- @Override
- public XmlTypeConverter getTypeConverter() {
- return this.virtualXmlVersion.getTypeConverter();
- }
-
- @Override
- public void setTypeConverter(XmlTypeConverter value) {
- this.virtualXmlVersion.setTypeConverter(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlVersion.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlVersion.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlVersion.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 1d651675e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaAnnotationDefinitionProvider.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.eclipselink.core.internal.v1_2;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.AbstractJpaAnnotationDefintionProvider;
-import org.eclipse.jpt.core.internal.jpa2.resource.java.Access2_0AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-
-/**
- * Provides annotations for 1.2 EclipseLink platform
- */
-public class EclipseLink1_2JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
-{
- // 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 addTypeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(Access2_0AnnotationDefinition.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaFactory.java
deleted file mode 100644
index 8bafa93488..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaFactory.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.eclipselink.core.internal.v1_2;
-
-import org.eclipse.jpt.core.context.PersistentType.Owner;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.context.java.EclipseLinkJavaPersistentType1_2;
-
-public class EclipseLink1_2JpaFactory
- extends EclipseLinkJpaFactory
-{
- public EclipseLink1_2JpaFactory() {
- super();
- }
-
- // ********** Java Context Model **********
-
- @Override
- public JavaPersistentType buildJavaPersistentType(Owner owner, JavaResourcePersistentType jrpt) {
- return new EclipseLinkJavaPersistentType1_2(owner, jrpt);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformFactory.java
deleted file mode 100644
index d07c9cfa3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformFactory.java
+++ /dev/null
@@ -1,73 +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.eclipselink.core.internal.v1_2;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.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 EclipseLink1_2JpaFactory(),
- buildJpaAnnotationProvider(),
- EclipseLink1_2JpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- protected JpaAnnotationProvider buildJpaAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- 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(
- JptEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_2,
- JptCorePlugin.JPA_FACET_VERSION_1_0
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformProvider.java
deleted file mode 100644
index 393f068006..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/EclipseLink1_2JpaPlatformProvider.java
+++ /dev/null
@@ -1,175 +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.eclipselink.core.internal.v1_2;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkOrmResourceModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.context.orm.EclipseLinkOrmXml1_2Definition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_2JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "eclipselink1_2"; //$NON-NLS-1$
-
- // 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 JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()};
- }
-
-
- // ********* java type mappings *********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no type mappings specific to eclipselink
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********* java attribute mappings *********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaEclipseLinkBasicCollectionMappingDefinition.instance(),
- JavaEclipseLinkBasicMapMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaEclipseLinkTransformationMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance()};
- }
-
-
- // ********* mapping files *********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- // order should not be important here
- return new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/java/EclipseLinkJavaPersistentType1_2.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/java/EclipseLinkJavaPersistentType1_2.java
deleted file mode 100644
index 3d0bd16d70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/java/EclipseLinkJavaPersistentType1_2.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.eclipselink.core.internal.v1_2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaPersistentType;
-import org.eclipse.jpt.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-
-/**
- * EclipseLink Java 1.2
- * Support for specified access.
- */
-public class EclipseLinkJavaPersistentType1_2
- extends AbstractJavaPersistentType
-{
-
-
- public EclipseLinkJavaPersistentType1_2(PersistentType.Owner parent, JavaResourcePersistentType jrpt) {
- super(parent, jrpt);
- }
-
-
- // ********** access **********
-
- protected Access2_0Annotation getAccessAnnotation() {
- return (Access2_0Annotation) this.resourcePersistentType.getNonNullAnnotation(this.getAccessAnnotationName());
- }
-
- protected String getAccessAnnotationName() {
- return Access2_0Annotation.ANNOTATION_NAME;
- }
-
- @Override
- protected AccessType buildSpecifiedAccess() {
- return AccessType.fromJavaResourceModel(this.getAccessAnnotation().getValue());
- }
-
- public void setSpecifiedAccess(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.getAccessAnnotation().setValue(AccessType.toJavaResourceModel(specifiedAccess));
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- protected void setSpecifiedAccess_(AccessType specifiedAccess) {
- AccessType old = this.specifiedAccess;
- this.specifiedAccess = specifiedAccess;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, specifiedAccess);
- }
-
- @Override
- protected Iterator<JavaResourcePersistentAttribute> resourceAttributes() {
- return (this.specifiedAccess == null) ?
- super.resourceAttributes() :
- this.resourcePersistentType.persistableAttributes(AccessType.toJavaResourceModel(this.specifiedAccess));
- }
-
- @Override
- public void updateAccess() {
- super.updateAccess();
- this.setSpecifiedAccess_(this.buildSpecifiedAccess());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/orm/EclipseLinkOrmXml1_2Definition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/orm/EclipseLinkOrmXml1_2Definition.java
deleted file mode 100644
index c7b03166b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v1_2/context/orm/EclipseLinkOrmXml1_2Definition.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.eclipselink.core.internal.v1_2.context.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractEclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.EclipseLinkOrmXml1_1ContextNodeFactory;
-
-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();
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml1_1ContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java
deleted file mode 100644
index 3a04b81bc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaFactory.java
+++ /dev/null
@@ -1,165 +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.eclipselink.core.internal.v2_0;
-
-import org.eclipse.jpt.core.JpaProject.Config;
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.java.JavaColumn;
-import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaNamedColumn;
-import org.eclipse.jpt.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.core.context.java.JavaBaseColumn.Owner;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa1.context.java.GenericJavaColumn;
-import org.eclipse.jpt.core.internal.jpa2.GenericMetamodelSynchronizer;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaCacheable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaCollectionTable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.java.VirtualAssociationOverride2_0Annotation;
-import org.eclipse.jpt.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkManyToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToOneMapping2_0;
-
-/**
- * EclipseLink2_0JpaFactory
- */
-public class EclipseLink2_0JpaFactory
- extends EclipseLinkJpaFactory
-{
- 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);
- }
-
- @Override
- public MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType) {
- return new GenericMetamodelSynchronizer(sourceType);
- }
-
- // ********** Java Context Model **********
- @Override
- public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourcePersistentType jrpt) {
- return new GenericJavaPersistentType2_0(owner, jrpt);
- }
-
- //The 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- @Override
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner) {
- return new GenericJavaAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public JavaAssociationOverrideRelationshipReference buildJavaAssociationOverrideRelationshipReference(JavaAssociationOverride parent) {
- return new GenericJavaAssociationOverrideRelationshipReference2_0(parent);
- }
-
- @Override
- public AssociationOverrideAnnotation buildJavaVirtualAssociationOverrideAnnotation(JavaResourcePersistentMember jrpm, String name, JoiningStrategy joiningStrategy) {
- return new VirtualAssociationOverride2_0Annotation(jrpm, name, joiningStrategy);
- }
-
- @Override
- public JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent) {
- return new GenericJavaDerivedIdentity2_0(parent);
- }
-
- @Override
- public JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkElementCollectionMapping2_0(parent);
- }
-
- @Override
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaJpaContextNode parent) {
- return new GenericJavaSequenceGenerator2_0(parent);
- }
-
- @Override
- public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
- return new GenericJavaCacheable2_0(parent);
- }
-
- @Override
- public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
- return new GenericJavaOrphanRemoval2_0(parent);
- }
-
- @Override
- public JavaNamedQuery buildJavaNamedQuery(JavaJpaContextNode parent) {
- return new GenericJavaNamedQuery2_0(parent);
- }
-
- @Override
- public JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent) {
- return new GenericJavaCollectionTable2_0(parent);
- }
-
- @Override
- public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaNamedColumn.Owner owner) {
- return new GenericJavaOrderColumn2_0(parent, owner);
- }
-
- @Override
- public JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToOneMapping2_0(parent);
- }
-
- @Override
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkManyToOneMapping2_0(parent);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformFactory.java
deleted file mode 100644
index 899fd6dbe5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformFactory.java
+++ /dev/null
@@ -1,72 +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.eclipselink.core.internal.v2_0;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.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.buildJpaAnnotationProvider(),
- EclipseLink2_0JpaPlatformProvider.instance(),
- this.buildJpaVariation());
- }
-
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_0,
- JptCorePlugin.JPA_FACET_VERSION_2_0
- );
- }
-
- protected JpaAnnotationProvider buildJpaAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformProvider.java
deleted file mode 100644
index f7ddbfcf2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/EclipseLink2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,183 +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.eclipselink.core.internal.v2_0;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkOrmResourceModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkIdMappingDefinition2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.EclipseLinkOrmXml2_0Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.EclipseLink2_0PersistenceXmlDefinition;
-
-/**
- * EclipseLink2_0JpaPlatformProvider
- */
-public class EclipseLink2_0JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- public static final String ID = "eclipselink2_0"; //$NON-NLS-1$
-
- // 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();
- }
-
-
- // ********** resource models **********
-
- public JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()};
- }
-
-
- // ********* java type mappings *********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no type mappings specific to eclipselink
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance()};
- }
-
-
- // ********* java attribute mappings *********
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that eclipselink uses
- // NOTE: no new attribute mappings from eclipselink 1.0 to 2.0
- return new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaEclipseLinkBasicCollectionMappingDefinition.instance(),
- JavaEclipseLinkBasicMapMappingDefinition.instance(),
- JavaElementCollectionMappingDefinition2_0.instance(),
- JavaEclipseLinkIdMappingDefinition2_0.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaEclipseLinkTransformationMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaEclipseLinkOneToManyMappingDefinition.instance(),
- JavaEclipseLinkOneToOneMappingDefinition.instance(),
- JavaEclipseLinkVariableOneToOneMappingDefinition.instance()};
- }
-
-
- // ********* mapping files *********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- // order should not be important here
- return new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLink2_0PersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- GenericOrmXml2_0Definition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance(),
- EclipseLinkOrmXml2_0Definition.instance()};
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index 4fdde039a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkElementCollectionMapping2_0.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.eclipselink.core.internal.v2_0.context.java;
-
-import java.util.List;
-import java.util.Vector;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.AbstractJavaElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkElementCollectionMapping2_0;
-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);
- }
-
- @Override
- protected void addSupportingAnnotationNamesTo(Vector<String> names) {
- super.addSupportingAnnotationNamesTo(names);
- names.add(EclipseLink.JOIN_FETCH);
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.joinFetch.initialize(this.getResourcePersistentAttribute());
- }
-
- @Override
- protected void update() {
- super.update();
- this.joinFetch.update(this.getResourcePersistentAttribute());
- }
-
- @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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkIdMappingDefinition2_0.java
deleted file mode 100644
index b1b52d8958..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkIdMappingDefinition2_0.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.eclipselink.core.internal.v2_0.context.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.AbstractJavaIdMappingDefinition2_0;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-public class JavaEclipseLinkIdMappingDefinition2_0
- extends AbstractJavaIdMappingDefinition2_0
-{
- // singleton
- private static final JavaEclipseLinkIdMappingDefinition2_0 INSTANCE =
- new JavaEclipseLinkIdMappingDefinition2_0();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkIdMappingDefinition2_0() {
- super();
- }
-
-
- @Override
- protected boolean testDerivedId(JavaPersistentAttribute persistentAttribute) {
- String defaultMappingKey = persistentAttribute.getDefaultMappingKey();
- return super.testDerivedId(persistentAttribute)
- || StringTools.stringsAreEqual(defaultMappingKey, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY)
- || StringTools.stringsAreEqual(defaultMappingKey, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkManyToOneMapping2_0.java
deleted file mode 100644
index 231870e86f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkManyToOneMapping2_0.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.eclipselink.core.internal.v2_0.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.AbstractJavaEclipseLinkManyToOneMapping;
-
-public class JavaEclipseLinkManyToOneMapping2_0
- extends AbstractJavaEclipseLinkManyToOneMapping
-{
- public JavaEclipseLinkManyToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaManyToOneRelationshipReference2_0(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index 2747d3e396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/java/JavaEclipseLinkOneToOneMapping2_0.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.eclipselink.core.internal.v2_0.context.java;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.java.GenericJavaOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.AbstractJavaEclipseLinkOneToOneMapping;
-
-public class JavaEclipseLinkOneToOneMapping2_0
- extends AbstractJavaEclipseLinkOneToOneMapping
-{
-
- public JavaEclipseLinkOneToOneMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- @Override
- protected JavaOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericJavaOneToOneRelationshipReference2_0(this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
deleted file mode 100644
index 789ca77057..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
+++ /dev/null
@@ -1,251 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.jpt.core.context.JoiningStrategy;
-import org.eclipse.jpt.core.context.XmlContextNode;
-import org.eclipse.jpt.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideRelationshipReference;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverrideContainer.Owner;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideContainer;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmAssociationOverrideRelationshipReference2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmCacheable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmCollectionTable2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmNamedQuery2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmOrphanRemoval2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmSequenceGenerator2_0;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlAssociationOverride2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNullAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlOrphanRemovable_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlSingleRelationshipMapping_2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlContextNodeFactory;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.OrmEclipseLinkPersistentAttribute1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtuaEclipseLinklXmlNullAttributeMapping1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlBasic1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlBasicCollection1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlBasicMap1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlEmbeddedId1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlId1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlTransformation1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlTransient1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlVariableOneToOne1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlVersion1_1;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-
-public class EclipseLinkOrmXml2_0ContextNodeFactory extends EclipseLinkOrmXmlContextNodeFactory
-{
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, OrmPersistentAttribute.Owner owner, org.eclipse.jpt.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new OrmEclipseLinkPersistentAttribute1_1(parent, owner, (XmlAttributeMapping) resourceMapping);
- }
-
- @Override
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(OrmEmbeddedMapping2_0 parent, Owner owner) {
- return new GenericOrmAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public OrmAssociationOverrideRelationshipReference buildOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, org.eclipse.jpt.core.resource.orm.XmlAssociationOverride associationOverride) {
- return new GenericOrmAssociationOverrideRelationshipReference2_0(parent, associationOverride);
- }
-
- @Override
- public OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator2_0(parent, resourceSequenceGenerator);
- }
-
- @Override
- public OrmDerivedIdentity2_0 buildOrmDerivedIdentity(
- OrmSingleRelationshipMapping2_0 parent, XmlSingleRelationshipMapping_2_0 resource) {
- return new GenericOrmDerivedIdentity2_0(parent, resource);
- }
-
- @Override
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
- return new GenericOrmElementCollectionMapping2_0(parent, resourceMapping);
- }
-
- @Override
- public OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent, XmlCacheable_2_0 resource) {
- return new GenericOrmCacheable2_0(parent, resource);
- }
-
- @Override
- public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent, XmlOrphanRemovable_2_0 resource) {
- return new GenericOrmOrphanRemoval2_0(parent, resource);
- }
-
- @Override
- public OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- return new GenericOrmNamedQuery2_0(parent, resourceNamedQuery);
- }
-
- @Override
- public OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, XmlCollectionTable resource) {
- return new GenericOrmCollectionTable2_0(parent, resource);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlManyToOne resourceMapping) {
- return new OrmEclipseLinkManyToOneMapping2_0(parent, (XmlManyToOne) resourceMapping);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlOneToOne resourceMapping) {
- return new OrmEclipseLinkOneToOneMapping2_0(parent, (XmlOneToOne) resourceMapping);
- }
-
-
- // ********** ORM Virtual Resource Model **********
- @Override
- public XmlBasic buildVirtualXmlBasic(OrmTypeMapping ormTypeMapping, JavaBasicMapping javaBasicMapping) {
- return new VirtualEclipseLinkXmlBasic1_1(ormTypeMapping, javaBasicMapping);
- }
-
- @Override
- public XmlId buildVirtualXmlId(OrmTypeMapping ormTypeMapping, JavaIdMapping javaIdMapping) {
- return new VirtualEclipseLinkXmlId1_1(ormTypeMapping, javaIdMapping);
- }
-
- @Override
- public XmlEmbeddedId buildVirtualXmlEmbeddedId(OrmTypeMapping ormTypeMapping, JavaEmbeddedIdMapping javaEmbeddedIdMapping) {
- return new VirtualEclipseLinkXmlEmbeddedId1_1(ormTypeMapping, javaEmbeddedIdMapping);
- }
-
- @Override
- public XmlEmbedded buildVirtualXmlEmbedded(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping javaEmbeddedMapping) {
- return new VirtualEclipseLinkXmlEmbedded2_0(ormTypeMapping, (JavaEmbeddedMapping2_0) javaEmbeddedMapping);
- }
-
- @Override
- public XmlManyToMany buildVirtualXmlManyToMany(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping javaManyToManyMapping) {
- return new VirtualEclipseLinkXmlManyToMany2_0(ormTypeMapping, (JavaManyToManyMapping2_0) javaManyToManyMapping);
- }
-
- @Override
- public XmlManyToOne buildVirtualXmlManyToOne(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping javaManyToOneMapping) {
- return new VirtualEclipseLinkXmlManyToOne2_0(ormTypeMapping, (JavaManyToOneMapping2_0) javaManyToOneMapping);
- }
-
- @Override
- public XmlOneToMany buildVirtualXmlOneToMany(OrmTypeMapping ormTypeMapping, JavaOneToManyMapping javaOneToManyMapping) {
- return new VirtualEclipseLinkXmlOneToMany2_0(ormTypeMapping, (JavaEclipseLinkOneToManyMapping) javaOneToManyMapping);
- }
-
- @Override
- public XmlOneToOne buildVirtualXmlOneToOne(OrmTypeMapping ormTypeMapping, JavaOneToOneMapping javaOneToOneMapping) {
- return new VirtualEclipseLinkXmlOneToOne2_0(ormTypeMapping, (JavaEclipseLinkOneToOneMapping2_0) javaOneToOneMapping);
- }
-
- @Override
- public XmlVersion buildVirtualXmlVersion(OrmTypeMapping ormTypeMapping, JavaVersionMapping javaVersionMapping) {
- return new VirtualEclipseLinkXmlVersion1_1(ormTypeMapping, javaVersionMapping);
- }
-
- @Override
- public XmlBasicCollection buildVirtualEclipseLinkXmlBasicCollection(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicCollectionMapping javaBasicCollectionMapping) {
- return new VirtualEclipseLinkXmlBasicCollection1_1(ormTypeMapping, javaBasicCollectionMapping);
- }
-
- @Override
- public XmlBasicMap buildVirtualEclipseLinkXmlBasicMap(OrmTypeMapping ormTypeMapping, JavaEclipseLinkBasicMapMapping javaBasicMapMapping) {
- return new VirtualEclipseLinkXmlBasicMap1_1(ormTypeMapping, javaBasicMapMapping);
- }
-
- @Override
- public XmlTransformation buildVirtualEclipseLinkXmlTransformation(OrmTypeMapping ormTypeMapping, JavaEclipseLinkTransformationMapping javaTransformationMapping) {
- return new VirtualEclipseLinkXmlTransformation1_1(ormTypeMapping, javaTransformationMapping);
- }
-
- @Override
- public XmlVariableOneToOne buildVirtualEclipseLinkXmlVariableOneToOne(OrmTypeMapping ormTypeMapping, JavaEclipseLinkVariableOneToOneMapping javaVariableOneToOneMapping) {
- return new VirtualEclipseLinkXmlVariableOneToOne1_1(ormTypeMapping, javaVariableOneToOneMapping);
- }
-
- @Override
- public XmlTransient buildVirtualXmlTransient(OrmTypeMapping ormTypeMapping, JavaTransientMapping javaAttributeMapping) {
- return new VirtualEclipseLinkXmlTransient1_1(ormTypeMapping, javaAttributeMapping);
- }
-
- @Override
- public XmlNullAttributeMapping buildVirtualXmlNullAttributeMapping(OrmTypeMapping ormTypeMapping, JavaAttributeMapping javaAttributeMapping) {
- return new VirtuaEclipseLinklXmlNullAttributeMapping1_1(ormTypeMapping, javaAttributeMapping);
- }
-
- @Override
- public XmlAssociationOverride buildVirtualXmlAssociationOverride(String name, OrmTypeMapping parent, JoiningStrategy joiningStrategy) {
- return new VirtualXmlAssociationOverride2_0(name, parent, joiningStrategy);
- }
-
- @Override
- public XmlElementCollection buildVirtualXmlElementCollection2_0(OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping) {
- return new VirtualEclipseLinkXmlElementCollection2_0(ormTypeMapping, javaMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0Definition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0Definition.java
deleted file mode 100644
index 29cca92091..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/EclipseLinkOrmXml2_0Definition.java
+++ /dev/null
@@ -1,118 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmTypeMappingDefinition;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmEntityDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.OrmElementCollectionMapping2_0Definition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicCollectionMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkTransformationMappingDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.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 EFactory getResourceNodeFactory() {
- return EclipseLinkOrmFactory.eINSTANCE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_0ContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkManyToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkManyToOneMapping2_0.java
deleted file mode 100644
index b1971efd49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkManyToOneMapping2_0.java
+++ /dev/null
@@ -1,29 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-
-public class OrmEclipseLinkManyToOneMapping2_0 extends AbstractOrmEclipseLinkManyToOneMapping
-{
- public OrmEclipseLinkManyToOneMapping2_0(OrmPersistentAttribute parent, XmlManyToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmManyToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmManyToOneRelationshipReference2_0(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index c08da0242a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/OrmEclipseLinkOneToOneMapping2_0.java
+++ /dev/null
@@ -1,29 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-
-public class OrmEclipseLinkOneToOneMapping2_0 extends AbstractOrmEclipseLinkOneToOneMapping
-{
-
- public OrmEclipseLinkOneToOneMapping2_0(OrmPersistentAttribute parent, XmlOneToOne resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- protected OrmOneToOneRelationshipReference2_0 buildRelationshipReference() {
- return new GenericOrmOneToOneRelationshipReference2_0(this, this.resourceAttributeMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlElementCollection2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlElementCollection2_0.java
deleted file mode 100644
index 0313a1091d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlElementCollection2_0.java
+++ /dev/null
@@ -1,267 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlElementCollection2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.EnumType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.TemporalType;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlElementCollection2_0 extends XmlElementCollection
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaElementCollectionMapping2_0 javaAttributeMapping;
-
- protected final VirtualXmlElementCollection2_0 virtualXmlElementCollection;
-
- public VirtualEclipseLinkXmlElementCollection2_0(OrmTypeMapping ormTypeMapping, JavaElementCollectionMapping2_0 javaMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaMapping;
- this.virtualXmlElementCollection = new VirtualXmlElementCollection2_0(ormTypeMapping, javaMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlElementCollection.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlElementCollection.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlElementCollection.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlElementCollection.getNameTextRange();
- }
- @Override
- public FetchType getFetch() {
- return this.virtualXmlElementCollection.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlElementCollection.setFetch(newFetch);
- }
-
- @Override
- public XmlColumn getColumn() {
- return this.virtualXmlElementCollection.getColumn();
- }
-
- @Override
- public void setColumn(XmlColumn value) {
- this.virtualXmlElementCollection.setColumn(value);
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.virtualXmlElementCollection.getMapKeyColumn();
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- this.virtualXmlElementCollection.setMapKeyColumn(newMapKeyColumn);
- }
-
- @Override
- public TemporalType getTemporal() {
- return this.virtualXmlElementCollection.getTemporal();
- }
-
- @Override
- public void setTemporal(TemporalType newTemporal){
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EnumType getEnumerated() {
- return this.virtualXmlElementCollection.getEnumerated();
- }
-
- @Override
- public void setEnumerated(EnumType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public boolean isLob() {
- return this.virtualXmlElementCollection.isLob();
- }
-
- @Override
- public void setLob(boolean value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return this.virtualXmlElementCollection.getEnumeratedTextRange();
- }
-
- @Override
- public TextRange getLobTextRange() {
- return this.virtualXmlElementCollection.getLobTextRange();
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return this.virtualXmlElementCollection.getTemporalTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlElementCollection.getAttributeOverrides();
- }
-
- @Override
- public EList<XmlAssociationOverride> getAssociationOverrides() {
- return this.virtualXmlElementCollection.getAssociationOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return null;
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- // TODO get from java annotations
- return null;
- }
-
- @Override
- public AccessType getAccess() {
- return this.virtualXmlElementCollection.getAccess();
- }
-
- @Override
- public void setAccess(AccessType value) {
- this.virtualXmlElementCollection.setAccess(value);
- }
-
- @Override
- public String getTargetClass() {
- return this.virtualXmlElementCollection.getTargetClass();
- }
-
- @Override
- public void setTargetClass(String newTargetClass) {
- this.virtualXmlElementCollection.setTargetClass(newTargetClass);
- }
-
- @Override
- public XmlCollectionTable getCollectionTable() {
- return this.virtualXmlElementCollection.getCollectionTable();
- }
-
- @Override
- public void setCollectionTable(XmlCollectionTable value) {
- this.virtualXmlElementCollection.setCollectionTable(value);
- }
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlElementCollection.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey newMapKey) {
- this.virtualXmlElementCollection.setMapKey(newMapKey);
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- return this.virtualXmlElementCollection.getMapKeyClass();
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference newMapKeyClass) {
- this.virtualXmlElementCollection.setMapKeyClass(newMapKeyClass);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlElementCollection.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String newOrderBy) {
- this.virtualXmlElementCollection.setOrderBy(newOrderBy);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlElementCollection.getOrderColumn();
- }
-
- @Override
- public void setOrderColumn(XmlOrderColumn newOrderColumn) {
- this.virtualXmlElementCollection.setOrderColumn(newOrderColumn);
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- return this.virtualXmlElementCollection.getMapKeyAttributeOverrides();
- }
-
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- if (isOrmMetadataComplete()) {
- return null; //don't return default value, it only applies for an empty @JoinFetch
- }
- return EclipseLinkJoinFetchType.toOrmResourceModel(((JavaEclipseLinkElementCollectionMapping2_0) this.javaAttributeMapping).getJoinFetch().getValue());
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlEmbedded2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlEmbedded2_0.java
deleted file mode 100644
index 1658c91dc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlEmbedded2_0.java
+++ /dev/null
@@ -1,100 +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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlEmbedded2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlEmbedded1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlEmbedded2_0 extends XmlEmbedded
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEmbeddedMapping2_0 javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlEmbedded1_1 virtualXmlEmbedded;
- protected final VirtualXmlEmbedded2_0 virtualXmlEmbedded2_0;
-
- public VirtualEclipseLinkXmlEmbedded2_0(OrmTypeMapping ormTypeMapping, JavaEmbeddedMapping2_0 javaEmbeddedMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaEmbeddedMapping;
- this.virtualXmlEmbedded = new VirtualEclipseLinkXmlEmbedded1_1(ormTypeMapping, javaEmbeddedMapping);
- this.virtualXmlEmbedded2_0 = new VirtualXmlEmbedded2_0(ormTypeMapping, javaEmbeddedMapping);
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlEmbedded.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlEmbedded.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlEmbedded.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlEmbedded.getNameTextRange();
- }
-
- @Override
- public EList<XmlAttributeOverride> getAttributeOverrides() {
- return this.virtualXmlEmbedded.getAttributeOverrides();
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.virtualXmlEmbedded.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.virtualXmlEmbedded.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.virtualXmlEmbedded.getProperties();
- }
-
- @Override
- public AccessType getAccess() {
- return this.virtualXmlEmbedded.getAccess();
- }
-
- @Override
- public void setAccess(AccessType value) {
- this.virtualXmlEmbedded.setAccess(null);
- }
-
- @Override
- public EList<XmlAssociationOverride> getAssociationOverrides() {
- return this.virtualXmlEmbedded2_0.getAssociationOverrides();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToMany2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToMany2_0.java
deleted file mode 100644
index d3de9cbc4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToMany2_0.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.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlManyToMany2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualEclipseLinkXmlManyToMany2_0 is an implementation of XmlManyToMany used when there is
- * no tag in the orm.xml and an underlying java many to many exists.
- */
-public class VirtualEclipseLinkXmlManyToMany2_0 extends XmlManyToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToManyMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlManyToMany eclipseLinkVirtualXmlManyToMany;
-
- protected final VirtualXmlManyToMany2_0 virtualXmlManyToMany;
-
- public VirtualEclipseLinkXmlManyToMany2_0(OrmTypeMapping ormTypeMapping, JavaManyToManyMapping2_0 javaManyToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToManyMapping;
- this.eclipseLinkVirtualXmlManyToMany = new VirtualEclipseLinkXmlManyToMany(ormTypeMapping, javaManyToManyMapping);
- this.virtualXmlManyToMany = new VirtualXmlManyToMany2_0(ormTypeMapping, javaManyToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlManyToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlManyToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlManyToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlManyToMany.setMapKey(value);
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- return this.virtualXmlManyToMany.getMapKeyClass();
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference value) {
- this.virtualXmlManyToMany.setMapKeyClass(value);
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.virtualXmlManyToMany.getMapKeyColumn();
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- this.virtualXmlManyToMany.setMapKeyColumn(newMapKeyColumn);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlManyToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlManyToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlManyToMany.getOrderColumn();
- }
-
- @Override
- public void setOrderColumn(XmlOrderColumn newOrderColumn) {
- this.virtualXmlManyToMany.setOrderColumn(newOrderColumn);
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlManyToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToMany.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.eclipseLinkVirtualXmlManyToMany.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.eclipseLinkVirtualXmlManyToMany.setJoinFetch(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.eclipseLinkVirtualXmlManyToMany.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.eclipseLinkVirtualXmlManyToMany.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.eclipseLinkVirtualXmlManyToMany.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.eclipseLinkVirtualXmlManyToMany.getJoinFetchTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return org.eclipse.jpt.core.context.AccessType.toOrmResourceModel(this.javaAttributeMapping.getPersistentAttribute().getAccess());
- }
-
- @Override
- public void setAccess(AccessType value) {
- throw new UnsupportedOperationException("cannot set values on a virtual mapping"); //$NON-NLS-1$
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- return this.virtualXmlManyToMany.getMapKeyAttributeOverrides();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToOne2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToOne2_0.java
deleted file mode 100644
index e757cd4724..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlManyToOne2_0.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlManyToOne2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlManyToOne2_0 extends XmlManyToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaManyToOneMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlManyToOne eclipseLinkVirtualXmlManyToOne;
-
- protected final VirtualXmlManyToOne2_0 virtualXmlManyToOne;
-
- public VirtualEclipseLinkXmlManyToOne2_0(OrmTypeMapping ormTypeMapping, JavaManyToOneMapping2_0 javaManyToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaManyToOneMapping;
- this.eclipseLinkVirtualXmlManyToOne = new VirtualEclipseLinkXmlManyToOne(ormTypeMapping, javaManyToOneMapping);
- this.virtualXmlManyToOne = new VirtualXmlManyToOne2_0(ormTypeMapping, javaManyToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlManyToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlManyToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlManyToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlManyToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlManyToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlManyToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlManyToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlManyToOne.setOptional(newOptional);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlManyToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlManyToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlManyToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlManyToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlManyToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlManyToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlManyToOne.setTargetEntity(value);
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlManyToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.eclipseLinkVirtualXmlManyToOne.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.eclipseLinkVirtualXmlManyToOne.setJoinFetch(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.eclipseLinkVirtualXmlManyToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.eclipseLinkVirtualXmlManyToOne.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.eclipseLinkVirtualXmlManyToOne.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.eclipseLinkVirtualXmlManyToOne.getJoinFetchTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return this.virtualXmlManyToOne.getAccess();
- }
-
- @Override
- public void setAccess(AccessType value) {
- this.virtualXmlManyToOne.setAccess(value);
- }
-
- @Override
- public Boolean getId() {
- return this.virtualXmlManyToOne.getId();
- }
-
- @Override
- public void setId(Boolean newId) {
- this.virtualXmlManyToOne.setId(newId);
- }
-
- @Override
- public String getMapsId() {
- return this.virtualXmlManyToOne.getMapsId();
- }
-
- @Override
- public void setMapsId(String newMapsId) {
- this.virtualXmlManyToOne.setMapsId(newMapsId);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java
deleted file mode 100644
index cfd10f1778..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToMany2_0.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlOneToMany2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.MapKey;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlOrderColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.VirtualEclipseLinkXmlOneToMany1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualEclipseLinkXmlOneToMany2_0 is an implementation of XmlOneToMany used when there is
- * no tag in the orm.xml and an underlying javaOneToMany exists.
- */
-public class VirtualEclipseLinkXmlOneToMany2_0 extends XmlOneToMany
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToManyMapping javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToMany1_1 eclipseLinkVirtualXmlOneToMany;
-
- protected final VirtualXmlOneToMany2_0 virtualXmlOneToMany;
-
- public VirtualEclipseLinkXmlOneToMany2_0(
- OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToManyMapping javaOneToManyMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToManyMapping;
- this.eclipseLinkVirtualXmlOneToMany = new VirtualEclipseLinkXmlOneToMany1_1(ormTypeMapping, javaOneToManyMapping);
- this.virtualXmlOneToMany = new VirtualXmlOneToMany2_0(ormTypeMapping, javaOneToManyMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToMany.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToMany.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToMany.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToMany.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToMany.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToMany.setFetch(newFetch);
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToMany.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToMany.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToMany.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToMany.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToMany.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToMany.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToMany.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToMany.setMappedBy(value);
- }
-
-
- @Override
- public MapKey getMapKey() {
- return this.virtualXmlOneToMany.getMapKey();
- }
-
- @Override
- public void setMapKey(MapKey value) {
- this.virtualXmlOneToMany.setMapKey(value);
- }
-
- @Override
- public XmlClassReference getMapKeyClass() {
- return this.virtualXmlOneToMany.getMapKeyClass();
- }
-
- @Override
- public void setMapKeyClass(XmlClassReference value) {
- this.virtualXmlOneToMany.setMapKeyClass(value);
- }
-
- @Override
- public XmlColumn getMapKeyColumn() {
- return this.virtualXmlOneToMany.getMapKeyColumn();
- }
-
- @Override
- public void setMapKeyColumn(XmlColumn newMapKeyColumn) {
- this.virtualXmlOneToMany.setMapKeyColumn(newMapKeyColumn);
- }
-
- @Override
- public String getOrderBy() {
- return this.virtualXmlOneToMany.getOrderBy();
- }
-
- @Override
- public void setOrderBy(String value) {
- this.virtualXmlOneToMany.setOrderBy(value);
- }
-
- @Override
- public XmlOrderColumn getOrderColumn() {
- return this.virtualXmlOneToMany.getOrderColumn();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToMany.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToMany.getTargetEntityTextRange();
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.eclipseLinkVirtualXmlOneToMany.getJoinColumns();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.eclipseLinkVirtualXmlOneToMany.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.eclipseLinkVirtualXmlOneToMany.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.eclipseLinkVirtualXmlOneToMany.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.eclipseLinkVirtualXmlOneToMany.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.eclipseLinkVirtualXmlOneToMany.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.eclipseLinkVirtualXmlOneToMany.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.eclipseLinkVirtualXmlOneToMany.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.eclipseLinkVirtualXmlOneToMany.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.eclipseLinkVirtualXmlOneToMany.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return this.eclipseLinkVirtualXmlOneToMany.getAccess();
- }
-
- @Override
- public void setAccess(AccessType value) {
- this.eclipseLinkVirtualXmlOneToMany.setAccess(value);
- }
-
- @Override
- public EList<XmlAttributeOverride> getMapKeyAttributeOverrides() {
- return this.virtualXmlOneToMany.getMapKeyAttributeOverrides();
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- return this.virtualXmlOneToMany.getOrphanRemoval();
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- this.virtualXmlOneToMany.setOrphanRemoval(newOrphanRemoval);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java
deleted file mode 100644
index 59c422ef9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/orm/VirtualEclipseLinkXmlOneToOne2_0.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.VirtualXmlOneToOne2_0;
-import org.eclipse.jpt.core.resource.orm.AccessType;
-import org.eclipse.jpt.core.resource.orm.CascadeType;
-import org.eclipse.jpt.core.resource.orm.FetchType;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.VirtualEclipseLinkXmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty;
-
-/**
- * VirtualBasic is an implementation of Basic used when there is
- * no tag in the orm.xml and an underlying javaBasicMapping exists.
- */
-public class VirtualEclipseLinkXmlOneToOne2_0 extends XmlOneToOne
-{
- protected OrmTypeMapping ormTypeMapping;
-
- protected final JavaEclipseLinkOneToOneMapping2_0 javaAttributeMapping;
-
- protected final VirtualEclipseLinkXmlOneToOne eclipseLinkVirtualXmlOneToOne;
-
- protected final VirtualXmlOneToOne2_0 virtualXmlOneToOne;
-
- public VirtualEclipseLinkXmlOneToOne2_0(OrmTypeMapping ormTypeMapping, JavaEclipseLinkOneToOneMapping2_0 javaOneToOneMapping) {
- super();
- this.ormTypeMapping = ormTypeMapping;
- this.javaAttributeMapping = javaOneToOneMapping;
- this.eclipseLinkVirtualXmlOneToOne = new VirtualEclipseLinkXmlOneToOne(ormTypeMapping, javaOneToOneMapping);
- this.virtualXmlOneToOne = new VirtualXmlOneToOne2_0(ormTypeMapping, javaOneToOneMapping);
- }
-
- protected boolean isOrmMetadataComplete() {
- return this.ormTypeMapping.isMetadataComplete();
- }
-
- @Override
- public String getMappingKey() {
- return this.virtualXmlOneToOne.getMappingKey();
- }
-
- @Override
- public String getName() {
- return this.virtualXmlOneToOne.getName();
- }
-
- @Override
- public void setName(String newName) {
- this.virtualXmlOneToOne.setName(newName);
- }
-
- @Override
- public TextRange getNameTextRange() {
- return this.virtualXmlOneToOne.getNameTextRange();
- }
-
- @Override
- public FetchType getFetch() {
- return this.virtualXmlOneToOne.getFetch();
- }
-
- @Override
- public void setFetch(FetchType newFetch) {
- this.virtualXmlOneToOne.setFetch(newFetch);
- }
-
- @Override
- public Boolean getOptional() {
- return this.virtualXmlOneToOne.getOptional();
- }
-
- @Override
- public void setOptional(Boolean newOptional) {
- this.virtualXmlOneToOne.setOptional(newOptional);
- }
-
- @Override
- public Boolean getOrphanRemoval() {
- return this.virtualXmlOneToOne.getOrphanRemoval();
- }
-
- @Override
- public void setOrphanRemoval(Boolean newOrphanRemoval) {
- this.virtualXmlOneToOne.setOrphanRemoval(newOrphanRemoval);
- }
-
- @Override
- public EList<XmlJoinColumn> getJoinColumns() {
- return this.virtualXmlOneToOne.getJoinColumns();
- }
-
- @Override
- public CascadeType getCascade() {
- return this.virtualXmlOneToOne.getCascade();
- }
-
- @Override
- public void setCascade(CascadeType value) {
- this.virtualXmlOneToOne.setCascade(value);
- }
-
- @Override
- public XmlJoinTable getJoinTable() {
- return this.virtualXmlOneToOne.getJoinTable();
- }
-
- @Override
- public void setJoinTable(XmlJoinTable value) {
- this.virtualXmlOneToOne.setJoinTable(value);
- }
-
- @Override
- public String getTargetEntity() {
- return this.virtualXmlOneToOne.getTargetEntity();
- }
-
- @Override
- public void setTargetEntity(String value) {
- this.virtualXmlOneToOne.setTargetEntity(value);
- }
-
- @Override
- public String getMappedBy() {
- return this.virtualXmlOneToOne.getMappedBy();
- }
-
- @Override
- public void setMappedBy(String value) {
- this.virtualXmlOneToOne.setMappedBy(value);
- }
-
- @Override
- public EList<XmlPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() {
- return this.virtualXmlOneToOne.getPrimaryKeyJoinColumns();
- }
-
- @Override
- public TextRange getMappedByTextRange() {
- return this.virtualXmlOneToOne.getMappedByTextRange();
- }
-
- @Override
- public TextRange getTargetEntityTextRange() {
- return this.virtualXmlOneToOne.getTargetEntityTextRange();
- }
-
- @Override
- public XmlJoinFetchType getJoinFetch() {
- return this.eclipseLinkVirtualXmlOneToOne.getJoinFetch();
- }
-
- @Override
- public void setJoinFetch(XmlJoinFetchType value) {
- this.eclipseLinkVirtualXmlOneToOne.setJoinFetch(value);
- }
-
- @Override
- public boolean isPrivateOwned() {
- return this.eclipseLinkVirtualXmlOneToOne.isPrivateOwned();
- }
-
- @Override
- public void setPrivateOwned(boolean value) {
- this.eclipseLinkVirtualXmlOneToOne.setPrivateOwned(value);
- }
-
- @Override
- public XmlAccessMethods getAccessMethods() {
- return this.eclipseLinkVirtualXmlOneToOne.getAccessMethods();
- }
-
- @Override
- public void setAccessMethods(XmlAccessMethods value) {
- this.eclipseLinkVirtualXmlOneToOne.setAccessMethods(value);
- }
-
- @Override
- public EList<XmlProperty> getProperties() {
- return this.eclipseLinkVirtualXmlOneToOne.getProperties();
- }
-
- @Override
- public TextRange getJoinFetchTextRange() {
- return this.eclipseLinkVirtualXmlOneToOne.getJoinFetchTextRange();
- }
-
- @Override
- public TextRange getPrivateOwnedTextRange() {
- return this.eclipseLinkVirtualXmlOneToOne.getPrivateOwnedTextRange();
- }
-
- @Override
- public AccessType getAccess() {
- return this.virtualXmlOneToOne.getAccess();
- }
-
- @Override
- public void setAccess(AccessType value) {
- this.virtualXmlOneToOne.setAccess(value);
- }
-
- @Override
- public Boolean getId() {
- return this.virtualXmlOneToOne.getId();
- }
-
- @Override
- public void setId(Boolean newId) {
- this.virtualXmlOneToOne.setId(newId);
- }
-
- @Override
- public String getMapsId() {
- return this.virtualXmlOneToOne.getMapsId();
- }
-
- @Override
- public void setMapsId(String newMapsId) {
- this.virtualXmlOneToOne.setMapsId(newMapsId);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 6ada1ae621..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.v2_0.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkJarFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.connection.EclipseLinkConnection2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.logging.EclipseLinkLogging2_0;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.options.EclipseLinkOptions2_0;
-
-
-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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
deleted file mode 100644
index 0bf5bad4bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.core.internal.v2_0.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.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 EFactory getResourceNodeFactory() {
- return PersistenceV2_0Factory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLink2_0PersistenceXmlContextNodeFactory();
- }
-
- public JpaResourceType getResourceType() {
- return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/connection/EclipseLinkConnection2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/connection/EclipseLinkConnection2_0.java
deleted file mode 100644
index 992860df0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/connection/EclipseLinkConnection2_0.java
+++ /dev/null
@@ -1,153 +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.eclipselink.core.internal.v2_0.context.persistence.connection;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.connection.EclipseLinkConnection;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.connection.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/logging/EclipseLinkLogging2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/logging/EclipseLinkLogging2_0.java
deleted file mode 100644
index 6a9f3befc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/logging/EclipseLinkLogging2_0.java
+++ /dev/null
@@ -1,329 +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.eclipselink.core.internal.v2_0.context.persistence.logging;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.logging.EclipseLinkLogging;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/options/EclipseLinkOptions2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/options/EclipseLinkOptions2_0.java
deleted file mode 100644
index 7eafd2c02b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/context/persistence/options/EclipseLinkOptions2_0.java
+++ /dev/null
@@ -1,249 +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.eclipselink.core.internal.v2_0.context.persistence.options;
-
-import java.util.Map;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.options.EclipseLinkOptions;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-
-/**
- * EclipseLinkOptions2_0
- */
-public class EclipseLinkOptions2_0 extends EclipseLinkOptions
- implements Options2_0
-{
- // ********** GenericConnection properties **********
- private Integer lockTimeout;
- private Integer queryTimeout;
- private String validationGroupPrePersist;
- private String validationGroupPreUpdate;
- private String validationGroupPreRemove;
-
-
- // ********** 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.validationGroupPrePersist =
- this.getStringValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.validationGroupPreUpdate =
- this.getStringValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.validationGroupPreRemove =
- this.getStringValue(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.validationGroupPrePersistChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdateChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemoveChanged(newValue);
- }
- }
-
- @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.validationGroupPrePersistChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdateChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemoveChanged(null);
- }
- }
-
- /**
- * 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;
- }
-
-
- // ********** ValidationGroupPrePersist **********
- public String getValidationGroupPrePersist() {
- return this.validationGroupPrePersist;
- }
-
- public void setValidationGroupPrePersist(String newValidationGroupPrePersist) {
- String old = this.validationGroupPrePersist;
- this.validationGroupPrePersist = newValidationGroupPrePersist;
- this.putProperty(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, newValidationGroupPrePersist);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, old, newValidationGroupPrePersist);
- }
-
- private void validationGroupPrePersistChanged(String newValue) {
- String old = this.validationGroupPrePersist;
- this.validationGroupPrePersist = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPrePersist() {
- return DEFAULT_VALIDATION_GROUP_PRE_PERSIST;
- }
-
- // ********** ValidationGroupPreUpdate **********
- public String getValidationGroupPreUpdate() {
- return this.validationGroupPreUpdate;
- }
-
- public void setValidationGroupPreUpdate(String newValidationGroupPreUpdate) {
- String old = this.validationGroupPreUpdate;
- this.validationGroupPreUpdate = newValidationGroupPreUpdate;
- this.putProperty(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, newValidationGroupPreUpdate);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, old, newValidationGroupPreUpdate);
- }
-
- private void validationGroupPreUpdateChanged(String newValue) {
- String old = this.validationGroupPreUpdate;
- this.validationGroupPreUpdate = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPreUpdate() {
- return DEFAULT_VALIDATION_GROUP_PRE_UPDATE;
- }
-
- // ********** ValidationGroupPreRemove **********
- public String getValidationGroupPreRemove() {
- return this.validationGroupPreRemove;
- }
-
- public void setValidationGroupPreRemove(String newValidationGroupPreRemove) {
- String old = this.validationGroupPreRemove;
- this.validationGroupPreRemove = newValidationGroupPreRemove;
- this.putProperty(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, newValidationGroupPreRemove);
- this.firePropertyChanged(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, old, newValidationGroupPreRemove);
- }
-
- private void validationGroupPreRemoveChanged(String newValue) {
- String old = this.validationGroupPreRemove;
- this.validationGroupPreRemove = newValue;
- this.firePropertyChanged(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, old, newValue);
- }
-
- public String getDefaultValidationGroupPreRemove() {
- return DEFAULT_VALIDATION_GROUP_PRE_REMOVE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/ddlgen/EclipseLink2_0DDLGenerator.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/ddlgen/EclipseLink2_0DDLGenerator.java
deleted file mode 100644
index 95b09f6c90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_0/ddlgen/EclipseLink2_0DDLGenerator.java
+++ /dev/null
@@ -1,82 +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.eclipselink.core.internal.v2_0.ddlgen;
-
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.ddlgen.EclipseLinkDDLGenerator;
-
-/**
- * EclipseLink2_0DDLGenerator
- */
-public class EclipseLink2_0DDLGenerator extends EclipseLinkDDLGenerator
-{
- static final String VALIDATION_MODE_PROPERTY = "javax.persistence.validation.mode"; //$NON-NLS-1$
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLink2_0DDLGenerator(puName, project, projectLocation, monitor).generate();
- }
-
- private EclipseLink2_0DDLGenerator(String puName, JpaProject jpaProject, String projectLocation, IProgressMonitor monitor) {
- super(puName, jpaProject, projectLocation, monitor);
- }
-
- // ********** EclipseLink properties **********
-
- @Override
- protected void buildAllProperties(Properties properties, String projectLocation) {
- super.buildAllProperties(properties, projectLocation);
-
- 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) {
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- Connection.ECLIPSELINK_BIND_PARAMETERS,
- FALSE);
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName());
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_URL,
- (cp == null) ? "" : cp.getURL());
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_USER,
- (cp == null) ? "" : cp.getUserName());
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index fb885ff4f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaAnnotationDefinitionProvider.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.eclipselink.core.internal.v2_1;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.AbstractJpaAnnotationDefintionProvider;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-
-/**
- * Provides annotations for 1.0 EclipseLink platform
- */
-public class EclipseLink2_1JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefintionProvider
-{
- // 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 addTypeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EclipseLinkCacheAnnotationDefinition.instance());
- definitions.add(EclipseLinkChangeTrackingAnnotationDefinition.instance());
- definitions.add(EclipseLinkClassExtractor2_1AnnotationDefinition.instance());
- definitions.add(EclipseLinkConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkCustomizerAnnotationDefinition.instance());
- definitions.add(EclipseLinkExistenceCheckingAnnotationDefinition.instance());
- definitions.add(EclipseLinkObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkPrimaryKeyAnnotationDefinition.instance());
- definitions.add(EclipseLinkReadOnlyAnnotationDefinition.instance());
- definitions.add(EclipseLinkStructConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkTypeConverterAnnotationDefinition.instance());
- }
-
- @Override
- protected void addAttributeAnnotationDefinitionsTo(List<AnnotationDefinition> definitions) {
- definitions.add(EclipseLinkBasicCollectionAnnotationDefinition.instance());
- definitions.add(EclipseLinkBasicMapAnnotationDefinition.instance());
- definitions.add(EclipseLinkConvertAnnotationDefinition.instance());
- definitions.add(EclipseLinkConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkJoinFetchAnnotationDefinition.instance());
- definitions.add(EclipseLinkMutableAnnotationDefinition.instance());
- definitions.add(EclipseLinkObjectTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkPrivateOwnedAnnotationDefinition.instance());
- definitions.add(EclipseLinkReadTransformerAnnotationDefinition.instance());
- definitions.add(EclipseLinkStructConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkTransformationAnnotationDefinition.instance());
- definitions.add(EclipseLinkTypeConverterAnnotationDefinition.instance());
- definitions.add(EclipseLinkVariableOneToOneAnnotationDefinition.instance());
- definitions.add(EclipseLinkWriteTransformerAnnotationDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformFactory.java
deleted file mode 100644
index b590d04ec2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformFactory.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.eclipselink.core.internal.v2_1;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaFactory;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformFactory;
-
-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.buildJpaAnnotationProvider(),
- EclipseLink2_1JpaPlatformProvider.instance(),
- this.buildJpaVariation());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_1,
- JptCorePlugin.JPA_FACET_VERSION_2_0);
- }
-
- @Override
- protected JpaAnnotationProvider buildJpaAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java
deleted file mode 100644
index b7944b0be0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_1;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.EclipseLinkOrmXml2_0Definition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.persistence.EclipseLink2_0PersistenceXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.v2_1.context.orm.EclipseLinkOrmXml2_1Definition;
-
-public class EclipseLink2_1JpaPlatformProvider
- extends EclipseLink2_0JpaPlatformProvider
-{
- public static final String ID = "eclipselink2_1"; //$NON-NLS-1$
-
- // 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 JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
-// if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
-// return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
-// }
-// else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
-// return JptCorePlugin.JAR_RESOURCE_TYPE;
-// }
-// else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
-// return JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
-// }
-// else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
-// return JptCorePlugin.ORM_XML_2_0_RESOURCE_TYPE;
-// }
- if (contentType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-// @Override
-// protected JpaResourceModelProvider[] buildResourceModelProviders() {
-// // order should not be important here
-// return new JpaResourceModelProvider[] {
-// JavaResourceModelProvider.instance(),
-// JarResourceModelProvider.instance(),
-// PersistenceResourceModelProvider.instance(),
-// OrmResourceModelProvider.instance(),
-// EclipseLinkOrmResourceModelProvider.instance()};
-// }
-
-
- // ********* java type mappings *********
-
-// @Override
-// protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
-// // order determined by analyzing order that eclipselink uses
-// // NOTE: no type mappings specific to eclipselink
-// return new JavaTypeMappingDefinition[] {
-// JavaEntityDefinition.instance(),
-// JavaEmbeddableDefinition.instance(),
-// JavaMappedSuperclassDefinition.instance()};
-// }
-
-
- // ********* java attribute mappings *********
-
-// @Override
-// protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
-// // order determined by analyzing order that eclipselink uses
-// // NOTE: no new attribute mappings from eclipselink 1.0 to 1.1
-// return new JavaAttributeMappingDefinition[] {
-// JavaEmbeddedMappingDefinition.instance(),
-// JavaEclipseLinkOneToManyMappingDefinition.instance(),
-// JavaEclipseLinkOneToOneMappingDefinition.instance(),
-// JavaEclipseLinkVariableOneToOneMappingDefinition.instance(),
-// JavaBasicMappingDefinition.instance()};
-// }
-
-// @Override
-// protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
-// // order determined by analyzing order that eclipselink uses
-// // NOTE: no new attribute mappings from eclipselink 1.0 to 2.0
-// return new JavaAttributeMappingDefinition[] {
-// JavaTransientMappingDefinition.instance(),
-// JavaEclipseLinkBasicCollectionMappingDefinition.instance(),
-// JavaEclipseLinkBasicMapMappingDefinition.instance(),
-// JavaElementCollectionMappingDefinition2_0.instance(),
-// JavaEclipseLinkIdMappingDefinition2_0.instance(),
-// JavaVersionMappingDefinition.instance(),
-// JavaBasicMappingDefinition.instance(),
-// JavaEmbeddedMappingDefinition.instance(),
-// JavaEmbeddedIdMappingDefinition.instance(),
-// JavaEclipseLinkTransformationMappingDefinition.instance(),
-// JavaManyToManyMappingDefinition.instance(),
-// JavaManyToOneMappingDefinition.instance(),
-// JavaEclipseLinkOneToManyMappingDefinition.instance(),
-// JavaEclipseLinkOneToOneMappingDefinition.instance(),
-// JavaEclipseLinkVariableOneToOneMappingDefinition.instance()};
-// }
-
-
- // ********* mapping files *********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- // order should not be important here
- return new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLink2_0PersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- GenericOrmXml2_0Definition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance(),
- EclipseLinkOrmXml2_0Definition.instance(),
- EclipseLinkOrmXml2_1Definition.instance()};
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmElementCollectionMapping2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmElementCollectionMapping2_1.java
deleted file mode 100644
index 6f4c192baa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmElementCollectionMapping2_1.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.eclipselink.core.internal.v2_1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkElementCollectionMapping2_0;
-
-
-public class EclipseLinkOrmElementCollectionMapping2_1
- extends AbstractOrmElementCollectionMapping2_0<XmlElementCollection>
- implements EclipseLinkElementCollectionMapping2_0
-{
- protected OrmEclipseLinkJoinFetch joinFetch;
-
- public EclipseLinkOrmElementCollectionMapping2_1(OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
- super(parent, resourceMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this, this.resourceAttributeMapping);
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java
deleted file mode 100644
index eab3381d95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.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.eclipselink.core.internal.v2_1.context.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.EclipseLinkOrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlElementCollection;
-
-public class EclipseLinkOrmXml2_1ContextNodeFactory extends EclipseLinkOrmXml2_0ContextNodeFactory
-{
-
- @Override
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, org.eclipse.jpt.core.resource.orm.XmlElementCollection resourceMapping) {
- return new EclipseLinkOrmElementCollectionMapping2_1(parent, (XmlElementCollection) resourceMapping);
- }
-
- @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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1Definition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1Definition.java
deleted file mode 100644
index a88e8ec55a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/EclipseLinkOrmXml2_1Definition.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.eclipselink.core.internal.v2_1.context.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.EclipseLinkOrmXml2_0Definition;
-
-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
- */
- private EclipseLinkOrmXml2_1Definition() {
- super();
- }
-
-
-// @Override
-// public EFactory getResourceNodeFactory() {
-// return EclipseLinkOrmFactory.eINSTANCE;
-// }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_1ContextNodeFactory();
- }
-
- @Override
- public JpaResourceType getResourceType() {
- return JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
deleted file mode 100644
index d1791d0182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.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 resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (!isVirtual()) { //if virtual the underlying java BasicMap annotation will have a java deprecation warning
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicMapMapping2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
deleted file mode 100644
index 7b6d062fa4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_1.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.AbstractOrmEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.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 resourceMapping) {
- super(parent, resourceMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (!isVirtual()) { //if virtual the underlying java BasicMap annotation will have a java deprecation warning
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java
deleted file mode 100644
index 8791add2f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.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.eclipselink.core.internal.v2_1.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentMember;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.jdt.Member;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.binary.BinaryEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.source.SourceEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.eclipselink.core.v2_0.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(JavaResourcePersistentMember parent, Member member) {
- return new SourceEclipseLinkClassExtractorAnnotation2_1((JavaResourcePersistentType) parent, (Type) member);
- }
-
- public Annotation buildNullAnnotation(JavaResourcePersistentMember parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourcePersistentMember parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkClassExtractorAnnotation2_1((JavaResourcePersistentType) parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index df99233a42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.core.internal.v2_1.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.v2_0.resource.java.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.v2_0.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(JavaResourcePersistentType 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);
- this.firePropertyChanged(FULLY_QUALIFIED_CLASS_NAME_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(EclipseLink2_1.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 597d14f88f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/internal/v2_1/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_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.eclipselink.core.internal.v2_1.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.core.internal.utility.jdt.MemberAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.core.utility.jdt.Type;
-import org.eclipse.jpt.eclipselink.core.v2_0.resource.java.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.v2_0.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-
-public final class SourceEclipseLinkClassExtractorAnnotation2_1
- extends SourceAnnotation<Type>
- 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;
-
- private String fullyQualifiedClassName;
-
-
- public SourceEclipseLinkClassExtractorAnnotation2_1(JavaResourcePersistentType parent, Type type) {
- super(parent, type, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new MemberAnnotationElementAdapter<String>(type, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncFullyQualifiedClassName(this.buildFullyQualifiedClassName(astRoot));
- }
-
- @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.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 class name
- public String getFullyQualifiedClassName() {
- return this.fullyQualifiedClassName;
- }
-
- private void syncFullyQualifiedClassName(String astFullyQualifiedClassName) {
- String old = this.fullyQualifiedClassName;
- this.fullyQualifiedClassName = astFullyQualifiedClassName;
- this.firePropertyChanged(FULLY_QUALIFIED_CLASS_NAME_PROPERTY, old, astFullyQualifiedClassName);
- }
-
- private String buildFullyQualifiedClassName(CompilationUnit astRoot) {
- return (this.value == null) ? null : ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(astRoot));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink2_1.CLASS_EXTRACTOR__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 7215859f34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/BaseEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,89 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.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 "model.MyDataType" if there is an import for model.MyDataType.
- * @return
- */
- String getFullyQualifiedDataType();
- String FULLY_QUALIFIED_DATA_TYPE_PROPERTY = "fullyQualifiedDataType"; //$NON-NLS-1$
-
- /**
- * 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 "model.MyObjectType" if there is an import for model.MyObjectType.
- * @return
- */
- String getFullyQualifiedObjectType();
- String FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY = "fullyQualifiedObjectType"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheCoordinationType.java
deleted file mode 100644
index c6b3e1a5f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/CacheType.java
deleted file mode 100644
index 8720062d0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ChangeTrackingType.java
deleted file mode 100644
index f322f45217..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLink.java
deleted file mode 100644
index 69be302041..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLink.java
+++ /dev/null
@@ -1,135 +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.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";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index 04f5e7af4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 784049ff42..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
deleted file mode 100644
index a42db3421b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,220 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index 51a5fa4ff3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index c3165ed67c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,73 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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 Annotation
-{
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
deleted file mode 100644
index 34af205401..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,59 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java
deleted file mode 100644
index e4df8a1c14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.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 customizer class name as resolved by the AST's bindings.
- * <pre>
- * &#64;Converter(GenderConverter.class)
- * </pre>
- * will return "model.GenderConverter" if there is an import for model.GenderConverter.
- * @return
- */
- String getFullyQualifiedConverterClassName();
- String FULLY_QUALIFIED_CONVERTER_CLASS_NAME_PROPERTY = "fullyQualifiedConverterClassName"; //$NON-NLS-1$
-
- /**
- * 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.eclipselink.core.context.EclipseLinkCustomConverter#ECLIPSELINK_CONVERTER_CLASS_NAME
- */
- boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index f094da99ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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 "model.EmployeeCustomizer" if there is an import for model.EmployeeCustomizer.
- */
- String getFullyQualifiedCustomizerClassName();
- String FULLY_QUALIFIED_CUSTOMIZER_CLASS_NAME_PROPERTY = "fullyQualifiedCustomizerClassName"; //$NON-NLS-1$
-
- /**
- * 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.eclipselink.core.context.EclipseLinkCustomizer#ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME
- */
- boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index 9bd4975450..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 366ee1e7a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java
deleted file mode 100644
index 45f495837f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 7a04690dbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,54 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index f82d4dcaf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,91 +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.eclipselink.core.resource.java;
-
-import java.util.ListIterator;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * 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.
- */
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues();
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- int conversionValuesSize();
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- EclipseLinkConversionValueAnnotation conversionValueAt(int index);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- int indexOfConversionValue(EclipseLinkConversionValueAnnotation conversionValue);
-
- /**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 565f767970..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index 7037c609ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index e872f77914..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 6b5361b533..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index e85ff3324c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,52 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index d60ed0ca1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.TimeOfDay
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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;
-
- /**
- * 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);
-
-
- /**
- * 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);
-
-
- /**
- * 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);
-
-
- /**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
deleted file mode 100644
index e0e404063e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,74 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java
deleted file mode 100644
index 632c9a2460..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index c7df28c2aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 29f456389d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,31 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 1a0e2fdc49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.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.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/ExistenceType.java
deleted file mode 100644
index a2b06d1494..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/JoinFetchType.java
deleted file mode 100644
index b702790e75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index c1e897378f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/java/NestableEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,28 +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.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-
-/**
- * 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.
- */
-public interface NestableEclipseLinkConversionValueAnnotation
- extends EclipseLinkConversionValueAnnotation, NestableAnnotation
-{
- // combine two interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java
deleted file mode 100644
index f7e3571129..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,394 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-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.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes <em>Variable One To Ones</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @model kind="class"
- * @generated
- */
-public class Attributes extends org.eclipse.jpt.core.resource.orm.Attributes
-{
- /**
- * 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>Basic Collections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.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.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.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.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.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.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.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__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__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__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__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__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);
- }
-
- @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()),
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheCoordinationType.java
deleted file mode 100644
index 48138ea477..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/CacheType.java
deleted file mode 100644
index ee76a2a944..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLink.java
deleted file mode 100644
index 30b9b18532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
deleted file mode 100644
index 713f205fad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
+++ /dev/null
@@ -1,887 +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.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.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.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_CHANGE_TRACKING: return (EObject)createXmlChangeTracking();
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY: return (EObject)createXmlCloneCopyPolicy();
- 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_ID: return (EObject)createXmlId();
- case EclipseLinkOrmPackage.XML_INSTANTIATION_COPY_POLICY: return (EObject)createXmlInstantiationCopyPolicy();
- 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_NAMED_CONVERTER: return (EObject)createXmlNamedConverter();
- 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_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- 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_RETURN_INSERT: return (EObject)createXmlReturnInsert();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER: return (EObject)createXmlStoredProcedureParameter();
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER: return (EObject)createXmlStructConverter();
- 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_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 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 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 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 XmlInstantiationCopyPolicy createXmlInstantiationCopyPolicy()
- {
- XmlInstantiationCopyPolicy xmlInstantiationCopyPolicy = new XmlInstantiationCopyPolicy();
- return xmlInstantiationCopyPolicy;
- }
-
- /**
- * <!-- 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 XmlNamedConverter createXmlNamedConverter()
- {
- XmlNamedConverter xmlNamedConverter = new XmlNamedConverter();
- return xmlNamedConverter;
- }
-
- /**
- * <!-- 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 XmlStoredProcedureParameter createXmlStoredProcedureParameter()
- {
- XmlStoredProcedureParameter xmlStoredProcedureParameter = new XmlStoredProcedureParameter();
- return xmlStoredProcedureParameter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructConverter createXmlStructConverter()
- {
- XmlStructConverter xmlStructConverter = new XmlStructConverter();
- return xmlStructConverter;
- }
-
- /**
- * <!-- 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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
deleted file mode 100644
index 044d96f175..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
+++ /dev/null
@@ -1,9789 +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.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.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-
-/**
- * <!-- 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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage.init();
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 2;
- /**
- * 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.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @generated
- */
- public static final int ATTRIBUTES = 3;
- /**
- * 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>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 + 0;
- /**
- * 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 + 1;
- /**
- * 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 + 2;
- /**
- * 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 + 3;
- /**
- * 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 + 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 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_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>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 + 6;
- /**
- * 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 + 7;
- /**
- * 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 + 8;
- /**
- * 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 + 9;
- /**
- * 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 + 10;
- /**
- * 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 + 11;
- /**
- * 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 + 12;
- /**
- * 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 + 13;
- /**
- * 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 + 14;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION = 5;
- /**
- * 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 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 + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @generated
- */
- public static final int XML_BASIC_MAP = 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_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 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 + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @generated
- */
- public static final int XML_BATCH_FETCH = 7;
- /**
- * 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.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @generated
- */
- public static final int XML_BATCH_FETCH_HOLDER = 8;
- /**
- * 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.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @generated
- */
- public static final int XML_CACHE = 9;
- /**
- * 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 = 0;
- /**
- * 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 = 1;
- /**
- * 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 = 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_CACHE__TYPE = 3;
- /**
- * 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 = 4;
- /**
- * 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 = 5;
- /**
- * 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 = 6;
- /**
- * 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 = 7;
- /**
- * 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 = 8;
- /**
- * 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 = 9;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @generated
- */
- public static final int XML_CACHE_HOLDER = 10;
- /**
- * 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.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING = 11;
- /**
- * 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.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_HOLDER = 12;
- /**
- * 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.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @generated
- */
- public static final int XML_CLONE_COPY_POLICY = 13;
- /**
- * 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.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @generated
- */
- public static final int XML_CONVERSION_VALUE = 14;
- /**
- * 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.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @generated
- */
- public static final int XML_NAMED_CONVERTER = 37;
- /**
- * 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.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @generated
- */
- public static final int XML_CONVERTER = 15;
- /**
- * 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.eclipselink.core.resource.orm.XmlConverterHolder <em>Xml Converter Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder()
- * @generated
- */
- public static final int XML_CONVERTER_HOLDER = 16;
- /**
- * 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.eclipselink.core.resource.orm.XmlConvertersHolder <em>Xml Converters Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder()
- * @generated
- */
- public static final int XML_CONVERTERS_HOLDER = 17;
- /**
- * 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.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final int XML_CONVERTIBLE_MAPPING = 18;
- /**
- * 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.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @generated
- */
- public static final int XML_COPY_POLICY = 19;
- /**
- * 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.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @generated
- */
- public static final int XML_CUSTOMIZER = 20;
- /**
- * 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.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @generated
- */
- public static final int XML_CUSTOMIZER_HOLDER = 21;
- /**
- * 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.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION = 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_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>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 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>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 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 + 16;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final int XML_EMBEDDABLE = 23;
- /**
- * 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>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 + 1;
- /**
- * 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 + 2;
- /**
- * 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 + 3;
- /**
- * 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 + 4;
- /**
- * 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 + 5;
- /**
- * 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 + 6;
- /**
- * 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 + 7;
- /**
- * 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 + 8;
- /**
- * 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 + 9;
- /**
- * 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 + 10;
- /**
- * 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 + 11;
- /**
- * 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 + 12;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final int XML_EMBEDDED = 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_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.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final int XML_EMBEDDED_ID = 25;
- /**
- * 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.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @generated
- */
- public static final int XML_ENTITY = 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_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>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 + 7;
- /**
- * 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 + 8;
- /**
- * 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 + 9;
- /**
- * 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 + 10;
- /**
- * 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 + 11;
- /**
- * 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 + 12;
- /**
- * 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 + 13;
- /**
- * 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 + 14;
- /**
- * 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 + 15;
- /**
- * 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 + 16;
- /**
- * 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 + 17;
- /**
- * 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 + 18;
- /**
- * 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 + 19;
- /**
- * 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 + 20;
- /**
- * 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 + 21;
- /**
- * 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 + 22;
- /**
- * 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 + 23;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS = 27;
- /**
- * 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>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 + 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_ENTITY_MAPPINGS__TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 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_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 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_ENTITY_MAPPINGS__STRUCT_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 3;
- /**
- * 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 + 4;
- /**
- * 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 + 5;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @generated
- */
- public static final int XML_FETCH_ATTRIBUTE = 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_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.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @generated
- */
- public static final int XML_FETCH_GROUP = 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_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.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 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_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>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 + 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_ID__PROPERTIES = OrmPackage.XML_ID_FEATURE_COUNT + 2;
- /**
- * 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 + 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_ID__CONVERTER = OrmPackage.XML_ID_FEATURE_COUNT + 4;
- /**
- * 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 + 5;
- /**
- * 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 + 6;
- /**
- * 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 + 7;
- /**
- * 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 + 8;
- /**
- * 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 + 9;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @generated
- */
- public static final int XML_INSTANTIATION_COPY_POLICY = 31;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @generated
- */
- public static final int XML_JOIN_FETCH = 32;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 33;
- /**
- * 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 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 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 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>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 + 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_MANY_TO_MANY__PROPERTIES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 9;
- /**
- * 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 + 10;
- /**
- * 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 + 11;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final int XML_MANY_TO_ONE = 34;
- /**
- * 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>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 + 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_MANY_TO_ONE__PROPERTIES = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 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_MANY_TO_ONE__JOIN_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 3;
- /**
- * 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 + 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 35;
- /**
- * 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>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 + 15;
- /**
- * 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 + 16;
- /**
- * 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 + 17;
- /**
- * 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 + 18;
- /**
- * 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 + 19;
- /**
- * 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 + 20;
- /**
- * 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 + 21;
- /**
- * 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 + 22;
- /**
- * 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 + 23;
- /**
- * 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 + 24;
- /**
- * 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 + 25;
- /**
- * 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 + 26;
- /**
- * 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 + 27;
- /**
- * 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 + 28;
- /**
- * 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 + 29;
- /**
- * 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 + 30;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @generated
- */
- public static final int XML_MUTABLE = 36;
- /**
- * 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.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY = 38;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @generated
- */
- public static final int XML_OBJECT_TYPE_CONVERTER = 39;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 40;
- /**
- * 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 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 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 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>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 + 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_ONE_TO_MANY__PROPERTIES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 9;
- /**
- * 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 + 10;
- /**
- * 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 + 11;
- /**
- * 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 + 12;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final int XML_ONE_TO_ONE = 41;
- /**
- * 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>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>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>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>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 + 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_ONE_TO_ONE__PROPERTIES = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 2;
- /**
- * 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 + 3;
- /**
- * 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 + 4;
- /**
- * 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 + 5;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING = 42;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final int XML_ORDER_COLUMN = 43;
- /**
- * 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.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 44;
- /**
- * 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 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 + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA = 45;
- /**
- * 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.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @generated
- */
- public static final int XML_PRIMARY_KEY = 46;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @generated
- */
- public static final int XML_PRIVATE_OWNED = 47;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @generated
- */
- public static final int XML_PROPERTY = 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_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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @generated
- */
- public static final int XML_PROPERTY_CONTAINER = 49;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final int XML_QUERY_CONTAINER = 50;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @generated
- */
- public static final int XML_QUERY_REDIRECTORS = 51;
- /**
- * 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.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @generated
- */
- public static final int XML_READ_ONLY = 52;
- /**
- * 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.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @generated
- */
- public static final int XML_RETURN_INSERT = 53;
- /**
- * 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.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER = 54;
- /**
- * 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.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @generated
- */
- public static final int XML_STRUCT_CONVERTER = 55;
- /**
- * 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.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @generated
- */
- public static final int XML_TIME_OF_DAY = 56;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @generated
- */
- public static final int XML_TRANSFORMATION = 57;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 58;
- /**
- * 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 meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @generated
- */
- public static final int XML_TYPE_CONVERTER = 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_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.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @generated
- */
- public static final int XML_VARIABLE_ONE_TO_ONE = 60;
- /**
- * 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 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 + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 61;
- /**
- * 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>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 + 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_VERSION__PROPERTIES = OrmPackage.XML_VERSION_FEATURE_COUNT + 2;
- /**
- * 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 + 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_VERSION__CONVERTER = OrmPackage.XML_VERSION_FEATURE_COUNT + 4;
- /**
- * 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 + 5;
- /**
- * 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 + 6;
- /**
- * 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 + 7;
- /**
- * 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 + 8;
- /**
- * 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 + 9;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @generated
- */
- public static final int CACHE_COORDINATION_TYPE = 62;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @generated
- */
- public static final int CACHE_TYPE = 63;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_TYPE = 64;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @generated
- */
- public static final int XML_DIRECTION = 65;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @generated
- */
- public static final int EXISTENCE_TYPE = 66;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @generated
- */
- public static final int XML_JOIN_FETCH_TYPE = 67;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING_TYPE = 68;
- /**
- * <!-- 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 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 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 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 xmlInstantiationCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinFetchEClass = 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 xmlMutableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedConverterEClass = 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 xmlStoredProcedureParameterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructConverterEClass = 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 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.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);
-
- // Create package meta-data objects
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.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.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.eclipselink.core.resource.orm.XmlAccessMethods
- * @generated
- */
- public EClass getXmlAccessMethods()
- {
- return xmlAccessMethodsEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @generated
- */
- public EClass getXmlAccessMethodsHolder()
- {
- return xmlAccessMethodsHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlAttributeMapping
- * @generated
- */
- public EClass getXmlAttributeMapping()
- {
- return xmlAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.Attributes
- * @generated
- */
- public EClass getAttributes()
- {
- return attributesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlBasic
- * @generated
- */
- public EClass getXmlBasic()
- {
- return xmlBasicEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBasicCollection
- * @generated
- */
- public EClass getXmlBasicCollection()
- {
- return xmlBasicCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBasicMap
- * @generated
- */
- public EClass getXmlBasicMap()
- {
- return xmlBasicMapEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBatchFetch
- * @generated
- */
- public EClass getXmlBatchFetch()
- {
- return xmlBatchFetchEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @generated
- */
- public EClass getXmlBatchFetchHolder()
- {
- return xmlBatchFetchHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlCache
- * @generated
- */
- public EClass getXmlCache()
- {
- return xmlCacheEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlCacheHolder
- * @generated
- */
- public EClass getXmlCacheHolder()
- {
- return xmlCacheHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.XmlChangeTracking
- * @generated
- */
- public EClass getXmlChangeTracking()
- {
- return xmlChangeTrackingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @generated
- */
- public EClass getXmlChangeTrackingHolder()
- {
- return xmlChangeTrackingHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @generated
- */
- public EClass getXmlCloneCopyPolicy()
- {
- return xmlCloneCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.XmlConversionValue
- * @generated
- */
- public EClass getXmlConversionValue()
- {
- return xmlConversionValueEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.XmlConverter
- * @generated
- */
- public EClass getXmlConverter()
- {
- return xmlConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlConverterHolder
- * @generated
- */
- public EClass getXmlConverterHolder()
- {
- return xmlConverterHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlConvertersHolder
- * @generated
- */
- public EClass getXmlConvertersHolder()
- {
- return xmlConvertersHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @generated
- */
- public EClass getXmlConvertibleMapping()
- {
- return xmlConvertibleMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlCopyPolicy
- * @generated
- */
- public EClass getXmlCopyPolicy()
- {
- return xmlCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlCustomizer
- * @generated
- */
- public EClass getXmlCustomizer()
- {
- return xmlCustomizerEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @generated
- */
- public EClass getXmlCustomizerHolder()
- {
- return xmlCustomizerHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlElementCollection
- * @generated
- */
- public EClass getXmlElementCollection()
- {
- return xmlElementCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEmbeddable
- * @generated
- */
- public EClass getXmlEmbeddable()
- {
- return xmlEmbeddableEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlEmbedded
- * @generated
- */
- public EClass getXmlEmbedded()
- {
- return xmlEmbeddedEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEmbeddedId
- * @generated
- */
- public EClass getXmlEmbeddedId()
- {
- return xmlEmbeddedIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEntity
- * @generated
- */
- public EClass getXmlEntity()
- {
- return xmlEntityEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlEntityMappings
- * @generated
- */
- public EClass getXmlEntityMappings()
- {
- return xmlEntityMappingsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlFetchAttribute
- * @generated
- */
- public EClass getXmlFetchAttribute()
- {
- return xmlFetchAttributeEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlFetchGroup
- * @generated
- */
- public EClass getXmlFetchGroup()
- {
- return xmlFetchGroupEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlId
- * @generated
- */
- public EClass getXmlId()
- {
- return xmlIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @generated
- */
- public EClass getXmlInstantiationCopyPolicy()
- {
- return xmlInstantiationCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlJoinFetch
- * @generated
- */
- public EClass getXmlJoinFetch()
- {
- return xmlJoinFetchEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlManyToMany
- * @generated
- */
- public EClass getXmlManyToMany()
- {
- return xmlManyToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlManyToOne
- * @generated
- */
- public EClass getXmlManyToOne()
- {
- return xmlManyToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass()
- {
- return xmlMappedSuperclassEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlMutable
- * @generated
- */
- public EClass getXmlMutable()
- {
- return xmlMutableEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlNamedConverter
- * @generated
- */
- public EClass getXmlNamedConverter()
- {
- return xmlNamedConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @generated
- */
- public EClass getXmlNamedStoredProcedureQuery()
- {
- return xmlNamedStoredProcedureQueryEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @generated
- */
- public EClass getXmlObjectTypeConverter()
- {
- return xmlObjectTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlOneToMany
- * @generated
- */
- public EClass getXmlOneToMany()
- {
- return xmlOneToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOneToOne
- * @generated
- */
- public EClass getXmlOneToOne()
- {
- return xmlOneToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @generated
- */
- public EClass getXmlOptimisticLocking()
- {
- return xmlOptimisticLockingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlOrderColumn
- * @generated
- */
- public EClass getXmlOrderColumn()
- {
- return xmlOrderColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults()
- {
- return xmlPersistenceUnitDefaultsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata()
- {
- return xmlPersistenceUnitMetadataEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlPrimaryKey
- * @generated
- */
- public EClass getXmlPrimaryKey()
- {
- return xmlPrimaryKeyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPrivateOwned
- * @generated
- */
- public EClass getXmlPrivateOwned()
- {
- return xmlPrivateOwnedEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlProperty
- * @generated
- */
- public EClass getXmlProperty()
- {
- return xmlPropertyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlPropertyContainer
- * @generated
- */
- public EClass getXmlPropertyContainer()
- {
- return xmlPropertyContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlQueryContainer
- * @generated
- */
- public EClass getXmlQueryContainer()
- {
- return xmlQueryContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @generated
- */
- public EClass getXmlQueryRedirectors()
- {
- return xmlQueryRedirectorsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlReadOnly
- * @generated
- */
- public EClass getXmlReadOnly()
- {
- return xmlReadOnlyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlReturnInsert
- * @generated
- */
- public EClass getXmlReturnInsert()
- {
- return xmlReturnInsertEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @generated
- */
- public EClass getXmlStoredProcedureParameter()
- {
- return xmlStoredProcedureParameterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlStructConverter
- * @generated
- */
- public EClass getXmlStructConverter()
- {
- return xmlStructConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.XmlTimeOfDay
- * @generated
- */
- public EClass getXmlTimeOfDay()
- {
- return xmlTimeOfDayEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.XmlTransformation
- * @generated
- */
- public EClass getXmlTransformation()
- {
- return xmlTransformationEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTransient
- * @generated
- */
- public EClass getXmlTransient()
- {
- return xmlTransientEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTypeConverter
- * @generated
- */
- public EClass getXmlTypeConverter()
- {
- return xmlTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @generated
- */
- public EClass getXmlVariableOneToOne()
- {
- return xmlVariableOneToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlVersion
- * @generated
- */
- public EClass getXmlVersion()
- {
- return xmlVersionEClass;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.CacheCoordinationType
- * @generated
- */
- public EEnum getCacheCoordinationType()
- {
- return cacheCoordinationTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.CacheType
- * @generated
- */
- public EEnum getCacheType()
- {
- return cacheTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @generated
- */
- public EEnum getXmlChangeTrackingType()
- {
- return xmlChangeTrackingTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlDirection
- * @generated
- */
- public EEnum getXmlDirection()
- {
- return xmlDirectionEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.ExistenceType
- * @generated
- */
- public EEnum getExistenceType()
- {
- return existenceTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @generated
- */
- public EEnum getXmlJoinFetchType()
- {
- return xmlJoinFetchTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.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.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);
-
- 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);
-
- 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);
-
- 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);
-
- xmlIdEClass = createEClass(XML_ID);
-
- xmlInstantiationCopyPolicyEClass = createEClass(XML_INSTANTIATION_COPY_POLICY);
-
- xmlJoinFetchEClass = createEClass(XML_JOIN_FETCH);
- createEAttribute(xmlJoinFetchEClass, XML_JOIN_FETCH__JOIN_FETCH);
-
- 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);
-
- xmlMutableEClass = createEClass(XML_MUTABLE);
- createEAttribute(xmlMutableEClass, XML_MUTABLE__MUTABLE);
-
- xmlNamedConverterEClass = createEClass(XML_NAMED_CONVERTER);
- createEAttribute(xmlNamedConverterEClass, XML_NAMED_CONVERTER__NAME);
-
- 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);
-
- xmlPersistenceUnitDefaultsEClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS);
-
- xmlPersistenceUnitMetadataEClass = createEClass(XML_PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS);
-
- 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);
-
- xmlReadOnlyEClass = createEClass(XML_READ_ONLY);
- createEAttribute(xmlReadOnlyEClass, XML_READ_ONLY__READ_ONLY);
-
- xmlReturnInsertEClass = createEClass(XML_RETURN_INSERT);
-
- 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);
-
- xmlStructConverterEClass = createEClass(XML_STRUCT_CONVERTER);
- createEAttribute(xmlStructConverterEClass, XML_STRUCT_CONVERTER__CONVERTER);
-
- 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);
-
- 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);
- 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);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlAttributeMappingEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAccessMethodsHolder());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- attributesEClass.getESuperTypes().add(theOrmPackage.getAttributes());
- xmlBasicEClass.getESuperTypes().add(theOrmPackage.getXmlBasic());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBasic_2_1());
- 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());
- xmlBasicMapEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicMapEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBatchFetchEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBatchFetch_2_1());
- 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());
- xmlEmbeddableEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddable());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbeddable_2_1());
- 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(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(this.getXmlConvertersHolder());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlFetchAttributeEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchAttribute_2_1());
- xmlFetchGroupEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchGroup_2_1());
- xmlIdEClass.getESuperTypes().add(theOrmPackage.getXmlId());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlId_2_1());
- xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlMutable());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlManyToManyEClass.getESuperTypes().add(theOrmPackage.getXmlManyToMany());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlManyToMany_2_0());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlManyToMany_2_1());
- 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(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(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());
- 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(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(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());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitDefaults());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPersistenceUnitDefaults_2_1());
- xmlPersistenceUnitMetadataEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitMetadata());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlPrimaryKey_1_1());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPrimaryKey_2_1());
- xmlQueryRedirectorsEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlQueryRedirectors_2_0());
- xmlReturnInsertEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlReturnInsert_2_1());
- xmlStructConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- 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());
- xmlVariableOneToOneEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlVariableOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(theOrmPackage.getXmlVersion());
- xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlVersion_2_1());
- 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(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(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(xmlConversionValueEClass, XmlConversionValue.class, "XmlConversionValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConversionValue_DataValue(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(xmlIdEClass, XmlId.class, "XmlId", !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(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(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(), ecorePackage.getEString(), "name", null, 0, 1, XmlNamedConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- 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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(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(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(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(xmlReturnInsertEClass, XmlReturnInsert.class, "XmlReturnInsert", !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(xmlStructConverterEClass, XmlStructConverter.class, "XmlStructConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStructConverter_Converter(), ecorePackage.getEString(), "converter", null, 0, 1, XmlStructConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- 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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "objectType", null, 0, 1, XmlTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- 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.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConverterHolder <em>Xml Converter Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConvertersHolder <em>Xml Converters Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java
deleted file mode 100644
index e676848cf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-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, JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, XmlEntityMappings.getRootTranslator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/ExistenceType.java
deleted file mode 100644
index e7e6d71948..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethods.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethods.java
deleted file mode 100644
index 102b94b6a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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,
- Translator.END_TAG_NO_INDENT,
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java
deleted file mode 100644
index bc3cd541ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- XmlAccessMethods getAccessMethods();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlAttributeMapping.java
deleted file mode 100644
index c7767ab669..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAttributeMapping
- extends org.eclipse.jpt.core.resource.orm.XmlAttributeMapping,
- XmlAccessMethodsHolder, XmlPropertyContainer
-{
-} // XmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasic.java
deleted file mode 100644
index 56b22324d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,1481 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @model kind="class"
- * @generated
- */
-public class XmlBasic extends org.eclipse.jpt.core.resource.orm.XmlBasic implements XmlBasic_2_1, 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 #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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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>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.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.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.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.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.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.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.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(),
- 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 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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java
deleted file mode 100644
index 0e2fbfed93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicCollection.java
+++ /dev/null
@@ -1,351 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicCollection extends AbstractXmlAttributeMapping 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 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.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.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.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.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;
- }
-
- /**
- * <!-- 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();
- }
- 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;
- }
- 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;
- }
- 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();
- }
- 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;
- }
- }
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java
deleted file mode 100644
index 47bd6bf865..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBasicMap.java
+++ /dev/null
@@ -1,351 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicMap extends AbstractXmlAttributeMapping 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 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.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.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.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.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;
- }
-
- /**
- * <!-- 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();
- }
- 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;
- }
- 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;
- }
- 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();
- }
- 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;
- }
- }
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetch.java
deleted file mode 100644
index 02976c25d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.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.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.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.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.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.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetchHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlBatchFetchHolder.java
deleted file mode 100644
index db8b0a8f39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- XmlBatchFetch getBatchFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java
deleted file mode 100644
index f48760d309..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCache.java
+++ /dev/null
@@ -1,841 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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 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.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCache extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * 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>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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.CacheType
- * @see #setType(CacheType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Type()
- * @model
- * @generated
- */
- public CacheType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.CacheCoordinationType
- * @see #setCoordinationType(CacheCoordinationType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_CoordinationType()
- * @model default=""
- * @generated
- */
- public CacheCoordinationType getCoordinationType()
- {
- return coordinationType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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__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__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__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__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 String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- 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(),
- buildTypeTranslator(),
- buildAlwaysRefreshTranslator(),
- buildRefreshOnlyIfNewerTranslator(),
- buildDisableHitsTranslator(),
- buildCoordinationTypeTranslator(),
- };
- }
-
- 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);
- }
-
-} // XmlCache
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCacheHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCacheHolder.java
deleted file mode 100644
index 633d25ca76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- XmlCache getCache();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- ExistenceType getExistenceChecking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- void setExistenceChecking(ExistenceType value);
-
-} // XmlCacheHolder
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTracking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTracking.java
deleted file mode 100644
index 5b30befd21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see #setType(XmlChangeTrackingType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking_Type()
- * @model
- * @generated
- */
- public XmlChangeTrackingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
deleted file mode 100644
index f3f60a1944..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- XmlChangeTracking getChangeTracking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlChangeTrackingType.java
deleted file mode 100644
index 81e1b9038f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java
deleted file mode 100644
index 2772bbe682..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValue.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConversionValue.java
deleted file mode 100644
index c97ed1da5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-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.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_DataValue()
- * @model
- * @generated
- */
- public String getDataValue()
- {
- return dataValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_ObjectValue()
- * @model
- * @generated
- */
- public String getObjectValue()
- {
- return objectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java
deleted file mode 100644
index 0815d6acac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverter.java
+++ /dev/null
@@ -1,224 +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.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.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 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.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter_ClassName()
- * @model
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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();
- }
-
- // ********** 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);
- }
-
-} // XmlConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java
deleted file mode 100644
index 8bccb361b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConverterHolder.java
+++ /dev/null
@@ -1,152 +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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConverterHolder#getConverter <em>Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterHolder#getTypeConverter <em>Type Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterHolder#getObjectTypeConverter <em>Object Type Converter</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverterHolder#getStructConverter <em>Struct Converter</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConverterHolder extends JpaEObject
-{
- /**
- * 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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_Converter()
- * @model containment="true"
- * @generated
- */
- XmlConverter getConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_TypeConverter()
- * @model containment="true"
- * @generated
- */
- XmlTypeConverter getTypeConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_ObjectTypeConverter()
- * @model containment="true"
- * @generated
- */
- XmlObjectTypeConverter getObjectTypeConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterHolder_StructConverter()
- * @model containment="true"
- * @generated
- */
- XmlStructConverter getStructConverter();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertersHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertersHolder.java
deleted file mode 100644
index fc6334b189..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConvertersHolder#getConverters <em>Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder#getTypeConverters <em>Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder#getObjectTypeConverters <em>Object Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder#getStructConverters <em>Struct Converters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertersHolder_StructConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlStructConverter> getStructConverters();
-
-} // XmlConvertersHolder
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlConvertibleMapping.java
deleted file mode 100644
index 0f257ddffb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlConvertibleMapping extends org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model
- * @generated
- */
- String getConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCopyPolicy.java
deleted file mode 100644
index 7962f7ccd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizer.java
deleted file mode 100644
index 0cec193b8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer_CustomizerClassName()
- * @model
- * @generated
- */
- public String getCustomizerClassName()
- {
- return customizerClassName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizerHolder.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlCustomizerHolder.java
deleted file mode 100644
index 268c8058a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCustomizer();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlDirection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlDirection.java
deleted file mode 100644
index a5d255d185..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlElementCollection.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlElementCollection.java
deleted file mode 100644
index 6560b955e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlElementCollection.java
+++ /dev/null
@@ -1,1534 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlElementCollection extends org.eclipse.jpt.core.resource.orm.XmlElementCollection implements XmlElementCollection_2_0, XmlElementCollection_2_1
-{
- /**
- * 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;
-
- /**
- * <!-- 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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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));
- }
-
- /**
- * <!-- 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);
- }
- 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();
- }
- 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;
- }
- 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;
- }
- 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);
- }
- 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;
- }
- }
- 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;
- }
- }
- 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(')');
- 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(),
- 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()),
- XmlConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_TypeConverter()),
- XmlConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_ObjectTypeConverter()),
- XmlConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterHolder_StructConverter()),
- XmlCollectionTable.buildTranslator(JPA2_0.COLLECTION_TABLE, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_CollectionTable()),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java
deleted file mode 100644
index 7e356ceaa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,1157 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1;
-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.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddable extends org.eclipse.jpt.core.resource.orm.XmlEmbeddable implements XmlEmbeddable_2_1, 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 #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.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.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>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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(" (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(),
- buildAccessTranslator(),
- buildMetadataCompleteTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildPropertyTranslator(),
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbedded.java
deleted file mode 100644
index 54d001a5b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbedded extends org.eclipse.jpt.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEmbeddedId.java
deleted file mode 100644
index 6e8f855364..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedId extends org.eclipse.jpt.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java
deleted file mode 100644
index 798b039446..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,2143 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-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.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends org.eclipse.jpt.core.resource.orm.XmlEntity implements XmlEntity_1_1, XmlEntity_2_0, XmlEntity_2_1, 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 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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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>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.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.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__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__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__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__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__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 == 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 == 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(", 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(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildTableTranslator(),
- buildSecondaryTableTranslator(),
- buildPrimaryKeyJoinColumnTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildInheritanceTranslator(),
- buildDiscriminatorValueTranslator(),
- buildDiscriminatorColumnTranslator(),
- buildClassExtractorTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- 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 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java
deleted file mode 100644
index 3faa58a689..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,517 +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.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-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.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleRootTranslator;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @model kind="class"
- * @generated
- */
-public class XmlEntityMappings extends org.eclipse.jpt.core.resource.orm.XmlEntityMappings implements XmlConvertersHolder, XmlQueryContainer
-{
- /**
- * 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>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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);
- 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(),
- 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()),
- 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()),
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchAttribute.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchAttribute.java
deleted file mode 100644
index 004de22448..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute_2_1_Name()
- * @model
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchGroup.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlFetchGroup.java
deleted file mode 100644
index b95ae531eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Name()
- * @model
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.java
deleted file mode 100644
index 7e9dcafc47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,1031 +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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlId_2_1;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @model kind="class"
- * @generated
- */
-public class XmlId extends org.eclipse.jpt.core.resource.orm.XmlId implements XmlId_2_1, 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 #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.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.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>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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(),
- buildGeneratedValueTranslator(),
- buildTemporalTranslator(),
- 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 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java
deleted file mode 100644
index d38c8f6a90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetch.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetch.java
deleted file mode 100644
index 1647492070..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- XmlJoinFetchType getJoinFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlJoinFetchType.java
deleted file mode 100644
index d857feec04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.java
deleted file mode 100644
index 119c67e5d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,1232 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToMany extends org.eclipse.jpt.core.resource.orm.XmlManyToMany implements XmlManyToMany_2_0, XmlManyToMany_2_1, 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 #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.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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>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.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.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.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.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__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__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__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__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__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 == 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 == 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(", 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(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.java
deleted file mode 100644
index 9dee8cfd55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,604 +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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOne extends org.eclipse.jpt.core.resource.orm.XmlManyToOne implements XmlManyToOne_2_1, 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 #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.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.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>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(" (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()
- };
- }
-
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java
deleted file mode 100644
index ec1c6f9236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,2646 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1;
-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.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass implements XmlMappedSuperclass_1_1, XmlMappedSuperclass_2_0, XmlMappedSuperclass_2_1, 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 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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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>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.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.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__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__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__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__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__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.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 == 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.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 == 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(", 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(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- 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 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 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);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMutable.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlMutable.java
deleted file mode 100644
index 9bb59eee78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java
deleted file mode 100644
index 30ab7b202e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedConverter.java
+++ /dev/null
@@ -1,212 +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.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.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter_Name()
- * @model
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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();
- }
-
- // ********** 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java
deleted file mode 100644
index 399e909502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints <em>Hints</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters <em>Parameters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
deleted file mode 100644
index 2dd4e844b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
+++ /dev/null
@@ -1,438 +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.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.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 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.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues <em>Conversion Values</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DataType()
- * @model
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_ObjectType()
- * @model
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DefaultObjectValue()
- * @model
- * @generated
- */
- public String getDefaultObjectValue()
- {
- return defaultObjectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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);
- }
-
-} // XmlObjectTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.java
deleted file mode 100644
index 264886c9c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToMany.java
+++ /dev/null
@@ -1,1322 +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.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.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToMany extends org.eclipse.jpt.core.resource.orm.XmlOneToMany implements XmlOneToMany_2_0, XmlOneToMany_2_1, 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 #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.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.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.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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>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.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.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.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.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__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__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__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__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__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 == 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 == 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(", 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(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.java
deleted file mode 100644
index 5d7dd96327..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,695 +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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1;
-import org.eclipse.jpt.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOne extends org.eclipse.jpt.core.resource.orm.XmlOneToOne implements XmlOneToOne_2_1, 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 #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.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.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>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.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.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.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.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(" (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(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- 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());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLocking.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLocking.java
deleted file mode 100644
index 2dc36c1a90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns <em>Selected Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see #setType(XmlOptimisticLockingType)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_Type()
- * @model
- * @generated
- */
- public XmlOptimisticLockingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLockingType.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOptimisticLockingType.java
deleted file mode 100644
index a05f0eeaf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlOrderColumn.java
deleted file mode 100644
index 8e45ba72a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlOrderColumn extends org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
deleted file mode 100644
index daac937911..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitDefaults implements XmlPersistenceUnitDefaults_2_1
-{
- /**
- * 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;
-
- /**
- * <!-- 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.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.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));
- }
-
- /**
- * <!-- 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);
- }
- 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();
- }
- 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_DEFAULTS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)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;
- }
- 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;
- }
- 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;
- }
- }
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDescriptionTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildDelimitedIdentifiersTranslator(),
- buildAccessTranslator(),
- buildAccessMethodsTranslator(),
- buildCascadePersistTranslator(),
- buildEntityListenersTranslator()
- };
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
-} // XmlPersistenceUnitDefaults
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java
deleted file mode 100644
index f842826747..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.JPA;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrimaryKey.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrimaryKey.java
deleted file mode 100644
index 0e5ef4d715..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.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.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.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.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.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.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.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPrivateOwned.java
deleted file mode 100644
index 89edb82aaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlProperty.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlProperty.java
deleted file mode 100644
index c6192c6c00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPropertyContainer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlPropertyContainer.java
deleted file mode 100644
index efcce09255..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties <em>Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- EList<XmlProperty> getProperties();
-
-} // XmlPropertyContainer
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryContainer.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryContainer.java
deleted file mode 100644
index cc1dcf998f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries <em>Named Stored Procedure Queries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries();
-
-} // XmlQueryContainer
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryRedirectors.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlQueryRedirectors.java
deleted file mode 100644
index b6af0dbf07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_AllQueries()
- * @model
- * @generated
- */
- public String getAllQueries()
- {
- return allQueries;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadAll()
- * @model
- * @generated
- */
- public String getReadAll()
- {
- return readAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadObject()
- * @model
- * @generated
- */
- public String getReadObject()
- {
- return readObject;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Report()
- * @model
- * @generated
- */
- public String getReport()
- {
- return report;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Update()
- * @model
- * @generated
- */
- public String getUpdate()
- {
- return update;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Insert()
- * @model
- * @generated
- */
- public String getInsert()
- {
- return insert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Delete()
- * @model
- * @generated
- */
- public String getDelete()
- {
- return delete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReadOnly.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReadOnly.java
deleted file mode 100644
index c60422a165..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.core.utility.TextRange;
-
-/**
- * <!-- 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.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReturnInsert.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlReturnInsert.java
deleted file mode 100644
index 18d3866627..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java
deleted file mode 100644
index 4b039cf2db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.XmlDirection
- * @see #setDirection(XmlDirection)
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Direction()
- * @model
- * @generated
- */
- public XmlDirection getDirection()
- {
- return direction;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java
deleted file mode 100644
index 5c65dd0aa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlStructConverter.java
+++ /dev/null
@@ -1,229 +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.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.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 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.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter_Converter()
- * @model
- * @generated
- */
- public String getConverter()
- {
- return converter;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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();
- }
-
- // ********** 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);
- }
-
-} // XmlStructConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTimeOfDay.java
deleted file mode 100644
index 392b7764b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransformation.java
deleted file mode 100644
index b2c0082e22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-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.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTransient.java
deleted file mode 100644
index 17d46c8b4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @model kind="class"
- * @generated
- */
-public class XmlTransient extends org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java
deleted file mode 100644
index 0587b41c0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlTypeConverter.java
+++ /dev/null
@@ -1,299 +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.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.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 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.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_DataType()
- * @model
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_ObjectType()
- * @model
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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);
- }
-} // XmlTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVariableOneToOne.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVariableOneToOne.java
deleted file mode 100644
index 6b9ddd0b41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVariableOneToOne.java
+++ /dev/null
@@ -1,355 +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.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.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlVariableOneToOne extends AbstractXmlAttributeMapping 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 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.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.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.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.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;
- }
-
- /**
- * <!-- 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);
- }
- 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();
- }
- 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;
- }
- 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;
- }
- 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();
- }
- 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;
- }
- }
- 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;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.java
deleted file mode 100644
index 93fdfed2ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/XmlVersion.java
+++ /dev/null
@@ -1,1028 +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.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.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1;
-import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @model kind="class"
- * @generated
- */
-public class XmlVersion extends org.eclipse.jpt.core.resource.orm.XmlVersion implements XmlVersion_2_1, 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 #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.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.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>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.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.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.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.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.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.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.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.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.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.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.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__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__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__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__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__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 == 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 == 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(),
- 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 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java
deleted file mode 100644
index ab195dca60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java
deleted file mode 100644
index e5baa2af3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
deleted file mode 100644
index 6526bf5710..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
+++ /dev/null
@@ -1,684 +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.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.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-
-/**
- * <!-- 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.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.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.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.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.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);
-
- // Create package meta-data objects
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java
deleted file mode 100644
index 5b2f91abb2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java
deleted file mode 100644
index 5f650bfaa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java
deleted file mode 100644
index ec96b98842..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java
deleted file mode 100644
index 9de36af3be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java
deleted file mode 100644
index 0b174587c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns <em>Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java
deleted file mode 100644
index 115b1c205c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v1_2;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java
deleted file mode 100644
index 286cf2afc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java
deleted file mode 100644
index 5be4ac8725..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
deleted file mode 100644
index 447ea791ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
+++ /dev/null
@@ -1,1521 +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.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.jpt.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-
-/**
- * <!-- 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.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.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.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>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20__CACHEABLE = OrmV2_0Package.XML_ENTITY_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_ENTITY_20__CACHE_INTERCEPTOR = OrmV2_0Package.XML_ENTITY_20_FEATURE_COUNT + 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 = OrmV2_0Package.XML_ENTITY_20_FEATURE_COUNT + 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 = OrmV2_0Package.XML_ENTITY_20_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.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.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();
-
- // 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);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.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());
- xmlEntity_2_0EClass.getESuperTypes().add(theOrmV2_0Package.getXmlEntity_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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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.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.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java
deleted file mode 100644
index 69749a2be4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java
deleted file mode 100644
index c28cac35e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlCacheInterceptor_2_0#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java
deleted file mode 100644
index ca7e7f78f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model
- * @generated
- */
- String getMapKeyConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java
deleted file mode 100644
index 73628e921b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConvertersHolder;
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
deleted file mode 100644
index 1680ba087a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
+++ /dev/null
@@ -1,92 +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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_0 extends org.eclipse.jpt.core.resource.orm.v2_0.XmlEntity_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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java
deleted file mode 100644
index a0910d5bf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java
deleted file mode 100644
index 05dfc02c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides <em>Map Key Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java
deleted file mode 100644
index 57771e4383..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java
deleted file mode 100644
index 4e2a680b58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
deleted file mode 100644
index e64ee8f355..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java
deleted file mode 100644
index 285ca61da6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_AllQueries()
- * @model
- * @generated
- */
- String getAllQueries();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadAll()
- * @model
- * @generated
- */
- String getReadAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadObject()
- * @model
- * @generated
- */
- String getReadObject();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Report()
- * @model
- * @generated
- */
- String getReport();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Update()
- * @model
- * @generated
- */
- String getUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Insert()
- * @model
- * @generated
- */
- String getInsert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Delete()
- * @model
- * @generated
- */
- String getDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java
deleted file mode 100644
index ef794a0cfe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java
deleted file mode 100644
index 3683b9e4eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java
deleted file mode 100644
index 71f83f0ada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java
deleted file mode 100644
index 175f351c74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
deleted file mode 100644
index 6edc5edbe3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
+++ /dev/null
@@ -1,2584 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.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.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-
-/**
- * <!-- 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.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.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.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.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>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__SEQUENCE_GENERATOR = EclipseLinkOrmV1_1Package.XML_BASIC_11__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_21__TABLE_GENERATOR = EclipseLinkOrmV1_1Package.XML_BASIC_11__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_21__GENERATED_VALUE = EclipseLinkOrmV1_1Package.XML_BASIC_11__GENERATED_VALUE;
-
- /**
- * 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 = EclipseLinkOrmV1_1Package.XML_BASIC_11_FEATURE_COUNT + 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 = EclipseLinkOrmV1_1Package.XML_BASIC_11_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_BASIC_21__ATTRIBUTE_TYPE = EclipseLinkOrmV1_1Package.XML_BASIC_11_FEATURE_COUNT + 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 = EclipseLinkOrmV1_1Package.XML_BASIC_11_FEATURE_COUNT + 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlId_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.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.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);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI);
- 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
- xmlBasic_2_1EClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlBasic_1_1());
- 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(), ecorePackage.getEString(), "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(), ecorePackage.getEString(), "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.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.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbeddable_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlId_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java
deleted file mode 100644
index b09b374ac6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlReturnInsert;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1;
-
-/**
- * <!-- 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.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic_2_1 extends XmlBasic_1_1
-{
- /**
- * 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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java
deleted file mode 100644
index 7765f92797..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java
deleted file mode 100644
index aa8dc9e3e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddable_2_1.java
deleted file mode 100644
index 3151e317f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbeddedId_2_1.java
deleted file mode 100644
index 0d38c5c7c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEmbedded_2_1.java
deleted file mode 100644
index b6d996fe89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java
deleted file mode 100644
index 14bd37b468..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java
deleted file mode 100644
index 368f1b68f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java
deleted file mode 100644
index 3cdecf909f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1_Name()
- * @model
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java
deleted file mode 100644
index a5b68b608f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups <em>Fetch Groups</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java
deleted file mode 100644
index 4d86d800b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Name()
- * @model
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlId_2_1.java
deleted file mode 100644
index 7bb2b43f19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlId_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java
deleted file mode 100644
index aa1b5c34d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java
deleted file mode 100644
index 230718affd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java
deleted file mode 100644
index a23d1da66e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * <li>{@link org.eclipse.jpt.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.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.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.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java
deleted file mode 100644
index 0589bdbd96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java
deleted file mode 100644
index 8f2a160346..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java
deleted file mode 100644
index 63ed04e53c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java
deleted file mode 100644
index fc37246908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java
deleted file mode 100644
index a5b43fdfa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlTransformation_2_1.java
deleted file mode 100644
index 8b7819148a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/resource/orm/v2_1/XmlVersion_2_1.java
deleted file mode 100644
index b35165d23c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/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.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.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.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.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.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.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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index e9ad7af44b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkElementCollectionMapping2_0.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.eclipselink.core.v2_0.context;
-
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
-
- EclipseLinkJoinFetch getJoinFetch();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyMapping2_0.java
deleted file mode 100644
index d5433092bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyMapping2_0.java
+++ /dev/null
@@ -1,29 +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.eclipselink.core.v2_0.context;
-
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{
- EclipseLinkOneToManyRelationshipReference2_0 getRelationshipReference();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyRelationshipReference2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyRelationshipReference2_0.java
deleted file mode 100644
index c1bf79df67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToManyRelationshipReference2_0.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.eclipselink.core.v2_0.context;
-
-import org.eclipse.jpt.core.context.RelationshipReference;
-import org.eclipse.jpt.core.jpa2.context.OneToManyRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyRelationshipReference;
-
-
-/**
- * Represents the {@link RelationshipReference} of an
- * {@link EclipseLinkOneToManyMapping}
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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 EclipseLinkOneToManyRelationshipReference2_0
- extends
- EclipseLinkOneToManyRelationshipReference,
- OneToManyRelationshipReference2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index 2b94710046..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/EclipseLinkOneToOneMapping2_0.java
+++ /dev/null
@@ -1,27 +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.eclipselink.core.v2_0.context;
-
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback 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
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/connection/Connection2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/connection/Connection2_0.java
deleted file mode 100644
index 54c0afb5a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/connection/Connection2_0.java
+++ /dev/null
@@ -1,21 +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.eclipselink.core.v2_0.context.persistence.connection;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-
-/**
- * Connection2_0
- */
-public interface Connection2_0 extends Connection, JpaConnection2_0
-{
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/logging/Logging2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/logging/Logging2_0.java
deleted file mode 100644
index e18504a598..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/logging/Logging2_0.java
+++ /dev/null
@@ -1,80 +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.eclipselink.core.v2_0.context.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-/**
- * 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.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/options/Options2_0.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/options/Options2_0.java
deleted file mode 100644
index 002f7c223c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/context/persistence/options/Options2_0.java
+++ /dev/null
@@ -1,21 +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.eclipselink.core.v2_0.context.persistence.options;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-
-/**
- * Options2_0
- */
-public interface Options2_0 extends Options, JpaOptions2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLink2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLink2_1.java
deleted file mode 100644
index cf87dbda02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLink2_1.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.eclipselink.core.v2_0.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.3
- * @since 2.3
- */
-@SuppressWarnings("nls")
-public interface EclipseLink2_1 {
-
- // EclipseLink package
- String PACKAGE = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
- String PACKAGE_ = PACKAGE + ".";
-
-
- // ********** API **********
-
- // EclispeLink 2.1 annotations
- String CLASS_EXTRACTOR = PACKAGE_ + "ClassExtractor";
- String CLASS_EXTRACTOR__VALUE = "value";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 580da8f0ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/src/org/eclipse/jpt/eclipselink/core/v2_0/resource/java/EclipseLinkClassExtractorAnnotation2_1.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.eclipselink.core.v2_0.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.core.resource.java.Annotation;
-import org.eclipse.jpt.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.3
- * @since 2.3
- */
-public interface EclipseLinkClassExtractorAnnotation2_1
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink2_1.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.
- * This will also remove the ClassExtractor annotation itself.
- */
- 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 ClassExtractor name as resolved by the AST's bindings.
- * <pre>
- * &#64;ClassExtractor(MyExtractor.class)
- * </pre>
- * will return "model.MyExtractor" if there is an import for model.MyExtractor.
- */
- String getFullyQualifiedClassName();
- String FULLY_QUALIFIED_CLASS_NAME_PROPERTY = "fullyQualifiedClassName"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.classpath b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.classpath
deleted file mode 100644
index bbf9ced68e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.classpath
+++ /dev/null
@@ -1,8 +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 exported="true" kind="lib" path="lib/eclipselink.jar" sourcepath="lib/eclipselink-src.zip"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ 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 b85bb2e115..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.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/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8fb4ff705c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Tue Apr 13 12:12:27 EDT 2010
-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.compliance=1.5
-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.eclipselink.jaxb.core.schemagen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index e4ebf6286b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.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.eclipselink.jaxb.core.schemagen;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: lib/eclipselink.jar
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind
-Export-Package: org.eclipse.jpt.eclipselink.jaxb.core.schemagen
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.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/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/build.properties
deleted file mode 100644
index a3ffe71f6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- lib/eclipselink.jar,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink-src.zip b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink-src.zip
deleted file mode 100644
index 68a5393d4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink-src.zip
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink.jar b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink.jar
deleted file mode 100644
index 855e644c5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/lib/eclipselink.jar
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/plugin.properties
deleted file mode 100644
index c05741163a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.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 - EclipseLink JAXB Support - Schema Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java
deleted file mode 100644
index 2438b94bc6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.jaxb.core.schemagen;
-
-import java.io.File;
-import java.io.IOException;
-import java.text.MessageFormat;
-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.eclipselink.jaxb.core.schemagen.internal.JptEclipseLinkJaxbCoreMessages;
-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);
- }
- String result = (jaxbContext != null) ?
- this.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_GENERATED, this.targetSchemaName) :
- this.bind(JptEclipseLinkJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName);
- System.out.println(result);
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(this.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(this.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(this.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 = this.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(this.getString(JptEclipseLinkJaxbCoreMessages.PROPERTIES_FILE_NOT_FOUND));
- }
- else {
- ex.printStackTrace();
- }
- }
-
- private String getString(String key) {
- return JptEclipseLinkJaxbCoreMessages.getString(key);
- }
-
- private String bind(String key, Object argument) {
- return MessageFormat.format(this.getString(key), argument);
- }
-
- // ********** 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 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 final String targetSchemaName;
-
- protected JptSchemaOutputResolver(String targetSchemaName) {
- this.targetSchemaName = targetSchemaName;
- }
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
-
- File file = new File(this.targetSchemaName );
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURI().toURL().toString());
- return result;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/JptEclipseLinkJaxbCoreMessages.java
deleted file mode 100644
index 62f89faba3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/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.eclipselink.jaxb.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.eclipselink.jaxb.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/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
deleted file mode 100644
index f7914dbf32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/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\
-configured 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/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.classpath b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.classpath
deleted file mode 100644
index fcf07989bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/eclipselink/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/ui/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.cvsignore
deleted file mode 100644
index 76e64421ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bin
-@dot
-temp.folder
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 e572be1b93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 2fdb2b173d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:59 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 9dd4c3641c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun Feb 24 21:27:01 EST 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.eclipselink.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index cb8ee7dcda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,59 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.eclipselink.ui;singleton:=true
-Bundle-Version: 1.3.0.qualifier
-Bundle-Activator: org.eclipse.jpt.eclipselink.ui.JptEclipseLinkUiPlugin
-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.core.runtime;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.jpt.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.200,2.0.0)"
-Export-Package: org.eclipse.jpt.eclipselink.ui,
- org.eclipse.jpt.eclipselink.ui.internal;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.ddlgen;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.ddlgen.wizards;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.details;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.details.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.details.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.caching;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.connection;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.customization;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.general;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.logging;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.options;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistence.schema.generation;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.persistencexml.details;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.structure;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v1_1.platform;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v1_2.platform;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.ddlgen.wizards;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.details;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.caching;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.logging;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.options;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.v2_1.platform;x-internal:=true,
- org.eclipse.jpt.eclipselink.ui.internal.wizards;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/about.html b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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/jpa/plugins/org.eclipse.jpt.eclipselink.ui/build.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/build.properties
deleted file mode 100644
index 213a2e2c4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,20 +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
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.properties
deleted file mode 100644
index b2c6af6d54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.properties
+++ /dev/null
@@ -1,30 +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 - UI
-providerName=Eclipse Web Tools Platform
-
-eclipseLinkWizardCategoryName=EclipseLink
-newEclipseLinkMappingFileWizardName=EclipseLink Mapping File
-newEclipseLinkJpaMappingFileWizardDesc=Create an EclipseLink specific mapping file
-
-newEclipseLink1_1MappingFileWizardName=EclipseLink 1.1 Mapping File
-newEclipseLink1_1JpaMappingFileWizardDesc=Create an EclipseLink 1.1 specific mapping file \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.xml
deleted file mode 100644
index 78f49870ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,131 +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.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="org.eclipse.eclipselink.platform.ui"
- jpaPlatform="org.eclipse.eclipselink.platform"
- factoryClass="org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink1_1.ui"
- jpaPlatform="eclipselink1_1"
- factoryClass="org.eclipse.jpt.eclipselink.ui.internal.v1_1.platform.EclipseLink1_1JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink1_2.ui"
- jpaPlatform="eclipselink1_2"
- factoryClass="org.eclipse.jpt.eclipselink.ui.internal.v1_2.platform.EclipseLink1_2JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_0.ui"
- jpaPlatform="eclipselink2_0"
- factoryClass="org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform.EclipseLink2_0JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_1.ui"
- jpaPlatform="eclipselink2_1"
- factoryClass="org.eclipse.jpt.eclipselink.ui.internal.v2_1.platform.EclipseLink2_1JpaPlatformUiFactory"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.eclipselink"
- name="%eclipseLinkWizardCategoryName"
- parentCategory="org.eclipse.jpt"/>
-
- <wizard
- id="org.eclipse.jpt.eclipselink.ui.wizard.newEclipseLinkMappingFile"
- name="%newEclipseLinkMappingFileWizardName"
- icon="platform:/plugin/org.eclipse.jpt.ui/icons/full/etool16/new_jpa_file_wiz.gif"
- category="org.eclipse.jpt/org.eclipse.jpt.eclipselink">
- <description>%newEclipseLinkJpaMappingFileWizardDesc</description>
- <class class="org.eclipse.jpt.eclipselink.ui.internal.wizards.EclipseLinkMappingFileWizard">
- <parameter name="javaeeartifact" value="true"/>
- <parameter name="menuIndex" value="40" />
- <parameter name="jptartifact" value="true"/>
- </class>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <commonWizard
- menuGroupId="org.eclipse.jpt.ui"
- type="new"
- wizardId="org.eclipse.jpt.eclipselink.ui.wizard.newEclipseLinkMappingFile">
- <enablement>
- <and>
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <instanceof value="org.eclipse.core.resources.IFolder"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa" />
- </adapt>
- <or>
- <test
- property="org.eclipse.jpt.core.jpaPlatform"
- value="org.eclipse.eclipselink.platform">
- </test>
- <test
- property="org.eclipse.jpt.core.jpaPlatform"
- value="eclipselink1_1">
- </test>
- <test
- property="org.eclipse.jpt.core.jpaPlatform"
- value="eclipselink1_2">
- </test>
- <test
- property="org.eclipse.jpt.core.jpaPlatform"
- value="eclipselink2_0">
- </test>
- <test
- property="org.eclipse.jpt.core.jpaPlatform"
- value="eclipselink2_1">
- </test>
- </or>
- </and>
- </enablement>
- </commonWizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
-
- <perspectiveExtension
- targetID="org.eclipse.jpt.ui.jpaPerspective">
- <newWizardShortcut
- id="org.eclipse.jpt.eclipselink.ui.wizard.newEclipseLinkMappingFile">
- </newWizardShortcut>
- </perspectiveExtension>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui.properties
deleted file mode 100644
index b71d2951c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui.properties
+++ /dev/null
@@ -1,381 +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
-################################################################################
-
-MappingFileWizard_title=New EclipseLink Mapping File
-MappingFileWizardPage_title=EclipseLink mapping file
-MappingFileWizardPage_desc=Specify EclipseLink mapping file location and properties
-
-EclipseLink1_1MappingFileWizard_title=New EclipseLink 1.1 Mapping File
-EclipseLink1_1MappingFileWizardPage_title=EclipseLink 1.1 mapping file
-EclipseLink1_1MappingFileWizardPage_desc=Specify EclipseLink 1.1 mapping file location and properties
-
-Boolean_True = True
-Boolean_False = False
-
-DefaultWithoutValue=Default ()
-DefaultWithValue=Default ({0})
-
-PersistenceXmlTabFolder_defaultEmpty = Default ()
-PersistenceXmlTabFolder_defaultWithOneParam = Default ({0})
-
-PersistenceXmlGeneralTab_name = Name:
-PersistenceXmlGeneralTab_provider = Provider:
-PersistenceXmlGeneralTab_browse = Browse...
-PersistenceXmlGeneralTab_description = Description:
-
-# General
-PersistenceXmlGeneralTab_title = General
-PersistenceXmlGeneralTab_generalSectionTitle = General
-PersistenceXmlGeneralTab_mappedClassesSectionTitle = Managed Classes
-PersistenceXmlGeneralTab_mappedClassesSectionDescription=Specify the list of classes to be managed in this persistence unit.
-PersistenceXmlGeneralTab_xmlMappingFilesSectionTitle = XML Mapping Files
-PersistenceXmlGeneralTab_xmlMappingFilesSectionDescription=Specify the XML mapping files for this persistence unit.
-
-PersistenceXmlGeneralTab_nameLabel = Name:
-PersistenceXmlGeneralTab_persistenceProviderLabel = Persistence Provider:
-PersistenceXmlGeneralTab_descriptionLabel = Description:
-
-PersistenceXmlGeneralTab_excludeUnlistedMappedClasses=Exclude unlisted classes
-PersistenceXmlGeneralTab_excludeUnlistedMappedClassesWithDefault=Exclude unlisted classes ({0})
-PersistenceXmlGeneralTab_mappedClassesNoName=<name not set>
-PersistenceXmlGeneralTab_open=Open
-
-PersistenceXmlGeneralTab_xmlMappingFilesDialog_title=JPA XML Mapping File Selection
-PersistenceXmlGeneralTab_xmlMappingFilesDialog_message=Choose the XML mapping files to be added to the persistence unit.
-PersistenceXmlGeneralTab_ormNoName=<name not set>
-PersistenceXmlGeneralTab_excludeEclipselinkOrm=Exclude unlisted EclipseLink XML mapping file
-PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault=Exclude unlisted EclipseLink XML mapping file ({0})
-
-# Connection
-PersistenceXmlConnectionTab_title = Connection
-PersistenceXmlConnectionTab_sectionTitle = Persistence Unit Connection
-PersistenceXmlConnectionTab_sectionDescription = Configure the data source or JDBC connection properties.
-PersistenceXmlConnectionTab_defaultWithOneParam = Default ({0})
-PersistenceXmlConnectionTab_defaultEmpty = Default ()
-
-PersistenceXmlConnectionTab_transactionTypeLabel = Transaction type:
-
-TransactionTypeComposite_jta = JTA
-TransactionTypeComposite_resource_local = Resource Local
-
-PersistenceXmlConnectionTab_nativeSqlLabel = Native SQL
-PersistenceXmlConnectionTab_nativeSqlLabelDefault = Native SQL ({0})
-
-PersistenceXmlConnectionTab_batchWritingLabel = Batch writing:
-
-BatchWritingComposite_none = None
-BatchWritingComposite_jdbc = JDBC
-BatchWritingComposite_buffered = Buffered
-BatchWritingComposite_oracle_jdbc = Oracle JDBC
-
-PersistenceXmlConnectionTab_cacheStatementsLabel = Statement caching:
-
-PersistenceXmlConnectionTab_jtaDataSourceLabel = JTA data source:
-PersistenceXmlConnectionTab_nonJtaDataSourceLabel = Non-JTA data source:
-
-PersistenceXmlConnectionTab_driverLabel = Driver:
-PersistenceXmlConnectionTab_urlLabel = URL:
-PersistenceXmlConnectionTab_userLabel = User:
-PersistenceXmlConnectionTab_passwordLabel = Password:
-PersistenceXmlConnectionTab_bindParametersLabel = Bind parameters
-PersistenceXmlConnectionTab_bindParametersLabelDefault = Bind parameters ({0})
-
-PersistenceXmlConnectionTab_readConnectionsSharedLabel = Shared
-PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault = Shared ({0})
-PersistenceXmlConnectionTab_readConnectionsSectionTitle = Read Connection
-PersistenceXmlConnectionTab_readConnectionsMinLabel = Minimum:
-PersistenceXmlConnectionTab_readConnectionsMaxLabel = Maximum:
-PersistenceXmlConnectionTab_writeConnectionsSectionTitle = Write Connection
-PersistenceXmlConnectionTab_writeConnectionsMinLabel = Minimum:
-PersistenceXmlConnectionTab_writeConnectionsMaxLabel = Maximum:
-
-ConnectionPropertiesComposite_Database_GroupBox = Database
-
-JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox = EclipseLink connection pool
-
-JdbcConnectionPropertiesComposite_ConnectionDialog_Message = &Enter connection name or pattern (*, ?, or camel case):
-JdbcConnectionPropertiesComposite_ConnectionDialog_Title = Connection Selection
-
-JdbcExclusiveConnectionsPropertiesComposite_GroupBox = Exclusive connections
-
-PersistenceXmlConnectionTab_exclusiveConnectionModeLabel = Exclusive connection mode:
-
-JdbcExclusiveConnectionModeComposite_always = Always
-JdbcExclusiveConnectionModeComposite_isolated = Isolated
-JdbcExclusiveConnectionModeComposite_transactional = Transactional
-
-PersistenceXmlConnectionTab_lazyConnectionLabel = Lazy connection acquisition
-PersistenceXmlConnectionTab_lazyConnectionLabelDefault = Lazy connection acquisition ({0})
-
-# SchemaGeneration
-PersistenceXmlSchemaGenerationTab_title = Schema Generation
-PersistenceXmlSchemaGenerationTab_sectionTitle = Persistence Unit Schema Generation
-PersistenceXmlSchemaGenerationTab_sectionDescription = Configure the EclipseLink schema generation properties.
-PersistenceXmlSchemaGenerationTab_defaultWithOneParam = Default ({0})
-PersistenceXmlSchemaGenerationTab_defaultEmpty = Default ()
-PersistenceXmlSchemaGenerationTab_defaultDot = Default (.)
-
-PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel = DDL generation type:
-PersistenceXmlSchemaGenerationTab_outputModeLabel = Output mode:
-PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel = Create DDL file name:
-PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel = Drop DDL file name:
-
-OutputModeComposite_both = Both
-OutputModeComposite_sql_script = Sql-script
-OutputModeComposite_database = Database
-
-DdlGenerationTypeComposite_none = None
-DdlGenerationTypeComposite_create_tables = Create Tables
-DdlGenerationTypeComposite_drop_and_create_tables = Drop and Create Tables
-
-PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel = DDL generation location:
-
-DdlGenerationLocationComposite_dialogTitle = Generation Location
-DdlGenerationLocationComposite_dialogMessage = Choose a folder for the generated DDL files:
-
-# Caching
-PersistenceXmlCachingTab_title = Caching
-PersistenceXmlCachingTab_sectionTitle = Persistence Unit Caching
-PersistenceXmlCachingTab_sectionDescription = Configure the session or entity specific EclipseLink caching properties.
-
-CacheDefaultsComposite_groupTitle = Defaults
-
-PersistenceXmlCachingTab_defaultCacheTypeLabel = Default cache type:
-PersistenceXmlCachingTab_cacheTypeLabel = Cache type:
-
-PersistenceXmlCachingTab_defaultSharedCacheLabel = Shared cache ({0})
-PersistenceXmlCachingTab_sharedCacheLabel = Shared cache
-
-PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel = Default shared cache ({0})
-PersistenceXmlCachingTab_sharedCacheDefaultLabel = Default shared cache
-
-CacheSizeComposite_cacheSize=Cache size:
-
-CacheTypeComposite_full = Full
-CacheTypeComposite_hard_weak = Weak with Hard Subcache
-CacheTypeComposite_none = None
-CacheTypeComposite_soft = Soft
-CacheTypeComposite_soft_weak = Weak with Soft Subcache
-CacheTypeComposite_weak = Weak
-
-DefaultCacheSizeComposite_defaultCacheSize=Default cache size:
-
-DefaultCacheTypeComposite_full = Full
-DefaultCacheTypeComposite_hard_weak = Weak With Hard Subcache
-DefaultCacheTypeComposite_none = None
-DefaultCacheTypeComposite_soft = Soft
-DefaultCacheTypeComposite_soft_weak = Weak with Soft Subcache
-DefaultCacheTypeComposite_weak = Weak
-
-EntityDialog_selectEntity = Select an Entity
-EntityDialog_name = Name:
-
-CachingEntityListComposite_groupTitle = Entity caching
-CachingEntityListComposite_editButton = Edit...
-
-CachingEntityListComposite_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
-CachingEntityListComposite_dialogTitle=Entity Selection
-
-PersistenceXmlCachingTab_FlushClearCacheLabel = Flush clear cache:
-
-FlushClearCacheComposite_drop = Drop
-FlushClearCacheComposite_drop_invalidate = Drop Invalidate
-FlushClearCacheComposite_merge = Merge
-
-# Customization
-PersistenceXmlCustomizationTab_title = Customization
-PersistenceXmlCustomizationTab_sectionTitle = Persistence Unit Customization
-PersistenceXmlCustomizationTab_sectionDescription = Set default or entity specific EclipseLink customization and validation properties.
-PersistenceXmlCustomizationTab_defaultWithOneParam = Default ({0})
-PersistenceXmlCustomizationTab_defaultEmpty = Default ()
-
-PersistenceXmlCustomizationTab_weavingPropertiesGroupBox = Weaving
-PersistenceXmlCustomizationTab_weavingLabel = Weaving:
-
-PersistenceXmlCustomizationTab_weavingLazyLabelDefault = Lazy ({0})
-PersistenceXmlCustomizationTab_weavingLazyLabel = Lazy
-
-PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault = Fetch groups ({0})
-PersistenceXmlCustomizationTab_weavingFetchGroupsLabel = Fetch groups
-
-PersistenceXmlCustomizationTab_weavingInternalLabel = Internal
-PersistenceXmlCustomizationTab_weavingInternalLabelDefault = Internal ({0})
-
-PersistenceXmlCustomizationTab_weavingEagerLabel = Eager
-PersistenceXmlCustomizationTab_weavingEagerLabelDefault = Eager ({0})
-
-PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault = Change tracking ({0})
-PersistenceXmlCustomizationTab_weavingChangeTrackingLabel = Change tracking
-
-PersistenceXmlCustomizationTab_validationOnlyLabel = Validation only
-PersistenceXmlCustomizationTab_validationOnlyLabelDefault = Validation only ({0})
-
-PersistenceXmlCustomizationTab_validateSchemaLabel = Mapping files schema validation
-PersistenceXmlCustomizationTab_validateSchemaLabelDefault = Mapping files schema validation ({0})
-
-PersistenceXmlCustomizationTab_throwExceptionsLabelDefault = Throw exceptions ({0})
-PersistenceXmlCustomizationTab_throwExceptionsLabel = Throw exceptions
-
-PersistenceXmlCustomizationTab_exceptionHandlerLabel = Exception handler:
-
-WeavingComposite_true_ = Weave Dynamically
-WeavingComposite_false_ = No Weaving
-WeavingComposite_static_ = Weave Statically
-
-CustomizationEntityListComposite_groupTitle = Descriptor customizers
-CustomizationEntityListComposite_editButton = Edit...
-
-CustomizationEntityListComposite_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
-CustomizationEntityListComposite_dialogTitle=Entity Selection
-
-PersistenceXmlCustomizationTab_customizerLabel = Customizer:
-PersistenceXmlCustomizationTab_sessionCustomizerLabel = Session customizers
-
-PersistenceXmlCustomizationTab_noName=<name not set>
-
-PersistenceXmlCustomizationTab_profilerLabel = Profiler:
-PersistenceXmlCustomizationTab_browse = Browse...
-
-ProfilerComposite_performance_profiler = Performance Profiler
-ProfilerComposite_query_monitor = Query Monitor
-ProfilerComposite_no_profiler = No Profiler
-
-# Logging
-PersistenceXmlLoggingTab_title = Logging
-PersistenceXmlLoggingTab_sectionTitle = Persistence Unit Logging
-PersistenceXmlLoggingTab_sectionDescription = Configure the EclipseLink logging properties.
-PersistenceXmlLoggingTab_defaultWithOneParam = Default ({0})
-PersistenceXmlLoggingTab_defaultEmpty = Default ()
-PersistenceXmlLoggingTab_defaultStdout = Default (stdout)
-
-PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle = Logging Categories
-PersistenceXmlLoggingTab_loggingLevelLabel = Logging level:
-
-PersistenceXmlLoggingTab_sqlLoggingLevelLabel = SQL:
-PersistenceXmlLoggingTab_transactionLoggingLevelLabel = Transaction:
-PersistenceXmlLoggingTab_eventLoggingLevelLabel = Event:
-PersistenceXmlLoggingTab_connectionLoggingLevelLabel = Connection:
-PersistenceXmlLoggingTab_queryLoggingLevelLabel = Query:
-PersistenceXmlLoggingTab_cacheLoggingLevelLabel = Cache:
-PersistenceXmlLoggingTab_propagationLoggingLevelLabel = Propagation:
-PersistenceXmlLoggingTab_sequencingLoggingLevelLabel = Sequencing:
-PersistenceXmlLoggingTab_ejbLoggingLevelLabel = EJB:
-PersistenceXmlLoggingTab_dmsLoggingLevelLabel = DMS:
-PersistenceXmlLoggingTab_ejb_or_metadataLoggingLevelLabel = EJB or metadata:
-PersistenceXmlLoggingTab_jpa_metamodelLoggingLevelLabel = JPA metamodel:
- PersistenceXmlLoggingTab_weaverLoggingLevelLabel = Weaving:
-PersistenceXmlLoggingTab_propertiesLoggingLevelLabel = Properties:
-PersistenceXmlLoggingTab_serverLoggingLevelLabel = Server:
-
-LoggingLevelComposite_off = Off
-LoggingLevelComposite_severe = Severe
-LoggingLevelComposite_warning = Warning
-LoggingLevelComposite_info = Info
-LoggingLevelComposite_config = Config
-LoggingLevelComposite_fine = Fine
-LoggingLevelComposite_finer = Finer
-LoggingLevelComposite_finest = Finest
-LoggingLevelComposite_all = All
-
-EclipseLinkCategoryLoggingLevelComposite_off = Off
-EclipseLinkCategoryLoggingLevelComposite_severe = Severe
-EclipseLinkCategoryLoggingLevelComposite_warning = Warning
-EclipseLinkCategoryLoggingLevelComposite_info = Info
-EclipseLinkCategoryLoggingLevelComposite_config = Config
-EclipseLinkCategoryLoggingLevelComposite_fine = Fine
-EclipseLinkCategoryLoggingLevelComposite_finer = Finer
-EclipseLinkCategoryLoggingLevelComposite_finest = Finest
-EclipseLinkCategoryLoggingLevelComposite_all = All
-
-PersistenceXmlLoggingTab_loggerLabel = Logger:
-PersistenceXmlLoggingTab_browse = Browse...
-LoggerComposite_default_logger = Default Logger
-LoggerComposite_java_logger = Java Logger
-LoggerComposite_server_logger = Server Logger
-
-PersistenceXmlLoggingTab_timestampLabel = Timestamp
-PersistenceXmlLoggingTab_timestampLabelDefault = Timestamp ({0})
-PersistenceXmlLoggingTab_threadLabel = Thread
-PersistenceXmlLoggingTab_threadLabelDefault = Thread ({0})
-PersistenceXmlLoggingTab_sessionLabel = Session
-PersistenceXmlLoggingTab_sessionLabelDefault = Session ({0})
-PersistenceXmlLoggingTab_exceptionsLabel = Exceptions
-PersistenceXmlLoggingTab_exceptionsLabelDefault = Exceptions ({0})
-PersistenceXmlLoggingTab_connectionLabel = Connection
-PersistenceXmlLoggingTab_connectionLabelDefault = Connection ({0})
-
-PersistenceXmlLoggingTab_loggersLabel = Loggers:
-
-PersistenceXmlLoggingTab_loggingFileLabel = Log file:
-
-LoggingFileLocationComposite_dialogTitle = Choose a log file
-
-# Options
-PersistenceXmlOptionsTab_title = Options
-PersistenceXmlOptionsTab_sessionSectionTitle = EclipseLink Session Options
-PersistenceXmlOptionsTab_sessionSectionDescription = Configure the EclipseLink session options.
-PersistenceXmlOptionsTab_defaultWithOneParam = Default ({0})
-PersistenceXmlOptionsTab_defaultEmpty = Default ()
-
-PersistenceXmlOptionsTab_sessionName = Session name:
-PersistenceXmlOptionsTab_sessionsXml = Sessions XML:
-
-PersistenceXmlOptionsTab_includeDescriptorQueriesLabel = Include descriptor queries
-PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault = Include descriptor queries ({0})
-
-PersistenceXmlOptionsTab_eventListenerLabel = Event listener:
-PersistenceXmlOptionsTab_targetDatabaseLabel = Target database:
-
-PersistenceXmlOptionsTab_miscellaneousSectionTitle = Miscellaneous Options
-PersistenceXmlOptionsTab_miscellaneousSectionDescription = Configure the miscellaneous options.
-
-PersistenceXmlOptionsTab_temporalMutableLabel = Temporal mutable
-PersistenceXmlOptionsTab_temporalMutableLabelDefault = Temporal mutable ({0})
-
-TargetDatabaseComposite_attunity = Attunity
-TargetDatabaseComposite_auto = Auto
-TargetDatabaseComposite_cloudscape = Cloudscape
-TargetDatabaseComposite_database = Database
-TargetDatabaseComposite_db2 = DB2
-TargetDatabaseComposite_db2mainframe = DB2Mainframe
-TargetDatabaseComposite_dbase = DBase
-TargetDatabaseComposite_derby = Derby
-TargetDatabaseComposite_hsql = HSQL
-TargetDatabaseComposite_informix = Informix
-TargetDatabaseComposite_javadb = JavaDB
-TargetDatabaseComposite_mysql = MySQL
-TargetDatabaseComposite_oracle = Oracle
-TargetDatabaseComposite_oracle11 = Oracle11
-TargetDatabaseComposite_oracle10 = Oracle10g
-TargetDatabaseComposite_oracle9 = Oracle9i
-TargetDatabaseComposite_oracle8 = Oracle8i
-TargetDatabaseComposite_pointbase = PointBase
-TargetDatabaseComposite_postgresql = PostgreSQL
-TargetDatabaseComposite_sqlanywhere = SQLAnywhere
-TargetDatabaseComposite_sqlserver = SQLServer
-TargetDatabaseComposite_sybase = Sybase
-TargetDatabaseComposite_timesten = TimesTen
-
-PersistenceXmlOptionsTab_targetServerLabel = Target server:
-
-TargetServerComposite_none = None
-TargetServerComposite_oc4j = OC4J
-TargetServerComposite_sunas9 = SunAS9
-TargetServerComposite_websphere = WebSphere
-TargetServerComposite_websphere_6_1 = WebSphere 6.1
-TargetServerComposite_weblogic = WebLogic
-TargetServerComposite_weblogic_9 = WebLogic 9
-TargetServerComposite_weblogic_10 = WebLogic 10
-TargetServerComposite_jboss = JBoss
-
-# DDLGeneration
-EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle = Generating DDL
-EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage = Warning: Generating DDL will DROP existing tables and{0}CREATE new tables based on the Entities in your project.{1}Are you sure you want to continue?
-EclipseLinkDDLGeneratorUi_error = Error
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_details.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_details.properties
deleted file mode 100644
index e218cf9f93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/property_files/eclipselink_ui_details.properties
+++ /dev/null
@@ -1,152 +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
-################################################################################
-
-EclipseLinkBasicCollectionMappingUiProvider_label = Basic Collection
-EclipseLinkBasicCollectionMappingUiProvider_linkLabel = basic collection
-
-EclipseLinkBasicMapMappingUiProvider_label = Basic Map
-EclipseLinkBasicMapMappingUiProvider_linkLabel = basic map
-
-EclipseLinkTransformationMappingUiProvider_label = Transformation
-EclipseLinkTransformationMappingUiProvider_linkLabel = transformation
-
-EclipseLinkVariableOneToOneMappingUiProvider_label = Variable One to One
-EclipseLinkVariableOneToOneMappingUiProvider_linkLabel = variable one to one
-
-EclipseLinkCacheTypeComposite_label = Type:
-EclipseLinkCacheTypeComposite_full = Full
-EclipseLinkCacheTypeComposite_weak = Weak
-EclipseLinkCacheTypeComposite_soft = Soft
-EclipseLinkCacheTypeComposite_soft_weak = Weak with Soft Subcache
-EclipseLinkCacheTypeComposite_hard_weak = Weak with Hard Subcache
-EclipseLinkCacheTypeComposite_cache = Cache
-EclipseLinkCacheTypeComposite_none = None
-
-EclipseLinkCacheSizeComposite_size = Size:
-
-EclipseLinkCacheCoordinationTypeComposite_label = Coordination type:
-EclipseLinkCacheCoordinationTypeComposite_send_object_changes = Send Object Changes
-EclipseLinkCacheCoordinationTypeComposite_invalidate_changed_objects = Invalidate Changed Objects
-EclipseLinkCacheCoordinationTypeComposite_send_new_objects_with_changes = Send New Objects with Changes
-EclipseLinkCacheCoordinationTypeComposite_none = None
-
-EclipseLinkCachingComposite_sharedLabelDefault = Shared ({0})
-EclipseLinkCachingComposite_sharedLabel = Shared
-EclipseLinkCachingComposite_advanced = Advanced
-
-EclipseLinkChangeTrackingComposite_label = Change tracking:
-EclipseLinkChangeTrackingComposite_attribute = Attribute
-EclipseLinkChangeTrackingComposite_object = Object
-EclipseLinkChangeTrackingComposite_deferred = Deferred
-EclipseLinkChangeTrackingComposite_auto = Auto
-
-EclipseLinkConvertComposite_converterNameLabel = Converter name:
-EclipseLinkConvertComposite_defineConverterSection = Define Converter
-EclipseLinkConvertComposite_default = Default
-EclipseLinkConvertComposite_custom = Custom
-EclipseLinkConvertComposite_type = Type
-EclipseLinkConvertComposite_objectType = Object type
-EclipseLinkConvertComposite_struct = Struct
-
-EclipseLinkConverterComposite_nameTextLabel = Name:
-EclipseLinkConverterComposite_classLabel = Class:
-
-EclipseLinkCustomizerComposite_classLabel = Customizer class:
-
-EclipseLinkConvertersComposite_customConverter = Custom
-EclipseLinkConvertersComposite_objectTypeConverter = Object type
-EclipseLinkConvertersComposite_structConverter = Struct
-EclipseLinkConvertersComposite_typeConverter = Type
-
-EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault = Always refresh ({0})
-EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel = Always refresh
-EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault = Refresh only if newer ({0})
-EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel = Refresh only if newer
-EclipseLinkDisableHitsComposite_disableHitsDefault = Disable hits ({0})
-EclipseLinkDisableHitsComposite_disableHitsLabel = Disable hits
-
-TypeSection_converted = Converted
-
-EclipseLinkTypeMappingComposite_advanced = Advanced
-EclipseLinkTypeMappingComposite_caching = Caching
-EclipseLinkTypeMappingComposite_converters = Converters
-
-EclipseLinkExistenceCheckingComposite_label = Existence checking:
-JavaEclipseLinkExistenceCheckingComposite_check_cache = Check Cache
-JavaEclipseLinkExistenceCheckingComposite_check_database = Check Cache then Database
-JavaEclipseLinkExistenceCheckingComposite_assume_existence = Assume Existence
-JavaEclipseLinkExistenceCheckingComposite_assume_non_existence = Assume Non-Existence
-OrmEclipseLinkExistenceCheckingComposite_check_cache = Check Cache
-OrmEclipseLinkExistenceCheckingComposite_check_database = Check Cache then Database
-OrmEclipseLinkExistenceCheckingComposite_assume_existence = Assume Existence
-OrmEclipseLinkExistenceCheckingComposite_assume_non_existence = Assume Non-Existence
-
-EclipseLinkExpiryComposite_expirySection = Expiry
-
-EclipseLinkExpiryComposite_noExpiry = No expiry
-EclipseLinkExpiryComposite_timeToLiveExpiry = Time to live expiry
-EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter = Expire after
-EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds = milliseconds
-EclipseLinkExpiryComposite_dailyExpiry = Daily expiry
-EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt = Expire at
-
-
-EclipseLinkJoinFetchComposite_label = Join fetch:
-EclipseLinkJoinFetchComposite_inner = Inner
-EclipseLinkJoinFetchComposite_outer = Outer
-
-EclipseLinkMutableComposite_mutableLabel=Mutable
-EclipseLinkMutableComposite_mutableLabelDefault=Mutable ({0})
-EclipseLinkMutableComposite_true=True
-EclipseLinkMutableComposite_false=False
-
-EclipseLinkObjectTypeConverterComposite_dataTypeLabel = Data type:
-EclipseLinkObjectTypeConverterComposite_objectTypeLabel = Object type:
-EclipseLinkObjectTypeConverterComposite_conversionValueEdit = Edit...
-EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn = Data Value
-EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn = Object Value
-EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel = Default object value:
-EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle = Conversion values
-EclipseLinkConversionValueDialog_addConversionValue = Add Conversion Value
-EclipseLinkConversionValueDialog_editConversionValue = Edit Conversion Value
-EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle = Create new conversion value
-EclipseLinkConversionValueDialog_addConversionValueDescription = Create a new conversion value setting both the 'data value' and the 'object value'
-EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle = Edit conversion value
-EclipseLinkConversionValueDialog_editConversionValueDescription = Edit the conversion value, changing the 'data value' or 'object value'
-
-EclipseLinkConversionValueDialog_dataValue = Data value:
-EclipseLinkConversionValueDialog_objectValue = Object value:
-EclipseLinkConversionValueStateObject_dataValueMustBeSpecified = A data value must be specified.
-EclipseLinkConversionValueStateObject_objectValueMustBeSpecified = An object value must be specified.
-EclipseLinkConversionValueStateObject_dataValueAlreadyExists = This data value is already specified, cannot map multiple object values to the same data value.
-
-
-EclipseLinkPrivateOwnedComposite_privateOwnedLabel = Private owned
-EclipseLinkReadOnlyComposite_readOnlyLabel = Read-only
-EclipseLinkReadOnlyComposite_readOnlyWithDefault = Read-only ({0})
-EclipseLinkTypeConverterComposite_dataTypeLabel = Data type:
-EclipseLinkTypeConverterComposite_objectTypeLabel = Object type:
-
-DefaultEclipseLinkOneToOneMappingUiProvider_label=Default (One to One)
-DefaultEclipseLinkVariableOneToOneMappingUiProvider_label=Default (Variable One to One)
-DefaultEclipseLinkOneToManyMappingUiProvider_label=Default (One to Many)
-DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel=default (one to one)
-DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel=default (variable one to one)
-DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel=default (one to many)
-
-
-EclipseLinkConverterDialog_name=Name:
-EclipseLinkConverterDialog_converterType=Type:
-EclipseLinkConverterDialog_addConverter=Add Converter
-EclipseLinkConverterDialog_addConverterDescriptionTitle=Create new converter
-EclipseLinkConverterDialog_addConverterDescription=Create a new converter setting both the 'name' and the 'type'
-EclipseLinkConverterStateObject_nameMustBeSpecified = A name must be specified.
-EclipseLinkConverterStateObject_typeMustBeSpecified = A converter type must be specified.
-
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/JptEclipseLinkUiPlugin.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/JptEclipseLinkUiPlugin.java
deleted file mode 100644
index dc082c09ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/JptEclipseLinkUiPlugin.java
+++ /dev/null
@@ -1,100 +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.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 JptEclipseLinkUiPlugin extends AbstractUIPlugin
-{
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.eclipselink.ui";
-
-
- // ********** singleton **********
- private static JptEclipseLinkUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptEclipseLinkUiPlugin 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;
- }
-
-
-
- // ********** constructors **********
- public JptEclipseLinkUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkHelpContextIds.java
deleted file mode 100644
index 3832c21f0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkHelpContextIds.java
+++ /dev/null
@@ -1,57 +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.eclipselink.ui.internal;
-
-import org.eclipse.jpt.ui.JptUiPlugin;
-
-/**
- * Help context ids for the Dali EclipseLink UI.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- */
-@SuppressWarnings("nls")
-public interface EclipseLinkHelpContextIds {
-
- //ContextID prefix
- public static final String PREFIX = JptUiPlugin.PLUGIN_ID + ".";
-
- //Persistent Type composites
- public static final String CACHING_ALWAYS_REFRESH = PREFIX + "caching_alwaysRefresh";
- public static final String CACHING_CACHE_COORDINATION_TYPE = PREFIX + "caching_cacheCoordinationType";
- public static final String CACHING_CACHE_TYPE = PREFIX + "caching_cacheType";
- public static final String CACHING_DISABLE_HITS = PREFIX + "caching_disableHits";
- public static final String CACHING_REFRESH_ONLY_IF_NEWER = PREFIX + "caching_refreshOnlyIfNewer";
- public static final String CACHING_SHARED = PREFIX + "caching_shared";
-
- //Persistence Xml Editor
- public static final String PERSISTENCE_CACHING = PREFIX + "persistence_caching";
- public static final String PERSISTENCE_CUSTOMIZATION = PREFIX + "persistence_customization";
- public static final String PERSISTENCE_LOGGING = PREFIX + "persistence_logging";
- public static final String PERSISTENCE_OPTIONS = PREFIX + "persistence_options";
- public static final String PERSISTENCE_SCHEMA_GENERATION = PREFIX + "persistence_schemaGeneration";
-
- public static final String PERSISTENCE_CACHING_DEFAULT_SHARED = PREFIX + "caching_defaultShared";
- public static final String PERSISTENCE_CACHING_DEFAULT_SIZE = PREFIX + "caching_defaultSize";
- public static final String PERSISTENCE_CACHING_DEFAULT_TYPE = PREFIX + "caching_defaultType";
-
- public static final String PERSISTENCE_LOGGING_EXCEPTIONS = PREFIX + "logging_exceptions";
- public static final String PERSISTENCE_LOGGING_LEVEL = PREFIX + "logging_level";
- public static final String PERSISTENCE_LOGGING_SESSION = PREFIX + "logging_session";
- public static final String PERSISTENCE_LOGGING_THREAD = PREFIX + "logging_thread";
- public static final String PERSISTENCE_LOGGING_TIMESTAMP = PREFIX + "logging_timeStamp";
-
- public static final String PERSISTENCE_OPTIONS_SESSION_NAME = PREFIX + "options_sessionName";
- public static final String PERSISTENCE_OPTIONS_SESSIONS_XML = PREFIX + "options_sessionsXml";
- public static final String PERSISTENCE_OPTIONS_TARGET_DATABASE = PREFIX + "options_targetDatabase";
- public static final String PERSISTENCE_OPTIONS_TARGET_SERVER = PREFIX + "options_targetServer";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java
deleted file mode 100644
index 90a37382a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/EclipseLinkUiMessages.java
+++ /dev/null
@@ -1,399 +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.eclipselink.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by ElipseLink UI.
- */
-public class EclipseLinkUiMessages {
-
- public static String MappingFileWizard_title;
- public static String MappingFileWizardPage_title;
- public static String MappingFileWizardPage_desc;
-
- public static String EclipseLink1_1MappingFileWizard_title;
- public static String EclipseLink1_1MappingFileWizardPage_title;
- public static String EclipseLink1_1MappingFileWizardPage_desc;
-
- public static String Boolean_True;
- public static String Boolean_False;
-
- public static String DefaultWithoutValue;
- public static String DefaultWithValue;
-
- public static String PersistenceXmlTabFolder_defaultEmpty;
- public static String PersistenceXmlTabFolder_defaultWithOneParam;
-
- public static String PersistenceXmlGeneralTab_name;
- public static String PersistenceXmlGeneralTab_provider;
- public static String PersistenceXmlGeneralTab_browse;
- public static String PersistenceXmlGeneralTab_description;
-
- // General
- public static String PersistenceXmlGeneralTab_title;
- public static String PersistenceXmlGeneralTab_generalSectionTitle;
- public static String PersistenceXmlGeneralTab_mappedClassesSectionTitle;
- public static String PersistenceXmlGeneralTab_mappedClassesSectionDescription;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesSectionTitle;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesSectionDescription;
-
- public static String PersistenceXmlGeneralTab_nameLabel;
- public static String PersistenceXmlGeneralTab_persistenceProviderLabel;
- public static String PersistenceXmlGeneralTab_descriptionLabel;
-
- public static String PersistenceXmlGeneralTab_excludeUnlistedMappedClasses;
- public static String PersistenceXmlGeneralTab_excludeUnlistedMappedClassesWithDefault;
- public static String PersistenceXmlGeneralTab_mappedClassesNoName;
- public static String PersistenceXmlGeneralTab_open;
-
- public static String PersistenceXmlGeneralTab_xmlMappingFilesDialog_title;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesDialog_message;
- public static String PersistenceXmlGeneralTab_ormNoName;
- public static String PersistenceXmlGeneralTab_excludeEclipselinkOrm;
- public static String PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault;
-
- // Connection
- public static String PersistenceXmlConnectionTab_title;
- public static String PersistenceXmlConnectionTab_sectionTitle;
- public static String PersistenceXmlConnectionTab_sectionDescription;
- public static String PersistenceXmlConnectionTab_defaultWithOneParam;
- public static String PersistenceXmlConnectionTab_defaultEmpty;
-
- public static String PersistenceXmlConnectionTab_transactionTypeLabel;
-
- public static String ConnectionPropertiesComposite_Database_GroupBox;
-
- public static String JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox;
-
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Message;
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Title;
-
- public static String TransactionTypeComposite_jta;
- public static String TransactionTypeComposite_resource_local;
-
- public static String PersistenceXmlConnectionTab_nativeSqlLabel;
- public static String PersistenceXmlConnectionTab_nativeSqlLabelDefault;
-
- public static String PersistenceXmlConnectionTab_batchWritingLabel;
-
- public static String BatchWritingComposite_none;
- public static String BatchWritingComposite_jdbc;
- public static String BatchWritingComposite_buffered;
- public static String BatchWritingComposite_oracle_jdbc;
-
- public static String PersistenceXmlConnectionTab_cacheStatementsLabel;
-
- public static String PersistenceXmlConnectionTab_jtaDataSourceLabel;
- public static String PersistenceXmlConnectionTab_nonJtaDataSourceLabel;
-
- public static String PersistenceXmlConnectionTab_driverLabel;
- public static String PersistenceXmlConnectionTab_urlLabel;
- public static String PersistenceXmlConnectionTab_userLabel;
- public static String PersistenceXmlConnectionTab_passwordLabel;
- public static String PersistenceXmlConnectionTab_bindParametersLabel;
- public static String PersistenceXmlConnectionTab_bindParametersLabelDefault;
-
- public static String PersistenceXmlConnectionTab_readConnectionsSharedLabel;
- public static String PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault;
- public static String PersistenceXmlConnectionTab_readConnectionsSectionTitle;
- public static String PersistenceXmlConnectionTab_readConnectionsMinLabel;
- public static String PersistenceXmlConnectionTab_readConnectionsMaxLabel;
- public static String PersistenceXmlConnectionTab_writeConnectionsSectionTitle;
- public static String PersistenceXmlConnectionTab_writeConnectionsMinLabel;
- public static String PersistenceXmlConnectionTab_writeConnectionsMaxLabel;
-
- public static String JdbcExclusiveConnectionsPropertiesComposite_GroupBox;
-
- public static String PersistenceXmlConnectionTab_exclusiveConnectionModeLabel;
- public static String PersistenceXmlConnectionTab_lazyConnectionLabel;
- public static String PersistenceXmlConnectionTab_lazyConnectionLabelDefault;
-
- public static String JdbcExclusiveConnectionModeComposite_always;
- public static String JdbcExclusiveConnectionModeComposite_isolated;
- public static String JdbcExclusiveConnectionModeComposite_transactional;
-
- // SchemaGeneration
- public static String PersistenceXmlSchemaGenerationTab_title;
- public static String PersistenceXmlSchemaGenerationTab_sectionTitle;
- public static String PersistenceXmlSchemaGenerationTab_sectionDescription;
- public static String PersistenceXmlSchemaGenerationTab_defaultWithOneParam;
- public static String PersistenceXmlSchemaGenerationTab_defaultEmpty;
- public static String PersistenceXmlSchemaGenerationTab_defaultDot;
-
- public static String PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel;
- public static String PersistenceXmlSchemaGenerationTab_outputModeLabel;
-
- public static String PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel;
- public static String PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel;
-
- public static String OutputModeComposite_both;
- public static String OutputModeComposite_sql_script;
- public static String OutputModeComposite_database;
-
- public static String DdlGenerationTypeComposite_none;
- public static String DdlGenerationTypeComposite_create_tables;
- public static String DdlGenerationTypeComposite_drop_and_create_tables;
-
- public static String PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel;
-
- public static String DdlGenerationLocationComposite_dialogTitle;
- public static String DdlGenerationLocationComposite_dialogMessage;
-
- // Caching
- public static String PersistenceXmlCachingTab_title;
- public static String PersistenceXmlCachingTab_sectionTitle;
- public static String PersistenceXmlCachingTab_sectionDescription;
-
- public static String CacheDefaultsComposite_groupTitle;
-
- public static String PersistenceXmlCachingTab_defaultCacheTypeLabel;
- public static String PersistenceXmlCachingTab_cacheTypeLabel;
-
- public static String PersistenceXmlCachingTab_defaultSharedCacheLabel;
- public static String PersistenceXmlCachingTab_sharedCacheLabel;
-
- public static String PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel;
- public static String PersistenceXmlCachingTab_sharedCacheDefaultLabel;
-
- public static String CacheSizeComposite_cacheSize;
-
- public static String CacheTypeComposite_full;
- public static String CacheTypeComposite_hard_weak;
- public static String CacheTypeComposite_none;
- public static String CacheTypeComposite_soft;
- public static String CacheTypeComposite_soft_weak;
- public static String CacheTypeComposite_weak;
-
- public static String DefaultCacheSizeComposite_defaultCacheSize;
-
- public static String DefaultCacheTypeComposite_full;
- public static String DefaultCacheTypeComposite_hard_weak;
- public static String DefaultCacheTypeComposite_none;
- public static String DefaultCacheTypeComposite_soft;
- public static String DefaultCacheTypeComposite_soft_weak;
- public static String DefaultCacheTypeComposite_weak;
-
- public static String EntityDialog_selectEntity;
- public static String EntityDialog_name;
-
- public static String CachingEntityListComposite_groupTitle;
- public static String CachingEntityListComposite_editButton;
-
- public static String CachingEntityListComposite_dialogMessage;
- public static String CachingEntityListComposite_dialogTitle;
-
- public static String PersistenceXmlCachingTab_FlushClearCacheLabel;
-
- public static String FlushClearCacheComposite_drop;
- public static String FlushClearCacheComposite_drop_invalidate;
- public static String FlushClearCacheComposite_merge;
-
- // Customization
- public static String PersistenceXmlCustomizationTab_title;
- public static String PersistenceXmlCustomizationTab_sectionTitle;
- public static String PersistenceXmlCustomizationTab_sectionDescription;
- public static String PersistenceXmlCustomizationTab_defaultWithOneParam;
-
- public static String PersistenceXmlCustomizationTab_weavingPropertiesGroupBox;
- public static String PersistenceXmlCustomizationTab_weavingLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingLazyLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingLazyLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingChangeTrackingLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingFetchGroupsLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingInternalLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingInternalLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingEagerLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingEagerLabel;
- public static String PersistenceXmlCustomizationTab_defaultEmpty;
-
- public static String PersistenceXmlCustomizationTab_throwExceptionsLabelDefault;
- public static String PersistenceXmlCustomizationTab_throwExceptionsLabel;
-
- public static String PersistenceXmlCustomizationTab_exceptionHandlerLabel;
-
- public static String WeavingComposite_true_;
- public static String WeavingComposite_false_;
- public static String WeavingComposite_static_;
-
- public static String CustomizationEntityListComposite_groupTitle;
- public static String CustomizationEntityListComposite_editButton;
-
- public static String CustomizationEntityListComposite_dialogMessage;
- public static String CustomizationEntityListComposite_dialogTitle;
-
- public static String PersistenceXmlCustomizationTab_customizerLabel;
- public static String PersistenceXmlCustomizationTab_sessionCustomizerLabel;
- public static String PersistenceXmlCustomizationTab_noName;
-
- public static String PersistenceXmlCustomizationTab_validationOnlyLabel;
- public static String PersistenceXmlCustomizationTab_validationOnlyLabelDefault;
-
- public static String PersistenceXmlCustomizationTab_validateSchemaLabel;
- public static String PersistenceXmlCustomizationTab_validateSchemaLabelDefault;
-
- public static String PersistenceXmlCustomizationTab_profilerLabel;
- public static String PersistenceXmlCustomizationTab_browse;
-
- public static String ProfilerComposite_performance_profiler;
- public static String ProfilerComposite_query_monitor;
- public static String ProfilerComposite_no_profiler;
-
- // Logging
- public static String PersistenceXmlLoggingTab_title;
- public static String PersistenceXmlLoggingTab_sectionTitle;
- public static String PersistenceXmlLoggingTab_sectionDescription;
- public static String PersistenceXmlLoggingTab_defaultWithOneParam;
- public static String PersistenceXmlLoggingTab_defaultEmpty;
- public static String PersistenceXmlLoggingTab_defaultStdout;
-
- public static String PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle;
- public static String PersistenceXmlLoggingTab_loggingLevelLabel;
- public static String PersistenceXmlLoggingTab_sqlLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_transactionLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_eventLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_connectionLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_queryLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_cacheLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_propagationLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_sequencingLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_ejbLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_dmsLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_ejb_or_metadataLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_jpa_metamodelLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_weaverLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_propertiesLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_serverLoggingLevelLabel;
-
- public static String LoggingLevelComposite_off;
- public static String LoggingLevelComposite_severe;
- public static String LoggingLevelComposite_warning;
- public static String LoggingLevelComposite_info;
- public static String LoggingLevelComposite_config;
- public static String LoggingLevelComposite_fine;
- public static String LoggingLevelComposite_finer;
- public static String LoggingLevelComposite_finest;
- public static String LoggingLevelComposite_all;
-
- public static String EclipseLinkCategoryLoggingLevelComposite_off;
- public static String EclipseLinkCategoryLoggingLevelComposite_severe;
- public static String EclipseLinkCategoryLoggingLevelComposite_warning;
- public static String EclipseLinkCategoryLoggingLevelComposite_info;
- public static String EclipseLinkCategoryLoggingLevelComposite_config;
- public static String EclipseLinkCategoryLoggingLevelComposite_fine;
- public static String EclipseLinkCategoryLoggingLevelComposite_finer;
- public static String EclipseLinkCategoryLoggingLevelComposite_finest;
- public static String EclipseLinkCategoryLoggingLevelComposite_all;
-
- public static String PersistenceXmlLoggingTab_loggerLabel;
- public static String PersistenceXmlLoggingTab_browse;
-
- public static String LoggerComposite_default_logger;
- public static String LoggerComposite_java_logger;
- public static String LoggerComposite_server_logger;
-
- public static String PersistenceXmlLoggingTab_timestampLabel;
- public static String PersistenceXmlLoggingTab_timestampLabelDefault;
- public static String PersistenceXmlLoggingTab_threadLabel;
- public static String PersistenceXmlLoggingTab_threadLabelDefault;
- public static String PersistenceXmlLoggingTab_sessionLabel;
- public static String PersistenceXmlLoggingTab_sessionLabelDefault;
- public static String PersistenceXmlLoggingTab_exceptionsLabel;
- public static String PersistenceXmlLoggingTab_exceptionsLabelDefault;
- public static String PersistenceXmlLoggingTab_connectionLabel;
- public static String PersistenceXmlLoggingTab_connectionLabelDefault;
-
- public static String PersistenceXmlLoggingTab_loggersLabel;
- public static String PersistenceXmlLoggingTab_loggingFileLabel;
-
- public static String LoggingFileLocationComposite_dialogTitle;
-
- // Session Options
- public static String PersistenceXmlOptionsTab_title;
- public static String PersistenceXmlOptionsTab_sessionSectionTitle;
- public static String PersistenceXmlOptionsTab_sessionSectionDescription;
- public static String PersistenceXmlOptionsTab_defaultWithOneParam;
- public static String PersistenceXmlOptionsTab_defaultEmpty;
-
- public static String PersistenceXmlOptionsTab_sessionName;
- public static String PersistenceXmlOptionsTab_sessionsXml;
-
- public static String PersistenceXmlOptionsTab_includeDescriptorQueriesLabel;
- public static String PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault;
-
- public static String PersistenceXmlOptionsTab_eventListenerLabel;
- public static String PersistenceXmlOptionsTab_targetDatabaseLabel;
-
- public static String PersistenceXmlOptionsTab_miscellaneousSectionTitle;
- public static String PersistenceXmlOptionsTab_miscellaneousSectionDescription;
-
- public static String PersistenceXmlOptionsTab_temporalMutableLabel;
- public static String PersistenceXmlOptionsTab_temporalMutableLabelDefault;
-
- public static String TargetDatabaseComposite_attunity;
- public static String TargetDatabaseComposite_auto;
- public static String TargetDatabaseComposite_cloudscape;
- public static String TargetDatabaseComposite_database;
- public static String TargetDatabaseComposite_db2;
- public static String TargetDatabaseComposite_db2mainframe;
- public static String TargetDatabaseComposite_dbase;
- public static String TargetDatabaseComposite_derby;
- public static String TargetDatabaseComposite_hsql;
- public static String TargetDatabaseComposite_informix;
- public static String TargetDatabaseComposite_javadb;
- public static String TargetDatabaseComposite_mysql;
- public static String TargetDatabaseComposite_oracle;
- public static String TargetDatabaseComposite_oracle11;
- public static String TargetDatabaseComposite_oracle10;
- public static String TargetDatabaseComposite_oracle9;
- public static String TargetDatabaseComposite_oracle8;
- public static String TargetDatabaseComposite_pointbase;
- public static String TargetDatabaseComposite_postgresql;
- public static String TargetDatabaseComposite_sqlanywhere;
- public static String TargetDatabaseComposite_sqlserver;
- public static String TargetDatabaseComposite_sybase;
- public static String TargetDatabaseComposite_timesten;
-
- public static String PersistenceXmlOptionsTab_targetServerLabel;
-
- public static String TargetServerComposite_none;
- public static String TargetServerComposite_oc4j;
- public static String TargetServerComposite_sunas9;
- public static String TargetServerComposite_websphere;
- public static String TargetServerComposite_websphere_6_1;
- public static String TargetServerComposite_weblogic;
- public static String TargetServerComposite_weblogic_9;
- public static String TargetServerComposite_weblogic_10;
- public static String TargetServerComposite_jboss;
-
- // DDL Generation
- public static String EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle;
- public static String EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage;
- public static String EclipseLinkDDLGeneratorUi_error;
-
- private static final String BUNDLE_NAME = "eclipselink_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = EclipseLinkUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private EclipseLinkUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
deleted file mode 100644
index 3e9859d810..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
+++ /dev/null
@@ -1,175 +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.eclipselink.ui.internal.ddlgen;
-
-import java.util.Iterator;
-
-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.core.runtime.OperationCanceledException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.ddlgen.EclipseLinkDDLGenerator;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.wizards.GenerateDDLWizard;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * EclipseLinkDLLGeneratorUi is used by the EclipseLinkPlatformUi to initiate
- * the execution of EclipseLink DDL generator.
- */
-public class EclipseLinkDDLGeneratorUi
-{
- private final JpaProject project;
- private static final String CR = StringTools.CR;
-
- // ********** constructors **********
-
- public static void generate(JpaProject project) {
- new EclipseLinkDDLGeneratorUi(project).generate();
- }
-
- protected EclipseLinkDDLGeneratorUi(JpaProject project) {
- super();
- if (project == null) {
- throw new NullPointerException();
- }
- this.project = project;
- }
-
- // ********** behavior **********
-
- protected void generate() {
-
- PersistenceUnit persistenceUnit = this.getPersistenceUnits().next(); // Take the first persistenceUnit
- String puName = persistenceUnit.getName();
- if( ! this.displayGeneratingDDLWarning()) {
- return;
- }
-
- GenerateDDLWizard wizard = new GenerateDDLWizard(this.project);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- if(wizard.getPageCount() > 0) {
- int returnCode = dialog.open();
- if (returnCode == Window.CANCEL) {
- return;
- }
- }
- IWorkspaceRunnable runnable = this.buildGenerateDDLRunnable(puName, this.project);
- try {
- ResourcesPlugin.getWorkspace().run(runnable, new NullProgressMonitor());
- }
- catch (CoreException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected IWorkspaceRunnable buildGenerateDDLRunnable(String puName, JpaProject project) {
- return new GenerateDDLRunnable(puName, project);
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- private boolean displayGeneratingDDLWarning() {
- String message = org.eclipse.osgi.util.NLS.bind(
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage,
- CR, CR + CR);
-
- return MessageDialog.openQuestion(
- this.getCurrentShell(),
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle,
- message);
- }
-
- // ********** Persistence Unit **********
-
- protected JpaPlatform getPlatform() {
- return this.project.getJpaPlatform();
- }
-
- protected Iterator<PersistenceUnit> getPersistenceUnits() {
- return this.getPersistence().persistenceUnits();
- }
-
- protected Persistence getPersistence() {
- return this.project.getRootContextNode().getPersistenceXml().getPersistence();
- }
-
- // ********** runnable **********
-
- protected static class GenerateDDLRunnable implements IWorkspaceRunnable {
- private final String puName;
- private final JpaProject project;
-
- public GenerateDDLRunnable(String puName, JpaProject project) {
- super();
- this.puName = puName;
- this.project = project;
- }
-
- public void run(IProgressMonitor monitor) {
- String projectLocation = this.project.getProject().getLocation().toString();
- try {
- this.ddlGeneratorGenerate(this.puName, this.project, projectLocation, monitor);
- }
- catch (OperationCanceledException e) {
- return;
- // fall through and tell monitor we are done
- }
- catch (RuntimeException re) {
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
-
- this.logError(message);
- throw new RuntimeException(re);
- }
- }
-
- protected void ddlGeneratorGenerate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
- EclipseLinkDDLGenerator.generate(puName, project, projectLocation, monitor);
- }
-
- protected void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- getShell(),
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_error,
- 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;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java
deleted file mode 100644
index 364e5b2bab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.ddlgen.wizards;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.wizards.DatabaseSchemaWizardPage;
-
-/**
- * GenerateDDLWizard
- */
-public class GenerateDDLWizard extends Wizard {
-
- private JpaProject jpaProject;
-
- private DatabaseSchemaWizardPage dbSettingsPage;
-
- public GenerateDDLWizard(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.setWindowTitle(JptUiMessages.GenerateDDLWizard_title);
- }
-
- @Override
- public void addPages() {
- super.addPages();
- if (this.getJpaProjectConnectionProfile() == null) {
- this.dbSettingsPage = new DatabaseSchemaWizardPage(this.jpaProject);
- this.addPage(this.dbSettingsPage);
- }
- }
-
- @Override
- public boolean performFinish() {
- return (this.getJpaProjectConnectionProfile() != null);
- }
-
- @Override
- public boolean canFinish() {
- return this.dbSettingsPage.isPageComplete();
- }
-
- private ConnectionProfile getJpaProjectConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index a51a4e5659..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkBasicCollectionMappingUiDefinition<M, T extends EclipseLinkBasicCollectionMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicCollectionMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicCollectionMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 72851c2962..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkBasicMapMappingUiDefinition<M, T extends EclipseLinkBasicMapMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicMapMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicMapMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index 48adfdb09e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkTransformationMappingUiDefinition<M, T extends EclipseLinkTransformationMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTransformationMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTransformationMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index e00e05e7fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkVariableOneToOneMappingUiDefinition<M, T extends EclipseLinkVariableOneToOneMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkVariableOneToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java
deleted file mode 100644
index 4613c5e740..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java
+++ /dev/null
@@ -1,101 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * This composite simply shows a tri-state check box for the Always Refresh option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkAlwaysRefreshComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkAlwaysRefreshComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel,
- buildAlwaysRefreshHolder(),
- buildAlwaysRefreshStringHolder(),
- EclipseLinkHelpContextIds.CACHING_ALWAYS_REFRESH
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildAlwaysRefreshHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedAlwaysRefresh();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedAlwaysRefresh(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildAlwaysRefreshStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultAlwaysRefreshHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultAlwaysRefreshHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY,
- EclipseLinkCaching.DEFAULT_ALWAYS_REFRESH_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedAlwaysRefresh() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultAlwaysRefresh());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java
deleted file mode 100644
index a293e2f6f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkBasicCollectionMappingComposite extends Pane<EclipseLinkBasicCollectionMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkBasicCollectionMappingComposite(PropertyValueModel<? extends EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java
deleted file mode 100644
index d498896632..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkBasicMapMappingComposite extends Pane<EclipseLinkBasicMapMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkBasicMapMappingComposite(PropertyValueModel<? extends EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
deleted file mode 100644
index 12f2dae696..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
+++ /dev/null
@@ -1,185 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AbstractBasicMappingComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.EnumTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | MutableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see ColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkBasicMappingComposite<T extends BasicMapping> extends AbstractBasicMappingComposite<T>
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkBasicMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(Converter.NO_CONVERTER),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- // Lob
- Button lobButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_lob,
- buildConverterBooleanHolder(Converter.LOB_CONVERTER),
- null);
- ((GridData) lobButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(Converter.TEMPORAL_CONVERTER),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
-
- // Enumerated
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_enumerated,
- buildConverterBooleanHolder(Converter.ENUMERATED_CONVERTER),
- null);
- registerSubPane(new EnumTypeComposite(buildEnumeratedConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<BasicMapping, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkBasicMapping) this.subject).getMutable();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java
deleted file mode 100644
index b37add9303..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java
+++ /dev/null
@@ -1,107 +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.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | ----------------------------------------------------- |
- * | Coordination Type: | |v| |
- * | ----------------------------------------------------- |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheCoordinationTypeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheCoordinationTypeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheCoordinationType> addCacheCoordinationTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheCoordinationType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_COORDINATION_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_COORDINATION_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType[] getChoices() {
- return EclipseLinkCacheCoordinationType.values();
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType getDefaultValue() {
- return getSubject().getDefaultCoordinationType();
- }
-
- @Override
- protected String displayString(EclipseLinkCacheCoordinationType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- EclipseLinkCacheCoordinationTypeComposite.this,
- value
- );
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType getValue() {
- return getSubject().getSpecifiedCoordinationType();
- }
-
- @Override
- protected void setValue(EclipseLinkCacheCoordinationType value) {
- getSubject().setSpecifiedCoordinationType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_label,
- addCacheCoordinationTypeCombo(container),
- EclipseLinkHelpContextIds.CACHING_CACHE_COORDINATION_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java
deleted file mode 100644
index 9281ab64fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java
+++ /dev/null
@@ -1,94 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | --------------- |
- * | Size: | I |I| Default (XXX) |
- * | --------------- |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheSizeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheSizeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheSizeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addSizeCombo(container);
- }
-
- private void addSizeCombo(Composite container) {
- new IntegerCombo<EclipseLinkCaching>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheSizeComposite_size;
- }
-
- @Override
- protected String getHelpId() {
- return null;//JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.DEFAULT_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultSize());
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedSize();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setSpecifiedSize(value);
- }
- };
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java
deleted file mode 100644
index 0ea0033e3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java
+++ /dev/null
@@ -1,107 +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.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Type: | |v| |
- * | ------------------------------------------------------------------ |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheTypeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheTypeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheType> addCacheTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkCacheType[] getChoices() {
- return EclipseLinkCacheType.values();
- }
-
- @Override
- protected EclipseLinkCacheType getDefaultValue() {
- return getSubject().getDefaultType();
- }
-
- @Override
- protected String displayString(EclipseLinkCacheType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- EclipseLinkCacheTypeComposite.this,
- value
- );
- }
-
- @Override
- protected EclipseLinkCacheType getValue() {
- return getSubject().getSpecifiedType();
- }
-
- @Override
- protected void setValue(EclipseLinkCacheType value) {
- getSubject().setSpecifiedType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_label,
- addCacheTypeCombo(container),
- EclipseLinkHelpContextIds.CACHING_CACHE_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
deleted file mode 100644
index e13af703fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,165 +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.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public abstract class EclipseLinkCachingComposite<T extends EclipseLinkCaching> extends Pane<T>
-{
-
- protected EclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- //Shared Check box, uncheck this and the rest of the panel is disabled
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 8),
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabel,
- buildSpecifiedSharedHolder(),
- buildSharedStringHolder(),
- EclipseLinkHelpContextIds.CACHING_SHARED
- );
-
- Composite subPane = addSubPane(container, 0, 16);
-
- Collection<Pane<?>> panes = new ArrayList<Pane<?>>();
-
- panes.add(new EclipseLinkCacheTypeComposite(this, subPane));
- panes.add(new EclipseLinkCacheSizeComposite(this, subPane));
-
- // Advanced sub-pane
- Composite advancedSection = addCollapsibleSubSection(
- subPane,
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_advanced,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- initializeAdvancedPane(addSubPane(advancedSection, 0, 16), panes);
-
- new PaneEnabler(buildSharedCacheEnabler(), panes);
-
- initializeExistenceCheckingComposite(addSubPane(container, 8));
- }
-
- protected void initializeAdvancedPane(Composite container, Collection<Pane<?>> panes) {
- panes.add(new EclipseLinkExpiryComposite(this, container));
- panes.add(new EclipseLinkAlwaysRefreshComposite(this, container));
- panes.add(new EclipseLinkRefreshOnlyIfNewerComposite(this, container));
- panes.add(new EclipseLinkDisableHitsComposite(this, container));
- panes.add(new EclipseLinkCacheCoordinationTypeComposite(this, container));
- }
-
- protected abstract void initializeExistenceCheckingComposite(Composite parent);
-
- private PropertyValueModel<Boolean> buildSharedCacheEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isShared());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildSpecifiedSharedHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedShared();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedShared(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildSharedStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultSharedHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultSharedHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedShared() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultShared());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java
deleted file mode 100644
index 65d81d31c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java
+++ /dev/null
@@ -1,109 +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.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | Change Tracking : | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkChangeTracking
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkChangeTrackingComposite extends Pane<EclipseLinkChangeTracking> {
-
- /**
- * Creates a new <code>ChangeTrackingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkChangeTrackingComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkChangeTracking> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_label),
- addChangeTrackingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkChangeTracking, EclipseLinkChangeTrackingType> addChangeTrackingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkChangeTracking, EclipseLinkChangeTrackingType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkChangeTracking.DEFAULT_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkChangeTracking.SPECIFIED_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkChangeTrackingType[] getChoices() {
- return EclipseLinkChangeTrackingType.values();
- }
-
- @Override
- protected EclipseLinkChangeTrackingType getDefaultValue() {
- return getSubject().getDefaultType();
- }
-
- @Override
- protected String displayString(EclipseLinkChangeTrackingType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- EclipseLinkChangeTrackingComposite.this,
- value
- );
- }
-
- @Override
- protected EclipseLinkChangeTrackingType getValue() {
- return getSubject().getSpecifiedType();
- }
-
- @Override
- protected void setValue(EclipseLinkChangeTrackingType value) {
- getSubject().setSpecifiedType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
deleted file mode 100644
index f36f0843d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
+++ /dev/null
@@ -1,209 +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.eclipselink.ui.internal.details;
-
-import java.util.Set;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkConversionValueDialog extends ValidatingDialog<EclipseLinkConversionValueStateObject> {
-
- /**
- * when creating a new EclipseLinkConversionValue, 'conversionValue' will be null
- */
- private final EclipseLinkConversionValue conversionValue;
-
- private EclipseLinkObjectTypeConverter objectTypeConverter;
-
- // ********** constructors **********
-
- /**
- * Use this constructor to create a new conversion value
- */
- public EclipseLinkConversionValueDialog(Shell parent, EclipseLinkObjectTypeConverter objectTypeConverter) {
- this(parent,objectTypeConverter, null);
- }
-
- /**
- * Use this constructor to edit an existing conversion value
- */
- public EclipseLinkConversionValueDialog(Shell parent, EclipseLinkObjectTypeConverter objectTypeConverter, EclipseLinkConversionValue conversionValue) {
- super(parent);
- this.objectTypeConverter = objectTypeConverter;
- this.conversionValue = conversionValue;
- }
-
- @Override
- protected EclipseLinkConversionValueStateObject buildStateObject() {
- String dataValue = null;
- String objectValue = null;
- Set<String> dataValues = CollectionTools.set(this.objectTypeConverter.dataValues());
- if (isEditDialog()) {
- dataValue = this.conversionValue.getDataValue();
- objectValue = this.conversionValue.getObjectValue();
- //remove *this* dataValue, don't want a duplicate data value error
- dataValues.remove(dataValue);
- }
- return new EclipseLinkConversionValueStateObject(
- dataValue,
- objectValue,
- dataValues);
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValue
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValue;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValueDescription
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValueDescription;
- }
-
- @Override
- protected DialogPane<EclipseLinkConversionValueStateObject> buildLayout(Composite container) {
- return new ConversionValueDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- ConversionValueDialogPane pane = (ConversionValueDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** convenience methods **********
-
- protected boolean isAddDialog() {
- return this.conversionValue == null;
- }
-
- protected boolean isEditDialog() {
- return ! this.isAddDialog();
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getDataValue() {
- return getSubject().getDataValue();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public String getObjectValue() {
- return getSubject().getObjectValue();
- }
-
- private class ConversionValueDialogPane extends DialogPane<EclipseLinkConversionValueStateObject> {
-
- private Text dataValueText;
- private Text objectValueText;
-
- ConversionValueDialogPane(Composite parent) {
- super(EclipseLinkConversionValueDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.dataValueText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_dataValue,
- buildDataValueHolder()
- );
-
- this.objectValueText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_objectValue,
- buildObjectValueHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildDataValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.DATA_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setDataValue(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildObjectValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.OBJECT_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setObjectValue(value);
- }
- };
- }
-
- void selectAll() {
- this.dataValueText.selectAll();
- this.objectValueText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java
deleted file mode 100644
index 7117d9eb51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java
+++ /dev/null
@@ -1,137 +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.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.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.1
- * @since 2.1
- */
-@SuppressWarnings("nls")
-final class EclipseLinkConversionValueStateObject extends AbstractNode
-{
- /**
- * The initial dataValue or <code>null</code>
- */
- private String dataValue;
-
- /**
- * The collection of data values that can't be used or an empty collection
- */
- private Collection<String> dataValues;
-
- /**
- * The initial objectValue or <code>null</code>
- */
- private String objectValue;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String DATA_VALUE_PROPERTY = "dataValue";
-
- /**
- * Notifies a change in the object value property.
- */
- static final String OBJECT_VALUE_PROPERTY = "objectValue";
-
- /**
- * 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
- */
- EclipseLinkConversionValueStateObject(String dataValue, String objectValue, Collection<String> dataValues) {
- super(null);
-
- this.dataValue = dataValue;
- this.objectValue = objectValue;
- this.dataValues = dataValues;
- }
-
- private void addDataValueProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.dataValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_dataValueMustBeSpecified));
- }
- else if (this.dataValues.contains(this.dataValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_dataValueAlreadyExists));
- }
- }
-
- private void addObjectValueProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.objectValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_objectValueMustBeSpecified));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- addDataValueProblemsTo(currentProblems);
- addObjectValueProblemsTo(currentProblems);
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- //not parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getDataValue() {
- return this.dataValue;
- }
-
- String getObjectValue() {
- return this.objectValue;
- }
-
- public void setDataValue(String dataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = dataValue;
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, dataValue);
- }
-
- public void setObjectValue(String objectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = objectValue;
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, objectValue);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
deleted file mode 100644
index 0ff0e3663b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
+++ /dev/null
@@ -1,363 +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.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Enum Type: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConvert
- * @see EclipseLinkBasicMappingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkConvertComposite extends Pane<EclipseLinkConvert>
-{
-
- /**
- * A key used to represent the default value, this is required to convert
- * the selected item from a combo to <code>null</code>. This key is most
- * likely never typed the user and it will help to convert the value to
- * <code>null</code> when it's time to set the new selected value into the
- * model.
- */
- protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?"; //$NON-NLS-1$
-
-
- /**
- * Creates a new <code>EnumTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkConvertComposite(PropertyValueModel<? extends EclipseLinkConvert> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel,
- buildConvertNameListHolder(),
- buildConvertNameHolder(),
- buildNameConverter(),
- null
- );
- SWTUtil.attachDefaultValueHandler(combo);
-
- Composite subSection = addCollapsibleSubSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_defineConverterSection,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE));
-
- // No Converter
- addRadioButton(
- subSection,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_default,
- buildNoConverterHolder(),
- null);
- PropertyValueModel<EclipseLinkConverter> converterHolder = buildConverterHolder();
- // CustomConverter
- addRadioButton(
- subSection,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_custom,
- buildConverterHolder(EclipseLinkConverter.CUSTOM_CONVERTER),
- null);
- EclipseLinkCustomConverterComposite converterComposite = new EclipseLinkCustomConverterComposite(buildCustomConverterHolder(converterHolder), subSection, getWidgetFactory());
- GridData gridData = (GridData) converterComposite.getControl().getLayoutData();
- gridData.horizontalIndent = 20;
- registerSubPane(converterComposite);
-
- // Type Converter
- addRadioButton(
- subSection,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_type,
- buildConverterHolder(EclipseLinkConverter.TYPE_CONVERTER),
- null);
- EclipseLinkTypeConverterComposite typeConverterComposite = new EclipseLinkTypeConverterComposite(buildTypeConverterHolder(converterHolder), subSection, getWidgetFactory());
- gridData = (GridData) typeConverterComposite.getControl().getLayoutData();
- gridData.horizontalIndent = 20;
- registerSubPane(typeConverterComposite);
-
- // Object Type Converter
- addRadioButton(
- subSection,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_objectType,
- buildConverterHolder(EclipseLinkConverter.OBJECT_TYPE_CONVERTER),
- null);
- EclipseLinkObjectTypeConverterComposite objectTypeConverterComposite = new EclipseLinkObjectTypeConverterComposite(buildObjectTypeConverterHolder(converterHolder), subSection, getWidgetFactory());
- gridData = (GridData) objectTypeConverterComposite.getControl().getLayoutData();
- gridData.horizontalIndent = 20;
- registerSubPane(objectTypeConverterComposite);
-
- // Struct Converter
- addRadioButton(
- subSection,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_struct,
- buildConverterHolder(EclipseLinkConverter.STRUCT_CONVERTER),
- null);
- EclipseLinkStructConverterComposite structConverterComposite = new EclipseLinkStructConverterComposite(buildStructConverterHolder(converterHolder), subSection, getWidgetFactory());
- gridData = (GridData) structConverterComposite.getControl().getLayoutData();
- gridData.horizontalIndent = 20;
- registerSubPane(structConverterComposite);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected final WritablePropertyValueModel<String> buildConvertNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedConverterName();
- }
-
- @Override
- protected void setValue_(String value) {
- // Convert the default value or an empty string to null
- if ((value != null) &&
- ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) {
-
- value = null;
- }
- this.subject.setSpecifiedConverterName(value);
- }
- };
- }
- private ListValueModel<String> buildConvertNameListHolder() {
- java.util.List<ListValueModel<String>> list = new ArrayList<ListValueModel<String>>();
- list.add(buildDefaultNameListHolder());
- list.add(buildReservedConverterNameListHolder());
- list.add(buildConverterNameListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(list);
- }
-
- protected ListValueModel<String> buildDefaultNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildDefaultNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- String name = this.subject.getDefaultConverterName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private StringConverter<String> buildNameConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
-
- if (getSubject() == null) {
- return value;
- }
-
- if (value == null) {
- value = getSubject().getDefaultConverterName();
-
- if (value != null) {
- value = DEFAULT_KEY + value;
- }
- else {
- value = DEFAULT_KEY;
- }
- }
-
- if (value.startsWith(DEFAULT_KEY)) {
- String defaultName = value.substring(DEFAULT_KEY.length());
-
- if (defaultName.length() > 0) {
- value = NLS.bind(
- JptUiDetailsMessages.DefaultWithOneParam,
- defaultName
- );
- }
- else {
- value = JptUiDetailsMessages.DefaultEmpty;
- }
- }
-
- return value;
- }
- };
- }
-
- protected ListValueModel<String> buildReservedConverterNameListHolder() {
- return new StaticListValueModel<String>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES);
- }
-
- protected ListValueModel<String> buildConverterNameListHolder() {
- return new ListAspectAdapter<EclipseLinkPersistenceUnit, String>(
- buildPersistenceUnitHolder(),
- EclipseLinkPersistenceUnit.CONVERTERS_LIST)//TODO need EclipseLinkPersistenceUnit interface
- {
- @Override
- protected ListIterator<String> listIterator_() {
- return CollectionTools.listIterator(ArrayTools.sort(this.subject.uniqueConverterNames()));
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, EclipseLinkPersistenceUnit>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPersistenceUnit buildValue_() {
- return (EclipseLinkPersistenceUnit) getSubject().getPersistenceUnit();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildNoConverterHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, Boolean>(getSubjectHolder(), EclipseLinkConvert.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getConverter() == null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(EclipseLinkConverter.NO_CONVERTER);
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildConverterHolder(final String converterType) {
- return new PropertyAspectAdapter<EclipseLinkConvert, Boolean>(getSubjectHolder(), EclipseLinkConvert.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- EclipseLinkConverter converter = this.subject.getConverter();
- if (converter == null) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkConverter> buildConverterHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, EclipseLinkConverter>(getSubjectHolder(), EclipseLinkConvert.CONVERTER_PROPERTY) {
- @Override
- protected EclipseLinkConverter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomConverter> buildCustomConverterHolder(PropertyValueModel<EclipseLinkConverter> converterHolder) {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkCustomConverter>(converterHolder) {
- @Override
- protected EclipseLinkCustomConverter transform_(EclipseLinkConverter converter) {
- return (converter != null && converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) ? (EclipseLinkCustomConverter) converter : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkTypeConverter> buildTypeConverterHolder(PropertyValueModel<EclipseLinkConverter> converterHolder) {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkTypeConverter>(converterHolder) {
- @Override
- protected EclipseLinkTypeConverter transform_(EclipseLinkConverter converter) {
- return (converter != null && converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) ? (EclipseLinkTypeConverter) converter : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConverterHolder(PropertyValueModel<EclipseLinkConverter> converterHolder) {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkObjectTypeConverter>(converterHolder) {
- @Override
- protected EclipseLinkObjectTypeConverter transform_(EclipseLinkConverter converter) {
- return (converter != null && converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) ? (EclipseLinkObjectTypeConverter) converter : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkStructConverter> buildStructConverterHolder(PropertyValueModel<EclipseLinkConverter> converterHolder) {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkStructConverter>(converterHolder) {
- @Override
- protected EclipseLinkStructConverter transform_(EclipseLinkConverter converter) {
- return (converter != null && converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) ? (EclipseLinkStructConverter) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConvert, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkConvert value) {
- if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
deleted file mode 100644
index 57898bbbf2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
+++ /dev/null
@@ -1,156 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCustomConverterComposite extends Pane<EclipseLinkCustomConverter>
-{
-
- /**
- * Creates a new <code>ConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCustomConverterComposite(PropertyValueModel<? extends EclipseLinkCustomConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addClassChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected WritablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomConverter, String>(
- getSubjectHolder(), EclipseLinkConverter.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkCustomConverter> addClassChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkCustomConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomConverter, String>(getSubjectHolder(), EclipseLinkCustomConverter.CONVERTER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterClass();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setConverterClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getConverterClass();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_classLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setConverterClass(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomConverter.ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkCustomConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkCustomConverter value) {
-// if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
-// return Boolean.FALSE;
-// }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java
deleted file mode 100644
index d755bc71eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java
+++ /dev/null
@@ -1,133 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @see EclipseLinkCustomizer
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkCustomizerComposite extends Pane<EclipseLinkCustomizer>
-{
- /**
- * Creates a new <code>CustomizerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCustomizerComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkCustomizer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new CustomizerClassChooserComboPane(this, container);
- }
-
- private class CustomizerClassChooserComboPane
- extends ClassChooserComboPane<EclipseLinkCustomizer>
- {
- public CustomizerClassChooserComboPane(Pane<EclipseLinkCustomizer> parentPane, Composite parent) {
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getSpecifiedCustomizerClass();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setSpecifiedCustomizerClass(className);
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkCustomizerComposite_classLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomizer.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getCustomizerClassEnclosingTypeSeparator();
- }
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomizer, String>(
- getSubjectHolder(),
- EclipseLinkCustomizer.SPECIFIED_CUSTOMIZER_CLASS_PROPERTY,
- EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
-
- @Override
- protected String buildValue_() {
- String value = this.subject.getSpecifiedCustomizerClass();
- return (value == null) ? defaultText(this.subject) : value;
- }
-
- @Override
- protected void setValue_(String value) {
- if (value == null
- || value.length() == 0
- || value.equals(defaultText(this.subject))) {
- value = null;
- }
- this.subject.setSpecifiedCustomizerClass(value);
- }
- };
- }
-
- protected String defaultText(EclipseLinkCustomizer customizer) {
- String defaultClassName = customizer.getDefaultCustomizerClass();
- return (defaultClassName == null) ?
- JptUiDetailsMessages.NoneSelected
- : NLS.bind(JptUiDetailsMessages.DefaultWithOneParam, defaultClassName);
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- return new PropertyListValueModelAdapter<String>(
- new PropertyAspectAdapter<EclipseLinkCustomizer, String>(
- getSubjectHolder(), EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultText(this.subject);
- }
- });
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java
deleted file mode 100644
index d5892d8ed1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java
+++ /dev/null
@@ -1,100 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Disable Hits option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkDisableHitsComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkDisableHitsComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsLabel,
- buildDisableHitsHolder(),
- buildDisableHitsStringHolder(),
- EclipseLinkHelpContextIds.CACHING_DISABLE_HITS
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildDisableHitsHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedDisableHits();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedDisableHits(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDisableHitsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultDisableHitsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultDisableHitsHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY,
- EclipseLinkCaching.DEFAULT_DISABLE_HITS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedDisableHits() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultDisableHits());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java
deleted file mode 100644
index c9470c6017..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java
+++ /dev/null
@@ -1,58 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkEmbeddableAdvancedComposite extends Pane<Embeddable> {
-
- public EclipseLinkEmbeddableAdvancedComposite(
- Pane<? extends Embeddable> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<Embeddable, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkEmbeddable) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<Embeddable, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkEmbeddable) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java
deleted file mode 100644
index 03cbde1eb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkEntityAdvancedComposite extends Pane<Entity> {
-
- public EclipseLinkEntityAdvancedComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkReadOnlyComposite(this, buildReadOnlyHolder(), container);
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkReadOnly> buildReadOnlyHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkReadOnly>(getSubjectHolder()) {
- @Override
- protected EclipseLinkReadOnly buildValue_() {
- return ((EclipseLinkEntity) this.subject).getReadOnly();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkEntity) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkEntity) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
deleted file mode 100644
index 82fc7962bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
+++ /dev/null
@@ -1,337 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-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.Group;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Expiry -------------------------------------------------------------- | |
- * | | | |
- * | | o No expiry | |
- * | | ---------------- | |
- * | | o Time to live expiry Expire after | I |I| milliseconds | |
- * | | ---------------- | |
- * | | -------------------- | |
- * | | o Daily expiry Expire at | HH:MM:SS:AM/PM |I| | |
- * | | -------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkExpiryTimeOfDay
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkExpiryComposite extends Pane<EclipseLinkCaching> {
- protected PropertyValueModel<Boolean> ttlEnabled;
-
- public EclipseLinkExpiryComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * lazy init because we need it while the superclass constructor is
- * executing
- */
- protected PropertyValueModel<Boolean> getTtlEnabled() {
- if (this.ttlEnabled == null) {
- this.ttlEnabled = this.buildTimeToLiveExpiryEnabler();
- }
- return this.ttlEnabled;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Expiry group pane
- Group expiryGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_expirySection,
- 2,
- null
- );
-
- // No Expiry radio button
- Button button = addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_noExpiry,
- buildNoExpiryHolder(),
- null
- );
- GridData gridData = new GridData();
- gridData.horizontalSpan = 2;
- button.setLayoutData(gridData);
-
-
- // Time To Live Expiry radio button
- addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiry,
- buildExpiryHolder(),
- null
- );
-
- addTimeToLiveComposite(expiryGroupPane);
-
- // Daily Expiry radio button
- addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_dailyExpiry,
- buildTimeOfDayExpiryBooleanHolder(),
- null
- );
-
- addTimeOfDayComposite(expiryGroupPane);
- }
-
- protected void addTimeToLiveComposite(Composite parent) {
- Composite container = this.addSubPane(parent, 3, 0, 10, 0, 0);
-
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter,
- this.getTtlEnabled()
- );
-
- IntegerCombo<?> combo = addTimeToLiveExpiryCombo(container);
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = false;
- combo.getControl().setLayoutData(gridData);
-
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds,
- this.getTtlEnabled()
- );
- }
-
- protected void addTimeOfDayComposite(Composite parent) {
- Composite container = this.addSubPane(parent, 2, 0, 10, 0, 0);
-
- PropertyValueModel<Boolean> todEnabled = this.buildTimeOfDayExpiryEnabler();
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt,
- todEnabled
- );
-
- PropertyValueModel<EclipseLinkExpiryTimeOfDay> timeOfDayExpiryHolder = buildTimeOfDayExpiryHolder();
- addDateTime(
- container,
- buildTimeOfDayExpiryHourHolder(timeOfDayExpiryHolder),
- buildTimeOfDayExpiryMinuteHolder(timeOfDayExpiryHolder),
- buildTimeOfDayExpirySecondHolder(timeOfDayExpiryHolder),
- null,
- todEnabled
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildNoExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_PROPERTY,
- EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() == null && this.subject.getExpiryTimeOfDay() == null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExpiry(null);
- if (this.subject.getExpiryTimeOfDay() != null) {
- this.subject.removeExpiryTimeOfDay();
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setExpiry(Integer.valueOf(0));
- }
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildTimeOfDayExpiryBooleanHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiryTimeOfDay() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.addExpiryTimeOfDay();
- }
- }
- };
- }
-
- private IntegerCombo<EclipseLinkCaching> addTimeToLiveExpiryCombo(Composite container) {
- return new IntegerCombo<EclipseLinkCaching>(this, container) {
-
- @Override
- protected Combo addIntegerCombo(Composite container) {
- return this.addEditableCombo(
- container,
- buildDefaultListHolder(),
- buildSelectedItemStringHolder(),
- StringConverter.Default.<String>instance(),
- EclipseLinkExpiryComposite.this.getTtlEnabled()
- );
- }
-
- @Override
- protected String getLabelText() {
- throw new UnsupportedOperationException();
- }
-
-
- @Override
- protected String getHelpId() {
- return null;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(0);
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getExpiry();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setExpiry(value);
- }
- };
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildTimeToLiveExpiryEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() != null);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildTimeOfDayExpiryEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiryTimeOfDay() != null);
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkExpiryTimeOfDay> buildTimeOfDayExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, EclipseLinkExpiryTimeOfDay>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected EclipseLinkExpiryTimeOfDay buildValue_() {
- return this.subject.getExpiryTimeOfDay();
- }
- };
- }
-
- private WritablePropertyValueModel<Integer> buildTimeOfDayExpiryHourHolder(PropertyValueModel<EclipseLinkExpiryTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkExpiryTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkExpiryTimeOfDay.HOUR_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getHour();
- }
-
- @Override
- protected void setValue_(Integer hour) {
- this.subject.setHour(hour);
- }
- };
- }
-
- private WritablePropertyValueModel<Integer> buildTimeOfDayExpiryMinuteHolder(PropertyValueModel<EclipseLinkExpiryTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkExpiryTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkExpiryTimeOfDay.MINUTE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getMinute();
- }
-
- @Override
- protected void setValue_(Integer minute) {
- this.subject.setMinute(minute);
- }
- };
- }
-
- private WritablePropertyValueModel<Integer> buildTimeOfDayExpirySecondHolder(PropertyValueModel<EclipseLinkExpiryTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkExpiryTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkExpiryTimeOfDay.SECOND_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSecond();
- }
-
- @Override
- protected void setValue_(Integer second) {
- this.subject.setSecond(second);
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
deleted file mode 100644
index 242ae7a32f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractIdMappingComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkIdMappingComposite<T extends IdMapping>
- extends AbstractIdMappingComposite<T>
- implements JpaComposite
-{
- public EclipseLinkIdMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(Converter.NO_CONVERTER),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(Converter.TEMPORAL_CONVERTER),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkIdMapping) this.subject).getMutable();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
deleted file mode 100644
index 509921e237..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
+++ /dev/null
@@ -1,114 +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.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.core.internal.JptCoreMessages;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------------- |
- * | Join Fetch: | |v| |
- * | ---------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Fetchable
- * @see BasicMappingComposite - A container of this widget
- * @see JavaManyToManyMapping2_0Composite - A container of this widget
- * @see OrmManyToOneMappingComposite - A container of this widget
- * @see OrmOneToManyMappingComposite - A container of this widget
- * @see OrmOneToOneMappingComposite - A container of this widget
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkJoinFetchComposite extends Pane<EclipseLinkJoinFetch> {
-
- /**
- * Creates a new <code>JoinFetchComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkJoinFetchComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkJoinFetch> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addLabeledComposite(
- container,
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkJoinFetchComposite_label),
- addJoinFetchTypeCombo(container).getControl(),
- null
- );
- }
-
-
- private EnumFormComboViewer<EclipseLinkJoinFetch, EclipseLinkJoinFetchType> addJoinFetchTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkJoinFetch, EclipseLinkJoinFetchType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkJoinFetch.VALUE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkJoinFetchType[] getChoices() {
- return EclipseLinkJoinFetchType.values();
- }
-
- @Override
- protected EclipseLinkJoinFetchType getDefaultValue() {
- return null;
- }
-
- @Override
- protected String displayString(EclipseLinkJoinFetchType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- EclipseLinkJoinFetchComposite.this,
- value
- );
- }
-
- @Override
- protected String nullDisplayString() {
- return JptCoreMessages.NONE;
- }
-
- @Override
- protected EclipseLinkJoinFetchType getValue() {
- return getSubject().getValue();
- }
-
- @Override
- protected void setValue(EclipseLinkJoinFetchType value) {
- getSubject().setValue(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
deleted file mode 100644
index f9ec7e51dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
+++ /dev/null
@@ -1,103 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractManyToManyMappingComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkManyToManyMappingComposite<T extends ManyToManyMapping>
- extends AbstractManyToManyMappingComposite<T, ManyToManyRelationshipReference>
- implements JpaComposite
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkManyToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<ManyToManyMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkRelationshipMapping) this.subject).getJoinFetch();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java
deleted file mode 100644
index 7a3a8d2f8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.ManyToOneRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractManyToOneMappingComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkManyToOneMappingComposite<T extends ManyToOneMapping>
- extends AbstractManyToOneMappingComposite<T, ManyToOneRelationshipReference>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkManyToOneMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkRelationshipMapping) this.subject).getJoinFetch();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java
deleted file mode 100644
index 90308ad409..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkMappedSuperclassAdvancedComposite extends Pane<MappedSuperclass> {
-
- public EclipseLinkMappedSuperclassAdvancedComposite(
- Pane<? extends MappedSuperclass> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkReadOnlyComposite(this, buildReadOnlyHolder(), container);
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkReadOnly> buildReadOnlyHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkReadOnly>(getSubjectHolder()) {
- @Override
- protected EclipseLinkReadOnly buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getReadOnly();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java
deleted file mode 100644
index fb183209f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java
+++ /dev/null
@@ -1,100 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Mutable option.
- *
- * @see EclipseLinkMutable
- * @see EclipseLinkBasicMappingComposite - A container of this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkMutableComposite extends Pane<EclipseLinkMutable>
-{
- /**
- * Creates a new <code>MutableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkMutableComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkMutable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabel,
- buildMutableHolder(),
- buildMutableStringHolder(),
- null
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildMutableHolder() {
- return new PropertyAspectAdapter<EclipseLinkMutable, Boolean>(getSubjectHolder(), EclipseLinkMutable.SPECIFIED_MUTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedMutable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedMutable(value);
- }
-
- };
- }
-
- private PropertyValueModel<String> buildMutableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultMutableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultMutableHolder() {
- return new PropertyAspectAdapter<EclipseLinkMutable, Boolean>(
- getSubjectHolder(),
- EclipseLinkMutable.SPECIFIED_MUTABLE_PROPERTY,
- EclipseLinkMutable.DEFAULT_MUTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedMutable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultMutable());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
deleted file mode 100644
index 29916f1800..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
+++ /dev/null
@@ -1,483 +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.eclipselink.ui.internal.details;
-
-import java.util.ListIterator;
-
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveTablePane;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkObjectTypeConverterComposite extends Pane<EclipseLinkObjectTypeConverter>
-{
-
- /**
- * Creates a new <code>ObjectTypeConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkObjectTypeConverterComposite(PropertyValueModel<? extends EclipseLinkObjectTypeConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addDataTypeChooser(container);
- addObjectTypeChooser(container);
-
- addConversionValuesTable(container);
-
- addLabeledEditableCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel,
- buildDefaultObjectValueListHolder(),
- buildDefaultObjectValueHolder(),
- buildStringConverter(),
- null
- );
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected WritablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(
- getSubjectHolder(), EclipseLinkConverter.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkObjectTypeConverter> addDataTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkObjectTypeConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(getSubjectHolder(), EclipseLinkObjectTypeConverter.DATA_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setDataType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getDataType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_dataTypeLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setDataType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkObjectTypeConverter> addObjectTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkObjectTypeConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(getSubjectHolder(), EclipseLinkObjectTypeConverter.OBJECT_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setObjectType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getObjectType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_objectTypeLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setObjectType(className);
- }
-
- @Override
- protected int getTypeDialogStyle() {
- return IJavaElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
- protected void addConversionValuesTable(Composite container) {
-
- // Join Columns group pane
- Group conversionValuesGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle
- );
-
- WritablePropertyValueModel<EclipseLinkConversionValue> conversionValueHolder =
- buildConversionValueHolder();
- // Conversion Values add/remove list pane
- new AddRemoveTablePane<EclipseLinkObjectTypeConverter>(
- this,
- conversionValuesGroupPane,
- buildConversionValuesAdapter(),
- buildConversionValuesListModel(),
- conversionValueHolder,
- buildConversionValuesLabelProvider(),
- null//TODO need a help context id for this
- ) {
- @Override
- protected ColumnAdapter<EclipseLinkConversionValue> buildColumnAdapter() {
- return new ConversionValueColumnAdapter();
- }
- };
-
- }
-
- protected WritablePropertyValueModel<EclipseLinkConversionValue> buildConversionValueHolder() {
- return new SimplePropertyValueModel<EclipseLinkConversionValue>();
- }
-
- protected AddRemoveListPane.Adapter buildConversionValuesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkConversionValueDialog dialog = buildConversionValueDialogForAdd();
- addConversionValueFromDialog(dialog, listSelectionModel);
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValueEdit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkConversionValue conversionValue = (EclipseLinkConversionValue) listSelectionModel.selectedValue();
- EclipseLinkConversionValueDialog dialog = new EclipseLinkConversionValueDialog(getShell(), getSubject(), conversionValue);
- editConversionValueFromDialog(dialog, conversionValue);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkObjectTypeConverter converter = getSubject();
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- converter.removeConversionValue(selectedIndices[index]);
- }
- }
- };
- }
-
-
- protected EclipseLinkConversionValueDialog buildConversionValueDialogForAdd() {
- return new EclipseLinkConversionValueDialog(getShell(), getSubject());
- }
-
- protected void addConversionValueFromDialog(EclipseLinkConversionValueDialog dialog, ObjectListSelectionModel listSelectionModel) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- EclipseLinkConversionValue conversionValue = this.getSubject().addConversionValue();
- conversionValue.setDataValue(dialog.getDataValue());
- conversionValue.setObjectValue(dialog.getObjectValue());
-
- listSelectionModel.setSelectedValue(conversionValue);
- }
-
- protected void editConversionValueFromDialog(EclipseLinkConversionValueDialog dialog, EclipseLinkConversionValue conversionValue) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- conversionValue.setDataValue(dialog.getDataValue());
- conversionValue.setObjectValue(dialog.getObjectValue());
- }
-
- private ListValueModel<EclipseLinkConversionValue> buildConversionValuesListModel() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConversionValue>(buildConversionValuesListHolder(),
- EclipseLinkConversionValue.DATA_VALUE_PROPERTY,
- EclipseLinkConversionValue.OBJECT_VALUE_PROPERTY);
- }
-
- private ListValueModel<EclipseLinkConversionValue> buildConversionValuesListHolder() {
- return new ListAspectAdapter<EclipseLinkObjectTypeConverter, EclipseLinkConversionValue>(getSubjectHolder(), EclipseLinkObjectTypeConverter.CONVERSION_VALUES_LIST) {
- @Override
- protected ListIterator<EclipseLinkConversionValue> listIterator_() {
- return this.subject.conversionValues();
- }
-
- @Override
- protected int size_() {
- return this.subject.conversionValuesSize();
- }
- };
- }
-
- private ITableLabelProvider buildConversionValuesLabelProvider() {
- return new TableLabelProvider();
- }
-
- protected ListValueModel<String> buildDefaultObjectValueListHolder() {
- return new TransformationListValueModelAdapter<EclipseLinkConversionValue, String>(buildConversionValuesListModel()) {
- @Override
- protected String transformItem(EclipseLinkConversionValue conversionValue) {
- return conversionValue.getObjectValue();
- }
- };
- }
-
- protected WritablePropertyValueModel<String> buildDefaultObjectValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(
- getSubjectHolder(), EclipseLinkObjectTypeConverter.DEFAULT_OBJECT_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDefaultObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- this.subject.setDefaultObjectValue(value);
- }
- };
- }
-
- protected final StringConverter<String> buildStringConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- return (value == null) ? "" : value; //$NON-NLS-1$
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkObjectTypeConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkObjectTypeConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
-
- EclipseLinkConversionValue conversionValue = (EclipseLinkConversionValue) element;
- String value = null;
-
- switch (columnIndex) {
- case ConversionValueColumnAdapter.DATA_VALUE_COLUMN: {
- value = conversionValue.getDataValue();
- break;
- }
-
- case ConversionValueColumnAdapter.OBJECT_VALUE_COLUMN: {
- value = conversionValue.getObjectValue();
- break;
- }
- }
-
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
-
- return value;
- }
- }
-
- private static class ConversionValueColumnAdapter implements ColumnAdapter<EclipseLinkConversionValue> {
-
- public static final int COLUMN_COUNT = 2;
- //public static final int SELECTION_COLUMN = 0;
- public static final int DATA_VALUE_COLUMN = 0;
- public static final int OBJECT_VALUE_COLUMN = 1;
-
- private WritablePropertyValueModel<String> buildDataValueHolder(EclipseLinkConversionValue subject) {
- return new PropertyAspectAdapter<EclipseLinkConversionValue, String>(EclipseLinkConversionValue.DATA_VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setDataValue(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildObjectValueHolder(EclipseLinkConversionValue subject) {
- return new PropertyAspectAdapter<EclipseLinkConversionValue, String>(EclipseLinkConversionValue.OBJECT_VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setObjectValue(value);
- }
- };
- }
-
- public WritablePropertyValueModel<?>[] cellModels(EclipseLinkConversionValue subject) {
- WritablePropertyValueModel<?>[] holders = new WritablePropertyValueModel<?>[COLUMN_COUNT];
- //holders[SELECTION_COLUMN] = new SimplePropertyValueModel<Object>();
- holders[DATA_VALUE_COLUMN] = buildDataValueHolder(subject);
- holders[OBJECT_VALUE_COLUMN] = buildObjectValueHolder(subject);
- return holders;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
-
- switch (columnIndex) {
- case ConversionValueColumnAdapter.DATA_VALUE_COLUMN: {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn;
- }
-
- case ConversionValueColumnAdapter.OBJECT_VALUE_COLUMN: {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn;
- }
-
- default: {
- return null;
- }
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java
deleted file mode 100644
index 25e113152e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyRelationshipReference;
-import org.eclipse.jpt.ui.internal.details.JoinColumnJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.details.MappedByJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOneToManyJoiningStrategyPane
- extends Pane<EclipseLinkOneToManyRelationshipReference>
-{
- public EclipseLinkOneToManyJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkOneToManyRelationshipReference> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java
deleted file mode 100644
index 2946d3b608..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java
+++ /dev/null
@@ -1,130 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractOneToManyMappingComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkOneToManyJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkvateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkOneToManyJoiningStrategyPane
- * @see FetchTypeComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkOneToManyMappingComposite<T extends OneToManyMapping>
- extends AbstractOneToManyMappingComposite<T, EclipseLinkOneToManyRelationshipReference>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipselinkOneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkOneToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new EclipseLinkOneToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToManyMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToManyMapping) this.subject).getJoinFetch();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java
deleted file mode 100644
index dfadca92fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java
+++ /dev/null
@@ -1,74 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.OneToOneRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractOneToOneMappingComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class EclipseLinkOneToOneMappingComposite<T extends OneToOneMapping>
- extends AbstractOneToOneMappingComposite<T, OneToOneRelationshipReference>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipselinkOneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkOneToOneMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping)this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping)this.subject).getPrivateOwned();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java
deleted file mode 100644
index a362dc6e55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java
+++ /dev/null
@@ -1,66 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows the Lob check box.
- *
- * @see BasicMapping
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkPrivateOwnedComposite extends Pane<EclipseLinkPrivateOwned>
-{
- /**
- * Creates a new <code>PrivateOwnedComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkPrivateOwnedComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkPrivateOwned> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- private PropertyAspectAdapter<EclipseLinkPrivateOwned, Boolean> buildPrivateOwnedHolder() {
-
- return new PropertyAspectAdapter<EclipseLinkPrivateOwned, Boolean>(getSubjectHolder(), EclipseLinkPrivateOwned.PRIVATE_OWNED_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isPrivateOwned());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setPrivateOwned(value.booleanValue());
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addCheckBox(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkPrivateOwnedComposite_privateOwnedLabel,
- buildPrivateOwnedHolder(),
- null
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java
deleted file mode 100644
index c0f87ae41e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java
+++ /dev/null
@@ -1,102 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows the Read Only check box.
- *
- * @see EclipseLinkReadOnly
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkReadOnlyComposite extends Pane<EclipseLinkReadOnly>
-{
- /**
- * Creates a new <code>ReadOnlyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkReadOnlyComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkReadOnly> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Unique tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyLabel,
- buildSpecifiedReadOnlyHolder(),
- buildReadOnlyStringHolder(),
- null
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildSpecifiedReadOnlyHolder() {
- return new PropertyAspectAdapter<EclipseLinkReadOnly, Boolean>(
- getSubjectHolder(),
- EclipseLinkReadOnly.SPECIFIED_READ_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedReadOnly();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedReadOnly(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildReadOnlyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultReadOnlyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyWithDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultReadOnlyHolder() {
- return new PropertyAspectAdapter<EclipseLinkReadOnly, Boolean>(
- getSubjectHolder(),
- EclipseLinkReadOnly.SPECIFIED_READ_ONLY_PROPERTY,
- EclipseLinkReadOnly.DEFAULT_READ_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedReadOnly() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultReadOnly());
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java
deleted file mode 100644
index a32cb08324..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java
+++ /dev/null
@@ -1,102 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Refresh Only If Newer option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkRefreshOnlyIfNewerComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkRefreshOnlyIfNewerComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel,
- buildRefreshOnlyIfNewerHolder(),
- buildRefreshOnlyIfNewerStringHolder(),
- EclipseLinkHelpContextIds.CACHING_REFRESH_ONLY_IF_NEWER
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildRefreshOnlyIfNewerHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedRefreshOnlyIfNewer();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedRefreshOnlyIfNewer(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildRefreshOnlyIfNewerStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultRefreshOnlyIfNewerHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultRefreshOnlyIfNewerHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY,
- EclipseLinkCaching.DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedRefreshOnlyIfNewer() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultRefreshOnlyIfNewer());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java
deleted file mode 100644
index d34f89ed2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java
+++ /dev/null
@@ -1,152 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkStructConverterComposite extends Pane<EclipseLinkStructConverter>
-{
-
- /**
- * Creates a new <code>StructConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkStructConverterComposite(PropertyValueModel<? extends EclipseLinkStructConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addClassChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected WritablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkStructConverter, String>(
- getSubjectHolder(), EclipseLinkConverter.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkStructConverter> addClassChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkStructConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkStructConverter, String>(getSubjectHolder(), EclipseLinkStructConverter.CONVERTER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterClass();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setConverterClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getConverterClass();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_classLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setConverterClass(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkStructConverter.ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkStructConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkStructConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java
deleted file mode 100644
index 0c90cfbd6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkTransformationMappingComposite extends Pane<EclipseLinkTransformationMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkTransformationMappingComposite(PropertyValueModel<? extends EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java
deleted file mode 100644
index 0b7744e9bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java
+++ /dev/null
@@ -1,199 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkTypeConverterComposite extends Pane<EclipseLinkTypeConverter>
-{
-
- /**
- * Creates a new <code>TypeConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkTypeConverterComposite(PropertyValueModel<? extends EclipseLinkTypeConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addDataTypeChooser(container);
- addObjectTypeChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected WritablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(
- getSubjectHolder(), EclipseLinkConverter.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkTypeConverter> addDataTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkTypeConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(getSubjectHolder(), EclipseLinkTypeConverter.DATA_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setDataType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getDataType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTypeConverterComposite_dataTypeLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setDataType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkTypeConverter> addObjectTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkTypeConverter>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(getSubjectHolder(), EclipseLinkTypeConverter.OBJECT_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setObjectType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getObjectType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTypeConverterComposite_objectTypeLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setObjectType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkTypeConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkTypeConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java
deleted file mode 100644
index d0a3bec929..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java
+++ /dev/null
@@ -1,168 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The localized strings used by the mapping panes.
- *
- * @version 2.3
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class EclipseLinkUiDetailsMessages extends NLS {
-
- public static String EclipseLinkBasicCollectionMappingUiProvider_label;
- public static String EclipseLinkBasicCollectionMappingUiProvider_linkLabel;
-
- public static String EclipseLinkBasicMapMappingUiProvider_label;
- public static String EclipseLinkBasicMapMappingUiProvider_linkLabel;
-
- public static String EclipseLinkTransformationMappingUiProvider_label;
- public static String EclipseLinkTransformationMappingUiProvider_linkLabel;
-
- public static String EclipseLinkVariableOneToOneMappingUiProvider_label;
- public static String EclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
-
- public static String EclipseLinkCacheTypeComposite_label;
- public static String EclipseLinkCacheTypeComposite_full;
- public static String EclipseLinkCacheTypeComposite_weak;
- public static String EclipseLinkCacheTypeComposite_soft;
- public static String EclipseLinkCacheTypeComposite_soft_weak;
- public static String EclipseLinkCacheTypeComposite_hard_weak;
- public static String EclipseLinkCacheTypeComposite_cache;
- public static String EclipseLinkCacheTypeComposite_none;
- public static String EclipseLinkTypeMappingComposite_advanced;
- public static String EclipseLinkTypeMappingComposite_caching;
- public static String EclipseLinkTypeMappingComposite_converters;
-
- public static String EclipseLinkCacheSizeComposite_size;
- public static String EclipseLinkCacheCoordinationTypeComposite_label;
- public static String EclipseLinkCacheCoordinationTypeComposite_send_object_changes;
- public static String EclipseLinkCacheCoordinationTypeComposite_invalidate_changed_objects;
- public static String EclipseLinkCacheCoordinationTypeComposite_send_new_objects_with_changes;
- public static String EclipseLinkCacheCoordinationTypeComposite_none;
-
- public static String EclipseLinkCachingComposite_sharedLabelDefault;
- public static String EclipseLinkCachingComposite_sharedLabel;
- public static String EclipseLinkCachingComposite_advanced;
- public static String EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault;
- public static String EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel;
- public static String EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault;
- public static String EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel;
- public static String EclipseLinkDisableHitsComposite_disableHitsDefault;
- public static String EclipseLinkDisableHitsComposite_disableHitsLabel;
-
- public static String EclipseLinkChangeTrackingComposite_label;
- public static String EclipseLinkChangeTrackingComposite_attribute;
- public static String EclipseLinkChangeTrackingComposite_object;
- public static String EclipseLinkChangeTrackingComposite_deferred;
- public static String EclipseLinkChangeTrackingComposite_auto;
-
- public static String EclipseLinkConvertComposite_converterNameLabel;
- public static String EclipseLinkConvertComposite_defineConverterSection;
- public static String EclipseLinkConvertComposite_default;
- public static String EclipseLinkConvertComposite_custom;
- public static String EclipseLinkConvertComposite_type;
- public static String EclipseLinkConvertComposite_objectType;
- public static String EclipseLinkConvertComposite_struct;
-
- public static String EclipseLinkConverterComposite_nameTextLabel;
- public static String EclipseLinkConverterComposite_classLabel;
-
- public static String EclipseLinkConvertersComposite_customConverter;
- public static String EclipseLinkConvertersComposite_objectTypeConverter;
- public static String EclipseLinkConvertersComposite_structConverter;
- public static String EclipseLinkConvertersComposite_typeConverter;
-
- public static String EclipseLinkCustomizerComposite_classLabel;
-
- public static String TypeSection_converted;
-
- public static String EclipseLinkExistenceCheckingComposite_label;
- public static String JavaEclipseLinkExistenceCheckingComposite_check_cache;
- public static String JavaEclipseLinkExistenceCheckingComposite_check_database;
- public static String JavaEclipseLinkExistenceCheckingComposite_assume_existence;
- public static String JavaEclipseLinkExistenceCheckingComposite_assume_non_existence;
- public static String OrmEclipseLinkExistenceCheckingComposite_check_cache;
- public static String OrmEclipseLinkExistenceCheckingComposite_check_database;
- public static String OrmEclipseLinkExistenceCheckingComposite_assume_existence;
- public static String OrmEclipseLinkExistenceCheckingComposite_assume_non_existence;
-
- public static String EclipseLinkExpiryComposite_expirySection;
- public static String EclipseLinkExpiryComposite_noExpiry;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiry;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds;
- public static String EclipseLinkExpiryComposite_dailyExpiry;
- public static String EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt;
-
- public static String EclipseLinkJoinFetchComposite_label;
- public static String EclipseLinkJoinFetchComposite_inner;
- public static String EclipseLinkJoinFetchComposite_outer;
-
- public static String EclipseLinkMutableComposite_mutableLabel;
- public static String EclipseLinkMutableComposite_mutableLabelDefault;
- public static String EclipseLinkMutableComposite_true;
- public static String EclipseLinkMutableComposite_false;
-
- public static String EclipseLinkObjectTypeConverterComposite_dataTypeLabel;
- public static String EclipseLinkObjectTypeConverterComposite_objectTypeLabel;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValueEdit;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn;
- public static String EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle;
-
- public static String EclipseLinkConversionValueDialog_addConversionValue;
- public static String EclipseLinkConversionValueDialog_editConversionValue;
- public static String EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle;
- public static String EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle;
- public static String EclipseLinkConversionValueDialog_addConversionValueDescription;
- public static String EclipseLinkConversionValueDialog_editConversionValueDescription;
-
- public static String EclipseLinkConversionValueDialog_dataValue;
- public static String EclipseLinkConversionValueDialog_objectValue;
- public static String EclipseLinkConversionValueStateObject_dataValueMustBeSpecified;
- public static String EclipseLinkConversionValueStateObject_objectValueMustBeSpecified;
- public static String EclipseLinkConversionValueStateObject_dataValueAlreadyExists;
-
- public static String EclipseLinkPrivateOwnedComposite_privateOwnedLabel;
-
- public static String EclipseLinkReadOnlyComposite_readOnlyLabel;
- public static String EclipseLinkReadOnlyComposite_readOnlyWithDefault;
-
- public static String EclipseLinkTypeConverterComposite_dataTypeLabel;
- public static String EclipseLinkTypeConverterComposite_objectTypeLabel;
-
- public static String DefaultEclipseLinkOneToOneMappingUiProvider_label;
- public static String DefaultEclipseLinkVariableOneToOneMappingUiProvider_label;
- public static String DefaultEclipseLinkOneToManyMappingUiProvider_label;
- public static String DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel;
- public static String DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- public static String DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel;
-
- public static String EclipseLinkConverterDialog_name;
- public static String EclipseLinkConverterDialog_converterType;
- public static String EclipseLinkConverterDialog_addConverter;
- public static String EclipseLinkConverterDialog_addConverterDescriptionTitle;
- public static String EclipseLinkConverterDialog_addConverterDescription;
- public static String EclipseLinkConverterStateObject_nameMustBeSpecified;
- public static String EclipseLinkConverterStateObject_typeMustBeSpecified;
-
- static {
- NLS.initializeMessages("eclipselink_ui_details", EclipseLinkUiDetailsMessages.class);
- }
-
- private EclipseLinkUiDetailsMessages() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java
deleted file mode 100644
index 7fd8431365..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class EclipseLinkVariableOneToOneMappingComposite extends Pane<EclipseLinkVariableOneToOneMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkVariableOneToOneMappingComposite(PropertyValueModel<? extends EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
deleted file mode 100644
index 02aa1f879f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
+++ /dev/null
@@ -1,162 +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.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.ConvertibleMapping;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractVersionMappingComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | MutableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see VersionMapping
- * @see ColumnComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkVersionMappingComposite<T extends VersionMapping> extends AbstractVersionMappingComposite<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>VersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IVersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkVersionMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(Converter.NO_CONVERTER),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(Converter.TEMPORAL_CONVERTER),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return (converter != null && converter.getType() == EclipseLinkConvert.ECLIPSE_LINK_CONVERTER) ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected PropertyValueModel<TemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, TemporalConverter>(converterHolder) {
- @Override
- protected TemporalConverter transform_(Converter converter) {
- return converter.getType() == Converter.TEMPORAL_CONVERTER ? (TemporalConverter) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkVersionMapping) this.subject).getMutable();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index b7a99d1fea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkEmbeddableAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkEmbeddableComposite extends AbstractEmbeddableComposite<JavaEmbeddable>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</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
- */
- protected AbstractJavaEclipseLinkEmbeddableComposite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeConvertersCollapsibleSection(container);
- initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
-
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterHolder> converterHolder) {
- new JavaEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<JavaEclipseLinkConverterHolder> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaEmbeddable, JavaEclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterHolder buildValue_() {
- return ((JavaEclipseLinkEmbeddable) this.subject).getConverterHolder();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEmbeddableAdvancedComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java
deleted file mode 100644
index 2b115790db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,120 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkEntityAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AbstractEntityComposite;
-import org.eclipse.jpt.ui.internal.details.java.JavaInheritanceComposite;
-import org.eclipse.jpt.ui.internal.details.java.JavaSecondaryTablesComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkEntityComposite<T extends JavaEntity>
- extends AbstractEntityComposite<T>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJavaEclipseLinkEntityComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeCachingCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- private PropertyAspectAdapter<JavaEntity, JavaEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<JavaEntity, JavaEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkCaching buildValue_() {
- return ((JavaEclipseLinkEntity) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterHolder> converterHolder) {
- new JavaEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<JavaEclipseLinkConverterHolder> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaEntity, JavaEclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterHolder buildValue_() {
- return ((JavaEclipseLinkEntity) this.subject).getConverterHolder();
- }
- };
- }
-
- @Override
- protected void initializeSecondaryTablesSection(Composite container) {
- new JavaSecondaryTablesComposite(this, container);
- }
-
- @Override
- protected void initializeInheritanceSection(Composite container) {
- new JavaInheritanceComposite(this, container);
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEntityAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 28c058405b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010, Form Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMappedSuperclassAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractMappedSuperclassComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkMappedSuperclassComposite
- extends AbstractMappedSuperclassComposite<JavaMappedSuperclass>
- implements JpaComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</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
- */
- protected AbstractJavaEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
-
- protected void initializeCachingCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- this.initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- private PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkCaching buildValue_() {
- return ((JavaEclipseLinkMappedSuperclass) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolderValueModel());
- }
-
- private PropertyValueModel<JavaEclipseLinkConverterHolder> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterHolder buildValue_() {
- return ((JavaEclipseLinkMappedSuperclass) this.subject).getConverterHolder();
- }
- };
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterHolder> converterHolder) {
- new JavaEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkMappedSuperclassAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java
deleted file mode 100644
index 311fe7cebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.ui.internal.details.AbstractOneToManyMappingUiDefinition;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkOneToManyMappingUiDefinition
- extends AbstractOneToManyMappingUiDefinition<PersistentAttribute, JavaOneToManyMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaOneToManyMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkOneToManyMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkOneToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaOneToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkOneToManyMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToManyMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java
deleted file mode 100644
index da1ef7bec4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.ui.internal.details.AbstractOneToOneMappingUiDefinition;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkOneToOneMappingUiDefinition
- extends AbstractOneToOneMappingUiDefinition<PersistentAttribute, JavaOneToOneMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaOneToOneMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkOneToOneMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkOneToOneMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToOneMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index 4458e4e0cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,78 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.JptUiIcons;
-import org.eclipse.jpt.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractMappingUiDefinition<PersistentAttribute, JavaEclipseLinkVariableOneToOneMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaEclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaEclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public Image getImage() {
- return JptUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkVariableOneToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java
deleted file mode 100644
index 509aaa51b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java
+++ /dev/null
@@ -1,106 +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.eclipselink.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-
-public class EclipseLinkJavaResourceUiDefinition
- extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkJavaResourceUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLinkJavaResourceUiDefinition() {
- super();
- }
-
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLinkJavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
-
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java
deleted file mode 100644
index 3da728716b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java
+++ /dev/null
@@ -1,160 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkJavaUiFactory extends BaseJavaUiFactory
-{
- public EclipseLinkJavaUiFactory() {
- super();
- }
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- @Override
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaBasicMappingComposite(
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaVersionMappingComposite(
- PropertyValueModel<JavaVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkBasicMapMappingComposite(
- PropertyValueModel<JavaEclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkBasicCollectionMappingComposite(
- PropertyValueModel<JavaEclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkVariableOneToOneMappingComposite(
- PropertyValueModel<JavaEclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkTransformationMappingComposite(
- PropertyValueModel<JavaEclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index 10f02fa5e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkBasicCollectionMappingUiDefinition
- extends AbstractEclipseLinkBasicCollectionMappingUiDefinition<PersistentAttribute, EclipseLinkBasicCollectionMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping>
-{
- // singleton
- private static final JavaEclipseLinkBasicCollectionMappingUiDefinition INSTANCE =
- new JavaEclipseLinkBasicCollectionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 01151268b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkBasicMapMappingUiDefinition
- extends AbstractEclipseLinkBasicMapMappingUiDefinition<PersistentAttribute, EclipseLinkBasicMapMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkBasicMapMapping>
-{
- // singleton
- private static final JavaEclipseLinkBasicMapMappingUiDefinition INSTANCE =
- new JavaEclipseLinkBasicMapMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkBasicMapMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java
deleted file mode 100644
index c2b3065bee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,62 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCachingComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching2_0
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkCachingComposite extends EclipseLinkCachingComposite<JavaEclipseLinkCaching>
-{
-
- public JavaEclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<JavaEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new JavaEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkConvertersComposite.java
deleted file mode 100644
index fb866e3446..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkConvertersComposite.java
+++ /dev/null
@@ -1,271 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCustomConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkObjectTypeConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkStructConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkTypeConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | X CustomConverter |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | CustomConverterComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | X Type Converter |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | TypeConverterComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | X Oject Type Converter |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | ObjectTypeConverterComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | X Struct Converter |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | StructConverterComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkConvertersComposite extends Pane<JavaEclipseLinkConverterHolder>
-{
-
- /**
- * Creates a new <code>ConversionComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JavaEclipseLinkConvertersComposite(Pane<?> parentPane,
- PropertyValueModel<? extends JavaEclipseLinkConverterHolder> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- initializeConverterPane(container);
- }
-
- private void initializeConverterPane(Composite container) {
- // Custom Converter check box
- Button customConverterCheckBox = addCheckBox(
- addSubPane(container, 5),
- EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_customConverter,
- buildCustomConverterBooleanHolder(),
- null
- );
-
- // Custom Converter pane
- EclipseLinkCustomConverterComposite customConverterComposite = new EclipseLinkCustomConverterComposite(
- buildCustomConverterHolder(),
- addSubPane(container, 0, customConverterCheckBox.getBorderWidth() + 16),
- getWidgetFactory()
- );
- registerSubPane(customConverterComposite);
-
-
- // Type Converter check box
- Button typeConverterCheckBox = addCheckBox(
- addSubPane(container, 5),
- EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_typeConverter,
- buildTypeConverterBooleanHolder(),
- null
- );
-
- // Type Converter pane
- EclipseLinkTypeConverterComposite typeConverterComposite = new EclipseLinkTypeConverterComposite(
- buildTypeConverterHolder(),
- addSubPane(container, 0, typeConverterCheckBox.getBorderWidth() + 16),
- getWidgetFactory()
- );
- registerSubPane(typeConverterComposite);
-
- // Object Type Converter check box
- Button objectTypeConverterCheckBox = addCheckBox(
- addSubPane(container, 5),
- EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_objectTypeConverter,
- buildObjectTypeConverterBooleanHolder(),
- null
- );
-
- // Object Type Converter pane
- EclipseLinkObjectTypeConverterComposite objectTypeConverterComposite = new EclipseLinkObjectTypeConverterComposite(
- buildObjectTypeConverterHolder(),
- addSubPane(container, 0, objectTypeConverterCheckBox.getBorderWidth() + 16),
- getWidgetFactory()
- );
- registerSubPane(objectTypeConverterComposite);
-
- // Struct Converter check box
- Button structConverterCheckBox = addCheckBox(
- addSubPane(container, 5),
- EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_structConverter,
- buildStructConverterBooleanHolder(),
- null
- );
-
- // Struct Converter pane
- EclipseLinkStructConverterComposite structConverterComposite = new EclipseLinkStructConverterComposite(
- buildStructConverterHolder(),
- addSubPane(container, 0, structConverterCheckBox.getBorderWidth() + 16),
- getWidgetFactory()
- );
- registerSubPane(structConverterComposite);
- }
-
- private WritablePropertyValueModel<Boolean> buildCustomConverterBooleanHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, Boolean>(getSubjectHolder(), JavaEclipseLinkConverterHolder.CUSTOM_CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getCustomConverter() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue() && (this.subject.getCustomConverter() == null)) {
- this.subject.addCustomConverter();
- }
- else if (!value.booleanValue() && (this.subject.getCustomConverter() != null)) {
- this.subject.removeCustomConverter();
- }
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomConverter> buildCustomConverterHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, EclipseLinkCustomConverter>(getSubjectHolder(), JavaEclipseLinkConverterHolder.CUSTOM_CONVERTER_PROPERTY) {
- @Override
- protected EclipseLinkCustomConverter buildValue_() {
- return this.subject.getCustomConverter();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildTypeConverterBooleanHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, Boolean>(getSubjectHolder(), JavaEclipseLinkConverterHolder.TYPE_CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getTypeConverter() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue() && (this.subject.getTypeConverter() == null)) {
- this.subject.addTypeConverter();
- }
- else if (!value.booleanValue() && (this.subject.getTypeConverter() != null)) {
- this.subject.removeTypeConverter();
- }
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkTypeConverter> buildTypeConverterHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, EclipseLinkTypeConverter>(getSubjectHolder(), JavaEclipseLinkConverterHolder.TYPE_CONVERTER_PROPERTY) {
- @Override
- protected EclipseLinkTypeConverter buildValue_() {
- return this.subject.getTypeConverter();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildObjectTypeConverterBooleanHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, Boolean>(getSubjectHolder(), JavaEclipseLinkConverterHolder.OBJECT_TYPE_CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getObjectTypeConverter() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue() && (this.subject.getObjectTypeConverter() == null)) {
- this.subject.addObjectTypeConverter();
- }
- else if (!value.booleanValue() && (this.subject.getObjectTypeConverter() != null)) {
- this.subject.removeObjectTypeConverter();
- }
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConverterHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, EclipseLinkObjectTypeConverter>(getSubjectHolder(), JavaEclipseLinkConverterHolder.OBJECT_TYPE_CONVERTER_PROPERTY) {
- @Override
- protected EclipseLinkObjectTypeConverter buildValue_() {
- return this.subject.getObjectTypeConverter();
- }
- };
- }
-
-
- private WritablePropertyValueModel<Boolean> buildStructConverterBooleanHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, Boolean>(getSubjectHolder(), JavaEclipseLinkConverterHolder.STRUCT_CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getStructConverter() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue() && (this.subject.getStructConverter() == null)) {
- this.subject.addStructConverter();
- }
- else if (!value.booleanValue() && (this.subject.getStructConverter() != null)) {
- this.subject.removeStructConverter();
- }
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkStructConverter> buildStructConverterHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkConverterHolder, EclipseLinkStructConverter>(getSubjectHolder(), JavaEclipseLinkConverterHolder.STRUCT_CONVERTER_PROPERTY) {
- @Override
- protected EclipseLinkStructConverter buildValue_() {
- return this.subject.getStructConverter();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index c86d3b4cd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkEmbeddableComposite extends AbstractJavaEclipseLinkEmbeddableComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</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
- */
- public JavaEclipseLinkEmbeddableComposite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java
deleted file mode 100644
index ba1176e3f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkEntityComposite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntityComposite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java
deleted file mode 100644
index 505b24fa99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java
+++ /dev/null
@@ -1,130 +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.eclipselink.ui.internal.details.java;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | x Existence Checking: | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see CachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkExistenceCheckingComposite extends Pane<JavaEclipseLinkCaching> {
-
- /**
- * Creates a new <code>ExistenceCheckingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JavaEclipseLinkExistenceCheckingComposite(Pane<? extends JavaEclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- addCheckBox(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_label,
- buildExistenceCheckingHolder(),
- null
- ),
- addExistenceCheckingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType> addExistenceCheckingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_EXISTENCE_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_EXISTENCE_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkExistenceType[] getChoices() {
- return EclipseLinkExistenceType.values();
- }
-
- @Override
- protected EclipseLinkExistenceType getDefaultValue() {
- return getSubject().getDefaultExistenceType();
- }
-
- @Override
- protected String displayString(EclipseLinkExistenceType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- JavaEclipseLinkExistenceCheckingComposite.this,
- value
- );
- }
-
- @Override
- protected EclipseLinkExistenceType getValue() {
- return getSubject().getSpecifiedExistenceType();
- }
-
- @Override
- protected void setValue(EclipseLinkExistenceType value) {
- getSubject().setSpecifiedExistenceType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildExistenceCheckingHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkCaching, Boolean>(getSubjectHolder(), JavaEclipseLinkCaching.EXISTENCE_CHECKING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.hasExistenceChecking());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExistenceChecking(value.booleanValue());
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 6666f3afd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkMappedSuperclassComposite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</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
- */
- public JavaEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index 9eecc40b55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkTransformationMappingUiDefinition
- extends AbstractEclipseLinkTransformationMappingUiDefinition<PersistentAttribute, EclipseLinkTransformationMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkTransformationMapping>
-{
- // singleton
- private static final JavaEclipseLinkTransformationMappingUiDefinition INSTANCE =
- new JavaEclipseLinkTransformationMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkTransformationMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index fd1e7e7036..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractEclipseLinkVariableOneToOneMappingUiDefinition<PersistentAttribute, EclipseLinkVariableOneToOneMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final JavaEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new JavaEclipseLinkVariableOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java
deleted file mode 100644
index 00651ce605..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,132 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractEntityMappingsDetailsPage;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see AbstractEclipseLinkEntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractEclipseLinkEntityMappingsDetailsPage extends AbstractEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEclipseLinkEntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityMappingsCollapsibleSection(container);
- this.initializePersistenceUnitMetadataCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
-
- this.initializeConvertersSection(container);
- }
-
- protected void initializeConvertersSection(Composite container) {
- new OrmEclipseLinkConvertersComposite(
- this,
- this.buildConverterHolder(),
- container
- );
- }
-
- private PropertyValueModel<EclipseLinkConverterHolder> buildConverterHolder() {
- return new PropertyAspectAdapter<EntityMappings, EclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterHolder buildValue_() {
- return ((EclipseLinkEntityMappings) this.subject).getConverterHolder();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java
deleted file mode 100644
index 7e0d4d2694..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,91 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkEntityAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmEntityComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOrmEclipseLinkEntityComposite extends AbstractOrmEntityComposite
-{
- protected AbstractOrmEclipseLinkEntityComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeCachingCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
-
- private PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkCaching buildValue_() {
- return ((OrmEclipseLinkEntity) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolder());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterHolder> converterHolder) {
- new OrmEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<EclipseLinkConverterHolder> buildConverterHolder() {
- return new PropertyAspectAdapter<OrmEntity, EclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterHolder buildValue_() {
- return ((OrmEclipseLinkEntity) this.subject).getConverterHolder();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEntityAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 4b823b0176..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,109 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMappedSuperclassAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractMappedSuperclassComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.ui.internal.details.orm.MetadataCompleteComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmJavaClassChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOrmEclipseLinkMappedSuperclassComposite<T extends OrmEclipseLinkMappedSuperclass>
- extends AbstractMappedSuperclassComposite<T>
- implements JpaComposite
-{
- protected AbstractOrmEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected void initializeCachingCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- this.initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<T, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- private PropertyAspectAdapter<T, OrmEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<T, OrmEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkCaching buildValue_() {
- return this.subject.getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolder());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterHolder> converterHolder) {
- new OrmEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<EclipseLinkConverterHolder> buildConverterHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterHolder buildValue_() {
- return this.subject.getConverterHolder();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkMappedSuperclassAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java
deleted file mode 100644
index bb8b3461ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java
+++ /dev/null
@@ -1,126 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.TransientMappingComposite;
-import org.eclipse.jpt.ui.internal.details.orm.BaseOrmXmlUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class BaseEclipseLinkOrmXmlUiFactory extends BaseOrmXmlUiFactory
-{
- // **************** orm type mapping composites ****************************
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmTransientMappingComposite(
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java
deleted file mode 100644
index 9e1f913718..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java
+++ /dev/null
@@ -1,195 +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.eclipselink.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkConverterDialog extends ValidatingDialog<EclipseLinkConverterStateObject> {
-
-
- // ********** constructors **********
-
- /**
- * Use this constructor to edit an existing conversion value
- */
- public EclipseLinkConverterDialog(Shell parent) {
- super(parent);
- }
-
- @Override
- protected EclipseLinkConverterStateObject buildStateObject() {
- return new EclipseLinkConverterStateObject();
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverter;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescription;
- }
-
- @Override
- protected DialogPane<EclipseLinkConverterStateObject> buildLayout(Composite container) {
- return new ConversionValueDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- ConversionValueDialogPane pane = (ConversionValueDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getName() {
- return getSubject().getName();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public String getConverterType() {
- return getSubject().getConverterType();
- }
-
- private class ConversionValueDialogPane extends DialogPane<EclipseLinkConverterStateObject> {
-
- private Text nameText;
-
- ConversionValueDialogPane(Composite parent) {
- super(EclipseLinkConverterDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.nameText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_name,
- buildNameHolder()
- );
-
- addLabeledCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_converterType,
- buildConverterTypeListHolder(),
- buildConverterTypeHolder(),
- buildStringConverter(),
- null);
- }
-
- protected ListValueModel<String> buildConverterTypeListHolder() {
- List<String> converterTypes = new ArrayList<String>();
- converterTypes.add(EclipseLinkConverter.CUSTOM_CONVERTER);
- converterTypes.add(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- converterTypes.add(EclipseLinkConverter.STRUCT_CONVERTER);
- converterTypes.add(EclipseLinkConverter.TYPE_CONVERTER);
-
- return new StaticListValueModel<String>(converterTypes);
- }
-
- private StringConverter<String> buildStringConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- if (value == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_customConverter;
- }
- if (value == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_objectTypeConverter;
- }
- if (value == EclipseLinkConverter.STRUCT_CONVERTER) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_structConverter;
- }
- if (value == EclipseLinkConverter.TYPE_CONVERTER) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_typeConverter;
- }
- return value;
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConverterStateObject, String>(getSubjectHolder(), EclipseLinkConverterStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildConverterTypeHolder() {
- return new PropertyAspectAdapter<EclipseLinkConverterStateObject, String>(getSubjectHolder(), EclipseLinkConverterStateObject.CONVERTER_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterType();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setConverterType(value);
- }
- };
- }
-
- void selectAll() {
- this.nameText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java
deleted file mode 100644
index d97f018907..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java
+++ /dev/null
@@ -1,125 +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.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.internal.node.Problem;
-
-/**
- * This is the state object used by the <code>EclipseLinkConverterDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see EclipseLinkConverterDialog
- *
- * @version 2.1
- * @since 2.1
- */
-final class EclipseLinkConverterStateObject extends AbstractNode
-{
- /**
- * The initial name or <code>null</code>
- */
- private String name;
-
- /**
- * The initial converterType or <code>null</code>
- */
- private String converterType;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Notifies a change in the object value property.
- */
- static final String CONVERTER_TYPE_PROPERTY = "converterType"; //$NON-NLS-1$
-
- /**
- * 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
- */
- EclipseLinkConverterStateObject() {
- super(null);
-
- }
-
- private void addNameProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.name)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameMustBeSpecified));
- }
- }
-
- private void addConverterTypeProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.converterType)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_typeMustBeSpecified));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- addNameProblemsTo(currentProblems);
- addConverterTypeProblemsTo(currentProblems);
- }
-
- @Override
- protected void checkParent(@SuppressWarnings("unused") Node parentNode) {
- //no parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getName() {
- return this.name;
- }
-
- String getConverterType() {
- return this.converterType;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public void setConverterType(String newConverterType) {
- String oldConverterType = this.converterType;
- this.converterType = newConverterType;
- firePropertyChanged(CONVERTER_TYPE_PROPERTY, oldConverterType, newConverterType);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java
deleted file mode 100644
index 5a162d1452..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,91 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EclipseLinkEntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.2
- * @since 2.1
- */
-public class EclipseLinkEntityMappingsDetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkEntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java
deleted file mode 100644
index 2ea79989bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPage}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 2.2
- * @since 2.2
- */
-public class EclipseLinkEntityMappingsDetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappingsDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkEntityMappingsDetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE)
- || resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE)
- || resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE);
- }
-
- public JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkEntityMappingsDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java
deleted file mode 100644
index 9806386813..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java
+++ /dev/null
@@ -1,103 +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.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmXmlUiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXmlUiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkOrmResourceModelStructureProvider.instance();
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java
deleted file mode 100644
index 079ae5b34b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java
+++ /dev/null
@@ -1,15 +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.eclipselink.ui.internal.details.orm;
-
-public class EclipseLinkOrmXmlUiFactory extends BaseEclipseLinkOrmXmlUiFactory
-{
- //nothing
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index cb82b5789f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicCollectionMappingUiDefinition
- extends AbstractEclipseLinkBasicCollectionMappingUiDefinition<PersistentAttribute, OrmEclipseLinkBasicCollectionMapping>
- implements OrmAttributeMappingUiDefinition<OrmEclipseLinkBasicCollectionMapping>
-{
- // singleton
- private static final OrmEclipseLinkBasicCollectionMappingUiDefinition INSTANCE =
- new OrmEclipseLinkBasicCollectionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEclipseLinkBasicCollectionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 98ac982267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicMapMappingUiDefinition
- extends AbstractEclipseLinkBasicMapMappingUiDefinition<PersistentAttribute, OrmEclipseLinkBasicMapMapping>
- implements OrmAttributeMappingUiDefinition<OrmEclipseLinkBasicMapMapping>
-{
- // singleton
- private static final OrmEclipseLinkBasicMapMappingUiDefinition INSTANCE =
- new OrmEclipseLinkBasicMapMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEclipseLinkBasicMapMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java
deleted file mode 100644
index 8b2800d022..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java
+++ /dev/null
@@ -1,58 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-//Remove the Converters section from 1.0 orm basic mappings.
-//This is supported in EclipseLink in version 1.1, but not 1.0
-public class OrmEclipseLinkBasicMappingComposite extends EclipseLinkBasicMappingComposite<OrmBasicMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMappingComposite(PropertyValueModel<? extends OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory());
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java
deleted file mode 100644
index d63a1f475e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,62 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCachingComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public class OrmEclipseLinkCachingComposite extends EclipseLinkCachingComposite<OrmEclipseLinkCaching>
-{
-
- public OrmEclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<OrmEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new OrmEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java
deleted file mode 100644
index dd054ac042..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvert1_0Composite.java
+++ /dev/null
@@ -1,223 +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.eclipselink.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Converter: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConvert
- * @see EclipseLinkBasicMappingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-
-//Removes the Define Converters section from orm basic, id, version mapping.
-//This is supported in EclipseLink in version 1.1, but not 1.0
-public class OrmEclipseLinkConvert1_0Composite extends Pane<EclipseLinkConvert>
-{
-
- /**
- * A key used to represent the default value, this is required to convert
- * the selected item from a combo to <code>null</code>. This key is most
- * likely never typed the user and it will help to convert the value to
- * <code>null</code> when it's time to set the new selected value into the
- * model.
- */
- protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?"; //$NON-NLS-1$
-
-
- /**
- * Creates a new <code>EnumTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmEclipseLinkConvert1_0Composite(PropertyValueModel<? extends EclipseLinkConvert> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel,
- buildConvertNameListHolder(),
- buildConvertNameHolder(),
- buildNameConverter(),
- null
- );
- SWTUtil.attachDefaultValueHandler(combo);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected final WritablePropertyValueModel<String> buildConvertNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedConverterName();
- }
-
- @Override
- protected void setValue_(String value) {
- // Convert the default value or an empty string to null
- if ((value != null) &&
- ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) {
-
- value = null;
- }
- this.subject.setSpecifiedConverterName(value);
- }
- };
- }
- private ListValueModel<String> buildConvertNameListHolder() {
- java.util.List<ListValueModel<String>> list = new ArrayList<ListValueModel<String>>();
- list.add(buildDefaultNameListHolder());
- list.add(buildReservedConverterNameListHolder());
- list.add(buildConverterNameListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(list);
- }
-
- protected ListValueModel<String> buildDefaultNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildDefaultNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- String name = this.subject.getDefaultConverterName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private StringConverter<String> buildNameConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
-
- if (getSubject() == null) {
- return value;
- }
-
- if (value == null) {
- value = getSubject().getDefaultConverterName();
-
- if (value != null) {
- value = DEFAULT_KEY + value;
- }
- else {
- value = DEFAULT_KEY;
- }
- }
-
- if (value.startsWith(DEFAULT_KEY)) {
- String defaultName = value.substring(DEFAULT_KEY.length());
-
- if (defaultName.length() > 0) {
- value = NLS.bind(
- JptUiDetailsMessages.DefaultWithOneParam,
- defaultName
- );
- }
- else {
- value = JptUiDetailsMessages.DefaultEmpty;
- }
- }
-
- return value;
- }
- };
- }
-
- protected ListValueModel<String> buildReservedConverterNameListHolder() {
- return new StaticListValueModel<String>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES);
- }
-
- protected ListValueModel<String> buildConverterNameListHolder() {
- return new ListAspectAdapter<EclipseLinkPersistenceUnit, String>(
- buildPersistenceUnitHolder(),
- EclipseLinkPersistenceUnit.CONVERTERS_LIST)//TODO need EclipseLinkPersistenceUnit interface
- {
- @Override
- protected ListIterator<String> listIterator_() {
- return CollectionTools.listIterator(ArrayTools.sort(this.subject.uniqueConverterNames()));
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, EclipseLinkPersistenceUnit>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPersistenceUnit buildValue_() {
- return (EclipseLinkPersistenceUnit) getSubject().getPersistenceUnit();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConvert, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkConvert value) {
- if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java
deleted file mode 100644
index 4281b3c27a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkConvertersComposite.java
+++ /dev/null
@@ -1,407 +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.eclipselink.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCustomConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkObjectTypeConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkStructConverterComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkTypeConverterComposite;
-import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This pane shows the list of named queries and named native queries.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConverterComposite or ObjectTypeConverterComposite | |
- * | | or StructConverterComposite or TypeConverterComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see Query
- * @see NamedNativeQuery
- * @see NamedQuery
- * @see AbstractEntityComposite - The parent container
- * @see NamedNativeQueryPropertyComposite
- * @see NamedQueryPropertyComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public class OrmEclipseLinkConvertersComposite extends Pane<EclipseLinkConverterHolder>
-{
- private AddRemoveListPane<EclipseLinkConverterHolder> listPane;
- private EclipseLinkCustomConverterComposite converterComposite;
- private EclipseLinkObjectTypeConverterComposite objectTypeConverterComposite;
- private EclipseLinkStructConverterComposite structConverterComposite;
- private EclipseLinkTypeConverterComposite typeConverterComposite;
- private WritablePropertyValueModel<EclipseLinkConverter> selectedConverterHolder;
-
- public OrmEclipseLinkConvertersComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkConverterHolder> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.selectedConverterHolder = buildSelectedConverterHolder();
- }
-
- private WritablePropertyValueModel<EclipseLinkConverter> buildSelectedConverterHolder() {
- return new SimplePropertyValueModel<EclipseLinkConverter>();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // List pane
- this.listPane = addListPane(container);
-
- // Property pane
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.converterComposite = new EclipseLinkCustomConverterComposite(
- buildCustomConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.converterComposite);
-
- this.objectTypeConverterComposite = new EclipseLinkObjectTypeConverterComposite(
- buildObjectTypeConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.objectTypeConverterComposite);
-
- this.structConverterComposite = new EclipseLinkStructConverterComposite(
- buildStructConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.structConverterComposite);
-
- this.typeConverterComposite = new EclipseLinkTypeConverterComposite(
- buildTypeConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.typeConverterComposite);
-
- installPaneSwitcher(pageBook);
- }
-
- private AddRemoveListPane<EclipseLinkConverterHolder> addListPane(Composite container) {
-
- return new AddRemoveListPane<EclipseLinkConverterHolder>(
- this,
- container,
- buildConvertersAdapter(),
- buildDisplayableConvertersListHolder(),
- this.selectedConverterHolder,
- buildConvertersListLabelProvider(),
- null//JpaHelpContextIds.MAPPING_NAMED_QUERIES
- ) {
- //TODO yeah, this is weird, but i don't want this to be disabled just
- //because the subject is null. i have no need for that and that is
- //currently how AddRemovePane works. See OrmQueriesComposite where
- //the work around there is yet another pane enabler. I want to change
- //how this works in 2.2
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(true);
- }
- };
- }
-
- private void installPaneSwitcher(PageBook pageBook) {
- new ControlSwitcher(this.selectedConverterHolder, buildPaneTransformer(), pageBook);
- }
-
- private Adapter buildConvertersAdapter() {
-
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addConverter();
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- if (((EclipseLinkConverter) item).getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- getSubject().removeCustomConverter((EclipseLinkCustomConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- getSubject().removeObjectTypeConverter((EclipseLinkObjectTypeConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- getSubject().removeStructConverter((EclipseLinkStructConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- getSubject().removeTypeConverter((EclipseLinkTypeConverter) item);
- }
- }
- }
- };
- }
-
- private void addConverter() {
- addEclipseLinkConverterFromDialog(buildEclipseLinkConverterDialog());
- }
-
- protected EclipseLinkConverterDialog buildEclipseLinkConverterDialog() {
- return new EclipseLinkConverterDialog(getShell());
- }
-
- protected void addEclipseLinkConverterFromDialog(EclipseLinkConverterDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- String converterType = dialog.getConverterType();
- EclipseLinkConverter converter;
- if (converterType == EclipseLinkConverter.CUSTOM_CONVERTER) {
- converter = this.getSubject().addCustomConverter(getSubject().customConvertersSize());
- }
- else if (converterType == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- converter = this.getSubject().addObjectTypeConverter(getSubject().objectTypeConvertersSize());
- }
- else if (converterType == EclipseLinkConverter.STRUCT_CONVERTER) {
- converter = this.getSubject().addStructConverter(getSubject().structConvertersSize());
- }
- else if (converterType == EclipseLinkConverter.TYPE_CONVERTER) {
- converter = this.getSubject().addTypeConverter(getSubject().typeConvertersSize());
- }
- else {
- throw new IllegalArgumentException();
- }
- converter.setName(dialog.getName());
- this.selectedConverterHolder.setValue(converter);//so that it gets selected in the List for the user to edit
- }
-
- private Transformer<EclipseLinkConverter, Control> buildPaneTransformer() {
- return new Transformer<EclipseLinkConverter, Control>() {
- public Control transform(EclipseLinkConverter converter) {
- if (converter == null) {
- return null;
- }
-
- if (converter.getType() == EclipseLinkConverter.CUSTOM_CONVERTER) {
- return OrmEclipseLinkConvertersComposite.this.converterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER) {
- return OrmEclipseLinkConvertersComposite.this.objectTypeConverterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkConverter.STRUCT_CONVERTER) {
- return OrmEclipseLinkConvertersComposite.this.structConverterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkConverter.TYPE_CONVERTER) {
- return OrmEclipseLinkConvertersComposite.this.typeConverterComposite.getControl();
- }
-
- return null;
- }
- };
- }
-
- private ListValueModel<EclipseLinkConverter> buildDisplayableConvertersListHolder() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConverter>(
- buildEclipseLinkConvertersHolder(),
- EclipseLinkConverter.NAME_PROPERTY
- );
- }
-
- private ListValueModel<EclipseLinkConverter> buildEclipseLinkConvertersHolder() {
- List<ListValueModel<? extends EclipseLinkConverter>> list = new ArrayList<ListValueModel<? extends EclipseLinkConverter>>();
- list.add(buildCustomConvertersListHolder());
- list.add(buildObjectTypeConvertersListHolder());
- list.add(buildStructConvertersListHolder());
- list.add(buildTypeConvertersListHolder());
- return new CompositeListValueModel<ListValueModel<? extends EclipseLinkConverter>, EclipseLinkConverter>(list);
- }
-
- private ListValueModel<EclipseLinkCustomConverter> buildCustomConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterHolder, EclipseLinkCustomConverter>(
- getSubjectHolder(),
- EclipseLinkConverterHolder.CUSTOM_CONVERTERS_LIST)
- {
- @Override
- protected ListIterator<EclipseLinkCustomConverter> listIterator_() {
- return this.subject.customConverters();
- }
-
- @Override
- protected int size_() {
- return this.subject.customConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterHolder, EclipseLinkObjectTypeConverter>(
- getSubjectHolder(),
- EclipseLinkConverterHolder.OBJECT_TYPE_CONVERTERS_LIST)
- {
- @Override
- protected ListIterator<EclipseLinkObjectTypeConverter> listIterator_() {
- return this.subject.objectTypeConverters();
- }
-
- @Override
- protected int size_() {
- return this.subject.objectTypeConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkStructConverter> buildStructConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterHolder, EclipseLinkStructConverter>(
- getSubjectHolder(),
- EclipseLinkConverterHolder.STRUCT_CONVERTERS_LIST)
- {
- @Override
- protected ListIterator<EclipseLinkStructConverter> listIterator_() {
- return this.subject.structConverters();
- }
-
- @Override
- protected int size_() {
- return this.subject.structConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkTypeConverter> buildTypeConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterHolder, EclipseLinkTypeConverter>(
- getSubjectHolder(),
- EclipseLinkConverterHolder.TYPE_CONVERTERS_LIST)
- {
- @Override
- protected ListIterator<EclipseLinkTypeConverter> listIterator_() {
- return this.subject.typeConverters();
- }
-
- @Override
- protected int size_() {
- return this.subject.typeConvertersSize();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomConverter> buildCustomConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkCustomConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkCustomConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkConverter.CUSTOM_CONVERTER ? (EclipseLinkCustomConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkObjectTypeConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkObjectTypeConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkConverter.OBJECT_TYPE_CONVERTER ? (EclipseLinkObjectTypeConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkStructConverter> buildStructConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkStructConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkStructConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkConverter.STRUCT_CONVERTER ? (EclipseLinkStructConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkTypeConverter> buildTypeConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkTypeConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkTypeConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkConverter.TYPE_CONVERTER ? (EclipseLinkTypeConverter) value : null;
- }
- };
- }
-
- private ILabelProvider buildConvertersListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((EclipseLinkConverter) element).getName();
- }
- };
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.listPane.enableWidgets(enabled);
- }
-
- //TODO need to check the converter repository for this, should check all converters, except for the override case, hmm
- //we at least need to check typeconverters, converters, structconverters, and objectypeconverters, on this particular
- //object. or we need to give a warning about the case where you are overriding or an error if it's not an override?
- private Iterator<String> converterNames() {
- return new TransformationIterator<EclipseLinkCustomConverter, String>(getSubject().customConverters()) {
- @Override
- protected String transform(EclipseLinkCustomConverter next) {
- return next.getName();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index 63365320bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java
+++ /dev/null
@@ -1,103 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkEmbeddableAdvancedComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.orm.MetadataCompleteComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmJavaClassChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class OrmEclipseLinkEmbeddableComposite<T extends OrmEclipseLinkEmbeddable>
- extends AbstractEmbeddableComposite<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</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
- */
- public OrmEclipseLinkEmbeddableComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<T, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
- protected void initializeConvertersCollapsibleSection(Composite container) {
-
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolder());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterHolder> converterHolder) {
- new OrmEclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<EclipseLinkConverterHolder> buildConverterHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkConverterHolder>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterHolder buildValue_() {
- return this.subject.getConverterHolder();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEmbeddableAdvancedComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java
deleted file mode 100644
index ede8d0d13b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEntityComposite extends AbstractOrmEclipseLinkEntityComposite
-{
- public OrmEclipseLinkEntityComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java
deleted file mode 100644
index ec4c2c7526..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.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.eclipselink.ui.internal.details.orm;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | x Existence Checking: | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see CachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class OrmEclipseLinkExistenceCheckingComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>ExistenceCheckingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmEclipseLinkExistenceCheckingComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_label,
- addExistenceCheckingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType> addExistenceCheckingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_EXISTENCE_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_EXISTENCE_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkExistenceType[] getChoices() {
- return EclipseLinkExistenceType.values();
- }
-
- @Override
- protected EclipseLinkExistenceType getDefaultValue() {
- return getSubject().getDefaultExistenceType();
- }
-
- @Override
- protected String displayString(EclipseLinkExistenceType value) {
- return buildDisplayString(
- EclipseLinkUiDetailsMessages.class,
- OrmEclipseLinkExistenceCheckingComposite.this,
- value
- );
- }
-
- @Override
- protected EclipseLinkExistenceType getValue() {
- return getSubject().getSpecifiedExistenceType();
- }
-
- @Override
- protected void setValue(EclipseLinkExistenceType value) {
- getSubject().setSpecifiedExistenceType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java
deleted file mode 100644
index 263c07987c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java
+++ /dev/null
@@ -1,49 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-//Remove the Converters section from 1.0 orm id mappings.
-//This is supported in EclipseLink in version 1.1, but not 1.0
-public class OrmEclipseLinkIdMappingComposite
- extends EclipseLinkIdMappingComposite<OrmIdMapping>
-{
- public OrmEclipseLinkIdMappingComposite(
- PropertyValueModel<? extends OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java
deleted file mode 100644
index 8e8d4a266f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToManyMappingComposite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToManyMappingComposite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java
deleted file mode 100644
index 8c19987320..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToOneMappingComposite
- extends EclipseLinkManyToOneMappingComposite<OrmManyToOneMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToOneMappingComposite(PropertyValueModel<? extends OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 1360123524..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclassComposite<T extends OrmEclipseLinkMappedSuperclass>
- extends AbstractOrmEclipseLinkMappedSuperclassComposite<T>
-{
- public OrmEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java
deleted file mode 100644
index d25223b5fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMappingComposite
- extends EclipseLinkOneToManyMappingComposite<OrmOneToManyMapping>
-{
- public OrmEclipseLinkOneToManyMappingComposite(
- PropertyValueModel<? extends OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmOneToManyMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java
deleted file mode 100644
index 61fae41ce3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OneToOneJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AccessTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OneToOneJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkPrivateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see AccessTypeComposite
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkPrivateOwnedComposite
- * @see FetchTypeComposite
- * @see MappedByPane
- * @see OneToOneJoiningStrategyPane
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkOneToOneMappingComposite
-extends EclipseLinkOneToOneMappingComposite<OrmOneToOneMapping>
-{
- /**
- * Creates a new <code>Eclipselink1_1OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkOneToOneMappingComposite(PropertyValueModel<? extends OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index 2b233b892d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkTransformationMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkTransformationMappingUiDefinition
- extends AbstractEclipseLinkTransformationMappingUiDefinition<PersistentAttribute, OrmEclipseLinkTransformationMapping>
- implements OrmAttributeMappingUiDefinition<OrmEclipseLinkTransformationMapping>
-{
- // singleton
- private static final OrmEclipseLinkTransformationMappingUiDefinition INSTANCE =
- new OrmEclipseLinkTransformationMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEclipseLinkTransformationMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index f8e8a0426d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.AbstractEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractEclipseLinkVariableOneToOneMappingUiDefinition<PersistentAttribute, OrmEclipseLinkVariableOneToOneMapping>
- implements OrmAttributeMappingUiDefinition<OrmEclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final OrmEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new OrmEclipseLinkVariableOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java
deleted file mode 100644
index 5ee4e75d7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java
+++ /dev/null
@@ -1,54 +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.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-//Remove the Converters section from 1.0 orm version mappings.
-//This is supported in EclipseLink in version 1.1, but not 1.0
-public class OrmEclipseLinkVersionMappingComposite extends EclipseLinkVersionMappingComposite<OrmVersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkVersionMappingComposite(PropertyValueModel<? extends OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
-
- @Override
- //everything but the 'Define Converter' section. This is not supported in eclipselink 1.0, but is in 1.1
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new OrmEclipseLinkConvert1_0Composite(convertHolder, container, getWidgetFactory());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
deleted file mode 100644
index 1f53e72c1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
+++ /dev/null
@@ -1,55 +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.eclipselink.ui.internal.persistence;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkPersistenceResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkPersistenceXmlUiDefinition extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new EclipseLinkPersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkPersistenceResourceModelStructureProvider.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java
deleted file mode 100644
index f15882882f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,215 +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.eclipselink.ui.internal.persistence;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.connection.PersistenceXmlConnectionTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.customization.PersistenceXmlCustomizationTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.schema.generation.PersistenceXmlSchemaGenerationTab;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkPersistenceXmlUiFactory implements PersistenceXmlUiFactory
-{
- // ********** constructors **********
-
- public EclipseLinkPersistenceXmlUiFactory() {
- super();
- }
-
- // **************** persistence unit composites ****************************
-
- public ListIterator<JpaPageComposite> createPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- ArrayList<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(8);
-
- PropertyValueModel<EclipseLinkPersistenceUnit> eclipseLinkPersistenceUnitHolder =
- this.buildEclipseLinkPersistenceUnitHolder(subjectHolder);
-
- pages.add(this.buildGeneralTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildConnectionTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildCustomizationTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildCachingTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildLoggingTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildOptionsTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildSchemaGenerationTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildPropertiesTab(subjectHolder, parent, widgetFactory));
-
- return pages.listIterator();
- }
-
- // ********** persistence unit tabs **********
-
- protected EclipseLinkPersistenceUnitGeneralComposite buildGeneralTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkPersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlConnectionTab<? extends Connection> buildConnectionTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Connection> connectionHolder = this.buildConnectionHolder(subjectHolder);
-
- return new PersistenceXmlConnectionTab<Connection>(connectionHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlCustomizationTab buildCustomizationTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Customization> customizationHolder = this.buildCustomizationHolder(subjectHolder);
-
- return new PersistenceXmlCustomizationTab(customizationHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlCachingTab<? extends Caching> buildCachingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Caching> cachingHolder = this.buildCachingHolder(subjectHolder);
-
- return new PersistenceXmlCachingTab<Caching>(cachingHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlLoggingTab<? extends Logging> buildLoggingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Logging> loggingHolder = this.buildLoggingHolder(subjectHolder);
-
- return new PersistenceXmlLoggingTab<Logging>(loggingHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlOptionsTab<? extends Options> buildOptionsTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Options> optionsHolder = this.buildOptionsHolder(subjectHolder);
-
- return new PersistenceXmlOptionsTab<Options>(optionsHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlSchemaGenerationTab buildSchemaGenerationTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<SchemaGeneration> schemaGenHolder = this.buildSchemaGenerationHolder(subjectHolder);
-
- return new PersistenceXmlSchemaGenerationTab(schemaGenHolder, parent, widgetFactory);
- }
-
- protected PersistenceUnitPropertiesComposite buildPropertiesTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory);
- }
-
- // ********** private methods **********
-
- private PropertyValueModel<EclipseLinkPersistenceUnit> buildEclipseLinkPersistenceUnitHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, EclipseLinkPersistenceUnit>(subjectHolder) {
- @Override
- protected EclipseLinkPersistenceUnit transform_(PersistenceUnit value) {
- return (EclipseLinkPersistenceUnit) value;
- }
- };
- }
-
- private PropertyValueModel<Connection> buildConnectionHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Connection>(subjectHolder) {
- @Override
- protected Connection transform_(PersistenceUnit value) {
-
- return ((EclipseLinkPersistenceUnit)value).getConnection();
- }
- };
- }
-
- private PropertyValueModel<Customization> buildCustomizationHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Customization>(subjectHolder) {
- @Override
- protected Customization transform_(EclipseLinkPersistenceUnit value) {
- return value.getCustomization();
- }
- };
- }
-
- protected PropertyValueModel<Caching> buildCachingHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Caching>(subjectHolder) {
- @Override
- protected Caching transform_(EclipseLinkPersistenceUnit value) {
- return value.getCaching();
- }
- };
- }
-
- private PropertyValueModel<Logging> buildLoggingHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Logging>(subjectHolder) {
- @Override
- protected Logging transform_(EclipseLinkPersistenceUnit value) {
- return value.getLogging();
- }
- };
- }
-
- private PropertyValueModel<Options> buildOptionsHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Options>(subjectHolder) {
- @Override
- protected Options transform_(PersistenceUnit value) {
-
- return ((EclipseLinkPersistenceUnit)value).getOptions();
- }
- };
- }
-
- private PropertyValueModel<SchemaGeneration> buildSchemaGenerationHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, SchemaGeneration>(subjectHolder) {
- @Override
- protected SchemaGeneration transform_(EclipseLinkPersistenceUnit value) {
- return value.getSchemaGeneration();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java
deleted file mode 100644
index 8a878321e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java
+++ /dev/null
@@ -1,55 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheDefaultsComposite
- */
-public class CacheDefaultsComposite<T extends Caching> extends Pane<T>
-{
- public CacheDefaultsComposite(Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- this.initializeCacheDefaultsPane(parent);
- }
-
- protected void initializeCacheDefaultsPane(Composite parent) {
-
- Composite defaultPane = this.addTitledGroup(
- parent,
- EclipseLinkUiMessages.CacheDefaultsComposite_groupTitle
- );
-
- this.initializeCacheDefaultsComposites(defaultPane);
- }
-
- protected void initializeCacheDefaultsComposites(Composite parent) {
-
- // Default Cache Type
- new DefaultCacheTypeComposite(this, parent);
-
- // Default Cache Size
- new DefaultCacheSizeComposite<T>(this, parent);
-
- // Default Shared Cache
- new DefaultSharedCacheComposite(this, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java
deleted file mode 100644
index 936de3acd8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java
+++ /dev/null
@@ -1,109 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheSizeComposite
- */
-public class CacheSizeComposite extends Pane<Entity>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CacheSizeComposite(Pane<Entity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addCacheSizeCombo(container);
- }
-
- private void addCacheSizeCombo(Composite container) {
- new IntegerCombo<Entity>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.CacheSizeComposite_cacheSize;
- }
-
- @Override
- protected String getHelpId() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(buildCachingHolder(), Caching.CACHE_SIZE_DEFAULT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- Integer value = this.subject.getCacheSizeDefault();
- if (value == null) {
- value = this.subject.getDefaultCacheSizeDefault();
- }
- return value;
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Entity, Integer>(this.getSubjectHolder(), Entity.CACHE_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return getSubjectParent().getCacheSizeOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(Integer value) {
- getSubjectParent().setCacheSizeOf(getSubjectName(), value);
- }
- };
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<Entity, Caching>(this.getSubjectHolder()) {
- @Override
- protected Caching transform_(Entity value) {
- return value.getParent();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java
deleted file mode 100644
index 1ebfc9d4b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java
+++ /dev/null
@@ -1,171 +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.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheTypeComposite
- */
-public class CacheTypeComposite extends Pane<Entity>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CacheTypeComposite(Pane<Entity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_cacheTypeLabel,
- new CacheTypeCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-
- private class CacheTypeCombo extends EnumFormComboViewer<Entity, CacheType> {
-
- private CacheTypeCombo(Composite parent) {
- super(CacheTypeComposite.this, parent);
- }
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Entity.CACHE_TYPE_PROPERTY);
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<Entity, Caching>(getSubjectHolder()) {
- @Override
- protected Caching transform_(Entity value) {
- return value.getParent();
- }
- };
- }
-
- private PropertyValueModel<CacheType> buildDefaultCacheTypeHolder() {
- return new PropertyAspectAdapter<Caching, CacheType>(buildCachingHolder(), Caching.CACHE_TYPE_DEFAULT_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- CacheType cacheType = subject.getCacheTypeDefault();
- if (cacheType == null) {
- cacheType = subject.getDefaultCacheTypeDefault();
- }
- return cacheType;
- }
- };
- }
-
- private PropertyChangeListener buildDefaultCachingTypePropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildDefaultCachingTypePropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildDefaultCachingTypePropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if ((e.getNewValue() != null) && !getCombo().isDisposed()) {
- CacheTypeCombo.this.doPopulate();
- }
- }
- };
- }
-
- @Override
- protected CacheType[] getChoices() {
- return CacheType.values();
- }
-
- @Override
- protected CacheType getDefaultValue() {
- return getSubjectParent().getDefaultCacheType();
- }
-
- @Override
- protected String displayString(CacheType value) {
- return buildDisplayString(
- EclipseLinkUiMessages.class,
- CacheTypeComposite.this,
- value
- );
- }
-
- @Override
- protected void doPopulate() {
- // This is required to allow the class loader to let the listener
- // written above to access this method
- super.doPopulate();
- }
-
- @Override
- protected CacheType getValue() {
- return getSubjectParent().getCacheTypeOf(getSubjectName());
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- PropertyValueModel<CacheType> defaultCacheTypeHolder =
- buildDefaultCacheTypeHolder();
-
- defaultCacheTypeHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildDefaultCachingTypePropertyChangeListener()
- );
- }
-
- @Override
- protected void setValue(CacheType value) {
- getSubjectParent().setCacheTypeOf(getSubjectName(), value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java
deleted file mode 100644
index 5d745a6da3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java
+++ /dev/null
@@ -1,88 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheSizeComposite
- */
-public class DefaultCacheSizeComposite<T extends Caching> extends Pane<T>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultCacheSizeComposite(Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addDefaultCacheSizeCombo(container);
- }
-
- private void addDefaultCacheSizeCombo(Composite container) {
- new IntegerCombo<Caching>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.DefaultCacheSizeComposite_defaultCacheSize;
- }
-
- @Override
- protected String getHelpId() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_SIZE;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultCacheSizeDefault();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(getSubjectHolder(), Caching.CACHE_SIZE_DEFAULT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getCacheSizeDefault();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setCacheSizeDefault(value);
- }
- };
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java
deleted file mode 100644
index 55de0096eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.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.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DefaultCacheTypeComposite
- */
-public class DefaultCacheTypeComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>DefaultCacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultCacheTypeComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Caching, CacheType> buildDefaultCacheTypeCombo(Composite container) {
- return new EnumFormComboViewer<Caching, CacheType>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Caching.CACHE_TYPE_DEFAULT_PROPERTY);
- }
-
- @Override
- protected CacheType[] getChoices() {
- return CacheType.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected CacheType getDefaultValue() {
- return getSubject().getDefaultCacheTypeDefault();
- }
-
- @Override
- protected String displayString(CacheType value) {
- return buildDisplayString(EclipseLinkUiMessages.class, DefaultCacheTypeComposite.this, value);
- }
-
- @Override
- protected CacheType getValue() {
- return getSubject().getCacheTypeDefault();
- }
-
- @Override
- protected void setValue(CacheType value) {
- getSubject().setCacheTypeDefault(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultCacheTypeLabel,
- this.buildDefaultCacheTypeCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java
deleted file mode 100644
index 5e34a1851e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java
+++ /dev/null
@@ -1,95 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DefaultShareCacheComposite
- */
-public class DefaultSharedCacheComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>DefaultShareCacheComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultSharedCacheComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheDefaultLabel,
- this.buildDefaultSharedCacheHolder(),
- this.buildDefaultSharedCacheStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_SHARED
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(getSubjectHolder(), Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheDefault();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSharedCacheDefault(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultSharedCacheStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultDefaultSharedCacheHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheDefaultLabel;
- }
- };
- }
- private PropertyValueModel<Boolean> buildDefaultDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(
- getSubjectHolder(),
- Caching.SHARED_CACHE_DEFAULT_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSharedCacheDefault() != null) {
- return null;
- }
- return this.subject.getDefaultSharedCacheDefault();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
deleted file mode 100644
index a2c502f4ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkCachingComposite
- */
-public class EclipseLinkCachingComposite<T extends Caching> extends Pane<T>
-{
- public EclipseLinkCachingComposite(Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- Composite container = this.addSection(
- parent,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionDescription
- );
-
- // Defaults
- new CacheDefaultsComposite<T>(this, container);
- // EntitiesList
- new EntityListComposite<T>(this, container);
- // Flush Clear Cache
- new FlushClearCacheComposite(this, container);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java
deleted file mode 100644
index b658f03dbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-public class EntityCachingPropertyComposite extends Pane<Entity> {
-
- /**
- * Creates a new <code>EntityCachingPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public EntityCachingPropertyComposite(Pane<? extends Caching> parentComposite,
- PropertyValueModel<Entity> subjectHolder,
- Composite parent) {
-
- super(parentComposite, subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Cache Type
- new CacheTypeComposite(this, container);
-
- // Cache Size
- new CacheSizeComposite(this, container);
-
- // Share Cache
- new SharedCacheComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityListComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityListComposite.java
deleted file mode 100644
index a0f315abf5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/EntityListComposite.java
+++ /dev/null
@@ -1,212 +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.eclipselink.ui.internal.persistence.caching;
-
-import java.util.ListIterator;
-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.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.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.ui.JptEclipseLinkUiPlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * EntityListComposite
- */
-public class EntityListComposite<T extends Caching> extends Pane<T>
-{
- WritablePropertyValueModel<Entity> entityHolder;
-
- public EntityListComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.entityHolder = this.buildEntityHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- container,
- EclipseLinkUiMessages.CachingEntityListComposite_groupTitle
- );
-
- // Entities add/remove list pane
- new AddRemoveListPane<Caching>(
- this,
- container,
- this.buildEntitiesAdapter(),
- this.buildEntitiesListHolder(),
- this.entityHolder,
- this.buildEntityLabelProvider(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
-
- // Entity Caching property pane
- EntityCachingPropertyComposite pane = new EntityCachingPropertyComposite(
- this,
- this.entityHolder,
- container
- );
- this.installPaneEnabler(this.entityHolder, pane);
- }
-
- private AddRemoveListPane.Adapter buildEntitiesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EntityListComposite.this.addEntities(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Caching caching = getSubject();
- for (Object item : listSelectionModel.selectedValues()) {
- Entity entityCaching = (Entity) item;
- caching.removeEntity(entityCaching.getName());
- }
- }
- };
- }
-
- private void addEntities(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseEntity();
-
- if (type != null) {
- String entityName = this.getEntityName(type.getFullyQualifiedName());
- if (entityName == null) {
- entityName = type.getElementName();
- }
-
- if( ! this.getSubject().entityExists(entityName)) {
- this.getSubject().addEntity(entityName);
- int index = CollectionTools.indexOf(this.getSubject().entityNames(), entityName);
- Entity entity = (Entity) listSelectionModel.getListModel().getElementAt(index);
- listSelectionModel.setSelectedValue(entity);
- this.entityHolder.setValue(entity);
- }
- }
- }
-
- private String getEntityName(String fullyQualifiedTypeName) {
-
- org.eclipse.jpt.core.context.Entity entity = getSubject().getPersistenceUnit().getEntity(fullyQualifiedTypeName);
- return (entity != null) ? entity.getName() : null;
- }
-
- private IType chooseEntity() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptEclipseLinkUiPlugin.log(e);
- return null;
- }
- typeSelectionDialog.setTitle(EclipseLinkUiMessages.CachingEntityListComposite_dialogTitle);
- typeSelectionDialog.setMessage(EclipseLinkUiMessages.CachingEntityListComposite_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- private ILabelProvider buildEntityLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- Entity entityCaching = (Entity) element;
- return entityCaching.getName();
- }
- };
- }
-
- private WritablePropertyValueModel<Entity> buildEntityHolder() {
- return new SimplePropertyValueModel<Entity>();
- }
-
- private ListValueModel<Entity> buildEntitiesListHolder() {
- return new ListAspectAdapter<Caching, Entity>(
- this.getSubjectHolder(), Caching.ENTITIES_LIST) {
- @Override
- protected ListIterator<Entity> listIterator_() {
- return this.subject.entities();
- }
- @Override
- protected int size_() {
- return this.subject.entitiesSize();
- }
- };
- }
-
- private void installPaneEnabler(WritablePropertyValueModel<Entity> entityHolder,
- EntityCachingPropertyComposite pane) {
-
- new PaneEnabler(
- this.buildPaneEnablerHolder(entityHolder),
- pane
- );
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder(WritablePropertyValueModel<Entity> entityHolder) {
- return new TransformationPropertyValueModel<Entity, Boolean>(entityHolder) {
- @Override
- protected Boolean transform_(Entity value) {
- return value.entityNameIsValid();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
deleted file mode 100644
index 5b37dd0160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
+++ /dev/null
@@ -1,91 +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.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.FlushClearCache;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * FlushClearCacheComposite
- */
-public class FlushClearCacheComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>FlushClearCacheComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public FlushClearCacheComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLabeledComposite(
- parent,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_FlushClearCacheLabel,
- this.addFlushClearCacheCombo(parent),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-
- private EnumFormComboViewer<Caching, FlushClearCache> addFlushClearCacheCombo(Composite container) {
- return new EnumFormComboViewer<Caching, FlushClearCache>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Caching.FLUSH_CLEAR_CACHE_PROPERTY);
- }
-
- @Override
- protected FlushClearCache[] getChoices() {
- return FlushClearCache.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected FlushClearCache getDefaultValue() {
- return this.getSubject().getDefaultFlushClearCache();
- }
-
- @Override
- protected String displayString(FlushClearCache value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, FlushClearCacheComposite.class, value);
- }
-
- @Override
- protected FlushClearCache getValue() {
- return this.getSubject().getFlushClearCache();
- }
-
- @Override
- protected void setValue(FlushClearCache value) {
- this.getSubject().setFlushClearCache(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java
deleted file mode 100644
index 6aea5bf154..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java
+++ /dev/null
@@ -1,87 +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.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCachingTab
- */
-public class PersistenceXmlCachingTab<T extends Caching>
- extends Pane<T>
- implements JpaPageComposite
-{
- public PersistenceXmlCachingTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new EclipseLinkCachingComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_title;
- }
-
- // ********** Layout **********
-
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java
deleted file mode 100644
index 1540bd7fb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java
+++ /dev/null
@@ -1,164 +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.eclipselink.ui.internal.persistence.caching;
-
-import java.util.ArrayList;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SharedCacheComposite
- */
-public class SharedCacheComposite extends Pane<Entity>
-{
- private TriStateCheckBox sharedCacheCheckBox;
-
- /**
- * Creates a new <code>ShareCacheComposite</code>.
- *
- * @param parentController The parent container of this one
- * @param parent The parent container
- */
- public SharedCacheComposite(Pane<Entity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<Entity, Caching>(this.getSubjectHolder()) {
- @Override
- protected Caching transform_(Entity value) {
- return value.getParent();
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultAndNonDefaultSharedCacheHolder() {
- return new ListPropertyValueModelAdapter<Boolean>(
- buildDefaultAndNonDefaultSharedCacheListHolder()
- ) {
- @Override
- protected Boolean buildValue() {
- // If the number of ListValueModel equals 1, that means the shared
- // Cache properties is not set (partially selected), which means we
- // want to see the default value appended to the text
- if (this.listHolder.size() == 1) {
- return (Boolean) this.listHolder.listIterator().next();
- }
- return null;
- }
- };
- }
-
- private ListValueModel<Boolean> buildDefaultAndNonDefaultSharedCacheListHolder() {
- ArrayList<ListValueModel<Boolean>> holders = new ArrayList<ListValueModel<Boolean>>(2);
- holders.add(buildSharedCacheListHolder());
- holders.add(buildDefaultSharedCacheListHolder());
-
- return new CompositeListValueModel<ListValueModel<Boolean>, Boolean>(
- holders
- );
- }
-
- private PropertyValueModel<Boolean> buildDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(buildCachingHolder(), Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Boolean value = this.subject.getSharedCacheDefault();
- if (value == null) {
- value = this.subject.getDefaultSharedCacheDefault();
- }
- return value;
- }
- };
- }
-
- private ListValueModel<Boolean> buildDefaultSharedCacheListHolder() {
- return new PropertyListValueModelAdapter<Boolean>(
- buildDefaultSharedCacheHolder()
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildSharedCacheHolder() {
- return new PropertyAspectAdapter<Entity, Boolean>(
- getSubjectHolder(), Entity.SHARED_CACHE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return getSubjectParent().getSharedCacheOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- getSubjectParent().setSharedCacheOf(getSubjectName(), value);
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- private ListValueModel<Boolean> buildSharedCacheListHolder() {
- return new PropertyListValueModelAdapter<Boolean>(
- buildSharedCacheHolder()
- );
- }
-
- private PropertyValueModel<String> buildSharedCacheStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultAndNonDefaultSharedCacheHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultSharedCacheLabel, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheLabel;
- }
- };
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.sharedCacheCheckBox.setEnabled(enabled);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.sharedCacheCheckBox = this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheLabel,
- this.buildSharedCacheHolder(),
- this.buildSharedCacheStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java
deleted file mode 100644
index d9dcd01e34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.BatchWriting;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * BatchWritingComposite
- */
-public class BatchWritingComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>BatchWritingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public BatchWritingComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Connection, BatchWriting> addBatchWritingCombo(Composite container) {
- return new EnumFormComboViewer<Connection, BatchWriting>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Connection.BATCH_WRITING_PROPERTY);
- }
-
- @Override
- protected BatchWriting[] getChoices() {
- return BatchWriting.values();
- }
-
- @Override
- protected BatchWriting getDefaultValue() {
- return getSubject().getDefaultBatchWriting();
- }
-
- @Override
- protected String displayString(BatchWriting value) {
- return buildDisplayString(EclipseLinkUiMessages.class, BatchWritingComposite.this, value);
- }
-
- @Override
- protected BatchWriting getValue() {
- return getSubject().getBatchWriting();
- }
-
- @Override
- protected void setValue(BatchWriting value) {
- getSubject().setBatchWriting(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_batchWritingLabel,
- this.addBatchWritingCombo( container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
deleted file mode 100644
index a0a2a52fab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
+++ /dev/null
@@ -1,135 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheStatementsPropertiesComposite
- */
-public class CacheStatementsPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public CacheStatementsPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- WritablePropertyValueModel<Boolean> cacheStatementsHolder = buildCacheStatementsHolder();
-
- container = this.addSubPane(container, 3, 5, 0, 0, 0);
-
- this.addTriStateCheckBox(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_cacheStatementsLabel,
- cacheStatementsHolder,
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- IntegerCombo<?> combo = addCacheStatementsSizeCombo(container);
-
- this.installControlEnabler(cacheStatementsHolder, combo);
- }
-
- private WritablePropertyValueModel<Boolean> buildCacheStatementsHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.CACHE_STATEMENTS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getCacheStatements();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setCacheStatements(value);
- }
-
- @Override
- protected void subjectChanged() {
- Object oldValue = this.getValue();
- super.subjectChanged();
- Object newValue = this.getValue();
-
- // Make sure the default value is appended to the text
- if (oldValue == newValue && newValue == null) {
- this.fireAspectChanged(Boolean.TRUE, newValue);
- }
- }
- };
- }
-
- private IntegerCombo<Connection> addCacheStatementsSizeCombo(Composite container) {
- return new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected Combo addIntegerCombo(Composite container) {
- return this.addEditableCombo(
- container,
- buildDefaultListHolder(),
- buildSelectedItemStringHolder(),
- StringConverter.Default.<String>instance());
- }
-
- @Override
- protected String getLabelText() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultCacheStatementsSize();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.CACHE_STATEMENTS_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getCacheStatementsSize();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setCacheStatementsSize(value);
- }
- };
- }
- };
- }
-
- private void installControlEnabler(WritablePropertyValueModel<Boolean> cacheStatementsHolder, IntegerCombo<?> combo) {
-
- new PaneEnabler(cacheStatementsHolder, combo);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java
deleted file mode 100644
index e173e28e13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,45 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ConnectionPropertiesComposite
- */
-public class ConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public ConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addTitledGroup(
- container,
- EclipseLinkUiMessages.ConnectionPropertiesComposite_Database_GroupBox
- );
-
- // Data source
- new DataSourcePropertiesComposite<T>(this, container);
- // EclipseLink Connection Pool
- new JdbcPropertiesComposite<T>(this, container);
- // Exclusive Connections
- new JdbcExclusiveConnectionsPropertiesComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java
deleted file mode 100644
index d65753ae53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java
+++ /dev/null
@@ -1,146 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-public class DataSourcePropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>DataSourcePropertiesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DataSourcePropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private WritablePropertyValueModel<String> buildJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(buildPersistenceUnitHolder(), PersistenceUnit.JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(this.transform2(value));
- }
- private boolean transform2(PersistenceUnitTransactionType value) {
- return value == null || value == PersistenceUnitTransactionType.JTA;
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildNonJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(buildPersistenceUnitHolder(), PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getNonJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setNonJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildNonJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(value == PersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- container = addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // JTA Data Source
- PropertyValueModel<Boolean> jtaEnabled = this.buildJTADataSourceHolder();
- Label jtaLabel = addLabel(container, EclipseLinkUiMessages.PersistenceXmlConnectionTab_jtaDataSourceLabel, jtaEnabled);
- Text jtaText = addText(container, this.buildJtaDataSourceHolder(), this.getHelpID(), jtaEnabled);
- this.addLabeledComposite(container, jtaLabel, jtaText, this.getHelpID());
-
- // Non-JTA Data Source
- PropertyValueModel<Boolean> nonJtaEnabled = this.buildNonJTADataSourceHolder();
- Label nonJtaLabel = addLabel(container, EclipseLinkUiMessages.PersistenceXmlConnectionTab_nonJtaDataSourceLabel, nonJtaEnabled);
- Text nonJtaText = addText(container, buildNonJtaDataSourceHolder(), this.getHelpID(), nonJtaEnabled);
- this.addLabeledComposite(container, nonJtaLabel, nonJtaText, this.getHelpID());
- }
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java
deleted file mode 100644
index a0155e742f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java
+++ /dev/null
@@ -1,55 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkConnectionComposite
- */
-public class EclipseLinkConnectionComposite<T extends Connection>
- extends Pane<T>
-{
- public EclipseLinkConnectionComposite(
- Pane<T> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin() * 2;
-
- container = addSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_sectionDescription
- );
-
- Composite subPane = addSubPane(
- container,
- 0, groupBoxMargin, 10, groupBoxMargin
- );
-
- new TransactionTypeComposite<T>(this, subPane);
-
- new BatchWritingComposite<T>(this, subPane);
-
- new CacheStatementsPropertiesComposite<T>(this, subPane);
-
- new NativeSqlComposite<T>(this, subPane);
-
- new ConnectionPropertiesComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java
deleted file mode 100644
index 10f2e9c9ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcBindParametersComposite
- */
-public class JdbcBindParametersComposite extends Pane<Connection>
-{
- /**
- * Creates a new <code>JdbcBindParametersComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcBindParametersComposite(
- Pane<? extends Connection> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabel,
- this.buildBindParametersHolder(),
- this.buildBindParametersStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildBindParametersHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.BIND_PARAMETERS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getBindParameters();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setBindParameters(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildBindParametersStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultBindParametersHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultBindParametersHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.BIND_PARAMETERS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getBindParameters() != null) {
- return null;
- }
- return this.subject.getDefaultBindParameters();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java
deleted file mode 100644
index a34aa45f8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,344 +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.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Comparator;
-
-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.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
-
-/**
- * JdbcConnectionPropertiesComposite
- */
-@SuppressWarnings("nls")
-public class JdbcConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * The constant ID used to retrieve the dialog settings.
- */
- private static final String DIALOG_SETTINGS = "org.eclipse.jpt.eclipselink.ui.dialogs.ConnectionDialog";
-
- public JdbcConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private WritablePropertyValueModel<String> buildPasswordHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.PASSWORD_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getPassword();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setPassword(value);
- }
- };
- }
-
- private Runnable buildPopulateFromConnectionAction() {
- return new Runnable() {
- public void run() {
- promptConnection();
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildUrlHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.URL_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getUrl();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setUrl(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildUserHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.USER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getUser();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setUser(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Populate from Connection hyperlink
- this.addHyperlink(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink,
- buildPopulateFromConnectionAction()
- );
-
- // Driver
- new JdbcDriverComposite(this, container);
-
- // Url
- this.addLabeledText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_urlLabel,
- buildUrlHolder()
- );
-
- // User
- this.addLabeledText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_userLabel,
- buildUserHolder()
- );
-
- // Password
- this.addLabeledPasswordText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_passwordLabel,
- buildPasswordHolder()
- );
-
- // Bind Parameters
- new JdbcBindParametersComposite(this, container);
- }
-
- void promptConnection() {
-
- ConnectionSelectionDialog dialog = new ConnectionSelectionDialog();
-
- if (dialog.open() != IDialogConstants.OK_ID) {
- return;
- }
-
- String name = (String) dialog.getResult()[0];
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(name);
-
- Connection connection = getSubject();
- connection.setUrl((cp == null) ? "" : cp.getURL());
- connection.setUser((cp == null) ? "" : cp.getUserName());
- connection.setPassword((cp == null) ? "" : cp.getUserPassword());
- connection.setDriver((cp == null) ? "" : cp.getDriverClassName());
- }
-
- ConnectionProfileFactory getConnectionProfileFactory() {
- // we allow the user to select any connection profile and simply
- // take the settings from it (user, password, etc.) and give them
- // to the EclipseLink connection, so we go
- // to the db plug-in directly to get the factory
- return JptDbPlugin.instance().getConnectionProfileFactory();
- }
-
- // broaden access a bit
- Shell getShell_() {
- return this.getShell();
- }
-
- /**
- * This dialog shows the list of possible connection names and lets the user
- * the option to filter them using a search field.
- */
- protected class ConnectionSelectionDialog extends FilteredItemsSelectionDialog {
-
- /**
- * Creates a new <code>MappingSelectionDialog</code>.
- */
- protected ConnectionSelectionDialog() {
- super(JdbcConnectionPropertiesComposite.this.getShell_(), false);
- setMessage(EclipseLinkUiMessages.JdbcConnectionPropertiesComposite_ConnectionDialog_Message);
- setTitle(EclipseLinkUiMessages.JdbcConnectionPropertiesComposite_ConnectionDialog_Title);
- setListLabelProvider(buildLabelProvider());
- setDetailsLabelProvider(buildLabelProvider());
- }
-
- protected ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- return (element == null) ? "" : element.toString();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Control createExtendedContentArea(Composite parent) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ItemsFilter createFilter() {
- return new ConnectionItemsFilter();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void fillContentProvider(AbstractContentProvider provider,
- ItemsFilter itemsFilter,
- IProgressMonitor monitor) throws CoreException {
-
- monitor.beginTask(null, -1);
-
- try {
- // Add the connection names to the dialog
- for (String name : this.getConnectionProfileNames()) {
- provider.add(name, itemsFilter);
- }
- }
- finally {
- monitor.done();
- }
- }
-
- private Iterable<String> getConnectionProfileNames() {
- return JdbcConnectionPropertiesComposite.this.getConnectionProfileFactory().getConnectionProfileNames();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected IDialogSettings getDialogSettings() {
-
- IDialogSettings dialogSettings = JptUiPlugin.instance().getDialogSettings();
- IDialogSettings settings = dialogSettings.getSection(DIALOG_SETTINGS);
-
- if (settings == null) {
- settings = dialogSettings.addNewSection(DIALOG_SETTINGS);
- }
-
- return settings;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getElementName(Object object) {
- return object.toString();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Comparator<String> getItemsComparator() {
- return new Comparator<String>() {
- public int compare(String item1, String item2) {
- return item1.compareTo(item2);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected IStatus validateItem(Object item) {
-
- if (item == null) {
- return new Status(IStatus.ERROR, JptUiPlugin.PLUGIN_ID, IStatus.ERROR, "", null);
- }
-
- return Status.OK_STATUS;
- }
-
- /**
- * Create the filter responsible to remove any connection name based on
- * the pattern entered in the text field.
- */
- private class ConnectionItemsFilter extends ItemsFilter {
-
- /**
- * Creates a new <code>ConnectionItemsFilter</code>.
- */
- ConnectionItemsFilter() {
-
- super();
-
- // Make sure that if the pattern is empty, we specify * in order
- // to show all the mapping types
- if (StringTools.stringIsEmpty(getPattern())) {
- patternMatcher.setPattern("*");
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean isConsistentItem(Object item) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean matchItem(Object item) {
- return matches(item.toString());
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java
deleted file mode 100644
index d4e5c297f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcDriverComposite
- */
-public class JdbcDriverComposite extends Pane<Connection>
-{
- /**
- * Creates a new <code>EventListenerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public JdbcDriverComposite(Pane<? extends Connection> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Connection> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Connection>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Connection, String>(
- this.getSubjectHolder(), Connection.DRIVER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDriver();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setDriver(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getDriver();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_driverLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
- @Override
- protected void setClassName(String className) {
- this.getSubject().setDriver(className);
- }
-
- @Override
- protected boolean allowTypeCreation() {
- //Does not make sense to allow the user to create a new Driver class
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java
deleted file mode 100644
index 34b5c48a8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.ExclusiveConnectionMode;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExclusiveConnectionModeComposite
- */
-public class JdbcExclusiveConnectionModeComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>ExclusiveConnectionModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcExclusiveConnectionModeComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_exclusiveConnectionModeLabel,
- this.addExclusiveConnectionModeCombo(container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private EnumFormComboViewer<Connection, ExclusiveConnectionMode> addExclusiveConnectionModeCombo(Composite container) {
- return new EnumFormComboViewer<Connection, ExclusiveConnectionMode>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY);
- }
-
- @Override
- protected ExclusiveConnectionMode[] getChoices() {
- return ExclusiveConnectionMode.values();
- }
-
- @Override
- protected ExclusiveConnectionMode getDefaultValue() {
- return this.getSubject().getDefaultExclusiveConnectionMode();
- }
-
- @Override
- protected String displayString(ExclusiveConnectionMode value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, JdbcExclusiveConnectionModeComposite.this, value);
- }
-
- @Override
- protected ExclusiveConnectionMode getValue() {
- return this.getSubject().getExclusiveConnectionMode();
- }
-
- @Override
- protected void setValue(ExclusiveConnectionMode value) {
- this.getSubject().setExclusiveConnectionMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java
deleted file mode 100644
index b6ab1b7270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcExclusiveConnectionsPropertiesComposite
- */
-public class JdbcExclusiveConnectionsPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcExclusiveConnectionsPropertiesComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- this.addSubPane(container, 10),
- EclipseLinkUiMessages.JdbcExclusiveConnectionsPropertiesComposite_GroupBox
- );
-
- // Exclusive connection mode
- new JdbcExclusiveConnectionModeComposite<T>(this, container);
-
- // Lazy Connection
- new JdbcLazyConnectionComposite<T>(this, container);
-
- this.installPaneEnabler();
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(this.buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return value == PersistenceUnitTransactionType.RESOURCE_LOCAL;
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- this.buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java
deleted file mode 100644
index 9eaebd0e36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcLazyConnectionComposite
- */
-public class JdbcLazyConnectionComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcLazyConnectionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcLazyConnectionComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabel,
- this.buildLazyConnectionHolder(),
- this.buildLazyConnectionStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildLazyConnectionHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(this.getSubjectHolder(), Connection.LAZY_CONNECTION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getLazyConnection();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setLazyConnection(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildLazyConnectionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultLazyConnectionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultLazyConnectionHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- this.getSubjectHolder(),
- Connection.LAZY_CONNECTION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getLazyConnection() != null) {
- return null;
- }
- return this.subject.getDefaultLazyConnection();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java
deleted file mode 100644
index 8fdb2d9604..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java
+++ /dev/null
@@ -1,90 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcPropertiesComposite
- */
-public class JdbcPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcPropertiesComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- this.addSubPane(container, 10),
- EclipseLinkUiMessages.JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox
- );
-
- // Connection Properties
- new JdbcConnectionPropertiesComposite<T>(this, container);
-
- container = this.addPane(container, new GridLayout(2, true));
-
- // Read Connection
- new JdbcReadConnectionPropertiesComposite<T>(this, container);
- // Write Connection
- new JdbcWriteConnectionPropertiesComposite<T>(this, container);
-
- this.installPaneEnabler();
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(this.buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return value == PersistenceUnitTransactionType.RESOURCE_LOCAL;
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- this.buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java
deleted file mode 100644
index b6cffe74a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,57 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionPropertiesComposite
- */
-public class JdbcReadConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcReadConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSubSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE) //exapanded
- );
-
- GridData data = (GridData) container.getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- data = (GridData) getControl().getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- // Read Connections Shared
- new JdbcReadConnectionsSharedComposite<T>(this, container);
-
- // Read Connections Minimum
- new JdbcReadConnectionsMinComposite<T>(this, container);
-
- // Read Connections Maximum
- new JdbcReadConnectionsMaxComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java
deleted file mode 100644
index 7567047e91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java
+++ /dev/null
@@ -1,88 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionsMaxComposite
- */
-public class JdbcReadConnectionsMaxComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcReadConnectionsMaxComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsMaxComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addReadConnectionsMaxCombo(container);
- }
-
- private void addReadConnectionsMaxCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsMaxLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultReadConnectionsMax();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.READ_CONNECTIONS_MAX_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getReadConnectionsMax();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setReadConnectionsMax(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java
deleted file mode 100644
index 2b4333624c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java
+++ /dev/null
@@ -1,87 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionsMinComposite
- */
-public class JdbcReadConnectionsMinComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcReadConnectionsMinComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsMinComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addReadConnectionsMinCombo(container);
- }
-
- private void addReadConnectionsMinCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsMinLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultReadConnectionsMin();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.READ_CONNECTIONS_MIN_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getReadConnectionsMin();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setReadConnectionsMin(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java
deleted file mode 100644
index 2bd8bd9bba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java
+++ /dev/null
@@ -1,98 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ReadConnectionsSharedComposite
- */
-public class JdbcReadConnectionsSharedComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>ReadConnectionsSharedComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsSharedComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabel,
- this.buildReadConnectionsSharedHolder(),
- this.buildReadConnectionsSharedStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildReadConnectionsSharedHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.READ_CONNECTIONS_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getReadConnectionsShared();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setReadConnectionsShared(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildReadConnectionsSharedStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultReadConnectionsSharedHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultReadConnectionsSharedHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.READ_CONNECTIONS_SHARED_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getReadConnectionsShared() != null) {
- return null;
- }
- return this.subject.getDefaultReadConnectionsShared();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java
deleted file mode 100644
index 80719c7624..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.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.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionPropertiesComposite
- */
-@SuppressWarnings("nls")
-public class JdbcWriteConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcWriteConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSubSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE) //exapanded
- );
-
- GridData data = (GridData) container.getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- data = (GridData) getControl().getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- // This will add space to have the same layout than read connection pool
- Button space = this.getWidgetFactory().createCheckBox(container, "m");
- Point size = space.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- container = this.addSubPane(container, size.y + 5);
- space.dispose();
-
- // Write Connections Minimum
- new JdbcWriteConnectionsMinComposite<T>(this, container);
-
- // Write Connections Maximum
- new JdbcWriteConnectionsMaxComposite<T>(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java
deleted file mode 100644
index aeec73a6e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java
+++ /dev/null
@@ -1,87 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionsMaxComposite
- */
-public class JdbcWriteConnectionsMaxComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcWriteConnectionsMaxComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcWriteConnectionsMaxComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addWriteConnectionsMaxCombo(container);
- }
-
- private void addWriteConnectionsMaxCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsMaxLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultWriteConnectionsMax();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.WRITE_CONNECTIONS_MAX_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getWriteConnectionsMax();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setWriteConnectionsMax(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java
deleted file mode 100644
index ae6010eff2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java
+++ /dev/null
@@ -1,87 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionsMinComposite
- */
-public class JdbcWriteConnectionsMinComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcWriteConnectionsMinComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcWriteConnectionsMinComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addWriteConnectionsMinCombo(container);
- }
-
- private void addWriteConnectionsMinCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsMinLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultWriteConnectionsMin();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.WRITE_CONNECTIONS_MIN_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getWriteConnectionsMin();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setWriteConnectionsMin(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java
deleted file mode 100644
index bcc7396f2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java
+++ /dev/null
@@ -1,98 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * NativeSqlComposite
- */
-public class NativeSqlComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>NativeSqlComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public NativeSqlComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabel,
- this.buildNativeSqlHolder(),
- this.buildNativeSqlStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildNativeSqlHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.NATIVE_SQL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getNativeSql();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNativeSql(value);
- }
-
- };
- }
-
- private PropertyValueModel<String> buildNativeSqlStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNativeSqlHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultNativeSqlHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.NATIVE_SQL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getNativeSql() != null) {
- return null;
- }
- return this.subject.getDefaultNativeSql();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java
deleted file mode 100644
index 9bea6ce21d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java
+++ /dev/null
@@ -1,84 +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.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlConnectionTab
- */
-public class PersistenceXmlConnectionTab<T extends Connection>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlConnectionTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkConnectionComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java
deleted file mode 100644
index cf79d30949..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java
+++ /dev/null
@@ -1,130 +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.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TransactionTypeComposite
- */
-public class TransactionTypeComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>TransactionTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TransactionTypeComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_transactionTypeLabel,
- this.addTransactionTypeCombo( container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType> addTransactionTypeCombo(Composite container) {
- return new EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType>(this, this.buildPersistenceUnitHolder(), container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY);
- propertyNames.add(PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY);
- }
-
- @Override
- protected PersistenceUnitTransactionType[] getChoices() {
- return PersistenceUnitTransactionType.values();
- }
-
- @Override
- protected PersistenceUnitTransactionType getDefaultValue() {
- return this.getSubject().getDefaultTransactionType();
- }
-
- @Override
- protected String displayString(PersistenceUnitTransactionType value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, TransactionTypeComposite.this, value);
- }
-
- @Override
- protected PersistenceUnitTransactionType getValue() {
- return this.getSubject().getSpecifiedTransactionType();
- }
-
- @Override
- protected void setValue(PersistenceUnitTransactionType value) {
- this.getSubject().setSpecifiedTransactionType(value);
-
- if (value == PersistenceUnitTransactionType.RESOURCE_LOCAL) {
- clearJTAProperties();
- }
- else {
- clearResourceLocalProperties();
- }
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-
- private void clearJTAProperties() {
- getSubject().getPersistenceUnit().setJtaDataSource(null);
- }
-
- private void clearResourceLocalProperties() {
- Connection connection = this.getSubject();
- connection.getPersistenceUnit().setNonJtaDataSource(null);
- connection.setDriver(null);
- connection.setUrl(null);
- connection.setUser(null);
- connection.setPassword(null);
- connection.setBindParameters(null);
- connection.setWriteConnectionsMax(null);
- connection.setWriteConnectionsMin(null);
- connection.setReadConnectionsMax(null);
- connection.setReadConnectionsMin(null);
- connection.setReadConnectionsShared(null);
- connection.setExclusiveConnectionMode(null);
- connection.setLazyConnection(null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java
deleted file mode 100644
index ee345a17e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java
+++ /dev/null
@@ -1,103 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CustomizerComposite
- */
-public class CustomizerComposite extends Pane<Entity>
-{
- /**
- * Creates a new <code>CustomizerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public CustomizerComposite(Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Entity> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Entity>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Entity, String>(
- this.getSubjectHolder(), Entity.DESCRIPTOR_CUSTOMIZER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return getSubjectParent().getDescriptorCustomizerOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- getSubjectParent().setDescriptorCustomizerOf(getSubjectName(), value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubjectParent().getDescriptorCustomizerOf(getSubjectName());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_customizerLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubjectParent().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubjectParent().setDescriptorCustomizerOf(getSubjectName(), className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomizer.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME;
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Customization getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
deleted file mode 100644
index 03c4a46d22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
+++ /dev/null
@@ -1,74 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * PersistenceUnitCustomizationComposite
- */
-public class EclipseLinkCustomizationComposite extends Pane<Customization>
-{
- public EclipseLinkCustomizationComposite(Pane<Customization> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sectionDescription);
- section.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite composite = this.addSubPane(section);
- section.setClient(composite);
-
- // Default pane
- int groupBoxMargin = this.getGroupBoxMargin();
-
- Composite defaultPane = this.addSubPane(
- composite,
- 0, groupBoxMargin, 0, groupBoxMargin
- );
-
- // Weaving Group
- new WeavingPropertiesComposite(this, defaultPane);
-
- // Validation Only
- new ValidationOnlyComposite(this, defaultPane);
-
- // Mapping Files Validate Schema
- new ValidateSchemaComposite(this, defaultPane);
-
- // Throw Exceptions
- new ThrowExceptionsComposite(this, defaultPane);
-
- // Exception Handler
- new ExceptionHandlerComposite(this, defaultPane);
-
- // Session Customizer
- new SessionCustomizersComposite(this, composite);
-
- // EntitiesList
- new EntityListComposite(this, composite);
-
- // Profiler:
- new ProfilerComposite(this, composite);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java
deleted file mode 100644
index c8b944fc6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EntityCustomizationPropertyComposite
- */
-public class EntityCustomizationPropertyComposite extends Pane<Entity> {
-
- /**
- * Creates a new <code>EntityCustomizationPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public EntityCustomizationPropertyComposite(Pane<Customization> parentComposite,
- PropertyValueModel<Entity> subjectHolder,
- Composite parent) {
-
- super(parentComposite, subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Customizer
- new CustomizerComposite(this, container);
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityListComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityListComposite.java
deleted file mode 100644
index 4a67dbe2e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/EntityListComposite.java
+++ /dev/null
@@ -1,212 +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.eclipselink.ui.internal.persistence.customization;
-
-import java.util.ListIterator;
-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.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.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-import org.eclipse.jpt.eclipselink.ui.JptEclipseLinkUiPlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * EntityListComposite
- */
-public class EntityListComposite extends Pane<Customization>
-{
- private WritablePropertyValueModel<Entity> entityHolder;
-
- public EntityListComposite(Pane<Customization> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.entityHolder = this.buildEntityHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- container,
- EclipseLinkUiMessages.CustomizationEntityListComposite_groupTitle
- );
-
- // Entities add/remove list pane
- new AddRemoveListPane<Customization>(
- this,
- container,
- this.buildEntitiesAdapter(),
- this.buildEntitiesListHolder(),
- this.entityHolder,
- this.buildEntityLabelProvider(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
-
- // Entity Customization property pane
- EntityCustomizationPropertyComposite pane = new EntityCustomizationPropertyComposite(
- this,
- this.entityHolder,
- container
- );
- this.installPaneEnabler(this.entityHolder, pane);
- }
-
- private AddRemoveListPane.Adapter buildEntitiesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EntityListComposite.this.addEntities(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Customization customization = getSubject();
- for (Object item : listSelectionModel.selectedValues()) {
- Entity entityCustomization = (Entity) item;
- customization.removeEntity(entityCustomization.getName());
- }
- }
- };
- }
-
- private void addEntities(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseEntity();
-
- if (type != null) {
- String entityName = this.getEntityName(type.getFullyQualifiedName());
- if (entityName == null) {
- entityName = type.getElementName();
- }
-
- if( ! this.getSubject().entityExists(entityName)) {
- this.getSubject().addEntity(entityName);
- int index = CollectionTools.indexOf(this.getSubject().entityNames(), entityName);
- Entity entity = (Entity) listSelectionModel.getListModel().getElementAt(index);
- listSelectionModel.setSelectedValue(entity);
- this.entityHolder.setValue(entity);
- }
- }
- }
-
- private String getEntityName(String fullyQualifiedTypeName) {
-
- org.eclipse.jpt.core.context.Entity entity = getSubject().getPersistenceUnit().getEntity(fullyQualifiedTypeName);
- return entity != null ? entity.getName() : null;
- }
-
- private IType chooseEntity() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptEclipseLinkUiPlugin.log(e);
- return null;
- }
- typeSelectionDialog.setTitle(EclipseLinkUiMessages.CustomizationEntityListComposite_dialogTitle);
- typeSelectionDialog.setMessage(EclipseLinkUiMessages.CustomizationEntityListComposite_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- private ILabelProvider buildEntityLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- Entity entityCustomization = (Entity) element;
- return entityCustomization.getName();
- }
- };
- }
-
- private WritablePropertyValueModel<Entity> buildEntityHolder() {
- return new SimplePropertyValueModel<Entity>();
- }
-
- private ListValueModel<Entity> buildEntitiesListHolder() {
- return new ListAspectAdapter<Customization, Entity>(
- this.getSubjectHolder(), Customization.ENTITIES_LIST) {
- @Override
- protected ListIterator<Entity> listIterator_() {
- return this.subject.entities();
- }
- @Override
- protected int size_() {
- return this.subject.entitiesSize();
- }
- };
- }
-
- private void installPaneEnabler(WritablePropertyValueModel<Entity> entityHolder,
- EntityCustomizationPropertyComposite pane) {
-
- new PaneEnabler(
- this.buildPaneEnablerHolder(entityHolder),
- pane
- );
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder(WritablePropertyValueModel<Entity> entityHolder) {
- return new TransformationPropertyValueModel<Entity, Boolean>(entityHolder) {
- @Override
- protected Boolean transform_(Entity value) {
- return value.entityNameIsValid();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java
deleted file mode 100644
index c2cb45e441..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExceptionHandlerComposite
- */
-public class ExceptionHandlerComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ExceptionHandlerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public ExceptionHandlerComposite(Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Customization> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Customization>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Customization, String>(
- this.getSubjectHolder(), Customization.EXCEPTION_HANDLER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getExceptionHandler();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setExceptionHandler(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getExceptionHandler();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_exceptionHandlerLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setExceptionHandler(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Customization.ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java
deleted file mode 100644
index f4cc9bad2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java
+++ /dev/null
@@ -1,88 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCustomizationTabItem
- */
-public class PersistenceXmlCustomizationTab
- extends Pane<Customization>
- implements JpaPageComposite
-{
- public PersistenceXmlCustomizationTab(
- PropertyValueModel<Customization> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new EclipseLinkCustomizationComposite(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_title;
- }
-
- // ********** Layout **********
-
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java
deleted file mode 100644
index 1ee6f8eb4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ProfilerComposite.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.eclipselink.ui.internal.persistence.customization;
-
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Profiler;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ProfilerComposite
- */
-public class ProfilerComposite extends ClassChooserComboPane<Customization>
-{
-
- /**
- * Creates a new <code>ProfilerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public ProfilerComposite(
- Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- return Profiler.getProfilerClassName(this.getSubject().getProfiler());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_profilerLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Customization, String>(this.getSubjectHolder(), Customization.PROFILER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getProfiler();
- if (name == null) {
- name = ProfilerComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setProfiler(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultProfilerHolder() {
- return new PropertyAspectAdapter<Customization, String>(this.getSubjectHolder(), Customization.DEFAULT_PROFILER) {
- @Override
- protected String buildValue_() {
- return ProfilerComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultProfilerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultProfilerHolder()
- );
- }
-
- private String buildDisplayString(String profilerName) {
-
- switch (Profiler.valueOf(profilerName)) {
- case no_profiler: {
- return EclipseLinkUiMessages.ProfilerComposite_no_profiler;
- }
- case performance_profiler: {
- return EclipseLinkUiMessages.ProfilerComposite_performance_profiler;
- }
- case query_monitor: {
- return EclipseLinkUiMessages.ProfilerComposite_query_monitor;
- }
- default: {
- return null;
- }
- }
- }
-
- private Comparator<String> buildProfilerComparator() {
- return new Comparator<String>() {
- public int compare(String profiler1, String profiler2) {
- profiler1 = buildDisplayString(profiler1);
- profiler2 = buildDisplayString(profiler2);
- return Collator.getInstance().compare(profiler1, profiler2);
- }
- };
- }
-
- @Override
- protected StringConverter<String> buildClassConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- Profiler.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a Profiler
- }
- return value;
- }
- };
- }
-
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(this.buildDefaultProfilerListHolder());
- holders.add(this.buildProfilersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildProfilers() {
- return new TransformationIterator<Profiler, String>(CollectionTools.iterator(Profiler.values())) {
- @Override
- protected String transform(Profiler next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildProfilersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(this.buildProfilers())
- );
- }
-
- private ListValueModel<String> buildProfilersListHolder() {
- return new SortedListValueModelAdapter<String>(
- this.buildProfilersCollectionHolder(),
- this.buildProfilerComparator()
- );
- }
-
- private String getDefaultValue(Customization subject) {
- String defaultValue = subject.getDefaultProfiler();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_defaultEmpty;
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setProfiler(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Customization.ECLIPSELINK_SESSION_PROFILER_CLASS_NAME;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java
deleted file mode 100644
index 0c31c299f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java
+++ /dev/null
@@ -1,193 +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.eclipselink.ui.internal.persistence.customization;
-
-import java.util.ListIterator;
-
-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.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.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.JptEclipseLinkUiPlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JptUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * SessionCustomizersComposite
- */
-public class SessionCustomizersComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>SessionCustomizerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public SessionCustomizersComposite(Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- private void addSessionCustomizerClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().sessionCustomizerExists(className)) {
-
- String classRef = this.getSubject().addSessionCustomizer(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addSessionCustomizerClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeSessionCustomizer((String) item);
- }
- }
- };
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(Object element) {
- String name = (String) element;
-
- if (name == null) {
- name = EclipseLinkUiMessages.PersistenceXmlCustomizationTab_noName;
- }
- return name;
- }
- };
- }
-
- private ListValueModel<String> buildListHolder() {
- return new ListAspectAdapter<Customization, String>(getSubjectHolder(), Customization.SESSION_CUSTOMIZER_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return subject.sessionCustomizers();
- }
-
- @Override
- protected int size_() {
- return subject.sessionCustomizersSize();
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<String>();
- }
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * canceled the dialog
- */
- private IType chooseType() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptEclipseLinkUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Description
- container = addTitledGroup(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sessionCustomizerLabel
- );
-
- // List pane
- new AddRemoveListPane<Customization>(
- this,
- container,
- buildAdapter(),
- buildListHolder(),
- buildSelectedItemHolder(),
- buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java
deleted file mode 100644
index 0f0882f411..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ThrowExceptionsComposite
- */
-public class ThrowExceptionsComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ThrowExceptionsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ThrowExceptionsComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabel,
- this.buildThrowExceptionsHolder(),
- this.buildThrowExceptionsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildThrowExceptionsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.THROW_EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThrowExceptions();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setThrowExceptions(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildThrowExceptionsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultThrowExceptionsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultThrowExceptionsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.THROW_EXCEPTIONS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getThrowExceptions() != null) {
- return null;
- }
- return this.subject.getDefaultThrowExceptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java
deleted file mode 100644
index ff2ba6ce64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidateSchemaComposite
- */
-public class ValidateSchemaComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ValidateSchemaComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidateSchemaComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabel,
- this.buildValidateSchemaHolder(),
- this.buildValidateSchemaStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildValidateSchemaHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.VALIDATE_SCHEMA_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getValidateSchema();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setValidateSchema(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildValidateSchemaStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultValidateSchemaHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultValidateSchemaHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.VALIDATE_SCHEMA_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getValidateSchema() != null) {
- return null;
- }
- return this.subject.getDefaultValidateSchema();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
deleted file mode 100644
index cd896251bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationOnlyComposite
- */
-public class ValidationOnlyComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ValidationOnlyComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationOnlyComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel,
- this.buildValidationOnlyHolder(),
- this.buildValidationOnlyStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildValidationOnlyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.VALIDATION_ONLY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getValidationOnly();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setValidationOnly(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildValidationOnlyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultValidationOnlyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultValidationOnlyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.VALIDATION_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getValidationOnly() != null) {
- return null;
- }
- return this.subject.getDefaultValidationOnly();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java
deleted file mode 100644
index 139ac43885..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingChangeTrackingComposite
- */
-public class WeavingChangeTrackingComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingChangeTrackingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingChangeTrackingComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabel,
- this.buildWeavingChangeTrackingHolder(),
- this.buildWeavingChangeTrackingStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildWeavingChangeTrackingHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_CHANGE_TRACKING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingChangeTracking();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingChangeTracking(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingChangeTrackingStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingChangeTrackingHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingChangeTrackingHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_CHANGE_TRACKING_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingChangeTracking() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingComposite.java
deleted file mode 100644
index 3f1b0a9d3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingComposite.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.eclipselink.ui.internal.persistence.customization;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Weaving;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingComposite
- */
-public class WeavingComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Customization, Weaving> addWeavingCombo(Composite container) {
- return new EnumFormComboViewer<Customization, Weaving>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Customization.WEAVING_PROPERTY);
- }
-
- @Override
- protected Weaving[] getChoices() {
- return Weaving.values();
- }
-
- @Override
- protected Weaving getDefaultValue() {
- return getSubject().getDefaultWeaving();
- }
-
- @Override
- protected String displayString(Weaving value) {
- return buildDisplayString(EclipseLinkUiMessages.class, WeavingComposite.this, value);
- }
-
- @Override
- protected Weaving getValue() {
- return getSubject().getWeaving();
- }
-
- @Override
- protected void setValue(Weaving value) {
- getSubject().setWeaving(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLabel,
- this.addWeavingCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java
deleted file mode 100644
index 3450e4f47e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingEagerComposite
- */
-public class WeavingEagerComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingEagerComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingEagerComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabel,
- this.buildWeavingEagerHolder(),
- this.buildWeavingEagerStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildWeavingEagerHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_EAGER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingEager();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingEager(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingEagerStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingEagerHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingEagerHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_EAGER_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingEager() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingEager();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java
deleted file mode 100644
index f88e695c04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingFetchGroupsComposite
- */
-public class WeavingFetchGroupsComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingFetchGroupsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingFetchGroupsComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabel,
- this.buildWeavingFetchGroupsHolder(),
- this.buildWeavingFetchGroupsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildWeavingFetchGroupsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_FETCH_GROUPS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingFetchGroups();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingFetchGroups(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingFetchGroupsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingFetchGroupsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingFetchGroupsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_FETCH_GROUPS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingFetchGroups() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingFetchGroups();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java
deleted file mode 100644
index 9bdd9a032a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java
+++ /dev/null
@@ -1,97 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingInternalComposite
- */
-public class WeavingInternalComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingInternalComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingInternalComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabel,
- this.buildWeavingInternalHolder(),
- this.buildWeavingInternalStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildWeavingInternalHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_INTERNAL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingInternal();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingInternal(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingInternalStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingInternalHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabel;
- }
- };
- }
-
-
- private PropertyValueModel<Boolean> buildDefaultWeavingInternalHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_INTERNAL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingInternal() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingInternal();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java
deleted file mode 100644
index b64d610b87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingLazyComposite
- */
-public class WeavingLazyComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingLazyComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingLazyComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabel,
- this.buildWeavingLazyHolder(),
- this.buildWeavingLazyStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildWeavingLazyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_LAZY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingLazy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingLazy(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingLazyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingLazyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingLazyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_LAZY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingLazy() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingLazy();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java
deleted file mode 100644
index f321960419..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.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.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingPropertiesComposite
- */
-public class WeavingPropertiesComposite extends Pane<Customization>
-{
- public WeavingPropertiesComposite(Pane<Customization> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- Composite weavingGroup = this.addTitledGroup(
- this.addSubPane(parent, 10),
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingPropertiesGroupBox
- );
-
- // Weaving
- new WeavingComposite(this, weavingGroup);
-
- // Weaving Lazy
- new WeavingLazyComposite(this, weavingGroup);
-
- // Weaving Fetch Groups
- new WeavingFetchGroupsComposite(this, weavingGroup);
-
- // Weaving Internal
- new WeavingInternalComposite(this, weavingGroup);
-
- // Weaving Eager
- new WeavingEagerComposite(this, weavingGroup);
-
- // Weaving Change Tracking
- new WeavingChangeTrackingComposite(this, weavingGroup);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java
deleted file mode 100644
index ff8f3633a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java
+++ /dev/null
@@ -1,68 +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.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitGeneralComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkPersistenceUnitGeneralComposite
- */
-public class EclipseLinkPersistenceUnitGeneralComposite
- extends PersistenceUnitGeneralComposite
-{
- // ********** constructors **********
- public EclipseLinkPersistenceUnitGeneralComposite(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
- super(subjectHolder, container, widgetFactory);
- }
-
- // ********** initialization **********
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeGeneralPane(container);
- this.initializeMappedClassesPane(container);
- this.initializeJPAMappingDescriptorsPane(container);
- this.initializeJarFilesPane(container);
- }
-
- protected void initializeJPAMappingDescriptorsPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors_description
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new EclipseLinkPersistenceUnitMappingFilesComposite(this, container);
- }
-
- protected void initializeJarFilesPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jarFiles
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new EclipseLinkPersistenceUnitJarFilesComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java
deleted file mode 100644
index 2449678ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java
+++ /dev/null
@@ -1,53 +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.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.ui.internal.persistence.details.ArchiveFileSelectionDialog;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitJarFilesComposite;
-import org.eclipse.jpt.ui.internal.persistence.details.ArchiveFileSelectionDialog.DeploymentPathCalculator;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkPersistenceUnitJarFilesComposite
- extends PersistenceUnitJarFilesComposite
-{
- public EclipseLinkPersistenceUnitJarFilesComposite(
- Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected DeploymentPathCalculator buildJarFileDeploymentPathCalculator() {
- return new EclipseLinkDeploymentPathCalculator();
- }
-
-
- private static class EclipseLinkDeploymentPathCalculator
- extends ArchiveFileSelectionDialog.ModuleDeploymentPathCalculator
- {
- @Override
- public String calculateDeploymentPath(IFile file) {
- String baseDeploymentPath = super.calculateDeploymentPath(file);
- if (JptCorePlugin.projectHasWebFacet(file.getProject())) {
- return "../" + baseDeploymentPath;
- }
- else {
- return baseDeploymentPath;
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java
deleted file mode 100644
index 8b028d29b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java
+++ /dev/null
@@ -1,123 +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.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.context.persistence.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceUnitMappingFilesComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitGeneralComposite - The parent container
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class EclipseLinkPersistenceUnitMappingFilesComposite extends PersistenceUnitMappingFilesComposite
-{
- /**
- * Creates a new <code>PersistenceUnitMappingFilesComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public EclipseLinkPersistenceUnitMappingFilesComposite(Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addMappingFilesList(container);
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrm,
- this.buildExcludeEclipselinkOrmHolder(),
- this.buildExcludeEclipselinkOrmStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL
- );
- }
-
- protected PropertyValueModel<GeneralProperties> buildGeneralPropertiesHolder() {
- return new TransformationPropertyValueModel<PersistenceUnit, GeneralProperties>(getSubjectHolder()) {
- @Override
- protected GeneralProperties transform_(PersistenceUnit persistenceUnit) {
- return ((EclipseLinkPersistenceUnit) persistenceUnit).getGeneralProperties();
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildExcludeEclipselinkOrmHolder() {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(
- buildGeneralPropertiesHolder(),
- GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExcludeEclipselinkOrm();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExcludeEclipselinkOrm(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildExcludeEclipselinkOrmStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultExcludeEclipselinkOrmHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrm;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultExcludeEclipselinkOrmHolder() {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(
- buildGeneralPropertiesHolder(),
- GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getExcludeEclipselinkOrm() != null) {
- return null;
- }
- return this.subject.getDefaultExcludeEclipselinkOrm();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
deleted file mode 100644
index e25109913e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-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.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * EclipseLinkLoggingComposite
- */
-public class EclipseLinkLoggingComposite<T extends Logging>
- extends Pane<T>
-{
- public EclipseLinkLoggingComposite(
- Pane<T> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sectionDescription);
- Composite composite = getWidgetFactory().createComposite(section);
- composite.setLayout(new GridLayout(1, false));
- section.setClient(composite);
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- // LoggingLevel:
- new LoggingLevelComposite(this, composite);
-
- // Boolean properties group
- this.logPropertiesComposite(composite);
-
- // LoggingFile:
- new LoggingFileLocationComposite(this, composite);
-
- // Logger:
- new LoggerComposite(this, composite);
-
- return;
- }
-
- protected void logPropertiesComposite(Composite parent) {
-
- // Timestamp:
- new TimestampComposite(this, parent);
-
- // Thread:
- new ThreadComposite(this, parent);
-
- // Session:
- new SessionComposite(this, parent);
-
- // Exceptions:
- new ExceptionsComposite(this, parent);
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java
deleted file mode 100644
index b10e499ea7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExceptionsComposite
- */
-public class ExceptionsComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>ExceptionsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ExceptionsComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabel,
- this.buildExceptionsHolder(),
- this.buildExceptionsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_EXCEPTIONS
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildExceptionsHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExceptions();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExceptions(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildExceptionsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultExceptionsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultExceptionsHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.EXCEPTIONS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getExceptions() != null) {
- return null;
- }
- return this.subject.getDefaultExceptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggerComposite.java
deleted file mode 100644
index c8e038fc44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggerComposite.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.eclipselink.ui.internal.persistence.logging;
-
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logger;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LoggerComposite
- */
-public class LoggerComposite extends ClassChooserComboPane<Logging>
-{
- /**
- * Creates a new <code>LoggerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public LoggerComposite(
- Pane<? extends Logging> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- if (this.getSubject().getLogger() == null) {
- return Logger.DEFAULT_LOGGER_CLASS_NAME;
- }
- return Logger.getLoggerClassName(this.getSubject().getLogger());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggerLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Logging.ECLIPSELINK_LOGGER_CLASS_NAME;
- }
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Logging, String>(this.getSubjectHolder(), Logging.LOGGER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getLogger();
- if (name == null) {
- name = LoggerComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setLogger(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultLoggerHolder() {
- return new PropertyAspectAdapter<Logging, String>(this.getSubjectHolder(), Logging.DEFAULT_LOGGER) {
- @Override
- protected String buildValue_() {
- return LoggerComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultLoggerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultLoggerHolder()
- );
- }
-
- private String buildDisplayString(String loggerName) {
-
- switch (Logger.valueOf(loggerName)) {
- case default_logger: {
- return EclipseLinkUiMessages.LoggerComposite_default_logger;
- }
- case java_logger: {
- return EclipseLinkUiMessages.LoggerComposite_java_logger;
- }
- case server_logger: {
- return EclipseLinkUiMessages.LoggerComposite_server_logger;
- }
- default: {
- return null;
- }
- }
- }
-
- private Comparator<String> buildLoggerComparator() {
- return new Comparator<String>() {
- public int compare(String logger1, String logger2) {
- logger1 = buildDisplayString(logger1);
- logger2 = buildDisplayString(logger2);
- return Collator.getInstance().compare(logger1, logger2);
- }
- };
- }
-
- @Override
- protected StringConverter<String> buildClassConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- Logger.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a Logger
- }
- return value;
- }
- };
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(this.buildDefaultLoggerListHolder());
- holders.add(this.buildLoggersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildLoggers() {
- return new TransformationIterator<Logger, String>(CollectionTools.iterator(Logger.values())) {
- @Override
- protected String transform(Logger next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildLoggersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(this.buildLoggers())
- );
- }
-
- private ListValueModel<String> buildLoggersListHolder() {
- return new SortedListValueModelAdapter<String>(
- this.buildLoggersCollectionHolder(),
- this.buildLoggerComparator()
- );
- }
-
- private String getDefaultValue(Logging subject) {
- String defaultValue = subject.getDefaultLogger();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_defaultEmpty;
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setLogger(className);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java
deleted file mode 100644
index 1a81193a7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java
+++ /dev/null
@@ -1,97 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.FileChooserComboPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LoggingFileLocationComposite
- */
-public class LoggingFileLocationComposite extends Pane<Logging>
-{
- public LoggingFileLocationComposite(Pane<? extends Logging> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new FileChooserComboPane<Logging>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Logging, String>(
- getSubjectHolder(), Logging.LOG_FILE_LOCATION_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getLogFileLocation();
- if (name == null) {
- name = defaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (defaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setLogFileLocation(value);
- }
- };
- }
-
- private String defaultValue(Logging subject) {
- String defaultValue = subject.getDefaultLogFileLocation();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_defaultWithOneParam,
- defaultValue
- );
- }
- else {
- return this.getDefaultString();
- }
- }
-
- @Override
- protected String getDefaultString() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_defaultStdout;
- }
-
- @Override
- protected String getDialogTitle() {
- return EclipseLinkUiMessages.LoggingFileLocationComposite_dialogTitle;
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggingFileLabel;
- }
-
- @Override
- protected String getProjectPath() {
- return this.getSubject().getJpaProject().getProject().getLocation().toString();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java
deleted file mode 100644
index 819b61bf6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java
+++ /dev/null
@@ -1,91 +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.eclipselink.ui.internal.persistence.logging;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LoggingLevelComposite
- */
-public class LoggingLevelComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>LoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public LoggingLevelComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<Logging, LoggingLevel> addLoggingLevelCombo(Composite container) {
- return new EnumFormComboViewer<Logging, LoggingLevel>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Logging.LEVEL_PROPERTY);
- }
-
- @Override
- protected LoggingLevel[] getChoices() {
- return LoggingLevel.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected LoggingLevel getDefaultValue() {
- return this.getSubject().getDefaultLevel();
- }
-
- @Override
- protected String displayString(LoggingLevel value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, LoggingLevelComposite.this, value);
- }
-
- @Override
- protected LoggingLevel getValue() {
- return this.getSubject().getLevel();
- }
-
- @Override
- protected void setValue(LoggingLevel value) {
- this.getSubject().setLevel(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggingLevelLabel,
- this.addLoggingLevelCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_LEVEL
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java
deleted file mode 100644
index 04a92135e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java
+++ /dev/null
@@ -1,84 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlLoggingTab
- */
-public class PersistenceXmlLoggingTab<T extends Logging>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlLoggingTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkLoggingComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_LOGGING;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/SessionComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/SessionComposite.java
deleted file mode 100644
index 6724eb0dec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/SessionComposite.java
+++ /dev/null
@@ -1,97 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionComposite
- */
-public class SessionComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>SessionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public SessionComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabel,
- this.buildSessionHolder(),
- this.buildSessionStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_SESSION
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildSessionHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.SESSION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSession();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSession(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildSessionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultSessionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultSessionHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.SESSION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSession() != null) {
- return null;
- }
- return this.subject.getDefaultSession();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ThreadComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ThreadComposite.java
deleted file mode 100644
index 3cf4dd3cd0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/ThreadComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ThreadComposite
- */
-public class ThreadComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>ThreadComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ThreadComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabel,
- this.buildThreadHolder(),
- this.buildThreadStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_THREAD
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildThreadHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.THREAD_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThread();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setThread(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildThreadStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultThreadHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultThreadHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.THREAD_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getThread() != null) {
- return null;
- }
- return this.subject.getDefaultThread();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/TimestampComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/TimestampComposite.java
deleted file mode 100644
index ce3a89b60c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/logging/TimestampComposite.java
+++ /dev/null
@@ -1,95 +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.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TimestampComposite
- */
-public class TimestampComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>TimestampComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TimestampComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabel,
- this.buildTimestampHolder(),
- this.buildTimestampStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_TIMESTAMP
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildTimestampHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.TIMESTAMP_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTimestamp();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setTimestamp(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildTimestampStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultTimestampHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabel;
- }
- };
- }
- private PropertyValueModel<Boolean> buildDefaultTimestampHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.TIMESTAMP_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getTimestamp() != null) {
- return null;
- }
- return this.subject.getDefaultTimestamp();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java
deleted file mode 100644
index fbfa8fb502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkOptionsComposite
- */
-public class EclipseLinkOptionsComposite<T extends Options> extends Pane<T>
-{
- public EclipseLinkOptionsComposite(
- Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.initializeSessionOptionsPane(parent);
- this.initializeMiscellaneousPane(parent);
- }
-
- private void initializeSessionOptionsPane(Composite parent) {
- Composite composite = this.addSection(parent,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionSectionTitle,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionSectionDescription);
-
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- new SessionNameComposite(this, composite);
-
- new SessionsXmlComposite(this, composite);
-
- new TargetDatabaseComposite(this, composite);
-
- new TargetServerComposite(this, composite);
-
- new EventListenerComposite(this, composite);
-
- new IncludeDescriptorQueriesComposite(this, composite);
-
- return;
- }
-
- protected Composite initializeMiscellaneousPane(Composite container) {
-
- this.updateGridData(container);
- this.updateGridData(container.getParent());
-
- Composite composite = this.addSection(container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_miscellaneousSectionTitle,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_miscellaneousSectionDescription);
-
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- new TemporalMutableComposite(this, composite);
-
- return composite;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EventListenerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EventListenerComposite.java
deleted file mode 100644
index 7bba4ca2a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/EventListenerComposite.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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EventListenerComposite
- */
-public class EventListenerComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>EventListenerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public EventListenerComposite(Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Options> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Options>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Options, String>(
- this.getSubjectHolder(), Options.SESSION_EVENT_LISTENER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getEventListener();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setEventListener(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getEventListener();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_eventListenerLabel;
- }
-
- @Override
- protected JpaProject getJpaProject() {
- return getSubject().getJpaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setEventListener(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Options.ECLIPSELINK_EVENT_LISTENER_CLASS_NAME;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java
deleted file mode 100644
index f0e0d78fdc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * IncludeDescriptorQueriesComposite
- */
-public class IncludeDescriptorQueriesComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>IncludeDescriptorQueriesComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public IncludeDescriptorQueriesComposite(
- Pane<? extends Options> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabel,
- this.buildIncludeDescriptorQueriesHolder(),
- this.buildIncludeDescriptorQueriesStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildIncludeDescriptorQueriesHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(getSubjectHolder(), Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getIncludeDescriptorQueries();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setIncludeDescriptorQueries(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildIncludeDescriptorQueriesStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultIncludeDescriptorQueriesHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultIncludeDescriptorQueriesHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(
- getSubjectHolder(),
- Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getIncludeDescriptorQueries() != null) {
- return null;
- }
- return this.subject.getDefaultIncludeDescriptorQueries();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java
deleted file mode 100644
index c1faecee6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java
+++ /dev/null
@@ -1,84 +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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlOptionsTab
- */
-public class PersistenceXmlOptionsTab<T extends Options>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlOptionsTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkOptionsComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
deleted file mode 100644
index c7abb3ea66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
+++ /dev/null
@@ -1,106 +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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionNameComposite
- */
-public class SessionNameComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>SessionNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SessionNameComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultSessionNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_SESSION_NAME) {
- @Override
- protected String buildValue_() {
- return SessionNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultSessionNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultSessionNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildSessionNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.SESSION_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getSessionName();
- if (name == null) {
- name = SessionNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setSessionName(value);
- }
- };
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultSessionName();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionName,
- this.buildDefaultSessionNameListHolder(),
- this.buildSessionNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_SESSION_NAME
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
deleted file mode 100644
index 6219d274e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
+++ /dev/null
@@ -1,106 +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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionsXmlComposite
- */
-public class SessionsXmlComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>SessionsXmlComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SessionsXmlComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultSessionsXmlFileNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_SESSIONS_XML) {
- @Override
- protected String buildValue_() {
- return SessionsXmlComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultSessionsXmlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultSessionsXmlFileNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildSessionsXmlFileNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.SESSIONS_XML_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getSessionsXml();
- if (name == null) {
- name = SessionsXmlComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setSessionsXml(value);
- }
- };
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultSessionsXml();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionsXml,
- this.buildDefaultSessionsXmlFileNameListHolder(),
- this.buildSessionsXmlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_SESSIONS_XML
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
deleted file mode 100644
index 504aee56d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
+++ /dev/null
@@ -1,183 +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.eclipselink.ui.internal.persistence.options;
-
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetDatabase;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TargetDatabaseComposite
- */
-public class TargetDatabaseComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TargetDatabaseComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetDatabaseComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultTargetDatabaseHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_TARGET_DATABASE) {
- @Override
- protected String buildValue_() {
- return TargetDatabaseComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultTargetDatabaseListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultTargetDatabaseHolder()
- );
- }
-
- private String buildDisplayString(String targetDatabaseName) {
-
- return SWTUtil.buildDisplayString(
- EclipseLinkUiMessages.class,
- this.getClass(),
- TargetDatabase.valueOf(targetDatabaseName));
- }
-
- private Comparator<String> buildTargetDatabaseComparator() {
- return new Comparator<String>() {
- public int compare(String targetDatabase1, String targetDatabase2) {
- targetDatabase1 = buildDisplayString(targetDatabase1);
- targetDatabase2 = buildDisplayString(targetDatabase2);
- return Collator.getInstance().compare(targetDatabase1, targetDatabase2);
- }
- };
- }
-
- private StringConverter<String> buildTargetDatabaseConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- TargetDatabase.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a TargetDatabase
- }
- return value;
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildTargetDatabaseHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.TARGET_DATABASE_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getTargetDatabase();
- if (name == null) {
- name = TargetDatabaseComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setTargetDatabase(value);
- }
- };
- }
-
- private ListValueModel<String> buildTargetDatabaseListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultTargetDatabaseListHolder());
- holders.add(buildTargetDatabasesListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildTargetDatabases() {
- return new TransformationIterator<TargetDatabase, String>(CollectionTools.iterator(TargetDatabase.values())) {
- @Override
- protected String transform(TargetDatabase next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildTargetDatabasesCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(buildTargetDatabases())
- );
- }
-
- private ListValueModel<String> buildTargetDatabasesListHolder() {
- return new SortedListValueModelAdapter<String>(
- buildTargetDatabasesCollectionHolder(),
- buildTargetDatabaseComparator()
- );
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultTargetDatabase();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetDatabaseLabel,
- this.buildTargetDatabaseListHolder(),
- this.buildTargetDatabaseHolder(),
- this.buildTargetDatabaseConverter(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_TARGET_DATABASE
- );
-
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
deleted file mode 100644
index ec912c7ca3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
+++ /dev/null
@@ -1,182 +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.eclipselink.ui.internal.persistence.options;
-
-import com.ibm.icu.text.Collator;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetServer;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TargetServerComposite
- */
-public class TargetServerComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TargetServerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetServerComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultTargetServerHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_TARGET_SERVER) {
- @Override
- protected String buildValue_() {
- return TargetServerComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultTargetServerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultTargetServerHolder()
- );
- }
-
- private String buildDisplayString(String targetServerName) {
-
- return SWTUtil.buildDisplayString(
- EclipseLinkUiMessages.class,
- this.getClass(),
- TargetServer.valueOf(targetServerName));
- }
-
- private Comparator<String> buildTargetServerComparator() {
- return new Comparator<String>() {
- public int compare(String targetServer1, String targetServer2) {
- targetServer1 = buildDisplayString(targetServer1);
- targetServer2 = buildDisplayString(targetServer2);
- return Collator.getInstance().compare(targetServer1, targetServer2);
- }
- };
- }
-
- private StringConverter<String> buildTargetServerConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- TargetServer.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a TargetServer
- }
- return value;
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildTargetServerHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.TARGET_SERVER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getTargetServer();
- if (name == null) {
- name = TargetServerComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setTargetServer(value);
- }
- };
- }
-
- private ListValueModel<String> buildTargetServerListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultTargetServerListHolder());
- holders.add(buildTargetServersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildTargetServers() {
- return new TransformationIterator<TargetServer, String>(CollectionTools.iterator(TargetServer.values())) {
- @Override
- protected String transform(TargetServer next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildTargetServersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(buildTargetServers())
- );
- }
-
- private ListValueModel<String> buildTargetServersListHolder() {
- return new SortedListValueModelAdapter<String>(
- buildTargetServersCollectionHolder(),
- buildTargetServerComparator()
- );
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultTargetServer();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetServerLabel,
- this.buildTargetServerListHolder(),
- this.buildTargetServerHolder(),
- this.buildTargetServerConverter(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_TARGET_SERVER
- );
-
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java
deleted file mode 100644
index bcaf1e5761..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java
+++ /dev/null
@@ -1,96 +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.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TemporalMutableComposite
- */
-public class TemporalMutableComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TemporalMutableComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TemporalMutableComposite(
- Pane<? extends Options> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabel,
- this.buildTemporalMutableHolder(),
- this.buildTemporalMutableStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildTemporalMutableHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(getSubjectHolder(), Options.TEMPORAL_MUTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTemporalMutable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setTemporalMutable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildTemporalMutableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultTemporalMutableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultTemporalMutableHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(
- getSubjectHolder(),
- Options.TEMPORAL_MUTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getTemporalMutable() != null) {
- return null;
- }
- return this.subject.getDefaultTemporalMutable();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
deleted file mode 100644
index 5ec55e81cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
+++ /dev/null
@@ -1,105 +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.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CreateDdlFileNameComposite
- */
-public class CreateDdlFileNameComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>CreateDdlFileNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public CreateDdlFileNameComposite(
- Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultCreateDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME) {
- @Override
- protected String buildValue_() {
- return CreateDdlFileNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultCreateDdlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultCreateDdlFileNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildCreateDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.CREATE_FILE_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getCreateFileName();
- if (name == null) {
- name = CreateDdlFileNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setCreateFileName(value);
- }
- };
- }
-
- private String getDefaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultCreateFileName();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel,
- this.buildDefaultCreateDdlFileNameListHolder(),
- this.buildCreateDdlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java
deleted file mode 100644
index c021588528..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java
+++ /dev/null
@@ -1,97 +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.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.FolderChooserComboPane;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DdlGenerationLocationComposite
- */
-public class DdlGenerationLocationComposite extends Pane<SchemaGeneration>
-{
- public DdlGenerationLocationComposite(Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new FolderChooserComboPane<SchemaGeneration>(this, container) {
-
- @Override
- protected WritablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(
- getSubjectHolder(), SchemaGeneration.APPLICATION_LOCATION_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getApplicationLocation();
- if (name == null) {
- name = defaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (defaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setApplicationLocation(value);
- }
- };
- }
-
- private String defaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultApplicationLocation();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultWithOneParam,
- defaultValue
- );
- }
- else {
- return this.getDefaultString();
- }
- }
-
- @Override
- protected String getDefaultString() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultDot;
- }
-
- @Override
- protected String getDialogMessage() {
- return EclipseLinkUiMessages.DdlGenerationLocationComposite_dialogMessage;
- }
-
- @Override
- protected String getDialogTitle() {
- return EclipseLinkUiMessages.DdlGenerationLocationComposite_dialogTitle;
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java
deleted file mode 100644
index 9ec9ff1d6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.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.eclipselink.ui.internal.persistence.schema.generation;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DdlGenerationTypeComposite
- */
-public class DdlGenerationTypeComposite
- extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>DdlGenerationTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DdlGenerationTypeComposite(
- Pane<? extends SchemaGeneration> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<SchemaGeneration, DdlGenerationType> addDdlGenerationTypeCombo(Composite container) {
- return new EnumFormComboViewer<SchemaGeneration, DdlGenerationType>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY);
- }
-
- @Override
- protected DdlGenerationType[] getChoices() {
- return DdlGenerationType.values();
- }
-
- @Override
- protected DdlGenerationType getDefaultValue() {
- return this.getSubject().getDefaultDdlGenerationType();
- }
-
- @Override
- protected String displayString(DdlGenerationType value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, DdlGenerationTypeComposite.this, value);
- }
-
- @Override
- protected DdlGenerationType getValue() {
- return this.getSubject().getDdlGenerationType();
- }
-
- @Override
- protected void setValue(DdlGenerationType value) {
- this.getSubject().setDdlGenerationType(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel,
- addDdlGenerationTypeCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
deleted file mode 100644
index ae609404ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
+++ /dev/null
@@ -1,105 +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.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DropDdlFileNameComposite
- */
-public class DropDdlFileNameComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>DropDdlFileNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DropDdlFileNameComposite(
- Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultDropDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME) {
- @Override
- protected String buildValue_() {
- return DropDdlFileNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultDropDdlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultDropDdlFileNameHolder()
- );
- }
-
- private WritablePropertyValueModel<String> buildDropDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DROP_FILE_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getDropFileName();
- if (name == null) {
- name = DropDdlFileNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (DropDdlFileNameComposite.this.getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setDropFileName(value);
- }
- };
- }
-
- private String getDefaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultDropFileName();
-
- if (defaultValue != null) {
- return NLS.bind(
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultWithOneParam,
- defaultValue
- );
- }
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel,
- this.buildDefaultDropDdlFileNameListHolder(),
- this.buildDropDdlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java
deleted file mode 100644
index 1a8121da4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java
+++ /dev/null
@@ -1,49 +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.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkSchemaGenerationComposite
- */
-public class EclipseLinkSchemaGenerationComposite
- extends Pane<SchemaGeneration>
-{
- public EclipseLinkSchemaGenerationComposite(
- Pane<SchemaGeneration> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_sectionDescription
- );
-
- // DDL Generation Type:
- new DdlGenerationTypeComposite(this, container);
- // Output Mode:
- new OutputModeComposite(this, container);
- // DDL Generation Location
- new DdlGenerationLocationComposite(this, container);
- // Create DDL File Name:
- new CreateDdlFileNameComposite(this, container);
- // Drop DDL File Name:
- new DropDdlFileNameComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java
deleted file mode 100644
index 89851aa867..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java
+++ /dev/null
@@ -1,86 +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.eclipselink.ui.internal.persistence.schema.generation;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * OutputModeComposite
- */
-public class OutputModeComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>OutputModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public OutputModeComposite(
- Pane<? extends SchemaGeneration> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<SchemaGeneration, OutputMode> addBuildOutputModeCombo(Composite container) {
- return new EnumFormComboViewer<SchemaGeneration, OutputMode>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SchemaGeneration.OUTPUT_MODE_PROPERTY);
- }
-
- @Override
- protected OutputMode[] getChoices() {
- return OutputMode.values();
- }
-
- @Override
- protected OutputMode getDefaultValue() {
- return this.getSubject().getDefaultOutputMode();
- }
-
- @Override
- protected String displayString(OutputMode value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, OutputModeComposite.this, value);
- }
-
- @Override
- protected OutputMode getValue() {
- return this.getSubject().getOutputMode();
- }
-
- @Override
- protected void setValue(OutputMode value) {
- this.getSubject().setOutputMode(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_outputModeLabel,
- this.addBuildOutputModeCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java
deleted file mode 100644
index 05384a605d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.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.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaPageComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlSchemaGenerationTab
- */
-public class PersistenceXmlSchemaGenerationTab
- extends Pane<SchemaGeneration>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlSchemaGenerationTab(
- PropertyValueModel<SchemaGeneration> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkSchemaGenerationComposite(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_title;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemContentProviderFactory.java
deleted file mode 100644
index f921d3bc40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemContentProviderFactory.java
+++ /dev/null
@@ -1,94 +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.eclipselink.ui.internal.persistencexml.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.core.context.JpaContextNode;
-import org.eclipse.jpt.core.context.MappingFile;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorItemContentProviderFactory;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * EclipseLinkNavigatorItemContentProviderFactory
- */
-public class EclipseLinkNavigatorItemContentProviderFactory
- extends GenericNavigatorItemContentProviderFactory
- implements TreeItemContentProviderFactory
-{
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- DelegatingTreeContentAndLabelProvider treeContentAndLabelProvider =
- (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
-
- if (item instanceof EclipseLinkPersistenceUnit) {
- return new EclipseLinkPersistenceUnitItemContentProvider(
- (EclipseLinkPersistenceUnit) item, treeContentAndLabelProvider);
- }
-
- return super.buildItemContentProvider(item, contentAndLabelProvider);
- }
-
-
- public static class EclipseLinkPersistenceUnitItemContentProvider
- extends PersistenceUnitItemContentProvider
- {
- public EclipseLinkPersistenceUnitItemContentProvider(
- EclipseLinkPersistenceUnit persistenceUnit, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistenceUnit, contentProvider);
- }
-
- @Override
- public EclipseLinkPersistenceUnit getModel() {
- return (EclipseLinkPersistenceUnit) super.getModel();
- }
-
- @Override
- protected CollectionValueModel<JpaContextNode> buildChildrenModel() {
- List<CollectionValueModel<? extends JpaContextNode>> list = new ArrayList<CollectionValueModel<? extends JpaContextNode>>();
- list.add(buildSpecifiedOrmXmlCvm());
- list.add(buildImpliedMappingFileCvm());
- list.add(buildImpliedEclipseLinkMappingFileCvm());
- list.add(buildPersistentTypeCvm());
- list.add(buildJarFileCvm());
- return new CompositeCollectionValueModel<CollectionValueModel<? extends JpaContextNode>, JpaContextNode>(list);
- }
-
- private CollectionValueModel<MappingFile> buildImpliedEclipseLinkMappingFileCvm() {
- return new PropertyCollectionValueModelAdapter<MappingFile>(
- new PropertyAspectAdapter<MappingFileRef, MappingFile>(
- new PropertyAspectAdapter<EclipseLinkPersistenceUnit, MappingFileRef>(
- EclipseLinkPersistenceUnit.IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY,
- getModel()) {
- @Override
- protected MappingFileRef buildValue_() {
- return subject.getImpliedEclipseLinkMappingFileRef();
- }
- },
- MappingFileRef.MAPPING_FILE_PROPERTY) {
- @Override
- protected MappingFile buildValue_() {
- return subject.getMappingFile();
- }
- }
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 6fa03d383d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/persistencexml/details/EclipseLinkNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,23 +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.eclipselink.ui.internal.persistencexml.details;
-
-import org.eclipse.jpt.ui.internal.platform.generic.GenericNavigatorItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-
-/**
- * EclipseLinkNavigatorItemLabelProviderFactory
- */
-public class EclipseLinkNavigatorItemLabelProviderFactory
- extends GenericNavigatorItemLabelProviderFactory
- implements ItemLabelProviderFactory
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java
deleted file mode 100644
index c25757f34e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.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.eclipselink.ui.internal.platform;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
-
-public class EclipseLinkJpaPlatformUi
- extends BaseJpaPlatformUi
-{
- public EclipseLinkJpaPlatformUi(
- JpaNavigatorProvider navigatorProvider,
- JpaPlatformUiProvider platformUiProvider)
- {
- super(navigatorProvider, platformUiProvider);
- }
-
- // ********** DDL generation **********
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- EclipseLinkDDLGeneratorUi.generate(project);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java
deleted file mode 100644
index bcbd6e975e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +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.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaPlatformUiFactory;
-
-public class EclipseLinkJpaPlatformUiFactory implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLinkJpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLinkJpaPlatformUi(
- new EclipseLinkNavigatorProvider(),
- EclipseLinkJpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java
deleted file mode 100644
index 00f1582bf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java
+++ /dev/null
@@ -1,71 +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.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.EclipseLinkJavaResourceUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLinkJpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLinkJpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLinkJavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkNavigatorProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkNavigatorProvider.java
deleted file mode 100644
index f8e5c4b3d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/platform/EclipseLinkNavigatorProvider.java
+++ /dev/null
@@ -1,34 +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.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.eclipselink.ui.internal.persistencexml.details.EclipseLinkNavigatorItemContentProviderFactory;
-import org.eclipse.jpt.eclipselink.ui.internal.persistencexml.details.EclipseLinkNavigatorItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
-
-/**
- * EclipseLinkNavigatorProvider
- */
-public class EclipseLinkNavigatorProvider implements JpaNavigatorProvider
-{
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return new EclipseLinkNavigatorItemLabelProviderFactory();
- }
-
- public TreeItemContentProviderFactory getTreeItemContentProviderFactory() {
- return new EclipseLinkNavigatorItemContentProviderFactory();
- }
-
- public void dispose() {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkOrmResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkOrmResourceModelStructureProvider.java
deleted file mode 100644
index 3d3e08d31d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkOrmResourceModelStructureProvider.java
+++ /dev/null
@@ -1,48 +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.eclipselink.ui.internal.structure;
-
-import org.eclipse.jpt.ui.internal.structure.OrmItemContentProviderFactory;
-import org.eclipse.jpt.ui.internal.structure.OrmItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmResourceModelStructureProvider
- implements JpaStructureProvider
-{
- // singleton
- private static final JpaStructureProvider INSTANCE = new EclipseLinkOrmResourceModelStructureProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaStructureProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmResourceModelStructureProvider() {
- super();
- }
-
-
- public TreeItemContentProviderFactory getTreeItemContentProviderFactory() {
- return new OrmItemContentProviderFactory();
- }
-
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return new OrmItemLabelProviderFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceItemContentProviderFactory.java
deleted file mode 100644
index 2e89f7f8e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceItemContentProviderFactory.java
+++ /dev/null
@@ -1,137 +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.eclipselink.ui.internal.structure;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.internal.structure.PersistenceItemContentProviderFactory;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-public class EclipseLinkPersistenceItemContentProviderFactory
- extends PersistenceItemContentProviderFactory
-{
- @Override
- public TreeItemContentProvider buildItemContentProvider(
- Object item, DelegatingContentAndLabelProvider contentAndLabelProvider) {
- DelegatingTreeContentAndLabelProvider treeContentProvider = (DelegatingTreeContentAndLabelProvider) contentAndLabelProvider;
- if (item instanceof EclipseLinkPersistenceUnit) {
- return new EclipseLinkPersistenceUnitItemContentProvider((EclipseLinkPersistenceUnit) item, treeContentProvider);
- }
- return super.buildItemContentProvider(item, contentAndLabelProvider);
- }
-
-
- public static class EclipseLinkPersistenceUnitItemContentProvider
- extends PersistenceUnitItemContentProvider
- {
- public EclipseLinkPersistenceUnitItemContentProvider(
- EclipseLinkPersistenceUnit persistenceUnit, DelegatingTreeContentAndLabelProvider contentProvider) {
- super(persistenceUnit, contentProvider);
- }
-
- @Override
- public EclipseLinkPersistenceUnit getModel() {
- return (EclipseLinkPersistenceUnit) super.getModel();
- }
-
- @Override
- protected CollectionValueModel<JpaStructureNode> buildChildrenModel() {
- CollectionValueModel<MappingFileRef> specifiedMappingFileCvm =
- new ListCollectionValueModelAdapter<MappingFileRef>(
- new ListAspectAdapter<PersistenceUnit, MappingFileRef>(
- PersistenceUnit.SPECIFIED_MAPPING_FILE_REFS_LIST,
- getModel()) {
- @Override
- protected ListIterator<MappingFileRef> listIterator_() {
- return subject.specifiedMappingFileRefs();
- }
- @Override
- protected int size_() {
- return subject.specifiedMappingFileRefsSize();
- }
- });
-
- CollectionValueModel<MappingFileRef> impliedMappingFileCvm =
- new PropertyCollectionValueModelAdapter<MappingFileRef>(
- new PropertyAspectAdapter<PersistenceUnit, MappingFileRef>(
- PersistenceUnit.IMPLIED_MAPPING_FILE_REF_PROPERTY,
- getModel()) {
- @Override
- protected MappingFileRef buildValue_() {
- return subject.getImpliedMappingFileRef();
- }
- }
- );
- CollectionValueModel<MappingFileRef> impliedEclipseLinkMappingFileCvm =
- new PropertyCollectionValueModelAdapter<MappingFileRef>(
- new PropertyAspectAdapter<EclipseLinkPersistenceUnit, MappingFileRef>(
- EclipseLinkPersistenceUnit.IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY,
- getModel()) {
- @Override
- protected MappingFileRef buildValue_() {
- return subject.getImpliedEclipseLinkMappingFileRef();
- }
- }
- );
- CollectionValueModel<ClassRef> specifiedClassCvm =
- new ListCollectionValueModelAdapter<ClassRef>(
- new ListAspectAdapter<PersistenceUnit, ClassRef>(
- PersistenceUnit.SPECIFIED_CLASS_REFS_LIST,
- getModel()) {
- @Override
- protected ListIterator<ClassRef> listIterator_() {
- return subject.specifiedClassRefs();
- }
- @Override
- protected int size_() {
- return subject.specifiedClassRefsSize();
- }
- });
- CollectionValueModel<ClassRef> impliedClassCvm =
- new CollectionAspectAdapter<PersistenceUnit, ClassRef>(
- PersistenceUnit.IMPLIED_CLASS_REFS_COLLECTION,
- getModel()) {
- @Override
- protected Iterator<ClassRef> iterator_() {
- return subject.impliedClassRefs();
- }
- @Override
- protected int size_() {
- return subject.impliedClassRefsSize();
- }
- };
- List<CollectionValueModel<? extends JpaStructureNode>> list = new ArrayList<CollectionValueModel<? extends JpaStructureNode>>(4);
- list.add(specifiedMappingFileCvm);
- list.add(impliedMappingFileCvm);
- list.add(impliedEclipseLinkMappingFileCvm);
- list.add(specifiedClassCvm);
- list.add(impliedClassCvm);
-
- return new CompositeCollectionValueModel<CollectionValueModel<? extends JpaStructureNode>, JpaStructureNode>(list);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceResourceModelStructureProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceResourceModelStructureProvider.java
deleted file mode 100644
index dc3b569088..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/structure/EclipseLinkPersistenceResourceModelStructureProvider.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.eclipselink.ui.internal.structure;
-
-import org.eclipse.jpt.ui.internal.structure.PersistenceItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkPersistenceResourceModelStructureProvider
- implements JpaStructureProvider
-{
- // singleton
- private static final JpaStructureProvider INSTANCE = new EclipseLinkPersistenceResourceModelStructureProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaStructureProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceResourceModelStructureProvider() {
- super();
- }
-
-
- public TreeItemContentProviderFactory getTreeItemContentProviderFactory() {
- return new EclipseLinkPersistenceItemContentProviderFactory();
- }
-
- public ItemLabelProviderFactory getItemLabelProviderFactory() {
- return new PersistenceItemLabelProviderFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiDefinition.java
deleted file mode 100644
index 76093d2e28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiDefinition.java
+++ /dev/null
@@ -1,107 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmXml1_1UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml1_1UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_1UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml1_1UiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkOrmResourceModelStructureProvider.instance();
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiFactory.java
deleted file mode 100644
index b4dee2bab3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/EclipseLinkOrmXml1_1UiFactory.java
+++ /dev/null
@@ -1,104 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.BaseEclipseLinkOrmXmlUiFactory;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml1_1UiFactory extends BaseEclipseLinkOrmXmlUiFactory
-{
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedIdMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java
deleted file mode 100644
index e9e3e7afc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkBasicCollectionMapping1_1Composite extends Pane<EclipseLinkBasicCollectionMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicCollectionMapping1_1Composite(PropertyValueModel<? extends EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EclipseLinkBasicCollectionMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java
deleted file mode 100644
index 9570262e71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkBasicMapMapping1_1Composite extends Pane<EclipseLinkBasicMapMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMapMapping1_1Composite(PropertyValueModel<? extends EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EclipseLinkBasicMapMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java
deleted file mode 100644
index cb1cc12398..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkBasicMapping1_1Composite.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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicMapping1_1Composite extends EclipseLinkBasicMappingComposite<OrmBasicMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMapping1_1Composite(PropertyValueModel<? extends OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<BasicMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java
deleted file mode 100644
index ac049a21d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java
+++ /dev/null
@@ -1,56 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractEmbeddedIdMappingComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEmbeddedIdMapping1_1Composite
- extends AbstractEmbeddedIdMappingComposite<OrmEmbeddedIdMapping>
- implements JpaComposite
-{
- public OrmEclipseLinkEmbeddedIdMapping1_1Composite(
- PropertyValueModel<? extends OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedIdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java
deleted file mode 100644
index 8be36c7e7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java
+++ /dev/null
@@ -1,77 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkEmbeddedMapping1_1Composite extends AbstractEmbeddedMappingComposite<OrmEmbeddedMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkEmbeddedMapping1_1Composite(PropertyValueModel<? extends OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container
- );
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmEmbeddedMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkIdMapping1_1Composite.java
deleted file mode 100644
index 3e75255b8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkIdMapping1_1Composite.java
+++ /dev/null
@@ -1,53 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkIdMapping1_1Composite
- extends EclipseLinkIdMappingComposite<OrmIdMapping>
-{
- public OrmEclipseLinkIdMapping1_1Composite(
- PropertyValueModel<? extends OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<IdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
deleted file mode 100644
index 0b9a5bf303..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
+++ /dev/null
@@ -1,95 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToManyMapping1_1Composite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToManyMapping1_1Composite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java
deleted file mode 100644
index be9e313f46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java
+++ /dev/null
@@ -1,107 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToOneMapping1_1Composite
- extends EclipseLinkManyToOneMappingComposite<OrmManyToOneMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToOneMapping1_1Composite(PropertyValueModel<? extends OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java
deleted file mode 100644
index f151f8e1ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMapping1_1Composite<T extends OrmOneToManyMapping>
- extends EclipseLinkOneToManyMappingComposite<T>
-{
- public OrmEclipseLinkOneToManyMapping1_1Composite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<T, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java
deleted file mode 100644
index 6270a5b0b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java
+++ /dev/null
@@ -1,127 +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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OneToOneJoiningStrategyPane;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AccessTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OneToOneJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkPrivateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see AccessTypeComposite
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkPrivateOwnedComposite
- * @see FetchTypeComposite
- * @see MappedByPane
- * @see OneToOneJoiningStrategyPane
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkOneToOneMapping1_1Composite
-extends EclipseLinkOneToOneMappingComposite<OrmOneToOneMapping>
-{
- /**
- * Creates a new <code>Eclipselink1_1OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkOneToOneMapping1_1Composite(PropertyValueModel<? extends OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java
deleted file mode 100644
index eee9199c04..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/details/orm/OrmEclipseLinkVersionMapping1_1Composite.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.eclipselink.ui.internal.v1_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkVersionMapping1_1Composite extends EclipseLinkVersionMappingComposite<OrmVersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkVersionMapping1_1Composite(PropertyValueModel<? extends OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<VersionMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiFactory.java
deleted file mode 100644
index b0b6dd0fd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiFactory.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.eclipselink.ui.internal.v1_1.platform;
-
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUi;
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkNavigatorProvider;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaPlatformUiFactory;
-
-public class EclipseLink1_1JpaPlatformUiFactory implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink1_1JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLinkJpaPlatformUi(
- new EclipseLinkNavigatorProvider(),
- EclipseLink1_1JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiProvider.java
deleted file mode 100644
index 35d17bd028..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_1/platform/EclipseLink1_1JpaPlatformUiProvider.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.eclipselink.ui.internal.v1_1.platform;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.EclipseLinkJavaResourceUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLink1_1JpaPlatformUiProvider
- extends AbstractJpaPlatformUiProvider
-{
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink1_1JpaPlatformUiProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLink1_1JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLinkJavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaResourceUiDefinition.java
deleted file mode 100644
index 37b0e1ab53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,104 +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.eclipselink.ui.internal.v1_2.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkOneToManyMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-
-public class EclipseLink1_2JavaResourceUiDefinition extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLink1_2JavaResourceUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLink1_2JavaResourceUiDefinition() {
- super();
- }
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLink1_2JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaUiFactory.java
deleted file mode 100644
index 77f2534c85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/EclipseLink1_2JavaUiFactory.java
+++ /dev/null
@@ -1,53 +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.eclipselink.ui.internal.v1_2.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.EclipseLinkJavaUiFactory;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java.JavaEclipseLinkEmbeddable1_2Composite;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java.JavaEclipseLinkEntity1_2Composite;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java.JavaEclipseLinkMappedSuperclass1_2Composite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLink1_2JavaUiFactory extends EclipseLinkJavaUiFactory
-{
- public EclipseLink1_2JavaUiFactory() {
- super();
- }
-
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclass1_2Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntity1_2Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEmbeddable1_2Composite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEmbeddable1_2Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEmbeddable1_2Composite.java
deleted file mode 100644
index 26a4c0a569..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEmbeddable1_2Composite.java
+++ /dev/null
@@ -1,69 +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.eclipselink.ui.internal.v1_2.details.java;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.AbstractJavaEclipseLinkEmbeddableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkEmbeddable1_2Composite extends AbstractJavaEclipseLinkEmbeddableComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</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
- */
- public JavaEclipseLinkEmbeddable1_2Composite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEmbeddable, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEntity1_2Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEntity1_2Composite.java
deleted file mode 100644
index 81d541a717..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkEntity1_2Composite.java
+++ /dev/null
@@ -1,68 +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.eclipselink.ui.internal.v1_2.details.java;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.AbstractJavaEclipseLinkEntityComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.ui.internal.details.TableComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink1.2 Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class JavaEclipseLinkEntity1_2Composite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntity1_2Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java
deleted file mode 100644
index 6f6737d3af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java
+++ /dev/null
@@ -1,64 +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.eclipselink.ui.internal.v1_2.details.java;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.AbstractJavaEclipseLinkMappedSuperclassComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkMappedSuperclass1_2Composite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</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
- */
- public JavaEclipseLinkMappedSuperclass1_2Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/orm/EclipseLinkOrmXml1_2UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/orm/EclipseLinkOrmXml1_2UiDefinition.java
deleted file mode 100644
index 20f05d11d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/details/orm/EclipseLinkOrmXml1_2UiDefinition.java
+++ /dev/null
@@ -1,108 +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.eclipselink.ui.internal.v1_2.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.EclipseLinkOrmXml1_1UiFactory;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmXml1_2UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml1_2UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_2UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml1_1UiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkOrmResourceModelStructureProvider.instance();
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiFactory.java
deleted file mode 100644
index e2e8ce411d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiFactory.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.eclipselink.ui.internal.v1_2.platform;
-
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUi;
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkNavigatorProvider;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaPlatformUiFactory;
-
-public class EclipseLink1_2JpaPlatformUiFactory implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink1_2JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLinkJpaPlatformUi(
- new EclipseLinkNavigatorProvider(),
- EclipseLink1_2JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiProvider.java
deleted file mode 100644
index f7d80e891c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v1_2/platform/EclipseLink1_2JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,75 +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.eclipselink.ui.internal.v1_2.platform;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java.EclipseLink1_2JavaResourceUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLink1_2JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink1_2JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink1_2JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink1_2JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
deleted file mode 100644
index e433b0003a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
+++ /dev/null
@@ -1,57 +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.eclipselink.ui.internal.v2_0.ddlgen.wizards;
-
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.ddlgen.EclipseLink2_0DDLGenerator;
-import org.eclipse.jpt.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi;
-
-/**
- * EclipseLink2_0DDLGeneratorUi
- */
-public class EclipseLink2_0DDLGeneratorUi extends EclipseLinkDDLGeneratorUi
-{
-
- // ********** static method **********
-
- public static void generate(JpaProject project) {
- new EclipseLink2_0DDLGeneratorUi(project).generate();
- }
-
- // ********** constructors **********
-
- private EclipseLink2_0DDLGeneratorUi(JpaProject project) {
- super(project);
- }
-
- // ********** behavior **********
-
- @Override
- protected IWorkspaceRunnable buildGenerateDDLRunnable(String puName, JpaProject project) {
- return new Generate2_0DDLRunnable(puName, project);
- }
-
- // ********** runnable **********
-
- protected static class Generate2_0DDLRunnable extends EclipseLinkDDLGeneratorUi.GenerateDDLRunnable {
-
- public Generate2_0DDLRunnable(String puName, JpaProject project) {
- super(puName, project);
- }
-
- @Override
- protected void ddlGeneratorGenerate(String puName, JpaProject project, String projectLocation, IProgressMonitor monitor) {
- EclipseLink2_0DDLGenerator.generate(puName, project, projectLocation, monitor);
- }
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/EclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/EclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 85b5362090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/EclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,186 +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.eclipselink.ui.internal.v2_0.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCacheCoordinationTypeComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkExpiryComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.ui.internal.jpa2.details.JptUiDetailsMessages2_0;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public abstract class EclipseLinkCaching2_0Composite<T extends EclipseLinkCaching> extends Pane<T>
-{
-
- protected EclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- PropertyValueModel<Cacheable2_0> cacheableHolder = buildCacheableHolder();
-
- //Shared Check box, uncheck this and the rest of the panel is disabled
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 8),
- JptUiDetailsMessages2_0.Entity_cacheableLabel,
- buildSpecifiedCacheableHolder(cacheableHolder),
- buildCacheableStringHolder(cacheableHolder),
- JpaHelpContextIds.ENTITY_CACHEABLE
- );
-
- Composite subPane = addSubPane(container, 0, 16);
-
- Collection<Pane<?>> panes = new ArrayList<Pane<?>>();
-
- panes.add(new EclipseLinkCacheTypeComposite(this, subPane));
- panes.add(new EclipseLinkCacheSizeComposite(this, subPane));
-
- // Advanced sub-pane
- Composite advancedSection = addCollapsibleSubSection(
- subPane,
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_advanced,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- initializeAdvancedPane(addSubPane(advancedSection, 0, 16), panes);
-
- new PaneEnabler(buildCacheableEnabler(cacheableHolder), panes);
-
- initializeExistenceCheckingComposite(addSubPane(container, 8));
- }
-
- protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Cacheable2_0>(getSubjectHolder()) {
- @Override
- protected Cacheable2_0 buildValue_() {
- return ((CacheableHolder2_0) this.subject).getCacheable();
- }
- };
- }
-
- protected void initializeAdvancedPane(Composite container, Collection<Pane<?>> panes) {
- panes.add(new EclipseLinkExpiryComposite(this, container));
- panes.add(new EclipseLinkAlwaysRefreshComposite(this, container));
- panes.add(new EclipseLinkRefreshOnlyIfNewerComposite(this, container));
- panes.add(new EclipseLinkDisableHitsComposite(this, container));
- panes.add(new EclipseLinkCacheCoordinationTypeComposite(this, container));
- }
-
- protected abstract void initializeExistenceCheckingComposite(Composite parent);
-
- private PropertyValueModel<Boolean> buildCacheableEnabler(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- cacheableHolder,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCacheable());
- }
- };
- }
-
- private WritablePropertyValueModel<Boolean> buildSpecifiedCacheableHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(cacheableHolder, Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedCacheable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedCacheable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildCacheableStringHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultCacheableHolder(cacheableHolder)) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptUiDetailsMessages.Boolean_True : JptUiDetailsMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages2_0.Entity_cacheableWithDefaultLabel, defaultStringValue);
- }
- return JptUiDetailsMessages2_0.Entity_cacheableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultCacheableHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- cacheableHolder,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedCacheable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultCacheable());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaResourceUiDefinition.java
deleted file mode 100644
index 5094722458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,116 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkOneToManyMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.jpa2.details.java.JavaElementCollectionMapping2_0UiDefinition;
-
-public class EclipseLink2_0JavaResourceUiDefinition
- extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLink2_0JavaResourceUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLink2_0JavaResourceUiDefinition() {
- super();
- }
-
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLink2_0JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaEclipseLinkIdMapping2_0UiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
-
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(JavaElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
-
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaUiFactory.java
deleted file mode 100644
index 863c2fd2a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/EclipseLink2_0JavaUiFactory.java
+++ /dev/null
@@ -1,114 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.java.EclipseLink1_2JavaUiFactory;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.EmbeddedIdMapping2_0Composite;
-import org.eclipse.jpt.ui.jpa2.details.java.JavaUiFactory2_0;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLink2_0JpaUiFactory
- */
-public class EclipseLink2_0JavaUiFactory
- extends EclipseLink1_2JavaUiFactory
- implements JavaUiFactory2_0
-{
- public EclipseLink2_0JavaUiFactory() {
- super();
- }
-
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- @Override
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddedIdMappingComposite(
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaElementCollectionMapping2_0Composite(
- PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkCaching2_0Composite.java
deleted file mode 100644
index b888f14b3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,63 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.JavaEclipseLinkExistenceCheckingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.EclipseLinkCaching2_0Composite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public class JavaEclipseLinkCaching2_0Composite extends EclipseLinkCaching2_0Composite<JavaEclipseLinkCaching>
-{
-
- public JavaEclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<JavaEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new JavaEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java
deleted file mode 100644
index 7e71436a3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkElementCollectionMapping2_0Composite extends AbstractElementCollectionMapping2_0Composite<JavaElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkElementCollectionMapping2_0Composite(PropertyValueModel<? extends JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchHolder(), container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchHolder() {
- return new PropertyAspectAdapter<JavaElementCollectionMapping2_0, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkElementCollectionMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkEntity2_0Composite.java
deleted file mode 100644
index a34fc9c6fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkEntity2_0Composite.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.GeneratorContainer;
-import org.eclipse.jpt.core.context.QueryContainer;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.AbstractJavaEclipseLinkEntityComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.ui.internal.details.TableComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.Generation2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink1.1 Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class JavaEclipseLinkEntity2_0Composite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntity2_0Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new Generation2_0Composite(this, generatorContainerHolder, container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0Composite.java
deleted file mode 100644
index c340793a1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0Composite.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkIdMapping2_0Composite
- extends EclipseLinkIdMappingComposite<JavaIdMapping>
- implements JpaComposite
-{
- public JavaEclipseLinkIdMapping2_0Composite(
- PropertyValueModel<? extends JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java
deleted file mode 100644
index 273ba5301c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.utility.internal.Tools;
-
-public class JavaEclipseLinkIdMapping2_0UiDefinition
- extends JavaIdMappingUiDefinition
-{
- // singleton
- private static final JavaEclipseLinkIdMapping2_0UiDefinition INSTANCE =
- new JavaEclipseLinkIdMapping2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaAttributeMappingUiDefinition<JavaIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkIdMapping2_0UiDefinition() {
- super();
- }
-
-
- @Override
- public boolean isEnabledFor(PersistentAttribute mappableObject) {
- // a default eclipselink 1-1 mapping can not be mapped as an id, as mapping it
- // that way will actually result in a default 1-1 with an id derived identity
- return Tools.valuesAreDifferent(
- mappableObject.getDefaultMappingKey(),
- MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java
deleted file mode 100644
index 2c8b559099..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkManyToManyMapping2_0Composite
- extends EclipseLinkManyToManyMappingComposite<ManyToManyMapping>
-{
- public JavaEclipseLinkManyToManyMapping2_0Composite(
- PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<ManyToManyRelationshipReference> buildEclipseLinkJoiningHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, ManyToManyRelationshipReference>(this.getSubjectHolder()) {
- @Override
- protected ManyToManyRelationshipReference transform_(ManyToManyMapping value) {
- return value.getRelationshipReference();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java
deleted file mode 100644
index 4fdab8c78c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.java.JavaEclipseLinkManyToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<JavaManyToOneMapping, JavaManyToOneRelationshipReference2_0>
-{
- public JavaEclipseLinkManyToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<JavaManyToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((JavaEclipseLinkManyToOneMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java
deleted file mode 100644
index a223f56496..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java
+++ /dev/null
@@ -1,70 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.java.AbstractJavaEclipseLinkMappedSuperclassComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.3
- */
-public class JavaEclipseLinkMappedSuperclass2_0Composite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</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
- */
- public JavaEclipseLinkMappedSuperclass2_0Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
deleted file mode 100644
index 5270872050..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,63 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkOneToManyMapping2_0Composite
- extends EclipseLinkOneToManyMappingComposite<JavaOneToManyMapping>
-{
- public JavaEclipseLinkOneToManyMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java
deleted file mode 100644
index 5c0c324f92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,86 +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.eclipselink.ui.internal.v2_0.details.java;
-
-import org.eclipse.jpt.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<JavaOneToOneMapping, JavaOneToOneRelationshipReference2_0>
-{
- public JavaEclipseLinkOneToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, EclipseLinkPrivateOwned>(this.getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java
deleted file mode 100644
index a1c813bfe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java
+++ /dev/null
@@ -1,103 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.orm.EntityMappings;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.AbstractEclipseLinkEntityMappingsDetailsPage;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.EntityMappingsGenerators2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmQueries2_0Composite;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EclipseLinkEntityMappings2_0DetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkEntityMappings2_0DetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkEntityMappings2_0DetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- new EntityMappingsGenerators2_0Composite(this, container);
- }
-
- @Override
- protected void initializeQueriesCollapsibleSection(Composite container) {
- new OrmQueries2_0Composite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java
deleted file mode 100644
index 3cb4efecaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JpaStructureNode;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaDetailsPage;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPage}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 2.2
- * @since 2.2
- */
-public class EclipseLinkEntityMappings2_0DetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappings2_0DetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkEntityMappings2_0DetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE) ||
- resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE);
- }
-
- public JpaDetailsPage<? extends JpaStructureNode> buildDetailsPage(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkEntityMappings2_0DetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiDefinition.java
deleted file mode 100644
index c2d4f0b131..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiDefinition.java
+++ /dev/null
@@ -1,110 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmXml2_0UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_0UiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkOrmResourceModelStructureProvider.instance();
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java
deleted file mode 100644
index 54101ec9d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/EclipseLinkOrmXml2_0UiFactory.java
+++ /dev/null
@@ -1,137 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.BaseEclipseLinkOrmXmlUiFactory;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkBasicMapping1_1Composite;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkVersionMapping1_1Composite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmEmbeddedMapping2_0Composite;
-import org.eclipse.jpt.ui.jpa2.details.orm.OrmXmlUiFactory2_0;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml2_0UiFactory
- extends BaseEclipseLinkOrmXmlUiFactory
- implements OrmXmlUiFactory2_0
-{
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 711e5cb61f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,63 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkExistenceCheckingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.EclipseLinkCaching2_0Composite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public class OrmEclipseLinkCaching2_0Composite extends EclipseLinkCaching2_0Composite<OrmEclipseLinkCaching>
-{
-
- public OrmEclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<OrmEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new OrmEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java
deleted file mode 100644
index 372ed3b52f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkEmbeddedIdMapping1_1Composite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.EmbeddedIdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEmbeddedIdMapping2_0Composite
- extends OrmEclipseLinkEmbeddedIdMapping1_1Composite
-{
- public OrmEclipseLinkEmbeddedIdMapping2_0Composite(
- PropertyValueModel<? extends OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedIdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new EmbeddedMappingOverridesComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEntity2_0Composite.java
deleted file mode 100644
index e744619142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkEntity2_0Composite.java
+++ /dev/null
@@ -1,53 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.GeneratorContainer;
-import org.eclipse.jpt.core.context.QueryContainer;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.AbstractOrmEclipseLinkEntityComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.ui.internal.jpa2.details.Generation2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEntity2_0Composite extends AbstractOrmEclipseLinkEntityComposite
-{
- public OrmEclipseLinkEntity2_0Composite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new Generation2_0Composite(this, generatorContainerHolder, container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkIdMapping2_0Composite.java
deleted file mode 100644
index f3f0a30ef4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkIdMapping2_0Composite.java
+++ /dev/null
@@ -1,49 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.OrmEclipseLinkIdMapping1_1Composite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkIdMapping2_0Composite
- extends OrmEclipseLinkIdMapping1_1Composite
-{
- public OrmEclipseLinkIdMapping2_0Composite(
- PropertyValueModel<? extends OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
deleted file mode 100644
index 1b2dd93a15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,51 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkManyToManyMapping2_0Composite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- public OrmEclipseLinkManyToManyMapping2_0Composite(
- PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java
deleted file mode 100644
index 70140c210e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,70 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.OrmEclipseLinkManyToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<OrmManyToOneMapping, OrmManyToOneRelationshipReference2_0>
-{
- public OrmEclipseLinkManyToOneMapping2_0Composite(
- PropertyValueModel<? extends OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<OrmManyToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((OrmEclipseLinkManyToOneMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java
deleted file mode 100644
index 4a8483f5d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.AbstractOrmEclipseLinkMappedSuperclassComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclass2_0Composite<T extends OrmEclipseLinkMappedSuperclass >
- extends AbstractOrmEclipseLinkMappedSuperclassComposite<T>
-{
- public OrmEclipseLinkMappedSuperclass2_0Composite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
deleted file mode 100644
index 2a173afd46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,79 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMapping2_0Composite
- extends EclipseLinkOneToManyMappingComposite<OrmOneToManyMapping>
-{
- public OrmEclipseLinkOneToManyMapping2_0Composite(
- PropertyValueModel<? extends OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, this.buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(this.getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OrmOneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java
deleted file mode 100644
index 3e799fc8a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,101 +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.eclipselink.ui.internal.v2_0.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<OrmOneToOneMapping, OrmOneToOneRelationshipReference2_0>
-{
- public OrmEclipseLinkOneToOneMapping2_0Composite(
- PropertyValueModel<? extends OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmOneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<OrmOneToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<OrmOneToOneMapping, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OrmOneToOneMapping, OrphanRemovable2_0>(getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java
deleted file mode 100644
index 00aa7f9a57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.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.eclipselink.ui.internal.v2_0.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiFactory;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.caching.PersistenceXmlCaching2_0Tab;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.logging.PersistenceXmlLogging2_0Tab;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.options.PersistenceXmlOptions2_0Tab;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLink2_0PersistenceXmlUiFactory extends EclipseLinkPersistenceXmlUiFactory
-{
- // ********** constructors **********
-
- public EclipseLink2_0PersistenceXmlUiFactory() {
- super();
- }
-
- // ********** persistence unit tabs **********
-
- @Override
- protected PersistenceXmlCachingTab<Caching> buildCachingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Caching> cachingHolder = this.buildCachingHolder(subjectHolder);
-
- return new PersistenceXmlCaching2_0Tab(cachingHolder, parent, widgetFactory);
- }
-
- @Override
- protected PersistenceXmlLoggingTab<? extends Logging2_0> buildLoggingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Logging2_0> logging2_0Holder = this.buildLogging2_0Holder(subjectHolder);
-
- return new PersistenceXmlLogging2_0Tab(logging2_0Holder, parent, widgetFactory);
- }
-
- @Override
- protected PersistenceXmlOptionsTab<Options2_0> buildOptionsTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Options2_0> options2_0Holder = this.buildOptions2_0Holder(subjectHolder);
-
- return new PersistenceXmlOptions2_0Tab(options2_0Holder, parent, widgetFactory);
- }
-
- // ********** private methods **********
-
- private PropertyValueModel<Logging2_0> buildLogging2_0Holder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Logging2_0>(subjectHolder) {
- @Override
- protected Logging2_0 transform_(EclipseLinkPersistenceUnit value) {
-
- return (Logging2_0) value.getLogging();
- }
- };
- }
-
- private PropertyValueModel<Options2_0> buildOptions2_0Holder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Options2_0>(subjectHolder) {
- @Override
- protected Options2_0 transform_(PersistenceUnit value) {
-
- return (Options2_0) ((PersistenceUnit2_0)value).getOptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
deleted file mode 100644
index 6651bd1d1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
+++ /dev/null
@@ -1,55 +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.eclipselink.ui.internal.v2_0.persistence;
-
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkPersistenceResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkPersistenceXml2_0UiDefinition extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new EclipseLink2_0PersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkPersistenceResourceModelStructureProvider.instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java
deleted file mode 100644
index 07681dad8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java
+++ /dev/null
@@ -1,88 +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.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.CacheDefaultsComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.DefaultCacheSizeComposite;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.DefaultCacheTypeComposite;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheDefaults2_0Composite
- */
-public class CacheDefaults2_0Composite extends CacheDefaultsComposite<Caching>
-{
- public CacheDefaults2_0Composite(Pane<Caching> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.initializeCacheDefaultsComposites(parent);
- this.installPaneEnabler();
- }
-
- @Override
- protected void initializeCacheDefaultsComposites(Composite parent) {
-
- // Default Cache Type
- new DefaultCacheTypeComposite(this, parent);
-
- // Default Cache Size
- new DefaultCacheSizeComposite<Caching>(this, parent);
-
- }
-
- // ********** private methods **********
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<SharedCacheMode, Boolean>(this.buildSharedCacheModeHolder()) {
- @Override
- protected Boolean transform(SharedCacheMode value) {
- return value != SharedCacheMode.NONE;
- }
- };
- }
-
- private PropertyValueModel<SharedCacheMode> buildSharedCacheModeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit2_0, SharedCacheMode>(
- this.buildPersistenceUnit2_0Holder(),
- PersistenceUnit2_0.SPECIFIED_SHARED_CACHE_MODE_PROPERTY,
- PersistenceUnit2_0.DEFAULT_SHARED_CACHE_MODE_PROPERTY) {
- @Override
- protected SharedCacheMode buildValue_() {
- return this.subject.getSharedCacheMode();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 48dc5bd89f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,74 +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.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.EclipseLinkCachingComposite;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.options.SharedCacheModeComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-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.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * EclipseLinkCaching2_0Composite
- */
-public class EclipseLinkCaching2_0Composite extends EclipseLinkCachingComposite<Caching>
-{
- public EclipseLinkCaching2_0Composite(
- Pane<Caching> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionDescription);
- Composite composite = getWidgetFactory().createComposite(section);
- composite.setLayout(new GridLayout(1, false));
- section.setClient(composite);
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- // SharedCacheMode
- new SharedCacheModeComposite(this, this.buildPersistenceUnit2_0Holder(), composite);
- // Defaults
- new CacheDefaults2_0Composite(this, composite);
- // Flush Clear Cache
- new FlushClearCache2_0Composite(this, composite);
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java
deleted file mode 100644
index b084141956..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java
+++ /dev/null
@@ -1,85 +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.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.FlushClearCacheComposite;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * FlushClearCache2_0Composite
- */
-public class FlushClearCache2_0Composite extends FlushClearCacheComposite
-{
- /**
- * Creates a new <code>FlushClearCache2_0Composite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public FlushClearCache2_0Composite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- super.initializeLayout(parent);
-
- this.installPaneEnabler();
- }
-
- // ********** private methods **********
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<SharedCacheMode, Boolean>(this.buildSharedCacheModeHolder()) {
- @Override
- protected Boolean transform(SharedCacheMode value) {
- return value != SharedCacheMode.NONE;
- }
- };
- }
-
- private PropertyValueModel<SharedCacheMode> buildSharedCacheModeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit2_0, SharedCacheMode>(
- this.buildPersistenceUnit2_0Holder(),
- PersistenceUnit2_0.SPECIFIED_SHARED_CACHE_MODE_PROPERTY,
- PersistenceUnit2_0.DEFAULT_SHARED_CACHE_MODE_PROPERTY) {
- @Override
- protected SharedCacheMode buildValue_() {
- return this.subject.getSharedCacheMode();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java
deleted file mode 100644
index 6d2447bc0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.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.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCaching2_0Tab
- */
-public class PersistenceXmlCaching2_0Tab extends PersistenceXmlCachingTab<Caching>
-{
- public PersistenceXmlCaching2_0Tab(
- PropertyValueModel<Caching> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new EclipseLinkCaching2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java
deleted file mode 100644
index 7466682715..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.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.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ConnectionComposite
- */
-public class ConnectionComposite extends Pane<Logging2_0>
-{
- /**
- * Creates a new <code>ConnectionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ConnectionComposite(
- Pane<? extends Logging2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel,
- this.buildConnectionHolder(),
- this.buildConnectionStringHolder(),
- null
-// EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_CONNECTION // TODO
- );
- }
-
- private WritablePropertyValueModel<Boolean> buildConnectionHolder() {
- return new PropertyAspectAdapter<Logging2_0, Boolean>(getSubjectHolder(), Logging2_0.CONNECTION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getConnection();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setConnection(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildConnectionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultConnectionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? EclipseLinkUiMessages.Boolean_True : EclipseLinkUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultConnectionHolder() {
- return new PropertyAspectAdapter<Logging2_0, Boolean>(
- getSubjectHolder(),
- Logging2_0.CONNECTION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getConnection() != null) {
- return null;
- }
- return this.subject.getDefaultConnection();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java
deleted file mode 100644
index 78b034d779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java
+++ /dev/null
@@ -1,198 +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.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkCategoryLoggingLevelComposite
- */
-public class EclipseLinkCategoryLoggingLevelComposite extends Pane<Logging2_0>
-{
- private String property;
-
- /**
- * Creates a new <code>EclipseLinkCategoryLoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public EclipseLinkCategoryLoggingLevelComposite(
- Pane<Logging2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- this.property = Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
-
- this.property = Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY;
- new CategoryLoggingLevelComboViewer(this, parent);
- }
-
-
-
- private class CategoryLoggingLevelComboViewer extends Pane<Logging2_0>
- {
- private static final String DEFAULT_PROPERTY = Logging2_0.CATEGORIES_DEFAULT_LOGGING_PROPERTY;
- final private String category;
-
- /**
- * Creates a new <code>CategoryLoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CategoryLoggingLevelComboViewer(
- Pane<? extends Logging2_0> parentComposite,
- Composite parent
- ) {
- super(parentComposite, parent);
-
- this.category = EclipseLinkCategoryLoggingLevelComposite.this.property;
- }
-
- private EnumFormComboViewer<Logging2_0, LoggingLevel> addLoggingLevelCombo(Composite container) {
- return new EnumFormComboViewer<Logging2_0, LoggingLevel>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(DEFAULT_PROPERTY);
- propertyNames.add(Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- @Override
- protected LoggingLevel[] getChoices() {
- return LoggingLevel.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected LoggingLevel getDefaultValue() {
- return this.getSubject().getCategoriesDefaultLevel();
- }
-
- @Override
- protected String displayString(LoggingLevel value) {
- return this.buildDisplayString(EclipseLinkUiMessages.class, EclipseLinkCategoryLoggingLevelComposite.class, value);
- }
-
- @Override
- protected LoggingLevel getValue() {
- return this.getSubject().getLevel(category);
- }
-
- @Override
- protected void setValue(LoggingLevel value) {
- this.getSubject().setLevel(category, value);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if( propertyName != category && propertyName != DEFAULT_PROPERTY) return;
- super.propertyChanged(propertyName);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLabeledComposite(
- parent,
- this.buildLabelString(),
- this.addLoggingLevelCombo(parent),
- null // TODO
- );
- }
-
- private String buildLabelString() {
-
- StringBuilder sb = new StringBuilder();
- sb.append("PersistenceXmlLoggingTab_"); //$NON-NLS-1$
- sb.append(EclipseLinkCategoryLoggingLevelComposite.this.property);
- sb.append("Label"); //$NON-NLS-1$
-
- return (String) ReflectionTools.getStaticFieldValue(EclipseLinkUiMessages.class, sb.toString());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
deleted file mode 100644
index 19f21b0d16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
+++ /dev/null
@@ -1,55 +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.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.logging.EclipseLinkLoggingComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkLogging2_0Composite
- */
-public class EclipseLinkLogging2_0Composite extends EclipseLinkLoggingComposite<Logging2_0>
-{
-
- public EclipseLinkLogging2_0Composite(
- Pane<Logging2_0> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- super.initializeLayout(parent);
-
- Composite categoryLoggingSection = this.addCollapsibleSubSection(
- this.addSubPane(parent, 0, 16),
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- this.addCategoryLoggingLevelComposite(categoryLoggingSection);
- }
-
- protected void addCategoryLoggingLevelComposite(Composite parent) {
- new EclipseLinkCategoryLoggingLevelComposite(this, parent);
- }
-
- @Override
- protected void logPropertiesComposite(Composite parent) {
- super.logPropertiesComposite(parent);
-
- // Connection:
- new ConnectionComposite(this, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java
deleted file mode 100644
index 3f6ec5871c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java
+++ /dev/null
@@ -1,37 +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.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlLogging2_0Tab
- */
-public class PersistenceXmlLogging2_0Tab extends PersistenceXmlLoggingTab<Logging2_0>
-{
- // ********** constructors/initialization **********
- public PersistenceXmlLogging2_0Tab(
- PropertyValueModel<Logging2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkLogging2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java
deleted file mode 100644
index bd753848c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.options.EclipseLinkOptionsComposite;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkOptions2_0Composite
- */
-public class EclipseLinkOptions2_0Composite extends EclipseLinkOptionsComposite<Options2_0>
-{
- public EclipseLinkOptions2_0Composite(
- Pane<Options2_0> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected Composite initializeMiscellaneousPane(Composite container) {
- Composite composite = super.initializeMiscellaneousPane(container);
-
- new LockingConfigurationComposite(this, composite);
- new QueryConfigurationComposite(this, composite);
- new ValidationConfigurationComposite(this, composite);
- return composite;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java
deleted file mode 100644
index 7beaaaf4f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java
+++ /dev/null
@@ -1,85 +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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LockingConfigurationComposite
- */
-public class LockingConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>LockingConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public LockingConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addLockTimeoutCombo(container);
- }
-
- private void addLockTimeoutCombo(Composite container) {
- new IntegerCombo<Options2_0>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.LockingConfigurationComposite_lockTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultLockTimeout();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder(), Options2_0.LOCK_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getLockTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setLockTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java
deleted file mode 100644
index f6637b82ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlOptions2_0Tab
- */
-public class PersistenceXmlOptions2_0Tab extends PersistenceXmlOptionsTab<Options2_0>
-{
- // ********** constructors/initialization **********
- public PersistenceXmlOptions2_0Tab(
- PropertyValueModel<Options2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkOptions2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java
deleted file mode 100644
index 5f4c7108e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java
+++ /dev/null
@@ -1,85 +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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.jpt.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * QueryConfigurationComposite
- */
-public class QueryConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>QueryConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public QueryConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addQueryTimeoutCombo(container);
- }
-
- private void addQueryTimeoutCombo(Composite container) {
- new IntegerCombo<Options2_0>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.QueryConfigurationComposite_queryTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultQueryTimeout();
- }
- };
- }
-
- @Override
- protected WritablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder(), Options2_0.QUERY_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getQueryTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setQueryTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java
deleted file mode 100644
index 2ec755330b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java
+++ /dev/null
@@ -1,129 +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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationConfigurationComposite
- */
-public class ValidationConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>ValidationGroupComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- // ValidationMode
- new ValidationModeComposite(this, this.buildPersistenceUnit2_0Holder(), parent);
-
- // GroupPrePersist
- this.addLabeledText(
- parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPrePersistLabel,
- this.buildValidationGroupPrePersistHolder()
- );
-
- // ValidationGroupPreUpdate
- this.addLabeledText(
- parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreUpdateLabel,
- this.buildValidationGroupPreUpdateHolder()
- );
-
- // ValidationGroupPreRemove
- this.addLabeledText(
- parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreRemoveLabel,
- this.buildValidationGroupPreRemoveHolder()
- );
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new TransformationPropertyValueModel<Options2_0, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 transform_(Options2_0 value) {
- return (PersistenceUnit2_0) value.getPersistenceUnit();
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildValidationGroupPrePersistHolder() {
- return new PropertyAspectAdapter<Options2_0, String>(this.getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getValidationGroupPrePersist();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setValidationGroupPrePersist(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildValidationGroupPreUpdateHolder() {
- return new PropertyAspectAdapter<Options2_0, String>(this.getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getValidationGroupPreUpdate();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setValidationGroupPreUpdate(value);
- }
- };
- }
-
- private WritablePropertyValueModel<String> buildValidationGroupPreRemoveHolder() {
- return new PropertyAspectAdapter<Options2_0, String>(this.getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getValidationGroupPreRemove();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setValidationGroupPreRemove(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java
deleted file mode 100644
index 3f5855ff49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.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.eclipselink.ui.internal.v2_0.persistence.options;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.ValidationMode;
-import org.eclipse.jpt.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.jpt.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.ui.internal.widgets.Pane;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationModeComposite
- */
-public class ValidationModeComposite extends Pane<PersistenceUnit2_0>
-{
- /**
- * Creates a new <code>ValidationModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationModeComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends PersistenceUnit2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLabeledComposite(
- parent,
- JptUiPersistence2_0Messages.ValidationModeComposite_validationModeLabel,
- this.addValidationModeCombo(parent),
- null // TODO
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit2_0, ValidationMode> addValidationModeCombo(Composite parent) {
-
- return new EnumFormComboViewer<PersistenceUnit2_0, ValidationMode>(this, this.getSubjectHolder(), parent) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit2_0.SPECIFIED_VALIDATION_MODE_PROPERTY);
- }
-
- @Override
- protected ValidationMode[] getChoices() {
- return ValidationMode.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected ValidationMode getDefaultValue() {
- return this.getSubject().getDefaultValidationMode();
- }
-
- @Override
- protected String displayString(ValidationMode value) {
- return this.buildDisplayString(JptUiPersistence2_0Messages.class, ValidationModeComposite.this, value);
- }
-
- @Override
- protected ValidationMode getValue() {
- return this.getSubject().getSpecifiedValidationMode();
- }
-
- @Override
- protected void setValue(ValidationMode value) {
- this.getSubject().setSpecifiedValidationMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.java
deleted file mode 100644
index 3a5a50dd74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUi.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.eclipselink.ui.internal.v2_0.platform;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.ddlgen.wizards.EclipseLink2_0DDLGeneratorUi;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.platform.base.BaseJpaPlatformUi;
-import org.eclipse.jpt.ui.navigator.JpaNavigatorProvider;
-
-public class EclipseLink2_0JpaPlatformUi extends BaseJpaPlatformUi
-{
- public EclipseLink2_0JpaPlatformUi(
- JpaNavigatorProvider navigatorProvider,
- JpaPlatformUiProvider platformUiProvider) {
-
- super(navigatorProvider, platformUiProvider);
- }
-
- // ********** DDL generation **********
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- EclipseLink2_0DDLGeneratorUi.generate(project);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.java
deleted file mode 100644
index e6563fa352..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiFactory.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.eclipselink.ui.internal.v2_0.platform;
-
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkNavigatorProvider;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaPlatformUiFactory;
-
-/**
- * EclipseLink2_0JpaPlatformUiFactory
- */
-public class EclipseLink2_0JpaPlatformUiFactory implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_0JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- new EclipseLinkNavigatorProvider(),
- EclipseLink2_0JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiProvider.java
deleted file mode 100644
index a0af4c0d3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_0/platform/EclipseLink2_0JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,87 +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.eclipselink.ui.internal.v2_0.platform;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.java.EclipseLink2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-/**
- * EclipseLink2_0JpaPlatformUiProvider
- */
-public class EclipseLink2_0JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_0JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_0JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- }
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiDefinition.java
deleted file mode 100644
index 92fde5f734..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiDefinition.java
+++ /dev/null
@@ -1,105 +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.eclipselink.ui.internal.v2_1.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.OrmEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.structure.EclipseLinkOrmResourceModelStructureProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-import org.eclipse.jpt.ui.structure.JpaStructureProvider;
-
-public class EclipseLinkOrmXml2_1UiDefinition extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_1UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_1UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_1UiFactory();
- }
-
- public boolean providesUi(JpaResourceType resourceType) {
- return resourceType.equals(JptEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE);
- }
-
- public JpaStructureProvider getStructureProvider() {
- return EclipseLinkOrmResourceModelStructureProvider.instance();
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiFactory.java
deleted file mode 100644
index 19b1eacf87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/EclipseLinkOrmXml2_1UiFactory.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.eclipselink.ui.internal.v2_1.details.orm;
-
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm.EclipseLinkOrmXml2_0UiFactory;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.details.JpaComposite;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml2_1UiFactory
- extends EclipseLinkOrmXml2_0UiFactory
-{
-
-
- @Override
- public JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkElementCollectionMapping2_1Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java
deleted file mode 100644
index 4a4c63a94c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java
+++ /dev/null
@@ -1,71 +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.eclipselink.ui.internal.v2_1.details.orm;
-
-import org.eclipse.jpt.core.context.AccessHolder;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.ui.WidgetFactory;
-import org.eclipse.jpt.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkElementCollectionMapping2_1Composite extends AbstractElementCollectionMapping2_0Composite<OrmElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkElementCollectionMapping2_1Composite(PropertyValueModel<? extends OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchHolder(), container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OrmElementCollectionMapping2_0, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchHolder() {
- return new PropertyAspectAdapter<OrmElementCollectionMapping2_0, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkElementCollectionMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiFactory.java
deleted file mode 100644
index 6e3ebfc4f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiFactory.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.eclipselink.ui.internal.v2_1.platform;
-
-import org.eclipse.jpt.eclipselink.ui.internal.platform.EclipseLinkNavigatorProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform.EclipseLink2_0JpaPlatformUi;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.platform.EclipseLink2_0JpaPlatformUiFactory;
-import org.eclipse.jpt.ui.JpaPlatformUi;
-
-public class EclipseLink2_1JpaPlatformUiFactory
- extends EclipseLink2_0JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_1JpaPlatformUiFactory() {
- super();
- }
- @Override
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- new EclipseLinkNavigatorProvider(),
- EclipseLink2_1JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiProvider.java
deleted file mode 100644
index 74646a0a56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/v2_1/platform/EclipseLink2_1JpaPlatformUiProvider.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.eclipselink.ui.internal.v2_1.platform;
-
-import java.util.List;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_1.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v1_2.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.java.EclipseLink2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.eclipselink.ui.internal.v2_1.details.orm.EclipseLinkOrmXml2_1UiDefinition;
-import org.eclipse.jpt.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.ui.ResourceUiDefinition;
-import org.eclipse.jpt.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-/**
- * EclipseLink2_1JpaPlatformUiProvider
- */
-public class EclipseLink2_1JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_1JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_1JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- }
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java
deleted file mode 100644
index 7ffab89acb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.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.eclipselink.ui.internal.wizards;
-
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.ui.internal.wizards.orm.MappingFileWizard;
-import org.eclipse.jpt.ui.internal.wizards.orm.MappingFileWizardPage;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * This is referenced in the plugin.xml as an org.eclipse.ui.newWizards extension
- */
-public class EclipseLinkMappingFileWizard extends MappingFileWizard
- implements INewWizard
-{
- public EclipseLinkMappingFileWizard() {
- this(null);
- }
-
- public EclipseLinkMappingFileWizard(IDataModel dataModel) {
- super(dataModel);
- setWindowTitle(EclipseLinkUiMessages.MappingFileWizard_title);
- }
-
-
- @Override
- protected MappingFileWizardPage buildMappingFileWizardPage() {
- return new EclipseLinkMappingFileWizardPage(getDataModel(), "Page_1", EclipseLinkUiMessages.MappingFileWizardPage_title, EclipseLinkUiMessages.MappingFileWizardPage_desc);
- }
-
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new EclipseLinkOrmFileCreationDataModelProvider();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizardPage.java b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizardPage.java
deleted file mode 100644
index 98bc51270b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/src/org/eclipse/jpt/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizardPage.java
+++ /dev/null
@@ -1,24 +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.eclipselink.ui.internal.wizards;
-
-import org.eclipse.jpt.ui.internal.wizards.orm.MappingFileWizardPage;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkMappingFileWizardPage extends MappingFileWizardPage
-{
- public EclipseLinkMappingFileWizardPage(IDataModel dataModel, String pageName, String title, String desc) {
- super(dataModel, pageName);
- setTitle(title);
- setDescription(desc);
- setPageComplete(false);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.classpath b/jpa/plugins/org.eclipse.jpt.gen/.classpath
deleted file mode 100644
index 8f257414e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ 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 ef2d5088ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.gen/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 1f15ff2b4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:07 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 3e1d50ad46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:28:54 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index 998af2bcd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/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.gen
-Bundle-Version: 1.3.100.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.gen.internal;x-friends:="org.eclipse.jpt.ui",
- org.eclipse.jpt.gen.internal.util;x-friends:="org.eclipse.jpt.ui"
-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.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.core;bundle-version="[2.2.0,2.4.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.gen/about.html b/jpa/plugins/org.eclipse.jpt.gen/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/build.properties b/jpa/plugins/org.eclipse.jpt.gen/build.properties
deleted file mode 100644
index 4fe875d02e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/component.xml b/jpa/plugins/org.eclipse.jpt.gen/component.xml
deleted file mode 100644
index 88034446f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.gen" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.gen/plugin.properties
deleted file mode 100644
index 9537a25a08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/property_files/jpt_gen.properties b/jpa/plugins/org.eclipse.jpt.gen/property_files/jpt_gen.properties
deleted file mode 100644
index db907a2472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/Association.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/Association.java
deleted file mode 100644
index 535a5a6820..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.gen.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/AssociationRole.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/AssociationRole.java
deleted file mode 100644
index f6654fb7a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/BaseEntityGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/BaseEntityGenCustomizer.java
deleted file mode 100644
index a1931ec99c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.gen.internal;
-
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/DatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/DatabaseAnnotationNameBuilder.java
deleted file mode 100644
index 2794256063..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.gen.internal;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenMessages.java
deleted file mode 100644
index d505f8d6c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/JptGenPlugin.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenPlugin.java
deleted file mode 100644
index 3540c2050d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/JptGenPlugin.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.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 JptGenPlugin {
- public static final String PLUGIN_ID = "org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/ORMGenColumn.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenColumn.java
deleted file mode 100644
index 336c9eb1b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenColumn.java
+++ /dev/null
@@ -1,415 +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.gen.internal;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.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(), getName());
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, mTable.getName(), getName());
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, mTable.getName(), getName());
- }
-
- 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(), getName());
- }
- }
-
- /**
- * Returns the column name.
- */
- public String getName() {
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildColumnAnnotationName(mDbColumn.getName(), mDbColumn);
- return annotationName != null ? annotationName : 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(getName(), 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.gen/src/org/eclipse/jpt/gen/internal/ORMGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenCustomizer.java
deleted file mode 100644
index 907acb5b90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenCustomizer.java
+++ /dev/null
@@ -1,820 +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.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.db.Column;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.gen.internal.util.FileUtil;
-import org.eclipse.jpt.gen.internal.util.ForeignKeyInfo;
-import org.eclipse.jpt.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) {
- JptGenPlugin.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, JptGenPlugin.PLUGIN_ID,
- "Unable to save the ORMGenCustomizer file: "+mFile,ex));
- JptGenPlugin.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));
- }
- /**
- * 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 shouldUpdatePersistenceXml() {
- return mUpdatePersistenceXml;
- }
- public void setShouldUpdatePersistenceXml(boolean updatePersistenceXml) {
- this.mUpdatePersistenceXml = updatePersistenceXml;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenTable.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenTable.java
deleted file mode 100644
index aebdda5e69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/ORMGenTable.java
+++ /dev/null
@@ -1,1031 +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.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.db.Column;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.gen.internal.util.StringUtil;
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * 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, getName(), null);
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, getName(), null);
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, getName(), null);
- }
-
- protected void setCustomizedBoolean(String propName, boolean value, boolean defaultValue) {
- if (defaultValue == value) {
- setCustomized(propName, null); // remove the property
- }
- else {
- getCustomizer().setBooleanProperty(propName, value, getName(), null);
- }
- }
-
- public Table getDbTable() {
- return mDbTable;
- }
-
- /**
- * Returns the table name.
- */
- public String getName() {
- if (mDbTable == null)
- return ORMGenCustomizer.ANY_TABLE;
- return mDbTable.getName();
- }
-
- 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(getName(), 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(getName());
- 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.gen/src/org/eclipse/jpt/gen/internal/OverwriteConfirmer.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/OverwriteConfirmer.java
deleted file mode 100644
index 86bf27d306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
deleted file mode 100644
index 90489abfa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,335 +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.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.NullProgressMonitor;
-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.core.JpaProject;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.context.persistence.Persistence;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.gen.internal.util.CompilationUnitModifier;
-import org.eclipse.jpt.gen.internal.util.FileUtil;
-import org.eclipse.jpt.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 JpaProject jpaProject;
- private ORMGenCustomizer customizer;
- private static OverwriteConfirmer overwriteConfirmer = null;
-
- static public void setOverwriteConfirmer(OverwriteConfirmer confirmer){
- overwriteConfirmer = confirmer;
- }
- /**
- * @param customizer
- * @param synchronizePersistenceXml
- * @param copyJdbcDrive
- * @throws Exception
- */
- static public void generate(JpaProject jpaProject, ORMGenCustomizer customizer, IProgressMonitor monitor ) throws CoreException {
- PackageGenerator generator = new PackageGenerator();
- generator.setProject(jpaProject);
- generator.setCustomizer(customizer);
-
- try {
- generator.doGenerate(monitor);
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JptGenPlugin.PLUGIN_ID, JptGenMessages.Error_Generating_Entities, e));
- }
- }
-
- private Object getCustomizer() {
- return this.customizer;
- }
-
- private void setCustomizer(ORMGenCustomizer customizer2) {
- this.customizer = customizer2;
- }
-
- private void setProject(JpaProject proj ){
- this.jpaProject = proj;
- }
-
- protected void doGenerate(IProgressMonitor monitor ) throws Exception {
- generateInternal( monitor );
- }
-
- protected void generateInternal(IProgressMonitor progress) 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 */
- String taskName = NLS.bind(JptGenMessages.EntityGenerator_taskName, "Total "+ tableNames.size() + 2);//$NON-NLS-1$
- progress.beginTask(taskName, tableNames.size() + 2);
-
-
- for (Iterator<String> iter = tableNames.iterator(); iter.hasNext();) {
- String tableName = iter.next();
- ORMGenTable table = customizer.getTable(tableName);
-
- String className = table.getQualifiedClassName();
-
- generateClass(table, templDir.getAbsolutePath(), progress);
- progress.worked(1);
-
- 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());
- }
- }
-
- //update persistence.xml
- if (this.customizer.shouldUpdatePersistenceXml()) {
- updatePersistenceXml(genClasses);
- }
- progress.done();
- }
-
- private void updatePersistenceXml(final List<String> genClasses) {
- JpaXmlResource resource = 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 = 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.persistenceUnitsSize() == 0) {
- persistenceUnit = persistence.addPersistenceUnit();
- persistenceUnit.setName(jpaProject.getName());
- } else {
- // we only support one persistence unit - take the first one
- persistenceUnit = persistence.persistenceUnits().next();
- }
- for (Iterator<String> stream = genClasses.iterator(); stream.hasNext();) {
- String className = stream.next();
- if (!persistenceUnit.mappingFileRefsContaining(className).hasNext() && !persistenceUnit.specifiesPersistentType(className)) {
- ClassRef classRef = persistenceUnit.addSpecifiedClassRef();
- classRef.setClassName(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(JptGenPlugin.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, JptGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptGenPlugin.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, JptGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptGenPlugin.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, 100);
-
- try{
- IFolder javaPackageFolder = getJavaPackageFolder(table, monitor);
- IFile javaFile = javaPackageFolder.getFile( table.getClassName() + ".java"); //$NON-NLS-1$
-
- if( javaFile.exists() ){
- if( overwriteConfirmer!=null && !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(20);
-
- generateJavaFile(table, javaFile, ve, "main.java.vm", true/*isDomainClass*/, monitor); //$NON-NLS-1$
- sm.worked(80);
-
- if (table.isCompositeKey()) {
- IFile compositeKeyFile = javaPackageFolder.getFile( table.getCompositeKeyClassName()+".java"); //$NON-NLS-1$
- generateJavaFile(table, compositeKeyFile, ve, "pk.java.vm", false/*isDomainClass*/, monitor ); //$NON-NLS-1$
- }
-
- javaFile.refreshLocal(1, new NullProgressMonitor());
-
- } catch(Throwable e){
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + "" + JptGenPlugin.PLUGIN_ID , e) );//$NON-NLS-1$
- JptGenPlugin.logException( ce );
- }
- sm.setWorkRemaining(0);
- }
-
- 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 {
- javaFile.setContents(new ByteArrayInputStream(fileContent.getBytes()), true, true, monitor );
- }
- } else {
- createFile(javaFile, new ByteArrayInputStream(fileContent.getBytes()));
- }
- }
-
-
- /**
- * 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)*/
- IJavaProject project = jpaProject.getJavaProject();
- CompilationUnitModifier modifier = new CompilationUnitModifier(project, 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(getJavaProject(), table.getSourceFolder());
- String packageName = table.getPackage();
- if( packageName==null ) packageName ="";
- IPackageFragment packageFragment = root.getPackageFragment(packageName);
- if( !packageFragment.exists()){
- root.createPackageFragment(packageName, true, monitor);
- }
- return (IFolder)packageFragment.getResource();
- }
-
- private IJavaProject getJavaProject(){
- return this.jpaProject.getJavaProject();
- }
-
- 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) {
- JptGenPlugin.logException(e);
- }
- }
- return defaultSrcPath;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/TagNames.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/TagNames.java
deleted file mode 100644
index 2b6533a97e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/util/CompilationUnitModifier.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/CompilationUnitModifier.java
deleted file mode 100644
index 586f01b672..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/util/DTPUtil.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/DTPUtil.java
deleted file mode 100644
index b4a71f982c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/DTPUtil.java
+++ /dev/null
@@ -1,80 +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.gen.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.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().getConnectionProfile().getDatabase().getDefaultSchema();
- return defaultSchema.getName() == schemaName;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/EntityGenTools.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/EntityGenTools.java
deleted file mode 100644
index 81e2563e01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.gen.internal.util;
-
-import java.util.Collection;
-import org.eclipse.jpt.utility.internal.NameTools;
-import org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/util/FileUtil.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/FileUtil.java
deleted file mode 100644
index 890b846166..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.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.gen/src/org/eclipse/jpt/gen/internal/util/ForeignKeyInfo.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/ForeignKeyInfo.java
deleted file mode 100644
index 75e91e9de3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.gen.internal.util;
-
-import java.util.List;
-
-import org.eclipse.jpt.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.gen/src/org/eclipse/jpt/gen/internal/util/StringUtil.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/StringUtil.java
deleted file mode 100644
index ee45e06fba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/src/org/eclipse/jpt/gen/internal/util/UrlUtil.java b/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/gen/internal/util/UrlUtil.java
deleted file mode 100644
index c2ef8f87ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/src/org/eclipse/jpt/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.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.gen/templates/entities/column.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/column.vm
deleted file mode 100644
index 5d1f13c98d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.quote($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.gen/templates/entities/join.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm
deleted file mode 100644
index 531e4d91be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/templates/entities/join.vm
+++ /dev/null
@@ -1,80 +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.quote($column.joinColumnName)")
-#if( !$referencedColumn.primaryKey || $referencedColumn.partOfCompositePrimaryKey )
-#set ($members = "$members, referencedColumnName=$customizer.quote($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="${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 = $role.getReferencedTable().getName() )
-#set( $referencedTablePkName = $role.getReferencedTable().getPrimaryKeyColumn().name )
-#set( $computedJoinColumnName = "${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.gen/templates/entities/main.java.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/main.java.vm
deleted file mode 100644
index 6f50a76f48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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="${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.gen/templates/entities/manyToMany.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/manyToMany.vm
deleted file mode 100644
index e482aa31c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/templates/entities/manyToOne.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/manyToOne.vm
deleted file mode 100644
index 7d279bbd6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/templates/entities/mappingKind.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/mappingKind.vm
deleted file mode 100644
index 80ad057233..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/templates/entities/oneToMany.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/oneToMany.vm
deleted file mode 100644
index 46f15cbec9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/templates/entities/oneToOne.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/oneToOne.vm
deleted file mode 100644
index 7bd7519a96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.gen/templates/entities/pk.java.vm b/jpa/plugins/org.eclipse.jpt.gen/templates/entities/pk.java.vm
deleted file mode 100644
index 1831098585..0000000000
--- a/jpa/plugins/org.eclipse.jpt.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.jaxb.core.schemagen/.classpath b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.classpath
deleted file mode 100644
index 64c5e31b7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.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/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
deleted file mode 100644
index c5e82d7458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin \ 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 025cb3b6fa..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 5b24c9f8fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Mar 22 12:16:03 EDT 2010
-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.compliance=1.5
-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.jaxb.core.schemagen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
deleted file mode 100644
index c73f61bd29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,10 +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.1.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: javax.xml.bind
-Export-Package: org.eclipse.jpt.jaxb.core.schemagen
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.properties
deleted file mode 100644
index 8ac4a493cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/build.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
-###############################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/plugin.properties
deleted file mode 100644
index 2e7dfca4c9..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
deleted file mode 100644
index b469e47b82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/Main.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* 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.text.MessageFormat;
-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;
-
-/**
- * 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);
- }
- String result = (jaxbContext != null) ?
- this.bind(JptJaxbCoreMessages.SCHEMA_GENERATED, this.targetSchemaName) :
- this.bind(JptJaxbCoreMessages.SCHEMA_NOT_CREATED, this.targetSchemaName);
- System.out.println(result);
- }
-
- private JAXBContext buildJaxbContext() {
- System.out.println(this.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(this.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(this.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 = this.bind(JptJaxbCoreMessages.CONTEXT_FACTORY_NOT_FOUND, linkedEx.getMessage());
- System.err.println(errorMessage);
- }
- else {
- ex.printStackTrace();
- }
- }
-
- private String getString(String key) {
- return JptJaxbCoreMessages.getString(key);
- }
-
- private String bind(String key, Object argument) {
- return MessageFormat.format(this.getString(key), argument);
- }
-
- // ********** 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 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 targetSchemaName;
-
- protected JptSchemaOutputResolver(String targetSchemaName) {
- this.targetSchemaName = targetSchemaName;
- }
-
- @Override
- public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException {
- String canonicalName = this.canonicalFileName(this.targetSchemaName);
- File file = new File(canonicalName);
- StreamResult result = new StreamResult(file);
- result.setSystemId(file.toURL().toExternalForm());
- return result;
- }
-
- public String canonicalFileName(String fileName) {
- return canonicalFile(new File(fileName)).getAbsolutePath();
- }
-
- public File canonicalFile(File file) {
- try {
- return file.getCanonicalFile();
- }
- catch (IOException ioexception) {
- return file.getAbsoluteFile();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/JptJaxbCoreMessages.java b/jpa/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/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/src/org/eclipse/jpt/jaxb/core/schemagen/internal/jpt_jaxb_core.properties
deleted file mode 100644
index e6367e13a7..0000000000
--- a/jpa/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\
-configured 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/jpa/plugins/org.eclipse.jpt.jaxb.ui/.classpath b/jpa/plugins/org.eclipse.jpt.jaxb.ui/.classpath
deleted file mode 100644
index a1d4f10a15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.classpath
+++ /dev/null
@@ -1,8 +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="src" path="property_files"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ No newline at end of file
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 67371280df..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 7e50a8f1f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,8 +0,0 @@
-#Mon Feb 08 18:48:37 EST 2010
-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.compliance=1.5
-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.jaxb.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jaxb.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 4260a4fa79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.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.jaxb.ui;singleton:=true
-Bundle-Version: 1.0.1.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.core.runtime;bundle-version="[3.4.0,4.0.0)",
- 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;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.core;bundle-version="[2.3.0,3.0.0)",
- org.eclipse.help;bundle-version="[3.5.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jaxb.core.internal;x-internal:=true,
- org.eclipse.jpt.jaxb.ui;x-internal:=true,
- 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.wizards.classesgen;x-internal:=true,
- org.eclipse.jpt.jaxb.ui.internal.wizards.schemagen;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/about.html b/jpa/plugins/org.eclipse.jpt.jaxb.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/build.properties b/jpa/plugins/org.eclipse.jpt.jaxb.ui/build.properties
deleted file mode 100644
index c822d05074..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/build.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
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties,\
- icons/
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/component.xml b/jpa/plugins/org.eclipse.jpt.jaxb.ui/component.xml
deleted file mode 100644
index 04957fe9b2..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif b/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
deleted file mode 100644
index b6efdd3d86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif b/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
deleted file mode 100644
index a1c6545cd6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/etool16/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif b/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
deleted file mode 100644
index 390f48216a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/NewXSD.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif b/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
deleted file mode 100644
index 0ac0ee8635..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/icons/full/wizban/newclass_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
deleted file mode 100644
index c3a67294d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.properties
+++ /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
-###############################################################################
-
-# ====================================================================
-# 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 - UI
-providerName=Eclipse Web Tools Platform
-
-jpaWizardCategoryName = JAXB
-
-generateJaxbClasses = JAXB Classes...
-
-generateSchemaFromClassesName = Schema from JAXB Classes
-generateSchemaFromClassesDesc = Generate a Schema from JAXB classes \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
deleted file mode 100644
index efae852975..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/plugin.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.jaxb"
- name="%jpaWizardCategoryName"/>
-
- <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>
-
- </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="*.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>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties b/jpa/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
deleted file mode 100644
index 478c762757..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/property_files/jpt_jaxb_ui.properties
+++ /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
-################################################################################
-
-# ClassesGenerator
-ClassesGeneratorWizard_title = JAXB Class Generation
-
-ClassesGeneratorWizard_errorDialogTitle = Generate Classes Failed
-ClassesGeneratorWizard_couldNotCreate = Could not create {0}
-
-ClassesGeneratorWizardPage_title = Generate Classes from Schema: {0}
-ClassesGeneratorWizardPage_desc = Configure JAXB class generation.
-
-ClassesGeneratorWizardPage_usesMoxyImplementation = Use EclipseLink MOXy as the JAXB implementation
-
-ClassesGeneratorWizardPage_catalog = Catalog:
-ClassesGeneratorWizardPage_bindingsFiles = Bindings files:
-ClassesGeneratorWizardPage_browseButton = Browse...
-ClassesGeneratorWizardPage_addButton = Add...
-ClassesGeneratorWizardPage_removeButton = Remove
-ClassesGeneratorWizardPage_chooseABindingsFile = External Bindings File Selection
-ClassesGeneratorWizardPage_chooseACatalog = Catalog File Selection
-
-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.
-
-# SchemaGenerator
-SchemaGeneratorWizard_title = JAXB Schema Generation
-
-SchemaGeneratorWizard_generatingSchema = Generating Schema
-
-ProjectWizardPage_desc = Select a Java project.
-ProjectWizardPage_project = Project:
-
-SchemaGeneratorWizardPage_title = Generate Schema from Classes
-SchemaGeneratorWizardPage_desc = Select schema location and included classes.
-
-SchemaGeneratorWizardPage_shemaLocation = Schema file:
-SchemaGeneratorWizardPage_shema = Schema name:
-SchemaGeneratorWizardPage_packages = Select the classes to include in the 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.
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java
deleted file mode 100644
index aa07c9d8fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/ClassesGenerator.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* 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.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.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-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.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-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.utility.internal.StringTools;
-
-/**
- * ClassesGenerator
- */
-public class ClassesGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "JAXB Run Config"; //$NON-NLS-1$
- static public String JAXB_GENERIC_GEN_CLASS = "com.sun.tools.xjc.XJCFacade"; //$NON-NLS-1$
- static public String JAXB_ECLIPSELINK_GEN_CLASS = "org.eclipse.persistence.jaxb.xjc.MOXyXJC"; //$NON-NLS-1$
-
- private IVMInstall jre;
- private ILaunchConfigurationWorkingCopy launchConfig;
- private ILaunch launch;
-
- private final IJavaProject javaProject;
- private final String xmlSchemaName;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final String[] bindingsFileNames;
- private final String mainType;
- private final boolean isDebug = false;
-
- // ********** static methods **********
-
- public static void generate(
- IJavaProject javaProject,
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames,
- IProgressMonitor monitor) {
- if (javaProject == null) {
- throw new NullPointerException();
- }
- new ClassesGenerator(javaProject,
- xmlSchemaName,
- outputDir,
- targetPackage,
- catalog,
- useMoxyGenerator,
- bindingsFileNames,
- monitor).generate();
- }
-
- // ********** constructors **********
-
- protected ClassesGenerator(
- IJavaProject javaProject,
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames,
- @SuppressWarnings("unused") IProgressMonitor monitor) {
- super();
- this.javaProject = javaProject;
- this.xmlSchemaName = xmlSchemaName;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.bindingsFileNames = bindingsFileNames;
- this.mainType = (useMoxyGenerator) ? JAXB_ECLIPSELINK_GEN_CLASS : JAXB_GENERIC_GEN_CLASS;
-
- this.initialize();
- }
-
- // ********** 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() {
- String projectLocation = this.javaProject.getProject().getLocation().toString();
-
- this.initializeLaunchConfiguration(projectLocation);
-
- this.addLaunchListener();
- this.launch = this.saveAndLaunchConfig();
- }
-
- private void initializeLaunchConfiguration(String projectLocation) {
-
- this.specifyJRE(this.jre.getName(), this.jre.getVMInstallType().getId());
-
- this.specifyProject(this.javaProject.getProject().getName());
- this.specifyMainType(this.mainType);
-
- this.specifyProgramArguments(
- this.xmlSchemaName,
- this.outputDir,
- this.targetPackage,
- this.catalog,
- this.bindingsFileNames); // -d -p
- this.specifyWorkingDir(projectLocation);
-
- this.specifyClasspathProperties(this.javaProject);
- }
-
- protected void postGenerate() {
- try {
- if ( ! this.isDebug) {
- this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
- }
- this.javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- private void specifyClasspathProperties(IJavaProject project) {
- List<String> classpath = new ArrayList<String>();
- try {
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry(project).getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // Containers classpath
- for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
- classpath.add(containerClasspathEntry.getMemento());
- }
- }
- catch (CoreException e) {
- throw new RuntimeException("An error occurs generating a memento", e);
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- }
-
- private void specifyJRE(String jreName, String vmId) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreName);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmId);
- }
-
- private void specifyProject(String projectName) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
- }
-
- private void specifyMainType(String mainType) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainType);
- }
-
- private void specifyProgramArguments(
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- String[] bindingsFileNames) {
-
- StringBuffer programArguments = new StringBuffer();
- // options
- programArguments.append("-d "); //$NON-NLS-1$
- programArguments.append(outputDir);
- if( ! StringTools.stringIsEmpty(targetPackage)) {
- programArguments.append(" -p "); //$NON-NLS-1$
- programArguments.append(targetPackage);
- }
- if( ! StringTools.stringIsEmpty(catalog)) {
- programArguments.append(" -catalog "); //$NON-NLS-1$
- programArguments.append(catalog);
- }
- // schema
- programArguments.append(' '); //$NON-NLS-1$
- programArguments.append(xmlSchemaName);
-
- // bindings
- if( bindingsFileNames.length > 0) {
- for(String bindingsFileName: bindingsFileNames) {
- programArguments.append(" -b "); //$NON-NLS-1$
- programArguments.append(bindingsFileName);
- }
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- private void specifyWorkingDir(String projectLocation) {
-
- File workingDir = new Path(projectLocation).toFile();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDir.getAbsolutePath());
- }
-
- // ********** LaunchConfig **********
-
- private ILaunchConfigurationWorkingCopy buildLaunchConfiguration() throws CoreException {
- ILaunchConfigurationWorkingCopy launchConfig = null;
- this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
-
- ILaunchConfigurationType type = this.getLaunchManager().getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
-
- launchConfig = type.newInstance(null, LAUNCH_CONFIG_NAME);
- return launchConfig;
- }
-
- private void removeLaunchConfiguration(String launchConfigurationName) throws CoreException {
-
- ILaunchManager manager = 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(launchConfigurationName)) {
- configuration.delete();
- break;
- }
- }
- }
-
- private ILaunch saveAndLaunchConfig() {
- ILaunchConfiguration configuration = null;
- ILaunch result = null;
- try {
- configuration = this.launchConfig.doSave();
- }
- catch (CoreException saveException) {
- throw new RuntimeException("Could not save LaunchConfig", saveException);
- }
- try {
- result = configuration.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
- }
- catch (CoreException lauchException) {
- throw new RuntimeException("An error occured during launch", lauchException);
- }
- return result;
- }
-
- private void addLaunchListener() {
-
- this.getLaunchManager().addLaunchListener(this.buildLaunchListener());
- }
-
- 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(ClassesGenerator.this.getLaunch())) {
-
- ClassesGenerator.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
- }
- };
- }
-
- // ********** Queries **********
-
- private IRuntimeClasspathEntry getSystemLibraryClasspathEntry() throws CoreException {
-
- IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
- return JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
- }
-
- private IRuntimeClasspathEntry getDefaultProjectClasspathEntry(IJavaProject project) {
-
- IRuntimeClasspathEntry projectEntry = JavaRuntime.newDefaultProjectClasspathEntry(project);
- projectEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return projectEntry;
- }
-
- 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;
- }
-
- private IVMInstall getProjectJRE() throws CoreException {
- return JavaRuntime.getVMInstall(this.javaProject);
- }
-
- protected ILaunch getLaunch() {
- return this.launch;
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java
deleted file mode 100644
index e5c1d14de5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/core/internal/SchemaGenerator.java
+++ /dev/null
@@ -1,527 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* 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.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.File;
-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.IProject;
-import org.eclipse.core.resources.IResource;
-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.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-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.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.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.core.internal.utility.jdt.JDTTools;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.osgi.service.datalocation.Location;
-import org.osgi.framework.Bundle;
-
-/**
- * SchemaGenerator
- */
-public class SchemaGenerator
-{
- 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.eclipselink.jaxb.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 = JAXB_SCHEMA_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- static public String ECLIPSELINK_JAXB_SCHEMA_GEN_JAR = 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$
- static public String PLUGINS_DIR = "plugins/"; //$NON-NLS-1$
-
- private IVMInstall jre;
- private ILaunchConfigurationWorkingCopy launchConfig;
- private ILaunch launch;
-
- private final IJavaProject javaProject;
- private final String targetSchemaName;
- private final String[] sourceClassNames;
- private String mainType;
- private boolean useMoxy;
- private final boolean isDebug = false;
-
- // ********** 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,
- monitor).generate();
- }
-
- // ********** constructors **********
-
- protected SchemaGenerator(
- IJavaProject javaProject,
- String targetSchemaName,
- String[] sourceClassNames,
- boolean useMoxy,
- @SuppressWarnings("unused") IProgressMonitor monitor) {
- super();
- this.javaProject = 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();
- }
-
- // ********** 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() {
- // generate jaxb.properties file if necessary
- if (this.useMoxy){
- if (!isJaxbPropertiesFilePresent()){
- this.generateJaxbPropertiesFile();
- }
- else if (!isJaxbContextMoxy(getJaxbPropertiesFile())){
- //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;
- }
- }
- String projectLocation = getProject().getLocation().toString();
- this.initializeLaunchConfiguration(projectLocation);
- this.addLaunchListener();
- this.launch = this.saveAndLaunchConfig();
- }
-
- /**
- * 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(IFile propertyFile){
-
- InputStream in = null;
- try {
- in = propertyFile.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);
- 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(){
- IPackageFragment packageFragment = findPackageFragementForSourceClassName(this.sourceClassNames[0]);
-
- IFolder folder = (IFolder)packageFragment.getResource();
- IFile file = folder.getFile("jaxb.properties");
-
- byte[] bytes;
- try {
- bytes = ECLIPSELINK_JAXB_PROPERTIES_FILE_CONTENTS.getBytes("UTF-8");
- } 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, null);
- } 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");
- }
-
- private void initializeLaunchConfiguration(String projectLocation) {
-
- this.specifyJRE(this.jre.getName(), this.jre.getVMInstallType().getId());
-
- this.specifyProject(this.getProject().getName());
- this.specifyMainType(this.mainType);
-
- this.specifyProgramArguments(
- this.targetSchemaName,
- this.sourceClassNames); // -d -c
- this.specifyWorkingDir(projectLocation);
-
- String jarName = (this.useMoxy) ?
- ECLIPSELINK_JAXB_SCHEMA_GEN_JAR :
- JAXB_SCHEMA_GEN_JAR;
- this.specifyClasspathProperties(this.javaProject, this.buildBootstrapJarPath(jarName));
- }
-
- protected void postGenerate() {
- try {
- if ( ! this.isDebug) {
- this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
- }
- this.getProject().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** Launch Configuration Setup **********
-
- private void specifyClasspathProperties(IJavaProject javaProject, IPath bootstrapJar) {
- List<String> classpath = new ArrayList<String>();
- try {
- // Schema_Gen jar
- classpath.add(this.getArchiveClasspathEntry(bootstrapJar).getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry(javaProject).getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- }
- catch (CoreException e) {
- throw new RuntimeException("An error occurs generating a memento", e); //$NON-NLS-1$
- }
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false);
- }
-
- private void specifyJRE(String jreName, String vmId) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreName);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmId);
- }
-
- private void specifyProject(String projectName) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
- }
-
- private void specifyMainType(String mainType) {
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainType);
- }
-
- private void specifyProgramArguments(
- String targetSchemaName,
- String[] sourceClassNames) {
-
- StringBuffer programArguments = new StringBuffer();
- // sourceClassNames
- StringBuffer sourceClassNamesArguments = this.buildClassNamesArguments(sourceClassNames);
- programArguments.append(sourceClassNamesArguments);
-
- // schema
- programArguments.append(" -s \""); //$NON-NLS-1$
- programArguments.append(targetSchemaName);
- programArguments.append('"'); //$NON-NLS-1$
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- private StringBuffer buildClassNamesArguments(String[] sourceClassNames) {
-
- StringBuffer classNamesArguments = new StringBuffer();
- for (String className: sourceClassNames) {
- classNamesArguments.append(" -c "); //$NON-NLS-1$
- classNamesArguments.append(className);
- }
- return classNamesArguments;
- }
-
- private void specifyWorkingDir(String projectLocation) {
-
- File workingDir = new Path(projectLocation).toFile();
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, workingDir.getAbsolutePath());
- }
-
- // ********** LaunchConfig **********
-
- private ILaunchConfigurationWorkingCopy buildLaunchConfiguration() throws CoreException {
- ILaunchConfigurationWorkingCopy launchConfig = null;
- this.removeLaunchConfiguration(LAUNCH_CONFIG_NAME);
-
- ILaunchManager manager = getLaunchManager();
- ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
-
- launchConfig = type.newInstance(null, LAUNCH_CONFIG_NAME);
- return launchConfig;
- }
-
- private void removeLaunchConfiguration(String launchConfigurationName) throws CoreException {
-
- ILaunchManager manager = 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(launchConfigurationName)) {
- configuration.delete();
- break;
- }
- }
- }
-
- private ILaunch saveAndLaunchConfig() {
- ILaunchConfiguration configuration = null;
- ILaunch result = null;
- try {
- configuration = this.launchConfig.doSave();
- }
- catch (CoreException saveException) {
- throw new RuntimeException("Could not save LaunchConfig", saveException);
- }
- try {
- result = configuration.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor());
- }
- catch (CoreException lauchException) {
- throw new RuntimeException("An error occured during launch", lauchException);
- }
- return result;
- }
-
- private void addLaunchListener() {
-
- this.getLaunchManager().addLaunchListener(this.buildLaunchListener());
- }
-
- 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(SchemaGenerator.this.getLaunch())) {
-
- SchemaGenerator.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
- }
- };
- }
-
- // ********** Queries **********
-
- private IRuntimeClasspathEntry getSystemLibraryClasspathEntry() throws CoreException {
-
- IPath systemLibsPath = new Path(JavaRuntime.JRE_CONTAINER);
- return JavaRuntime.newRuntimeContainerClasspathEntry(systemLibsPath, IRuntimeClasspathEntry.STANDARD_CLASSES);
- }
-
- private IRuntimeClasspathEntry getArchiveClasspathEntry(IPath archivePath) {
-
- IRuntimeClasspathEntry archiveEntry = JavaRuntime.newArchiveRuntimeClasspathEntry(archivePath);
- archiveEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return archiveEntry;
- }
-
- private IRuntimeClasspathEntry getDefaultProjectClasspathEntry(IJavaProject project) {
-
- IRuntimeClasspathEntry projectEntry = JavaRuntime.newDefaultProjectClasspathEntry(project);
- projectEntry.setClasspathProperty(IRuntimeClasspathEntry.USER_CLASSES);
-
- return projectEntry;
- }
-
- public IProject getProject() {
- return this.javaProject.getProject();
- }
-
- private IVMInstall getProjectJRE() throws CoreException {
- return JavaRuntime.getVMInstall(this.javaProject);
- }
-
- protected ILaunch getLaunch() {
- return this.launch;
- }
-
- protected ILaunchManager getLaunchManager() {
- return DebugPlugin.getDefault().getLaunchManager();
- }
-
- // ********** private method **********
-
- private IPath buildBootstrapJarPath(String jarName) {
- try {
- File jarInstallDir = this.getBundleParentDir(JptJaxbUiPlugin.PLUGIN_ID);
-
- List<File> result = new ArrayList<File>();
- this.findFile(jarName, jarInstallDir, result);
- if (result.isEmpty()) {
- throw new RuntimeException("Could not find: " + jarName + "#.#.#v###.jar in: " + jarInstallDir); //$NON-NLS-1$ //$NON-NLS-2$
- }
- File ddlGenJarFile = result.get(0);
- String ddlGenJarPath = ddlGenJarFile.getCanonicalPath();
- return new Path(ddlGenJarPath);
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void findFile(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.findFile(fileName, file, list);
- }
- }
- }
-
- 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();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiIcons.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiIcons.java
deleted file mode 100644
index a829ef0847..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiIcons.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;
-
-@SuppressWarnings("nls")
-public class JptJaxbUiIcons
-{
- // **************** General icons **************************************
-
- public static final String SCHEMA_GEN = "full/wizban/NewXSD";
-
- // **************** Wizard icons *******************************************
-
- public static final String SCHEMA_GEN_WIZ_BANNER = "full/wizban/NewXSD";
- public static final String CLASSES_GEN_WIZ_BANNER = "full/wizban/newclass_wiz";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.java
deleted file mode 100644
index 09ff02efec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/JptJaxbUiPlugin.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.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 JptJaxbUiPlugin extends AbstractUIPlugin
-{
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jaxb.ui";
-
-
- // ********** 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;
- }
-
-
-
- // ********** constructors **********
- public JptJaxbUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
deleted file mode 100644
index a7f800950c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/ClassesGeneratorUi.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-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.OperationCanceledException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.jaxb.core.internal.ClassesGenerator;
-import org.eclipse.jpt.jaxb.ui.internal.wizards.classesgen.ClassesGeneratorWizard;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * ClassesGeneratorUi
- */
-public class ClassesGeneratorUi {
- private final IJavaProject javaProject;
- private final String xmlSchemaName;
-
- // ********** static methods **********
-
- public static void generate(IFile xsdFile) {
- IJavaProject javaProject = JavaCore.create(xsdFile.getProject());
- if (javaProject == null) {
- throw new NullPointerException();
- }
- IPath xmlSchema = xsdFile.getProjectRelativePath();
-
- new ClassesGeneratorUi(javaProject, xmlSchema.toOSString()).generate();
- }
-
- // ********** constructors **********
- private ClassesGeneratorUi(IJavaProject javaProject, String xmlSchemaName) {
- super();
- if(javaProject == null || StringTools.stringIsEmpty(xmlSchemaName)) {
- throw new NullPointerException();
- }
- this.javaProject = javaProject;
- this.xmlSchemaName = xmlSchemaName;
- }
-
- // ********** generate **********
- /**
- * prompt the user with a wizard
- */
- protected void generate() {
-
- ClassesGeneratorWizard wizard = new ClassesGeneratorWizard(this.javaProject, this.xmlSchemaName);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
- String outputDir = wizard.getDestinationFolder();
- String targetPackage = wizard.getTargetPackage();
- String catalog = wizard.getCatalog();
- boolean useMoxy = wizard.getUseMoxy();
- String[] bindingsFileNames = wizard.getBindingsFileNames();
-
- this.run(outputDir, targetPackage, catalog, useMoxy, bindingsFileNames);
- }
-
- // ********** internal methods **********
-
- private void run(
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames) {
-
- IWorkspaceRunnable runnable = this.buildGenerateEntitiesRunnable(
- this.javaProject,
- this.xmlSchemaName,
- outputDir,
- targetPackage,
- catalog,
- useMoxyGenerator,
- bindingsFileNames);
- try {
- ResourcesPlugin.getWorkspace().run(runnable, new NullProgressMonitor());
- }
- catch (CoreException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private IWorkspaceRunnable buildGenerateEntitiesRunnable(
- IJavaProject javaProject,
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames) {
-
- return new GenerateEntitiesRunnable(javaProject, xmlSchemaName, outputDir, targetPackage, catalog, useMoxyGenerator, bindingsFileNames);
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- // ********** Runnable Class **********
-
- private static class GenerateEntitiesRunnable implements IWorkspaceRunnable {
- private final IJavaProject javaProject;
- private final String xmlSchemaName;
- private final String outputDir;
- private final String targetPackage;
- private final String catalog;
- private final boolean useMoxyGenerator;
- private final String[] bindingsFileNames;
-
- // ********** constructors **********
-
- public GenerateEntitiesRunnable(
- IJavaProject javaProject,
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames) {
-
- super();
- this.javaProject = javaProject;
- this.xmlSchemaName = xmlSchemaName;
- this.outputDir = outputDir;
- this.targetPackage = targetPackage;
- this.catalog = catalog;
- this.useMoxyGenerator = useMoxyGenerator;
- this.bindingsFileNames = bindingsFileNames;
- }
-
- public void run(IProgressMonitor monitor) {
- try {
- this.entitiesGeneratorGenerate(this.javaProject,
- this.xmlSchemaName,
- this.outputDir,
- this.targetPackage,
- this.catalog,
- this.useMoxyGenerator,
- this.bindingsFileNames,
- monitor);
- }
- catch (OperationCanceledException e) {
- return;
- // fall through and tell monitor we are done
- }
- catch (RuntimeException re) {
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
-
- this.logError(message);
- throw new RuntimeException(re);
- }
- }
-
- private void entitiesGeneratorGenerate(IJavaProject javaProject,
- String xmlSchemaName,
- String outputDir,
- String targetPackage,
- String catalog,
- boolean useMoxyGenerator,
- String[] bindingsFileNames,
- IProgressMonitor monitor) {
-
- ClassesGenerator.generate(javaProject,
- xmlSchemaName,
- outputDir,
- targetPackage,
- catalog,
- useMoxyGenerator,
- bindingsFileNames,
- monitor);
- return;
- }
-
- 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;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
deleted file mode 100644
index 99bbb6dcbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/JptJaxbUiMessages.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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 {
-
- // ClassesGenerator
- public static String ClassesGeneratorWizard_title;
- public static String ClassesGeneratorWizard_errorDialogTitle;
- public static String ClassesGeneratorWizard_couldNotCreate;
-
- 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_jaxbLibrariesNotAvailable;
-
- public static String ClassesGeneratorWizardPage_moxyLibrariesNotAvailable;
-
- // SchemaGenerator
- public static String SchemaGeneratorWizard_title;
- public static String SchemaGeneratorWizard_generatingSchema;
-
- public static String ProjectWizardPage_desc;
- public static String ProjectWizardPage_project;
-
- 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;
-
-
- 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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/GenerateClassesAction.java
deleted file mode 100644
index 526fd69580..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/actions/ObjectAction.java
deleted file mode 100644
index 652d75ac58..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/ContainerFilter.java
deleted file mode 100644
index 5572e0b5fa..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/EmptyInnerPackageFilter.java
deleted file mode 100644
index e89609ec7a..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonArchiveOrExternalElementFilter.java
deleted file mode 100644
index 9ae95f8b9b..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonContainerFilter.java
deleted file mode 100644
index 8fd6e6ac82..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/filters/NonJavaElementFilter.java
deleted file mode 100644
index 0c1a6949bd..0000000000
--- a/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.java
deleted file mode 100644
index 195aa0021c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizard.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.jaxb.ui.internal.wizards.classesgen;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.osgi.util.NLS;
-
-/**
- * ClassesGeneratorWizard
- */
-public class ClassesGeneratorWizard extends Wizard {
-
- private final IJavaProject javaProject;
- private final String xmlSchemaName;
-
- private String destinationFolder;
- private String targetPackage;
- private String catalog;
- private boolean useMoxy;
- private String[] bindingsFileNames;
-
- private ClassesGeneratorWizardPage generatorSettingsPage;
-
- // ********** constructor **********
-
- public ClassesGeneratorWizard(IJavaProject javaProject, String xmlSchemaName) {
- super();
- this.javaProject = javaProject;
- this.xmlSchemaName = xmlSchemaName;
-
- this.setWindowTitle(JptJaxbUiMessages.ClassesGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.CLASSES_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
- // ********** overrides **********
-
- @Override
- public void addPages() {
- super.addPages();
-
- this.generatorSettingsPage = this.buildClassesGeneratorPage();
-
- this.addPage(this.generatorSettingsPage);
- }
-
- @Override
- public boolean performFinish() {
- this.destinationFolder = this.generatorSettingsPage.getTargetFolder();
- this.targetPackage = this.generatorSettingsPage.getTargetPackage();
- this.catalog = this.generatorSettingsPage.getCatalog();
- this.useMoxy = this.generatorSettingsPage.usesMoxy();
- this.bindingsFileNames = this.generatorSettingsPage.getBindingsFileNames();
-
- IFolder folder = this.javaProject.getProject().getFolder(this.destinationFolder);
- this.createFolderIfNotExist(folder);
- return true;
- }
-
- @Override
- public boolean canFinish() {
- return this.generatorSettingsPage.isPageComplete();
- }
-
- // ********** public methods **********
-
- public String getDestinationFolder() {
- return this.destinationFolder;
- }
-
- public String getTargetPackage() {
- return this.targetPackage;
- }
-
- public String getCatalog() {
- return this.catalog;
- }
-
- public boolean getUseMoxy() {
- return this.useMoxy;
- }
-
- public String[] getBindingsFileNames() {
- return this.bindingsFileNames;
- }
-
- // ********** internal methods **********
-
- private ClassesGeneratorWizardPage buildClassesGeneratorPage() {
- return new ClassesGeneratorWizardPage(this.javaProject, this.xmlSchemaName);
- }
-
- private void createFolderIfNotExist(IFolder folder) {
- if( folder.exists()) {
- return;
- }
- try {
- folder.create(true, true, null);
- }
- catch (CoreException e) {
- this.logError(NLS.bind(
- JptJaxbUiMessages.ClassesGeneratorWizard_couldNotCreate,
- folder.getProjectRelativePath().toOSString()));
- }
- }
-
- protected void logError(String message) {
- this.displayError(message);
- }
-
- private void displayError(String message) {
- MessageDialog.openError(
- this.getShell(),
- JptJaxbUiMessages.ClassesGeneratorWizard_errorDialogTitle,
- message
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
deleted file mode 100644
index 1574703c62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/classesgen/ClassesGeneratorWizardPage.java
+++ /dev/null
@@ -1,635 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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.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.NewWizardMessages;
-import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
-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.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.jaxb.core.internal.ClassesGenerator;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-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.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 String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.eclipselink.ui"; //$NON-NLS-1$
- static public String XML_FILTER = "*.xml"; //$NON-NLS-1$
- static public String XJB_FILTER = "*.xjb"; //$NON-NLS-1$
-
- public static final String HELP_CONTEXT_ID = JptUiPlugin.PLUGIN_ID + ".configure_jaxb_class_generation_dialog"; //$NON-NLS-1$
-
- private final IJavaProject javaProject;
-
- private SettingsGroup settingsGroup;
-
- private String targetFolder;
- private String targetPackage;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- // ********** constructor **********
-
- public ClassesGeneratorWizardPage(IJavaProject javaProject, String xmlSchemaName) {
- super(true, "Classes Generator"); //$NON-NLS-1$
- if (javaProject == null) {
- throw new NullPointerException();
- }
- this.javaProject = javaProject;
- // default usesMoxy to true only when JPT EclipseLink bundle exists and MOXy is on the classpath
- this.usesMoxy = (this.jptEclipseLinkBundleExists() && this.moxyIsOnClasspath());
-
- this.setTitle(NLS.bind(JptJaxbUiMessages.ClassesGeneratorWizardPage_title, xmlSchemaName));
- this.setDescription(JptJaxbUiMessages.ClassesGeneratorWizardPage_desc);
- }
-
- // ********** UI components **********
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
-
- initContainerPage(this.javaProject);
- }
-
- 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);
-
- // add checkbox only if jpt.eclipselink.ui plugin is available
- // and EclipseLink MOXy is not on the classpath
- if(this.jptEclipseLinkBundleExists() && ! this.moxyIsOnClasspath()) {
- 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.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) {
- setUsesMoxy(usesMoxyCheckBox.getSelection());
- validateProjectClasspath();
- }
- };
- }
-
- // ********** 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;
- }
-
- protected void setUsesMoxy(boolean usesMoxy){
- this.usesMoxy = usesMoxy;
- }
-
- // ********** internal methods **********
-
- 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.moxyIsOnClasspath()) {
- //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);
-// }
-// }
- }
-
- private void displayWarning(String message) {
- this.setMessage(message, WARNING);
- }
-
- /**
- * Test if the Jaxb compiler is on the classpath.
- */
- private boolean genericJaxbIsOnClasspath() {
- try {
- String className = ClassesGenerator.JAXB_GENERIC_GEN_CLASS;
- IType genClass = this.javaProject.findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Test if the EclipseLink Jaxb compiler is on the classpath.
- */
- private boolean moxyIsOnClasspath() {
- try {
- String className = ClassesGenerator.JAXB_ECLIPSELINK_GEN_CLASS;
- IType genClass = this.javaProject.findType(className);
- return (genClass != null);
- }
- catch (JavaModelException e) {
- throw new RuntimeException(e);
- }
- }
-
- // ********** 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)) {
- updateStatus(fContainerStatus);
- }else if( ! this.fPackageStatus.matches(IStatus.OK) ) {
- updateStatus(fPackageStatus);
- } else {
- updateStatus(Status.OK_STATUS);
- }
- 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);
- validateProjectClasspath();
- }
-
- /**
- * 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(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_title);
- dialog.setMessage(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_description);
- dialog.addFilter(filter);
- //set the java project as the input instead of the workspace like the NewContainerWizardPage was doing
- //******************************************************//
- dialog.setInput(this.javaProject); //
- //******************************************************//
- 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;
- }
-
- // ********** 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, JpaHelpContextIds.XXX);
-
- // 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 = promptFile(XML_FILTER);
- 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 buttons
- 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 = promptFile(XJB_FILTER);
- if( ! StringTools.stringIsEmpty(filePath)) {
-
- addBindingsFile(filePath, tableDataModel);
- tableViewer.refresh();
- }
- }
- });
- // Remove buttons
- 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 makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(javaProject.getProject().getLocation());
- return relativePath.toOSString();
- }
-
- private void addBindingsFile(String filePath, final ArrayList<String> tableDataModel) {
- String relativePath = this.makeRelativeToProjectPath(filePath);
- 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 promptFile(String filter) {
- String projectPath= javaProject.getProject().getLocation().toString();
- String dialogTitle = (filter.equals(XJB_FILTER)) ?
- JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseABindingsFile :
- JptJaxbUiMessages.ClassesGeneratorWizardPage_chooseACatalog;
-
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(dialogTitle);
- dialog.setFilterPath(projectPath);
- dialog.setFilterExtensions(new String[] {filter});
- String filePath = dialog.open();
-
- return (filePath != null) ? filePath : null;
- }
-
- private void addColumnsData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- }
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/AbstractJarDestinationWizardPage.java b/jpa/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/jpa/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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.java
deleted file mode 100644
index 649fe1ab50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/CheckboxTreeAndListGroup.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.ui.internal.wizards.schemagen;
-
-import java.util.Iterator;
-
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Tree;
-
-/**
- * Façade class to change accessibility of CheckboxTreeAndListGroup.
- */
-@SuppressWarnings("restriction")
-public class CheckboxTreeAndListGroup extends org.eclipse.jdt.internal.ui.jarpackager.CheckboxTreeAndListGroup
-{
-
- public CheckboxTreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height) {
- super(parent, rootObject, treeContentProvider, treeLabelProvider, listContentProvider, listLabelProvider, style, width, height);
- }
-
- /**
- * Sets the initial checked state of the passed element to true,
- * as well as to all of its children and associated list elements
- */
- @Override
- public void initialCheckTreeItem(Object element) {
- super.initialCheckTreeItem(element) ;
- }
-
- /**
- * Sets the initial checked state of the passed list element to true.
- */
- @Override
- public void initialCheckListItem(Object element) {
- super.initialCheckListItem(element) ;
- }
-
- @Override
- public void addCheckStateListener(ICheckStateListener listener) {
- super.addCheckStateListener(listener);
- }
-
- @Override
- public void addTreeFilter(ViewerFilter filter) {
- super.addTreeFilter(filter);
- }
-
- @Override
- public void addListFilter(ViewerFilter filter) {
- super.addListFilter(filter);
- }
-
- /**
- *Sets the contents of the list viewer based upon the specified selected
- *tree element. This also includes checking the appropriate list items.
- */
- @Override
- public void populateListViewer(final Object treeElement) {
- super.populateListViewer(treeElement);
- }
-
- @Override
- public Iterator<?> getAllCheckedListItems() {
- return super.getAllCheckedListItems();
- }
-
- @Override
- public Table getTable() {
- return super.getTable();
- }
-
- @Override
- public Tree getTree() {
- return super.getTree();
- }
-
- @Override
- public void setListComparator(ViewerComparator comparator) {
- super.setListComparator(comparator);
- }
-
- @Override
- public void setTreeComparator(ViewerComparator sorter) {
- super.setTreeComparator(sorter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/ProjectWizardPage.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/ProjectWizardPage.java
deleted file mode 100644
index 292342d188..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/ProjectWizardPage.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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.Comparator;
-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.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-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;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * ProjectWizardPage
- */
-public class ProjectWizardPage extends WizardPage
-{
- private IJavaProject javaProject;
- private ProjectGroup projectGroup;
-
- protected ProjectWizardPage() {
- super("Java Project"); //$NON-NLS-1$
-
- this.setTitle(JptJaxbUiMessages.SchemaGeneratorWizardPage_title);
- this.setDescription(JptJaxbUiMessages.ProjectWizardPage_desc);
- }
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- 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;
- }
-
- // ********** intra-wizard methods **********
-
- protected IJavaProject getProject() {
- return this.javaProject;
- }
-
-
- // ********** internal methods **********
-
- private void setProject(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.setProject(JavaCore.create(project));
- 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.ProjectWizardPage_project);
- this.projectCombo = this.buildProjectCombo(composite, this.buildProjectComboSelectionListener());
- this.updateProjectCombo();
-
- setPageComplete(false);
- }
-
- // ********** 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.getJavaProjectsNames()) {
- this.projectCombo.add(name);
- }
- if(javaProject != null) {
- this.projectCombo.select(this.projectCombo.indexOf(javaProject.getProject().getName()));
- }
- }
-
- private Iterable<String> getJavaProjectsNames() {
- return new TransformationIterable<IProject, String>(this.getJavaProjects()) {
- @Override
- protected String transform(IProject project) {
- return project.getName();
- }
- };
- }
-
- 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>(this.sortedProjects());
- }
-
- private IProject[] sortedProjects() {
-
- return ArrayTools.sort(ResourcesPlugin.getWorkspace().getRoot().getProjects(), this.projectNameComparator());
- }
-
- private Comparator<IProject> projectNameComparator() {
- return new Comparator<IProject>() {
- public int compare(IProject project1, IProject project2) {
- return Collator.getInstance().compare(project1.getName(), project2.getName());
- }
- };
- }
-
- // ********** 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/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.java
deleted file mode 100644
index a563e46e25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizard.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.ui.internal.wizards.schemagen;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceRuleFactory;
-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.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jaxb.core.internal.SchemaGenerator;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiIcons;
-import org.eclipse.jpt.jaxb.ui.JptJaxbUiPlugin;
-import org.eclipse.jpt.jaxb.ui.internal.JptJaxbUiMessages;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.FileTools;
-import org.eclipse.ui.IExportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-
-public class SchemaGeneratorWizard extends Wizard implements IExportWizard {
-
- protected IStructuredSelection selection;
-
- private ProjectWizardPage javaProjectWizardPage;
- protected SchemaGeneratorWizardPage schemaGenWizardPage;
-
- public static final String XSD_EXTENSION = ".xsd"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizard() {
- super();
- }
-
- // ********** IWorkbenchWizard implementation **********
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
-
- this.selection = this.getValidSelection();
-
- this.setWindowTitle(JptJaxbUiMessages.SchemaGeneratorWizard_title);
- this.setDefaultPageImageDescriptor(JptJaxbUiPlugin.getImageDescriptor(JptJaxbUiIcons.SCHEMA_GEN_WIZ_BANNER));
- this.setNeedsProgressMonitor(true);
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
- if(this.selection.isEmpty()) {
- this.javaProjectWizardPage = new ProjectWizardPage();
- this.addPage(this.javaProjectWizardPage);
- }
-
- this.schemaGenWizardPage = new SchemaGeneratorWizardPage(this.selection);
- this.addPage(this.schemaGenWizardPage);
- }
-
- @Override
- public boolean performFinish() {
-
- IJavaProject javaProject = this.getJavaProject();
-
- String[] sourceClassNames = this.buildSourceClassNames(this.getAllCheckedItems());
-
- WorkspaceJob genEntitiesJob = new GenerateSchemaJob(
- javaProject,
- sourceClassNames,
- this.getTargetSchema(),
- this.usesMoxy());
- genEntitiesJob.schedule();
-
- return true;
- }
-
- // ********** internal methods **********
-
- private String getTargetSchema() {
- String targetSchema = this.schemaGenWizardPage.getSchemaPath();
- if ( ! FileTools.extension(targetSchema).equalsIgnoreCase(XSD_EXTENSION)) {
- targetSchema += XSD_EXTENSION;
- }
- return targetSchema;
- }
-
- private IJavaProject getJavaProject() {
- return this.schemaGenWizardPage.getJavaProject();
- }
-
- private boolean usesMoxy() {
- return this.schemaGenWizardPage.usesMoxy();
- }
-
- 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);
- classNames.add(packageName + '.' + className);
- }
-
- return ArrayTools.array(classNames, new String[0]);
- }
-
- /**
- * Gets the current workspace page selection and converts it to a valid
- * selection for this wizard.
- * Valid selections:
- * - Java projects
- * - Source package fragments
- * all other input elements are ignored
- *
- * @return a valid structured selection based on the current selection
- */
- private IStructuredSelection getValidSelection() {
- ISelection currentSelection = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
- if(currentSelection instanceof IStructuredSelection) {
- IStructuredSelection structuredSelection = (IStructuredSelection) currentSelection;
- List<IAdaptable> selectedElements = new ArrayList<IAdaptable>(structuredSelection.size());
- Iterator<?> i = structuredSelection.iterator();
- while(i.hasNext()) {
- Object selectedElement = i.next();
- if(selectedElement instanceof IProject) {
- this.addProject(selectedElements, (IProject)selectedElement);
- }
- else if(selectedElement instanceof IJavaElement) {
- this.addJavaElement(selectedElements, (IJavaElement)selectedElement);
- }
- }
- return new StructuredSelection(selectedElements);
- }
- return StructuredSelection.EMPTY;
- }
-
- private void addJavaElement(List<IAdaptable> selectedElements, IJavaElement javaElement) {
- if(javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
- if( ! isInArchiveOrExternal(javaElement))
- selectedElements.add(javaElement);
- }
- }
-
- private void addProject(List<IAdaptable> selectedElements, IProject project) {
- try {
- if(project.hasNature(JavaCore.NATURE_ID))
- selectedElements.add(JavaCore.create(project));
- }
- catch(CoreException ex) {
- // ignore selected element
- }
- }
-
- private static boolean isInArchiveOrExternal(IJavaElement element) {
- IPackageFragmentRoot root = (IPackageFragmentRoot) element.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT);
- return root != null && (root.isArchive() || root.isExternal());
- }
-
- // ********** 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;
-
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- this.setRule(ruleFactory.modifyRule(javaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try{
- SchemaGenerator.generate(javaProject, this.targetSchema, this.sourceClassNames, this.useMoxy, monitor);
- }
- catch(OperationCanceledException e) {
- //user canceled generation
- }
- return Status.OK_STATUS;
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java b/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
deleted file mode 100644
index 32945adac1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/src/org/eclipse/jpt/jaxb/ui/internal/wizards/schemagen/SchemaGeneratorWizardPage.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this 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.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-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.jaxb.core.internal.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.jpt.ui.JptUiPlugin;
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-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.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.PlatformUI;
-import org.osgi.framework.Bundle;
-
-public class SchemaGeneratorWizardPage extends AbstractJarDestinationWizardPage {
-
- private IStructuredSelection initialSelection;
- private IJavaProject targetProject;
-
- // widgets
- private SettingsGroup settingsGroup;
-
- private Button usesMoxyCheckBox;
- private boolean usesMoxy;
-
- static public String JPT_ECLIPSELINK_UI_PLUGIN_ID = "org.eclipse.jpt.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 = JptUiPlugin.PLUGIN_ID + ".wizard_jaxbschema_classes"; //$NON-NLS-1$
-
- // ********** constructor **********
-
- public SchemaGeneratorWizardPage(IStructuredSelection selection) {
- super("JAXB Schema Generator", selection, null); //$NON-NLS-1$
-
- this.initialSelection = selection;
- 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);
-
- this.updateTargetProject();
- this.setDefaultSchemaFile();
- 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();
- this.giveFocusToDestination();
- }
-
- // default the schema name to the project name
- protected void setDefaultSchemaFile() {
- String defaultSchemaName = this.targetProject.getProject().getName() + SchemaGeneratorWizard.XSD_EXTENSION;
- this.settingsGroup.schemaFileText.setText(defaultSchemaName);
- this.settingsGroup.schemaFileText.setSelection(0, defaultSchemaName.length());
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public boolean isPageComplete() {
- boolean complete = this.validateDestinationGroup();
- if(complete) {
- 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 IJavaProject getJavaProject() {
- return this.targetProject;
- }
-
- /**
- * @return The schema relative path to the project.
- */
- protected String getSchemaPath() {
- return this.settingsGroup.getSchemaPath();
- }
-
- 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() {
- boolean complete = this.targetSchemaIsEmpty();
- if( ! complete) {
- this.setErrorMessage(JptJaxbUiMessages.SchemaGeneratorWizardPage_errorNoSchema);
- return false;
- }
- this.setErrorMessage(null);
- 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() {
- //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() {
- IWizardPage previousPage = this.getPreviousPage();
-
- if(previousPage instanceof ProjectWizardPage) {
- // get project from previousPage
- this.targetProject = ((ProjectWizardPage)previousPage).getProject();
- }
- else if(initialSelection != null && ! this.initialSelection.isEmpty()) {
- // no previousPage - get project from initialSelection
- this.targetProject = this.getProjectFromInitialSelection();
- }
- }
-
- private void updateInputGroupTreeFilter() {
- this.getInputGroup().addTreeFilter(new NonContainerFilter(this.targetProject.getProject().getName()));
- }
-
- private IJavaProject getProjectFromInitialSelection() {
- IJavaProject project = null;
-
- Object firstElement = 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 boolean targetSchemaIsEmpty() {
- return ! StringTools.stringIsEmpty(this.getSchemaPath());
- }
-
- 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() {
- this.settingsGroup.giveFocusToDestination();
- }
-
- // ********** 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;
- private Text schemaFileText;
-
- // ********** 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);
-
- if(initialSelection != null)
- BusyIndicator.showWhile(parent.getDisplay(), new Runnable() {
- public void run() {
- setupBasedOnInitialSelections();
- }
- });
- }
-
- 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));
-
- // Schema Location
- this.buildLabel(composite, JptJaxbUiMessages.SchemaGeneratorWizardPage_shemaLocation);
- this.schemaFileText = this.buildSchemaText(composite);
- this.buildBrowseButton(composite, 1);
-
- }
- // ********** intra-wizard methods **********
-
- /**
- * @return The schema relative path to the project.
- */
- protected String getSchemaPath() {
- return this.schemaFileText.getText();
- }
-
- protected void giveFocusToDestination() {
- this.schemaFileText.setFocus();
- }
-
- // ********** UI components **********
-
- private Label buildLabel(Composite parent, String text) {
- Label label = new Label(parent, SWT.LEFT);
- label.setText(text);
- label.setLayoutData(new GridData());
- return label;
- }
-
- private Text buildSchemaText(Composite parent) {
-
- Text text = new Text(parent, SWT.BORDER);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.grabExcessHorizontalSpace = true;
- text.setLayoutData(gridData);
- text.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updatePageCompletion();
- }
- });
- return text;
- }
-
- private Button buildBrowseButton(Composite parent, int horizontalSpan) {
-
- Button browseButton = new Button(parent, SWT.PUSH);
- browseButton.setText(JptJaxbUiMessages.SchemaGeneratorWizardPage_browse);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.horizontalSpan = horizontalSpan;
- browseButton.setLayoutData(gridData);
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String fileName = promptFile();
- if( ! StringTools.stringIsEmpty(fileName)) {
- schemaFileText.setText(makeRelativeToProjectPath(fileName));
- }
- }
- });
- return browseButton;
- }
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a file and return it.
- */
- private String promptFile() {
- FileDialog dialog = new FileDialog(getShell());
- dialog.setText(JptJaxbUiMessages.SchemaGeneratorWizardPage_chooseSchemaDialogTitle);
- dialog.setFilterPath(this.getFilterPath());
- dialog.setFilterExtensions(new String[] {"*.xsd"}); //$NON-NLS-1$
- String filePath = dialog.open();
-
- return (filePath != null) ? filePath : null;
- }
-
- /**
- * 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;
- }
-
- // ********** internal methods **********
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(targetProject.getProject().getLocation());
- return relativePath.toOSString();
- }
-
- /**
- * 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
- */
- private String getFilterPath() {
- return targetProject.getProject().getLocation().toOSString();
- }
-
- private void setupBasedOnInitialSelections() {
-
- Iterator<?> iterator = initialSelection.iterator();
- while(iterator.hasNext()) {
- Object selectedElement = iterator.next();
-
- if(selectedElement instanceof IResource && !((IResource)selectedElement).isAccessible())
- continue;
-
- if(selectedElement instanceof IJavaElement && !((IJavaElement)selectedElement).exists())
- continue;
-
- if(selectedElement instanceof ICompilationUnit || selectedElement instanceof IClassFile || selectedElement instanceof IFile)
- this.inputGroup.initialCheckListItem(selectedElement);
- else {
- if(selectedElement instanceof IFolder) {
- // Convert resource to Java element if possible
- IJavaElement je = JavaCore.create((IResource)selectedElement);
- if(je != null && je.exists() && je.getJavaProject().isOnClasspath((IResource)selectedElement)) {
-
- selectedElement = je;
- je.toString();
- }
- }
- this.inputGroup.initialCheckTreeItem(selectedElement);
- }
- }
-
- TreeItem[] items = this.inputGroup.getTree().getItems();
- int i = 0;
- while(i < items.length && ! items[i].getChecked())
- i++;
- if(i < items.length) {
- this.inputGroup.getTree().setSelection(new TreeItem[] {items[i]});
- this.inputGroup.getTree().showSelection();
- this.inputGroup.populateListViewer(items[i].getData());
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.classpath b/jpa/plugins/org.eclipse.jpt.utility/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.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.utility/.cvsignore b/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
deleted file mode 100644
index a128605b1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml \ 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 99b389b9c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility</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.utility/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 8e5b2c2b65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:22 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 443826069d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:37 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.utility/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
deleted file mode 100644
index 4b9b41ba67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,88 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.utility
-Bundle-Version: 1.5.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.utility,
- org.eclipse.jpt.utility.internal;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.enumerations;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.iterables;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.iterators;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.jaxb.ui,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.listener.awt;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value.prefs;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.model.value.swing;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.node;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.swing;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.internal.synchronizers;
- x-friends:="org.eclipse.jpt.core,
- org.eclipse.jpt.db,
- org.eclipse.jpt.db.ui,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.ui",
- org.eclipse.jpt.utility.model,
- org.eclipse.jpt.utility.model.event,
- org.eclipse.jpt.utility.model.listener,
- org.eclipse.jpt.utility.model.value
diff --git a/jpa/plugins/org.eclipse.jpt.utility/about.html b/jpa/plugins/org.eclipse.jpt.utility/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/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.utility/build.properties b/jpa/plugins/org.eclipse.jpt.utility/build.properties
deleted file mode 100644
index 11ab8d42f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/build.properties
+++ /dev/null
@@ -1,17 +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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
diff --git a/jpa/plugins/org.eclipse.jpt.utility/component.xml b/jpa/plugins/org.eclipse.jpt.utility/component.xml
deleted file mode 100644
index 364b5c50f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/component.xml
+++ /dev/null
@@ -1,11 +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.utility"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.utility" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/plugin.properties b/jpa/plugins/org.eclipse.jpt.utility/plugin.properties
deleted file mode 100644
index c959ed0246..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/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 - Utility
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java
deleted file mode 100644
index 5d1941dc35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Command.java
+++ /dev/null
@@ -1,87 +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.utility;
-
-import java.io.Serializable;
-
-/**
- * Simple interface for implementing the GOF Command design pattern,
- * and it doesn't carry the baggage of {@link java.lang.Runnable}.
- * <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 Command {
-
- /**
- * Execute the command. The semantics of the command
- * is determined by the contract between the client and server.
- */
- void execute();
-
- /**
- * Singleton implementation of the command interface that will do nothing
- * when executed.
- */
- final class Null implements Command, Serializable {
- public static final Command INSTANCE = new Null();
- public static Command instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void execute() {
- // do nothing
- }
- @Override
- public String toString() {
- return "Command.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 command interface that will throw an
- * exception when executed.
- */
- final class Disabled implements Command, Serializable {
- public static final Command INSTANCE = new Disabled();
- public static Command instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public void execute() {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Command.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java
deleted file mode 100644
index 7c427cc1e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/CommandExecutor.java
+++ /dev/null
@@ -1,61 +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.utility;
-
-import java.io.Serializable;
-
-/**
- * This interface allows clients to control how a command is executed.
- * This is useful when the server provides the command but the client provides
- * the context (e.g. the client would like to dispatch the command to the UI
- * thread).
- * <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 CommandExecutor {
-
- /**
- * Execute the specified command.
- */
- void execute(Command command);
-
-
- /**
- * Singleton implementation of the command executor interface
- * that simply executes the command without any sort of enhancement.
- */
- final class Default implements CommandExecutor, Serializable {
- public static final CommandExecutor INSTANCE = new Default();
- public static CommandExecutor instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public void execute(Command command) {
- command.execute();
- }
- @Override
- public String toString() {
- return "CommandExecutor.Default"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java
deleted file mode 100644
index adf33f9da8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/Filter.java
+++ /dev/null
@@ -1,125 +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.utility;
-
-import java.io.Serializable;
-
-/**
- * Used by various "pluggable" classes to filter 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.
- *
- * @param <T> the type of objects to be filtered
- */
-public interface Filter<T> {
-
- /**
- * Return whether the specified object is "accepted" by the
- * filter. The semantics of "accept" is determined by the
- * contract between the client and the server.
- */
- boolean accept(T o);
-
-
- /**
- * Singleton implemetation of the filter interface that accepts all the
- * objects (i.e. it does no filtering).
- */
- final class Null<S> implements Filter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Filter INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // nothing is filtered - everything is accepted
- public boolean accept(S o) {
- return true;
- }
- @Override
- public String toString() {
- return "Filter.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /**
- * Singleton implemetation of the filter interface that accepts none of the
- * objects (i.e. it filters out all the objects).
- */
- final class Opaque<S> implements Filter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Filter INSTANCE = new Opaque();
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Opaque() {
- super();
- }
- // everything is filtered - nothing is accepted
- public boolean accept(S o) {
- return false;
- }
- @Override
- public String toString() {
- return "Filter.Opaque"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /**
- * Singleton implemetation of the filter interface that throws an exception
- * if called.
- */
- final class Disabled<S> implements Filter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Filter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public boolean accept(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Filter.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/IndentingPrintWriter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/IndentingPrintWriter.java
deleted file mode 100644
index 35fa70a79b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/IndentingPrintWriter.java
+++ /dev/null
@@ -1,155 +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.utility;
-
-import java.io.PrintWriter;
-import java.io.Writer;
-
-/**
- * Extend {@link PrintWriter} to automatically indent new lines.
- */
-public class IndentingPrintWriter
- extends PrintWriter
-{
- private final String indent;
- private int indentLevel;
- private boolean needsIndent;
-
- public static String DEFAULT_INDENT = "\t"; //$NON-NLS-1$
-
-
- /**
- * Construct a writer that indents with tabs.
- */
- public IndentingPrintWriter(Writer out) {
- this(out, DEFAULT_INDENT);
- }
-
- /**
- * Construct a writer that indents with the specified string.
- */
- public IndentingPrintWriter(Writer out, String indent) {
- super(out);
- this.indent = indent;
- this.indentLevel = 0;
- this.needsIndent = true;
- }
-
- /**
- * Set flag so following line is indented.
- */
- @Override
- public void println() {
- synchronized (this.lock) {
- super.println();
- this.needsIndent = true;
- }
- }
-
- /**
- * Print the appropriate indent.
- * Pre-condition: synchronized
- */
- private void printIndent() {
- if (this.needsIndent) {
- this.needsIndent = false;
- for (int i = this.indentLevel; i-- > 0; ) {
- this.print(this.indent);
- }
- }
- }
-
- /**
- * Write a portion of an array of characters.
- */
- @Override
- public void write(char buf[], int off, int len) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(buf, off, len);
- }
- }
-
- /**
- * Write a single character.
- */
- @Override
- public void write(int c) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(c);
- }
- }
-
- /**
- * Write a portion of a string.
- */
- @Override
- public void write(String s, int off, int len) {
- synchronized (this.lock) {
- this.printIndent();
- super.write(s, off, len);
- }
- }
-
- /**
- * Bump the indent level.
- */
- public void indent() {
- this.incrementIndentLevel();
- }
-
- /**
- * Decrement the indent level.
- */
- public void undent() {
- this.decrementIndentLevel();
- }
-
- /**
- * Bump the indent level.
- */
- public void incrementIndentLevel() {
- synchronized (this.lock) {
- this.indentLevel++;
- }
- }
-
- /**
- * Decrement the indent level.
- */
- public void decrementIndentLevel() {
- synchronized (this.lock) {
- this.indentLevel--;
- }
- }
-
- /**
- * Return the current indent level.
- */
- public int getIndentLevel() {
- synchronized (this.lock) {
- return this.indentLevel;
- }
- }
-
- /**
- * Allow the indent level to be set directly.
- * Return the previous indent level.
- */
- public int setIndentLevel(int indentLevel) {
- synchronized (this.lock) {
- int old = this.indentLevel;
- this.indentLevel = indentLevel;
- return old;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.java
deleted file mode 100644
index ab769ccf4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/JavaType.java
+++ /dev/null
@@ -1,135 +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.utility;
-
-import java.io.PrintWriter;
-
-/**
- * This interface describes a Java type; i.e. its "element type"
- * and its "array depth". The element type is referenced by name,
- * allowing us to reference classes that are not (or cannot be) loaded.
- * <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.
- */
-public interface JavaType {
-
- /**
- * Return the name of the type's "element type".
- * A member type will have one or more <code>'$'</code> characters in its name.
- */
- String getElementTypeName();
-
- /**
- * Return the type's "array depth".
- */
- int getArrayDepth();
-
- /**
- * Return whether the type is an array (i.e. its "array depth" is greater
- * than zero).
- */
- boolean isArray();
-
- /**
- * Return whether the type is a "primitive" (e.g. <code>int</code>, <code>float</code>).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- boolean isPrimitive();
-
- /**
- * Return whether the type is a "primitive wrapper" (e.g. {@link java.lang.Integer},
- * {@link java.lang.Float}).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- boolean isPrimitiveWrapper();
-
- /**
- * Return whether the type is a "variable primitive" (e.g. <code>int</code>, <code>float</code>,
- * but not <code>void</code>).
- * <p>
- * <strong>NB:</strong> variables cannot be declared <code>void</code>
- */
- boolean isVariablePrimitive();
-
- /**
- * Return whether the type is a "variable primitive wrapper" (e.g.
- * {@link java.lang.Integer}, {@link java.lang.Float},
- * but not {@link java.lang.Void}).
- * <p>
- * <strong>NB:</strong> variables cannot be declared <code>void</code>
- */
- boolean isVariablePrimitiveWrapper();
-
- /**
- * Return the class corresponding to the type's element type and array depth.
- */
- Class<?> getJavaClass() throws ClassNotFoundException;
-
- /**
- * Return the version of the type's name that matches that
- * returned by {@link java.lang.Class#getName()}
- * (e.g. <code>"[[J"</code>, <code>"[Ljava.lang.Object;"</code>,
- * <code>"java.util.Map$Entry"</code>).
- */
- String getJavaClassName();
-
- /**
- * Return whether the type is equal to the specified type.
- */
- boolean equals(String otherElementTypeName, int otherArrayDepth);
-
- /**
- * Return whether the type describes to the specified type.
- */
- boolean describes(String className);
-
- /**
- * Return whether the type describes to the specified type.
- */
- boolean describes(Class<?> javaClass);
-
- /**
- * Return whether the type is equal to the specified type.
- */
- boolean equals(JavaType other);
-
- /**
- * Return the version of the type's name that can be used in source code:<ul>
- * <li><code>"[[J"</code> => <code>"long[][]"</code>
- * <li><code>"java.util.Map$Entry"</code> => <code>"java.util.Map.Entry"</code>
- * </ul>
- */
- String declaration();
-
- /**
- * Append the version of the type's name that can be used in source code:<ul>
- * <li><code>"[[J"</code> => <code>"long[][]"</code>
- * <li><code>"java.util.Map$Entry"</code> => <code>"java.util.Map.Entry"</code>
- * </ul>
- */
- void appendDeclarationTo(StringBuilder sb);
-
- /**
- * Print the version of the type's name that can be used in source code:<ul>
- * <li><code>"[[J"</code> => <code>"long[][]"</code>
- * <li><code>"java.util.Map$Entry"</code> => <code>"java.util.Map.Entry"</code>
- * </ul>
- */
- void printDeclarationOn(PrintWriter pw);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.java
deleted file mode 100644
index 4b33c7ecfb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/MethodSignature.java
+++ /dev/null
@@ -1,73 +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.utility;
-
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-
-/**
- * This interface describes a Java method signature; i.e. its "name"
- * and its "parameter types". The parameter types are referenced by name,
- * allowing us to reference classes that are not (or cannot be) loaded.
- * <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.
- */
-public interface MethodSignature {
-
- /**
- * Return the method's name.
- */
- String getName();
-
- /**
- * Return the method's parameter types.
- */
- JavaType[] getParameterTypes();
-
- /**
- * Return whether the method signature describes the specified method.
- */
- boolean describes(Method method);
-
- /**
- * Return whether the method signature equals the specified signature.
- */
- boolean equals(String otherName, JavaType[] otherParameterTypes);
-
- /**
- * Return whether the method signature equals the specified signature.
- */
- boolean equals(MethodSignature other);
-
- /**
- * Return a string representation of the method's signature:<p>
- * <code>"foo(int, java.lang.String)"</code>
- */
- String getSignature();
-
- /**
- * Append a string representation of the method's signature:<p>
- * <code>"foo(int, java.lang.String)"</code>
- */
- void appendSignatureTo(StringBuilder sb);
-
- /**
- * Print a string representation of the method's signature:<p>
- * <code>"foo(int, java.lang.String)"</code>
- */
- void printSignatureOn(PrintWriter pw);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.java
deleted file mode 100644
index ddca716eb7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AbstractAssociation.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.utility.internal;
-
-/**
- * Implement some of the methods in {@link Association} that can
- * be defined in terms of the other methods.
- */
-public abstract class AbstractAssociation<K, V>
- implements Association<K, V>
-{
-
- /**
- * Default constructor.
- */
- protected AbstractAssociation() {
- super();
- }
-
- @Override
- public synchronized boolean equals(Object o) {
- if ( ! (o instanceof Association<?, ?>)) {
- return false;
- }
- Association<?, ?> other = (Association<?, ?>) o;
- return (this.key() == null ?
- other.key() == null : this.key().equals(other.key()))
- && (this.value() == null ?
- other.value() == null : this.value().equals(other.value()));
- }
-
- @Override
- public synchronized int hashCode() {
- return (this.key() == null ? 0 : this.key().hashCode())
- ^ (this.value() == null ? 0 : this.value().hashCode());
- }
-
- @Override
- public synchronized String toString() {
- return this.key() + " => " + this.value(); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ArrayTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ArrayTools.java
deleted file mode 100644
index f1d37d51b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ArrayTools.java
+++ /dev/null
@@ -1,3122 +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.utility.internal;
-
-import java.lang.reflect.Array;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Random;
-
-/**
- * Array-related utility methods.
- */
-public final class ArrayTools {
- public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public static final char[] EMPTY_CHAR_ARRAY = new char[0];
- public static final int[] EMPTY_INT_ARRAY = new int[0];
-
- // ********** instantiation **********
-
- /**
- * Return a new array with the same length
- * and the same component type as the specified array.
- * <p>
- * <code>Arrays.newArray(Object[] array)</code>
- */
- public static <E> E[] newArray(E[] array) {
- return newArray(array, array.length);
- }
-
- /**
- * Return a new array with the specified length
- * and the same component type as the specified array.
- * <p>
- * <code>Arrays.newArray(Object[] array, int length)</code>
- */
- public static <E> E[] newArray(E[] array, int length) {
- return newArray(componentType(array), length);
- }
-
- /**
- * Return the specified array's component type, with appropriate support
- * for generics.
- */
- public static <E> Class<? extends E> componentType(E[] array) {
- Class<?> rawComponentType = array.getClass().getComponentType();
- @SuppressWarnings("unchecked")
- Class<? extends E> componentType = (Class<? extends E>) rawComponentType;
- return componentType;
- }
-
- /**
- * Return a new array with the specified component type and length,
- * with appropriate support for generics. The component type cannot be a
- * primitive type.
- */
- public static <E> E[] newArray(Class<? extends E> componentType, int length) {
- if (componentType.isPrimitive()) {
- throw new IllegalArgumentException("Array class cannot be primitive: " + componentType); //$NON-NLS-1$
- }
- return newArray_(componentType, length);
- }
-
- /**
- * assume the component type is not a primitive class
- */
- @SuppressWarnings("unchecked")
- private static <E> E[] newArray_(Class<? extends E> componentType, int length) {
- return (E[]) ((componentType == OBJECT_CLASS) ?
- new Object[length] :
- Array.newInstance(componentType, length));
- }
- private static final Class<Object> OBJECT_CLASS = Object.class;
-
-
- // ********** conversion **********
-
- /**
- * Return an array corresponding to the specified iterable.
- * <p>
- * <code>Iterable.toArray()</code>
- * @see Collection#toArray()
- */
- public static Object[] array(Iterable<?> iterable) {
- return array(iterable.iterator());
- }
-
- /**
- * Return an array corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.toArray()</code>
- * @see Collection#toArray()
- */
- public static Object[] array(Iterable<?> iterable, int iterableSize) {
- return array(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return an array corresponding to the specified iterable;
- * the runtime type of the returned array is that of the specified array.
- * If the iterable fits in the specified array, it is returned therein.
- * Otherwise, a new array is allocated with the runtime type of the
- * specified array and the size of the iterable.
- * <p>
- * <code>Iterable.toArray(Object[])</code>
- * @see Collection#toArray(Object[])
- */
- public static <E> E[] array(Iterable<? extends E> iterable, E[] array) {
- return array(iterable.iterator(), array);
- }
-
- /**
- * Return an array corresponding to the specified iterable;
- * the runtime type of the returned array is that of the specified array.
- * If the iterable fits in the specified array, it is returned therein.
- * Otherwise, a new array is allocated with the runtime type of the
- * specified array and the size of the iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.toArray(Object[])</code>
- * @see Collection#toArray(Object[])
- */
- public static <E> E[] array(Iterable<? extends E> iterable, int iterableSize, E[] array) {
- return array(iterable.iterator(), iterableSize, array);
- }
-
- /**
- * Return an array corresponding to the specified iterator.
- * <p>
- * <code>Iterator.toArray()</code>
- * @see Collection#toArray()
- */
- public static Object[] array(Iterator<?> iterator) {
- return iterator.hasNext() ?
- CollectionTools.list(iterator).toArray() :
- EMPTY_OBJECT_ARRAY;
- }
-
- /**
- * Return an array corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.toArray()</code>
- * @see Collection#toArray()
- */
- public static Object[] array(Iterator<?> iterator, int iteratorSize) {
- return iterator.hasNext() ?
- CollectionTools.list(iterator, iteratorSize).toArray() :
- EMPTY_OBJECT_ARRAY;
- }
-
- /**
- * Return an array corresponding to the specified iterator;
- * the runtime type of the returned array is that of the specified array.
- * If the iterator fits in the specified array, it is returned therein.
- * Otherwise, a new array is allocated with the runtime type of the
- * specified array and the size of the iterator.
- * <p>
- * <code>Iterator.toArray(Object[])</code>
- * @see Collection#toArray(Object[])
- */
- public static <E> E[] array(Iterator<? extends E> iterator, E[] array) {
- return iterator.hasNext() ?
- CollectionTools.list(iterator).toArray(array) :
- emptyArray(array);
- }
-
- /**
- * Return an array corresponding to the specified iterator;
- * the runtime type of the returned array is that of the specified array.
- * If the iterator fits in the specified array, it is returned therein.
- * Otherwise, a new array is allocated with the runtime type of the
- * specified array and the size of the iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.toArray(Object[])</code>
- * @see Collection#toArray(Object[])
- */
- public static <E> E[] array(Iterator<? extends E> iterator, int iteratorSize, E[] array) {
- return iterator.hasNext() ?
- CollectionTools.list(iterator, iteratorSize).toArray(array) :
- emptyArray(array);
- }
-
- /**
- * If the specified array is empty, return it;
- * otherwise, set its first element to null.
- * @see Collection#toArray(Object[])
- */
- private static <E> E[] emptyArray(E[] array) {
- return (array.length == 0) ? array : clearFirst(array);
- }
-
- /**
- * Set the specified array's first element to null and and return the array.
- * Assume the array length > 0.
- */
- private static <E> E[] clearFirst(E[] array) {
- array[0] = null;
- return array;
- }
-
-
- // ********** add **********
-
- /**
- * Return a new array containing the elements in the
- * specified array followed by the specified object to be added.
- * <p>
- * <code>Arrays.add(Object[] array, Object o)</code>
- */
- public static <E> E[] add(E[] array, E value) {
- int len = array.length;
- E[] result = newArray(array, len + 1);
- if (len > 0) {
- System.arraycopy(array, 0, result, 0, len);
- }
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array containing the elements in the
- * specified array with the specified object added at the specified index.
- * <p>
- * <code>Arrays.add(Object[] array, int index, Object o)</code>
- */
- public static <E> E[] add(E[] array, int index, E value) {
- int len = array.length;
- E[] result = newArray(array, len + 1);
- if (index > 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- result[index] = value;
- if (index < len) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Return a new array containing the elements in the
- * specified array followed by the specified value to be added.
- * <p>
- * <code>Arrays.add(char[] array, char value)</code>
- */
- public static char[] add(char[] array, char value) {
- int len = array.length;
- char[] result = new char[len + 1];
- if (len > 0) {
- System.arraycopy(array, 0, result, 0, len);
- }
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array containing the elements in the
- * specified array with the specified value added at the specified index.
- * <p>
- * <code>Arrays.add(char[] array, int index, char value)</code>
- */
- public static char[] add(char[] array, int index, char value) {
- int len = array.length;
- char[] result = new char[len + 1];
- if (index > 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- result[index] = value;
- if (index < len) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
- /**
- * Return a new array containing the elements in the
- * specified array followed by the specified value to be added.
- * <p>
- * <code>Arrays.add(int[] array, int value)</code>
- */
- public static int[] add(int[] array, int value) {
- int len = array.length;
- int[] result = new int[len + 1];
- if (len > 0) {
- System.arraycopy(array, 0, result, 0, len);
- }
- result[len] = value;
- return result;
- }
-
- /**
- * Return a new array containing the elements in the
- * specified array with the specified value added at the specified index.
- * <p>
- * <code>Arrays.add(int[] array, int index, int value)</code>
- */
- public static int[] add(int[] array, int index, int value) {
- int len = array.length;
- int[] result = new int[len + 1];
- if (index > 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- result[index] = value;
- if (index < len) {
- System.arraycopy(array, index, result, index + 1, len - index);
- }
- return result;
- }
-
-
- // ********** add all **********
-
- /**
- * Return an array containing the elements in the
- * specified array followed by the elements
- * in the specified collection.
- *<p>
- * <code>Arrays.addAll(Object[] array, Collection collection)</code>
- */
- public static <E> E[] addAll(E[] array, Collection<? extends E> collection) {
- return addAll(array, collection, collection.size());
- }
-
- /**
- * check collection size
- */
- private static <E> E[] addAll(E[] array, Collection<? extends E> collection, int collectionSize) {
- return (collectionSize == 0) ? array : addAll_(array, collection, collectionSize);
- }
-
- /**
- * assume the collection is non-empty
- */
- private static <E> E[] addAll_(E[] array, Collection<? extends E> collection) {
- return addAll_(array, collection, collection.size());
- }
-
- /**
- * assume collection size > zero
- */
- private static <E> E[] addAll_(E[] array, Collection<? extends E> collection, int collectionSize) {
- return addAll(array, collection, array.length, collectionSize);
- }
-
- /**
- * assume collection size > zero; check array length
- */
- private static <E> E[] addAll(E[] array, Collection<? extends E> collection, int arrayLength, int collectionSize) {
- return (arrayLength == 0) ?
- collection.toArray(newArray(array, collectionSize)) :
- addAll_(array, collection, arrayLength, collectionSize);
- }
-
- /**
- * assume array length and collection size > zero
- */
- private static <E> E[] addAll_(E[] array, Collection<? extends E> collection, int arrayLength, int collectionSize) {
- E[] result = newArray(array, arrayLength + collectionSize);
- System.arraycopy(array, 0, result, 0, arrayLength);
- int i = arrayLength;
- for (E element : collection) {
- result[i++] = element;
- }
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array followed by the elements
- * in the specified iterable.
- * <p>
- * <code>Arrays.addAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable) {
- return addAll(array, iterable.iterator());
- }
-
- /**
- * Return an array containing the elements in the
- * specified array followed by the elements
- * in the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Arrays.addAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] addAll(E[] array, Iterable<? extends E> iterable, int iterableSize) {
- return addAll(array, iterable.iterator(), iterableSize);
- }
-
- /**
- * Return an array containing the elements in the
- * specified array followed by the elements
- * in the specified iterator.
- * <p>
- * <code>Arrays.addAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] addAll(E[] array, Iterator<? extends E> iterator) {
- return iterator.hasNext() ? addAll_(array, CollectionTools.list(iterator)) : array;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array followed by the elements
- * in the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Arrays.addAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] addAll(E[] array, Iterator<? extends E> iterator, int iteratorSize) {
- return iterator.hasNext() ? addAll_(array, CollectionTools.list(iterator, iteratorSize)) : array;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * <p>
- * <code>Arrays.addAll(Object[] array1, Object[] array2)</code>
- */
- public static <E> E[] addAll(E[] array1, E... array2) {
- return addAll(array1, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static <E> E[] addAll(E[] array1, E[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static <E> E[] addAll_(E[] array1, E[] array2, int array2Length) {
- return addAll(array1, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static <E> E[] addAll(E[] array1, E[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ? array2 : addAll_(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0
- */
- private static <E> E[] addAll_(E[] array1, E[] array2, int array1Length, int array2Length) {
- E[] result = newArray(array1, array1Length + array2Length);
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * <p>
- * <code>Arrays.addAll(Object[] array1, int index, Object[] array2)</code>
- */
- public static <E> E[] addAll(E[] array1, int index, E... array2) {
- return addAll(array1, index, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static <E> E[] addAll(E[] array1, int index, E[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, index, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static <E> E[] addAll_(E[] array1, int index, E[] array2, int array2Length) {
- return addAll(array1, index, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static <E> E[] addAll(E[] array1, int index, E[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ?
- array2 :
- (index == array1Length) ? // 'array2' added to end of 'array1'
- addAll_(array1, array2, array1Length, array2Length) :
- addAll_(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0 and index != array 1 length
- */
- private static <E> E[] addAll_(E[] array1, int index, E[] array2, int array1Length, int array2Length) {
- E[] result = newArray(array1, array1Length + array2Length);
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - index);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array with the elements
- * in the specified collection inserted at the specified index.
- * <p>
- * <code>Arrays.addAll(Object[] array, int index, Collection c)</code>
- */
- public static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection) {
- return addAll(array, index, collection, collection.size());
- }
-
- /**
- * check collection size
- */
- private static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection, int collectionSize) {
- return (collectionSize == 0) ? array : addAll_(array, index, collection, collectionSize);
- }
-
- /**
- * assume collection size > 0
- */
- private static <E> E[] addAll_(E[] array, int index, Collection<? extends E> collection, int collectionSize) {
- return addAll(array, index, collection, array.length, collectionSize);
- }
-
- /**
- * assume collection size > 0; check array length
- */
- private static <E> E[] addAll(E[] array, int index, Collection<? extends E> collection, int arrayLength, int collectionSize) {
- if (arrayLength == 0) {
- if (index == 0) {
- return collection.toArray(newArray(array, collectionSize));
- }
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- return (index == arrayLength) ? // 'collection' added to end of 'array'
- addAll_(array, collection, arrayLength, collectionSize) :
- addAll_(array, index, collection, arrayLength, collectionSize);
- }
-
- /**
- * assume array length and collection size > 0 and index != array length
- */
- private static <E> E[] addAll_(E[] array, int index, Collection<? extends E> collection, int arrayLength, int collectionSize) {
- E[] result = newArray(array, arrayLength + collectionSize);
- System.arraycopy(array, 0, result, 0, index);
- int i = index;
- for (E item : collection) {
- result[i++] = item;
- }
- System.arraycopy(array, index, result, index + collectionSize, arrayLength - index);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * <p>
- * <code>Arrays.addAll(Object[] array, int index, Iterable iterable)</code>
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable) {
- return addAll(array, index, iterable.iterator());
- }
-
- /**
- * Return an array containing the elements in the
- * specified array with the elements
- * in the specified iterable inserted at the specified index.
- * <p>
- * <code>Arrays.addAll(Object[] array, int index, Iterable iterable)</code>
- */
- public static <E> E[] addAll(E[] array, int index, Iterable<? extends E> iterable, int iterableSize) {
- return addAll(array, index, iterable.iterator(), iterableSize);
- }
-
- /**
- * Return an array containing the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * <p>
- * <code>Arrays.addAll(Object[] array, int index, Iterator iterator)</code>
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator) {
- return iterator.hasNext() ? addAll_(array, index, CollectionTools.list(iterator)) : array;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array with the elements
- * in the specified iterator inserted at the specified index.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Arrays.addAll(Object[] array, int index, Iterator iterator)</code>
- */
- public static <E> E[] addAll(E[] array, int index, Iterator<? extends E> iterator, int iteratorSize) {
- return iterator.hasNext() ? addAll_(array, index, CollectionTools.list(iterator, iteratorSize)) : array;
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] addAll_(E[] array, int index, Collection<? extends E> collection) {
- return addAll_(array, index, collection, collection.size());
- }
-
- /**
- * Return an array containing the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * <p>
- * <code>Arrays.addAll(char[] array1, char[] array2)</code>
- */
- public static char[] addAll(char[] array1, char... array2) {
- return addAll(array1, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static char[] addAll(char[] array1, char[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static char[] addAll_(char[] array1, char[] array2, int array2Length) {
- return addAll(array1, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static char[] addAll(char[] array1, char[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ? array2 : addAll_(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0
- */
- private static char[] addAll_(char[] array1, char[] array2, int array1Length, int array2Length) {
- char[] result = new char[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * <p>
- * <code>Arrays.add(char[] array1, int index, char[] array2)</code>
- */
- public static char[] addAll(char[] array1, int index, char... array2) {
- return addAll(array1, index, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static char[] addAll(char[] array1, int index, char[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, index, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static char[] addAll_(char[] array1, int index, char[] array2, int array2Length) {
- return addAll(array1, index, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static char[] addAll(char[] array1, int index, char[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ?
- array2 :
- (index == array1Length) ? // 'array2' added to end of 'array1'
- addAll_(array1, array2, array1Length, array2Length) :
- addAll_(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0 and index != array 1 length
- */
- private static char[] addAll_(char[] array1, int index, char[] array2, int array1Length, int array2Length) {
- char[] result = new char[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - index);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * specified array 1 followed by the elements
- * in the specified array 2.
- * <p>
- * <code>Arrays.addAll(int[] array1, int[] array2)</code>
- */
- public static int[] addAll(int[] array1, int... array2) {
- return addAll(array1, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static int[] addAll(int[] array1, int[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static int[] addAll_(int[] array1, int[] array2, int array2Length) {
- return addAll(array1, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static int[] addAll(int[] array1, int[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ? array2 : addAll_(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0
- */
- private static int[] addAll_(int[] array1, int[] array2, int array1Length, int array2Length) {
- int[] result = new int[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, array1Length);
- System.arraycopy(array2, 0, result, array1Length, array2Length);
- return result;
- }
-
- /**
- * Return an array containing the elements in the
- * first specified array with the objects in the second
- * specified array added at the specified index.
- * <p>
- * <code>Arrays.add(int[] array1, int index, int[] array2)</code>
- */
- public static int[] addAll(int[] array1, int index, int... array2) {
- return addAll(array1, index, array2, array2.length);
- }
-
- /**
- * check array 2 length
- */
- private static int[] addAll(int[] array1, int index, int[] array2, int array2Length) {
- return (array2Length == 0) ? array1 : addAll_(array1, index, array2, array2Length);
- }
-
- /**
- * assume array 2 length > 0
- */
- private static int[] addAll_(int[] array1, int index, int[] array2, int array2Length) {
- return addAll(array1, index, array2, array1.length, array2Length);
- }
-
- /**
- * assume array 2 length > 0; check array 1 length
- */
- private static int[] addAll(int[] array1, int index, int[] array2, int array1Length, int array2Length) {
- return (array1Length == 0) ?
- array2 :
- (index == array1Length) ? // 'array2' added to end of 'array1'
- addAll_(array1, array2, array1Length, array2Length) :
- addAll_(array1, index, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0 and index != array 1 length
- */
- private static int[] addAll_(int[] array1, int index, int[] array2, int array1Length, int array2Length) {
- int[] result = new int[array1Length + array2Length];
- System.arraycopy(array1, 0, result, 0, index);
- System.arraycopy(array2, 0, result, index, array2Length);
- System.arraycopy(array1, index, result, index + array2Length, array1Length - index);
- return result;
- }
-
-
- // ********** clear **********
-
- /**
- * Return an empty array with the same component type as the specified array.
- * <p>
- * <code>Arrays.clear(Object[] array)</code>
- */
- public static <E> E[] clear(E[] array) {
- return (array.length == 0) ? array : newArray(array, 0);
- }
-
-
- // ********** concatenate **********
-
- /**
- * Return an array containing all the elements in all the
- * specified arrays, concatenated in the specified order.
- * This is useful for building constant arrays out of other constant arrays.
- * <p>
- * <code>Arrays.concatenate(Object[]... arrays)</code>
- */
- public static <E> E[] concatenate(E[]... arrays) {
- int len = 0;
- for (E[] array : arrays) {
- len += array.length;
- }
- E[] result = newArray(arrays[0], len);
- if (len == 0) {
- return result;
- }
- int current = 0;
- for (E[] array : arrays) {
- int arrayLength = array.length;
- if (arrayLength > 0) {
- System.arraycopy(array, 0, result, current, arrayLength);
- current += arrayLength;
- }
- }
- return result;
- }
-
- /**
- * Return an array containing all the elements in all the
- * specified arrays, concatenated in the specified order.
- * This is useful for building constant arrays out other constant arrays.
- * <p>
- * <code>Arrays.concatenate(char[]... arrays)</code>
- */
- public static char[] concatenate(char[]... arrays) {
- int len = 0;
- for (char[] array : arrays) {
- len += array.length;
- }
- if (len == 0) {
- return EMPTY_CHAR_ARRAY;
- }
- char[] result = new char[len];
- int current = 0;
- for (char[] array : arrays) {
- int arrayLength = array.length;
- if (arrayLength != 0) {
- System.arraycopy(array, 0, result, current, arrayLength);
- current += arrayLength;
- }
- }
- return result;
- }
-
- /**
- * Return an array containing all the elements in all the
- * specified arrays, concatenated in the specified order.
- * This is useful for building constant arrays out other constant arrays.
- * <p>
- * <code>Arrays.concatenate(int[]... arrays)</code>
- */
- public static int[] concatenate(int[]... arrays) {
- int len = 0;
- for (int[] array : arrays) {
- len += array.length;
- }
- if (len == 0) {
- return EMPTY_INT_ARRAY;
- }
- int[] result = new int[len];
- int current = 0;
- for (int[] array : arrays) {
- int arrayLength = array.length;
- if (arrayLength != 0) {
- System.arraycopy(array, 0, result, current, arrayLength);
- current += arrayLength;
- }
- }
- return result;
- }
-
-
- // ********** contains **********
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * <p>
- * <code>Arrays.contains(Object[] array, Object o)</code>
- */
- public static boolean contains(Object[] array, Object value) {
- return contains(array, value, array.length);
- }
-
- /**
- * check array length
- */
- private static boolean contains(Object[] array, Object value, int arrayLength) {
- return (arrayLength == 0) ? false : contains_(array, value, arrayLength);
- }
-
- /**
- * assume array length > 0
- */
- public static boolean contains_(Object[] array, Object value, int arrayLength) {
- if (value == null) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] == null) {
- return true;
- }
- }
- } else {
- for (int i = arrayLength; i-- > 0; ) {
- if (value.equals(array[i])) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * <p>
- * <code>Arrays.contains(char[] array, char value)</code>
- */
- public static boolean contains(char[] array, char value) {
- return contains(array, value, array.length);
- }
-
- /**
- * check array length
- */
- private static boolean contains(char[] array, char value, int arrayLength) {
- return (arrayLength == 0) ? false : contains_(array, value, arrayLength);
- }
-
- /**
- * assume array length > 0
- */
- private static boolean contains_(char[] array, char value, int arrayLength) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified array contains the
- * specified element.
- * <p>
- * <code>Arrays.contains(int[] array, int value)</code>
- */
- public static boolean contains(int[] array, int value) {
- return contains(array, value, array.length);
- }
-
- /**
- * check array length
- */
- private static boolean contains(int[] array, int value, int arrayLength) {
- return (arrayLength == 0) ? false : contains_(array, value, arrayLength);
- }
-
- /**
- * assume array length > 0
- */
- private static boolean contains_(int[] array, int value, int arrayLength) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] == value) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** contains all **********
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified collection.
- * <p>
- * <code>Arrays.containsAll(Object[] array, Collection collection)</code>
- */
- public static boolean containsAll(Object[] array, Collection<?> collection) {
- return containsAll(array, collection.iterator());
- }
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified iterable.
- * <p>
- * <code>Arrays.containsAll(Object[] array, Iterable iterable)</code>
- */
- public static boolean containsAll(Object[] array, Iterable<?> iterable) {
- return containsAll(array, iterable.iterator());
- }
-
- /**
- * Return whether the specified array contains all of the
- * elements in the specified iterator.
- * <p>
- * <code>Arrays.containsAll(Object[] array, Iterator iterator)</code>
- */
- public static boolean containsAll(Object[] array, Iterator<?> iterator) {
- // use hashed lookup
- HashSet<Object> set = CollectionTools.set(array);
- while (iterator.hasNext()) {
- if ( ! set.contains(iterator.next())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * <p>
- * <code>Arrays.containsAll(Object[] array1, Object[] array2)</code>
- */
- public static boolean containsAll(Object[] array1, Object... array2) {
- // use hashed lookup
- HashSet<Object> set = CollectionTools.set(array1);
- for (int i = array2.length; i-- > 0; ) {
- if ( ! set.contains(array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * <p>
- * <code>Arrays.containsAll(char[] array1, char[] array2)</code>
- */
- public static boolean containsAll(char[] array1, char... array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified array 1 contains all of the
- * elements in the specified array 2.
- * <p>
- * <code>Arrays.containsAll(int[] array1, int[] array2)</code>
- */
- public static boolean containsAll(int[] array1, int... array2) {
- for (int i = array2.length; i-- > 0; ) {
- if ( ! contains(array1, array2[i])) {
- return false;
- }
- }
- return true;
- }
-
-
- // ********** diff **********
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different, beginning at the end.
- * If the arrays are identical, return -1.
- * If the arrays are different sizes, return the index of the
- * last element in the longer array.
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- */
- public static int diffEnd(Object[] array1, Object[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- if (len1 != len2) {
- return Math.max(len1, len2) - 1;
- }
- for (int i = len1 - 1; i > -1; i--) {
- Object o = array1[i];
- if (o == null) {
- if (array2[i] != null) {
- return i;
- }
- } else {
- if ( ! o.equals(array2[i])) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- * @see #diffStart(Object[], Object[])
- * @see #diffEnd(Object[], Object[])
- */
- public static Range diffRange(Object[] array1, Object[] array2) {
- int end = diffEnd(array1, array2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(array1.length, end);
- }
- // the lists are different, calculate the start of the range
- return new Range(diffStart(array1, array2), end);
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different. If the arrays are identical, return
- * the size of the two arrays (i.e. one past the last index).
- * If the arrays are different sizes and all the elements in
- * the shorter array match their corresponding elements in
- * the longer array, return the size of the shorter array
- * (i.e. one past the last index of the shorter array).
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- */
- public static int diffStart(Object[] array1, Object[] array2) {
- int end = Math.min(array1.length, array2.length);
- for (int i = 0; i < end; i++) {
- Object o = array1[i];
- if (o == null) {
- if (array2[i] != null) {
- return i;
- }
- } else {
- if ( ! o.equals(array2[i])) {
- return i;
- }
- }
- }
- return end;
- }
-
-
- // ********** identity diff **********
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different, beginning at the end.
- * If the arrays are identical, return -1.
- * If the arrays are different sizes, return the index of the
- * last element in the longer array.
- * Use object identity to compare the elements.
- */
- public static int identityDiffEnd(Object[] array1, Object[] array2) {
- int len1 = array1.length;
- int len2 = array2.length;
- if (len1 != len2) {
- return Math.max(len1, len2) - 1;
- }
- for (int i = len1 - 1; i > -1; i--) {
- if (array1[i] != array2[i]) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use object identity to compare the elements.
- * @see #identityDiffStart(Object[], Object[])
- * @see #identityDiffEnd(Object[], Object[])
- */
- public static Range identityDiffRange(Object[] array1, Object[] array2) {
- int end = identityDiffEnd(array1, array2);
- if (end == -1) {
- // the lists are identical, the start is the size of the two lists
- return new Range(array1.length, end);
- }
- // the lists are different, calculate the start of the range
- return new Range(identityDiffStart(array1, array2), end);
- }
-
- /**
- * Return the index of the first elements in the specified
- * arrays that are different. If the arrays are identical, return
- * the size of the two arrays (i.e. one past the last index).
- * If the arrays are different sizes and all the elements in
- * the shorter array match their corresponding elements in
- * the longer array, return the size of the shorter array
- * (i.e. one past the last index of the shorter array).
- * Use object identity to compare the elements.
- */
- public static int identityDiffStart(Object[] array1, Object[] array2) {
- int end = Math.min(array1.length, array2.length);
- for (int i = 0; i < end; i++) {
- if (array1[i] != array2[i]) {
- return i;
- }
- }
- return end;
- }
-
-
- // ********** elements are identical **********
-
- /**
- * Return whether the specified arrays contain the same elements.
- * <p>
- * <code>Arrays.identical(Object[] array1, Object[] array2)</code>
- */
- public static boolean elementsAreIdentical(Object[] array1, Object[] array2) {
- if (array1 == array2) {
- return true;
- }
- if (array1 == null || array2 == null) {
- return false;
- }
- int length = array1.length;
- if (array2.length != length) {
- return false;
- }
- for (int i = length; i-- > 0; ) {
- if (array1[i] != array2[i]) {
- return false;
- }
- }
- return true;
- }
-
-
- // ********** index of **********
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.indexOf(Object[] array, Object o)</code>
- */
- public static int indexOf(Object[] array, Object value) {
- int len = array.length;
- if (value == null) {
- for (int i = 0; i < len; i++) {
- if (array[i] == null) {
- return i;
- }
- }
- } else {
- for (int i = 0; i < len; i++) {
- if (value.equals(array[i])) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.identityIndexOf(Object[] array, Object o)</code>
- */
- public static int identityIndexOf(Object[] array, Object value) {
- int len = array.length;
- for (int i = 0; i < len; i++) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.indexOf(char[] array, char value)</code>
- */
- public static int indexOf(char[] array, char value) {
- int len = array.length;
- for (int i = 0; i < len; i++) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.indexOf(int[] array, int value)</code>
- */
- public static int indexOf(int[] array, int value) {
- int len = array.length;
- for (int i = 0; i < len; i++) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** insertion index of **********
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted array and still keep
- * the array sorted.
- */
- public static <E extends Comparable<? super E>> int insertionIndexOf(E[] sortedArray, Comparable<E> value) {
- int len = sortedArray.length;
- for (int i = 0; i < len; i++) {
- if (value.compareTo(sortedArray[i]) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted array and still keep
- * the array sorted.
- */
- public static <E> int insertionIndexOf(E[] sortedArray, E value, Comparator<? super E> comparator) {
- int len = sortedArray.length;
- for (int i = 0; i < len; i++) {
- if (comparator.compare(value, sortedArray[i]) < 0) {
- return i;
- }
- }
- return len;
- }
-
-
- // ********** last index of **********
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array;
- * return -1 if there is no such index.
- * <p>
- * <code>Arrays.lastIndexOf(Object[] array, Object o)</code>
- */
- public static int lastIndexOf(Object[] array, Object value) {
- int len = array.length;
- if (value == null) {
- for (int i = len; i-- > 0; ) {
- if (array[i] == null) {
- return i;
- }
- }
- } else {
- for (int i = len; i-- > 0; ) {
- if (value.equals(array[i])) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.lastIndexOf(char[] array, char value)</code>
- */
- public static int lastIndexOf(char[] array, char value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified array,
- * or return -1 if there is no such index.
- * <p>
- * <code>Arrays.lastIndexOf(int[] array, int value)</code>
- */
- public static int lastIndexOf(int[] array, int value) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == value) {
- return i;
- }
- }
- return -1;
- }
-
-
- // ********** min/max **********
-
- /**
- * Return the character from the specified array with the minimum value.
- * <p>
- * <code>Arrays.min(char[] array)</code>
- */
- public static char min(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int last = len - 1;
- char min = array[last];
- for (int i = last; i-- > 0; ) {
- char c = array[i];
- if (c < min) {
- min = c;
- }
- }
- return min;
- }
-
- /**
- * Return the integer from the specified array with the minimum value.
- * <p>
- * <code>Arrays.min(int[] array)</code>
- */
- public static int min(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int last = len - 1;
- int min = array[last];
- for (int i = last; i-- > 0; ) {
- int x = array[i];
- if (x < min) {
- min = x;
- }
- }
- return min;
- }
-
- /**
- * Return the character from the specified array with the maximum value.
- * <p>
- * <code>Arrays.max(char[] array)</code>
- */
- public static char max(char... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int last = len - 1;
- char max = array[last];
- for (int i = last; i-- > 0; ) {
- char c = array[i];
- if (c > max) {
- max = c;
- }
- }
- return max;
- }
-
- /**
- * Return the integer from the specified array with the maximum value.
- * <p>
- * <code>Arrays.max(int[] array)</code>
- */
- public static int max(int... array) {
- int len = array.length;
- if (len == 0) {
- throw new IndexOutOfBoundsException();
- }
- int last = len - 1;
- int max = array[last];
- for (int i = last; i-- > 0; ) {
- int x = array[i];
- if (x > max) {
- max = x;
- }
- }
- return max;
- }
-
-
- // ********** move **********
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(Object[] array, int targetIndex, int sourceIndex)</code>
- */
- public static <E> E[] move(E[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume target index != source index
- */
- private static <E> E[] move_(E[] array, int targetIndex, int sourceIndex) {
- E temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(Object[] array, int targetIndex, int sourceIndex, int length)</code>
- */
- public static <E> E[] move(E[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- E[] temp = newArray(array, length);
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(int[] array, int targetIndex, int sourceIndex)</code>
- */
- public static int[] move(int[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static int[] move_(int[] array, int targetIndex, int sourceIndex) {
- int temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(int[] array, int targetIndex, int sourceIndex, int length)</code>
- */
- public static int[] move(int[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- int[] temp = new int[length];
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(char[] array, int targetIndex, int sourceIndex)</code>
- */
- public static char[] move(char[] array, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? array : move_(array, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static char[] move_(char[] array, int targetIndex, int sourceIndex) {
- char temp = array[sourceIndex];
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + 1, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + 1, array, sourceIndex, targetIndex - sourceIndex);
- }
- array[targetIndex] = temp;
- return array;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered array.
- * <p>
- * <code>Arrays.move(char[] array, int targetIndex, int sourceIndex, int length)</code>
- */
- public static char[] move(char[] array, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return array;
- }
- if (length == 1) {
- return move_(array, targetIndex, sourceIndex);
- }
- char[] temp = new char[length];
- System.arraycopy(array, sourceIndex, temp, 0, length);
- if (targetIndex < sourceIndex) {
- System.arraycopy(array, targetIndex, array, targetIndex + length, sourceIndex - targetIndex);
- } else {
- System.arraycopy(array, sourceIndex + length, array, sourceIndex, targetIndex - sourceIndex);
- }
- System.arraycopy(temp, 0, array, targetIndex, length);
- return array;
- }
-
-
- // ********** remove **********
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.remove(Object[] array, Object value)</code>
- */
- public static <E> E[] remove(E[] array, Object value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.remove(char[] array, char value)</code>
- */
- public static char[] remove(char[] array, char value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.remove(int[] array, int value)</code>
- */
- public static int[] remove(int[] array, int value) {
- return removeElementAtIndex(array, indexOf(array, value));
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the first element removed.
- * <p>
- * <code>Arrays.removeFirst(Object[] array)</code>
- */
- public static <E> E[] removeFirst(E[] array) {
- return removeElementAtIndex(array, 0);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the first element removed.
- * <p>
- * <code>Arrays.removeFirst(char[] array)</code>
- */
- public static char[] removeFirst(char[] array) {
- return removeElementAtIndex(array, 0);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the first element removed.
- * <p>
- * <code>Arrays.removeFirst(int[] array)</code>
- */
- public static int[] removeFirst(int[] array) {
- return removeElementAtIndex(array, 0);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the last element removed.
- * <p>
- * <code>Arrays.removeLast(Object[] array)</code>
- */
- public static <E> E[] removeLast(E[] array) {
- return removeElementAtIndex(array, array.length - 1);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the last element removed.
- * <p>
- * <code>Arrays.removeLast(char[] array)</code>
- */
- public static char[] removeLast(char[] array) {
- return removeElementAtIndex(array, array.length - 1);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the last element removed.
- * <p>
- * <code>Arrays.removeLast(int[] array)</code>
- */
- public static int[] removeLast(int[] array) {
- return removeElementAtIndex(array, array.length - 1);
- }
-
-
- // ********** remove all **********
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterable and return the result.
- * <p>
- * <code>Arrays.removeAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] removeAll(E[] array, Iterable<?> iterable) {
- return removeAll(array, iterable.iterator());
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterable and return the result.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Arrays.removeAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] removeAll(E[] array, Iterable<?> iterable, int iterableSize) {
- return removeAll(array, iterable.iterator(), iterableSize);
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * <p>
- * <code>Arrays.removeAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator) {
- // convert to a set to take advantage of hashed look-up
- return iterator.hasNext() ? removeAll_(array, CollectionTools.set(iterator)) : array;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified iterator and return the result.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Arrays.removeAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] removeAll(E[] array, Iterator<?> iterator, int iteratorSize) {
- // convert to a set to take advantage of hashed look-up
- return iterator.hasNext() ? removeAll_(array, CollectionTools.set(iterator, iteratorSize)) : array;
- }
-
- /**
- * Remove from the specified array all the elements in
- * the specified collection and return the result.
- * <p>
- * <code>Arrays.removeAll(Object[] array, Collection collection)</code>
- */
- public static <E> E[] removeAll(E[] array, Collection<?> collection) {
- return collection.isEmpty() ? array : removeAll_(array, collection);
- }
-
- /**
- * assume collection is non-empty
- */
- private static <E> E[] removeAll_(E[] array, Collection<?> collection) {
- return removeAll(array, collection, array.length);
- }
-
- /**
- * assume collection is non-empty; check array length
- */
- private static <E> E[] removeAll(E[] array, Collection<?> collection, int arrayLength) {
- return (arrayLength == 0) ? array : removeAll_(array, collection, arrayLength);
- }
-
- /**
- * assume collection is non-empty and array length > 0
- */
- private static <E> E[] removeAll_(E[] array, Collection<?> collection, int arrayLength) {
- // build the indices of the elements that are to remain
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = 0; i < arrayLength; i++) {
- if ( ! collection.contains(array[i])) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays.removeAll(Object[] array1, Object[] array2)</code>
- */
- public static <E> E[] removeAll(E[] array1, Object... array2) {
- // convert to a set to take advantage of hashed look-up
- return (array2.length == 0) ? array1 : removeAll_(array1, CollectionTools.set(array2));
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays#removeAll(char[] array1, char[] array2)</code>
- */
- public static char[] removeAll(char[] array1, char... array2) {
- if (array2.length == 0) {
- return array1;
- }
- int array1Length = array1.length;
- if (array1Length == 0) {
- return array1;
- }
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if ( ! contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // nothing was removed
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays#removeAll(int[] array1, int[] array2)</code>
- */
- public static int[] removeAll(int[] array1, int... array2) {
- if (array2.length == 0) {
- return array1;
- }
- int array1Length = array1.length;
- if (array1Length == 0) {
- return array1;
- }
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if ( ! contains(array2, array1[i])) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // nothing was removed
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
-
- // ********** remove all occurrences **********
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * <p>
- * <code>Arrays.removeAllOccurrences(Object[] array, Object value)</code>
- */
- public static <E> E[] removeAllOccurrences(E[] array, Object value) {
- int arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- if (value == null) {
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != null) {
- indices[j++] = i;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if ( ! value.equals(array[i])) {
- indices[j++] = i;
- }
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * <p>
- * <code>Arrays.removeAllOccurrences(char[] array, char value)</code>
- */
- public static char[] removeAllOccurrences(char[] array, char value) {
- int arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != value) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the specified array all occurrences of
- * the specified element and return the result.
- * <p>
- * <code>Arrays.removeAllOccurrences(int[] array, int value)</code>
- */
- public static int[] removeAllOccurrences(int[] array, int value) {
- int arrayLength = array.length;
- if (arrayLength == 0) {
- return array;
- }
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = arrayLength; i-- > 0; ) {
- if (array[i] != value) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // nothing was removed
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[i]];
- }
- return result;
- }
-
-
- // ********** remove duplicate elements **********
-
- /**
- * Remove any duplicate elements from the specified array,
- * while maintaining the order.
- */
- public static <E> E[] removeDuplicateElements(E... array) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- ArrayList<E> temp = CollectionTools.list(array);
- return CollectionTools.removeDuplicateElements(temp, len) ?
- temp.toArray(newArray(array, temp.size())) :
- array;
- }
-
-
- // ********** remove element at index **********
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.removeElementAtIndex(Object[] array, int index)</code>
- */
- public static <E> E[] removeElementAtIndex(E[] array, int index) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.removeElementAtIndex(char[] array, int index)</code>
- */
- public static char[] removeElementAtIndex(char[] array, int index) {
- return removeElementsAtIndex(array, index, 1);
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified element removed.
- * <p>
- * <code>Arrays.removeElementAtIndex(int[] array, int index)</code>
- */
- public static int[] removeElementAtIndex(int[] array, int index) {
- return removeElementsAtIndex(array, index, 1);
- }
-
-
- // ********** remove elements at index **********
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * <p>
- * <code>Arrays.removeElementsAtIndex(Object[] array, int index, int length)</code>
- */
- public static <E> E[] removeElementsAtIndex(E[] array, int index, int length) {
- if (length == 0) {
- return array;
- }
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- E[] result = newArray(array, newLength);
- if ((newLength == 0) && (index == 0)) {
- return result; // performance tweak
- }
- if (index != 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- int length2 = newLength - index;
- if (length2 != 0) {
- System.arraycopy(array, index + length, result, index, length2);
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * <p>
- * <code>Arrays.removeElementsAtIndex(char[] array, int index, int length)
- */
- public static char[] removeElementsAtIndex(char[] array, int index, int length) {
- if (length == 0) {
- return array;
- }
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_CHAR_ARRAY; // performance tweak
- }
- char[] result = new char[newLength];
- if (index != 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- int length2 = newLength - index;
- if (length2 != 0) {
- System.arraycopy(array, index + length, result, index, length2);
- }
- return result;
- }
-
- /**
- * Return a new array that contains the elements in the
- * specified array with the specified elements removed.
- * <p>
- * <code>Arrays.removeElementsAtIndex(int[] array, int index, int length)
- */
- public static int[] removeElementsAtIndex(int[] array, int index, int length) {
- if (length == 0) {
- return array;
- }
- int arrayLength = array.length;
- int newLength = arrayLength - length;
- if ((newLength == 0) && (index == 0)) {
- return EMPTY_INT_ARRAY; // performance tweak
- }
- int[] result = new int[newLength];
- if (index != 0) {
- System.arraycopy(array, 0, result, 0, index);
- }
- int length2 = newLength - index;
- if (length2 != 0) {
- System.arraycopy(array, index + length, result, index, length2);
- }
- return result;
- }
-
-
- // ********** replace all **********
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value. Return the altered array.
- * <p>
- * <code>Arrays.replaceAll(Object[] array, Object oldValue, Object newValue)</code>
- */
- public static <E> E[] replaceAll(E[] array, Object oldValue, E newValue) {
- if (oldValue == null) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == null) {
- array[i] = newValue;
- }
- }
- } else {
- for (int i = array.length; i-- > 0; ) {
- if (oldValue.equals(array[i])) {
- array[i] = newValue;
- }
- }
- }
- return array;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value. Return the altered array.
- *<p>
- * <code> Arrays.replaceAll(int[] array, int oldValue, int newValue)</code>
- */
- public static int[] replaceAll(int[] array, int oldValue, int newValue) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == oldValue) {
- array[i] = newValue;
- }
- }
- return array;
- }
-
- /**
- * Replace all occurrences of the specified old value with
- * the specified new value. Return the altered array.
- * <p>
- * <code>Arrays.replaceAll(char[] array, char oldValue, char newValue)</code>
- */
- public static char[] replaceAll(char[] array, char oldValue, char newValue) {
- for (int i = array.length; i-- > 0; ) {
- if (array[i] == oldValue) {
- array[i] = newValue;
- }
- }
- return array;
- }
-
-
- // ********** retain all **********
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterable and return the result.
- * <p>
- * <code>Arrays.retainAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] retainAll(E[] array, Iterable<?> iterable) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterable.iterator());
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterable and return the result.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Arrays.retainAll(Object[] array, Iterable iterable)</code>
- */
- public static <E> E[] retainAll(E[] array, Iterable<?> iterable, int iterableSize) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterable.iterator(), iterableSize);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterator and return the result.
- * <p>
- * <code>Arrays.retainAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] retainAll(E[] array, Iterator<?> iterator) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterator);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified iterator and return the result.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Arrays.retainAll(Object[] array, Iterator iterator)</code>
- */
- public static <E> E[] retainAll(E[] array, Iterator<?> iterator, int iteratorSize) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, arrayLength, iterator, iteratorSize);
- }
-
- /**
- * assume array length > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator) {
- return iterator.hasNext() ?
- retainAll_(array, CollectionTools.set(iterator), arrayLength) :
- newArray(array, 0);
- }
-
- /**
- * assume array length > 0
- */
- private static <E> E[] retainAll(E[] array, int arrayLength, Iterator<?> iterator, int iteratorSize) {
- return iterator.hasNext() ?
- retainAll_(array, CollectionTools.set(iterator, iteratorSize), arrayLength) :
- newArray(array, 0);
- }
-
- /**
- * Retain in the specified array all the elements in
- * the specified collection and return the result.
- * <p>
- * <code>Arrays.retainAll(Object[] array, Collection collection)</code>
- */
- public static <E> E[] retainAll(E[] array, Collection<?> collection) {
- int arrayLength = array.length;
- return (arrayLength == 0) ? array : retainAll(array, collection, arrayLength);
- }
-
- /**
- * assume array length > 0
- */
- private static <E> E[] retainAll(E[] array, Collection<?> collection, int arrayLength) {
- return collection.isEmpty() ?
- newArray(array, 0) :
- retainAll_(array, collection, arrayLength);
- }
-
- /**
- * assume collection is non-empty and array length > 0
- */
- private static <E> E[] retainAll_(E[] array, Collection<?> collection, int arrayLength) {
- int[] indices = new int[arrayLength];
- int j = 0;
- for (int i = 0; i < arrayLength; i++) {
- if (collection.contains(array[i])) {
- indices[j++] = i;
- }
- }
- if (j == arrayLength) {
- return array; // everything was retained
- }
- E[] result = newArray(array, j);
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays.retainAll(Object[] array1, Object[] array2)</code>
- */
- public static <E> E[] retainAll(E[] array1, Object[] array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ?
- array1 :
- (array2.length == 0) ?
- newArray(array1, 0) :
- retainAll(array1, CollectionTools.set(array2), array1Length);
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays.retainAll(char[] array1, char[] array2)</code>
- */
- public static char[] retainAll(char[] array1, char... array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array 1 length > 0
- */
- private static char[] retainAll(char[] array1, char[] array2, int array1Length) {
- int array2Length = array2.length;
- return (array2Length == 0) ? EMPTY_CHAR_ARRAY : retainAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0
- */
- private static char[] retainAll(char[] array1, char[] array2, int array1Length, int array2Length) {
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if (contains_(array2, array1[i], array2Length)) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // everything was retained
- }
- char[] result = new char[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
- /**
- * Remove from the first specified array all the elements in
- * the second specified array and return the result.
- * <p>
- * <code>Arrays.retainAll(int[] array1, int[] array2)</code>
- */
- public static int[] retainAll(int[] array1, int... array2) {
- int array1Length = array1.length;
- return (array1Length == 0) ? array1 : retainAll(array1, array2, array1Length);
- }
-
- /**
- * assume array 1 length > 0
- */
- private static int[] retainAll(int[] array1, int[] array2, int array1Length) {
- int array2Length = array2.length;
- return (array2Length == 0) ? EMPTY_INT_ARRAY : retainAll(array1, array2, array1Length, array2Length);
- }
-
- /**
- * assume both array lengths > 0
- */
- private static int[] retainAll(int[] array1, int[] array2, int array1Length, int array2Length) {
- int[] indices = new int[array1Length];
- int j = 0;
- for (int i = 0; i < array1Length; i++) {
- if (contains_(array2, array1[i], array2Length)) {
- indices[j++] = i;
- }
- }
- if (j == array1Length) {
- return array1; // everything was retained
- }
- int[] result = new int[j];
- int resultLength = result.length;
- for (int i = 0; i < resultLength; i++) {
- result[i] = array1[indices[i]];
- }
- return result;
- }
-
-
- // ********** reverse **********
-
- /**
- * Return the array, reversed.
- * <p>
- * <code>Arrays.reverse(Object... array)</code>
- */
- public static <E> E[] reverse(E... array) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array, reversed.
- * <p>
- * <code>Arrays.reverse(char... array)</code>
- */
- public static char[] reverse(char... array) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
- /**
- * Return the array, reversed.
- * <p>
- * <code>Arrays.reverse(int... array)</code>
- */
- public static int[] reverse(int... array) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = 0, mid = len >> 1, j = len - 1; i < mid; i++, j--) {
- swap(array, i, j);
- }
- return array;
- }
-
-
- // ********** rotate **********
-
- /**
- * Return the rotated array after rotating it one position.
- * <p>
- * <code>Arrays.rotate(Object[] array)</code>
- */
- public static <E> E[] rotate(E... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * <p>
- * <code>Arrays.rotate(Object[] array, int distance)</code>
- */
- public static <E> E[] rotate(E[] array, int distance) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- E displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- E temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * <p>
- * <code>Arrays.rotate(char[] array)</code>
- */
- public static char[] rotate(char... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * <p>
- * <code>Arrays.rotate(char[] array, int distance)</code>
- */
- public static char[] rotate(char[] array, int distance) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- char displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- char temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
- /**
- * Return the rotated array after rotating it one position.
- * <p>
- * <code>Arrays.rotate(int[] array)</code>
- */
- public static int[] rotate(int... array) {
- return rotate(array, 1);
- }
-
- /**
- * Return the rotated array after rotating it the specified distance.
- * <p>
- * <code>Arrays.rotate(int[] array, int distance)</code>
- */
- public static int[] rotate(int[] array, int distance) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- distance = distance % len;
- if (distance < 0) {
- distance += len;
- }
- if (distance == 0) {
- return array;
- }
- for (int cycleStart = 0, nMoved = 0; nMoved != len; cycleStart++) {
- int displaced = array[cycleStart];
- int i = cycleStart;
- do {
- i += distance;
- if (i >= len) {
- i -= len;
- }
- int temp = array[i];
- array[i] = displaced;
- displaced = temp;
- nMoved ++;
- } while (i != cycleStart);
- }
- return array;
- }
-
-
- // ********** shuffle **********
-
- private static final Random RANDOM = new Random();
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(Object... array)</code>
- */
- public static <E> E[] shuffle(E... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(Object[] array, Random r)</code>
- */
- public static <E> E[] shuffle(E[] array, Random random) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(char... array)</code>
- */
- public static char[] shuffle(char... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(char[] array, Random r)</code>
- */
- public static char[] shuffle(char[] array, Random random) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(int... array)</code>
- */
- public static int[] shuffle(int... array) {
- return shuffle(array, RANDOM);
- }
-
- /**
- * Return the array after "shuffling" it.
- * <p>
- * <code>Arrays.shuffle(int[] array, Random r)</code>
- */
- public static int[] shuffle(int[] array, Random random) {
- int len = array.length;
- if ((len == 0) || (len == 1)) {
- return array;
- }
- for (int i = len; i-- > 0; ) {
- swap(array, i, random.nextInt(len));
- }
- return array;
- }
-
-
- // ********** sub-array **********
-
- /**
- * Return a sub-array of the specified array with elements copied from
- * the specified range. The "from" index is inclusive; the "to" index is exclusive.
- * <p>
- * <code>Arrays.subArray(E[] array, int fromIndex, int toIndex)</code>
- */
- public static <E> E[] subArray(E[] array, int fromIndex, int toIndex) {
- int len = toIndex - fromIndex;
- E[] result = newArray(array, len);
- if (len > 0) {
- System.arraycopy(array, fromIndex, result, 0, len);
- }
- return result;
- }
-
- /**
- * Return a sub-array of the specified array with elements copied from
- * the specified range. The "from" index is inclusive; the "to" index is exclusive.
- * <p>
- * <code>Arrays.subArray(int[] array, int fromIndex, int toIndex)</code>
- */
- public static int[] subArray(int[] array, int fromIndex, int toIndex) {
- int len = toIndex - fromIndex;
- if (len == 0) {
- return EMPTY_INT_ARRAY;
- }
- int[] result = new int[len];
- System.arraycopy(array, fromIndex, result, 0, len);
- return result;
- }
-
- /**
- * Return a sub-array of the specified array with elements copied from
- * the specified range. The "from" index is inclusive; the "to" index is exclusive.
- * <p>
- * <code>
- * Arrays.subArray(char[] array, int fromIndex, int toIndex)</code>
- * </code>
- */
- public static char[] subArray(char[] array, int fromIndex, int toIndex) {
- int len = toIndex - fromIndex;
- if (len == 0) {
- return EMPTY_CHAR_ARRAY;
- }
- char[] result = new char[len];
- System.arraycopy(array, fromIndex, result, 0, len);
- return result;
- }
-
-
- // ********** swap **********
-
- /**
- * Return the array after the specified elements have been "swapped".
- * <p>
- * <code>Arrays.swap(Object[] array, int i, int j)</code>
- */
- public static <E> E[] swap(E[] array, int i, int j) {
- return (i == j) ? array : swap_(array, i, j);
- }
-
- /**
- * assume the indices are different
- */
- private static <E> E[] swap_(E[] array, int i, int j) {
- E temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * <p>
- * <code>Arrays.swap(char[] array, int i, int j)</code>
- */
- public static char[] swap(char[] array, int i, int j) {
- return (i == j) ? array : swap_(array, i, j);
- }
-
- /**
- * assume the indices are different
- */
- private static char[] swap_(char[] array, int i, int j) {
- char temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
- /**
- * Return the array after the specified elements have been "swapped".
- * <p>
- * <code>Arrays.swap(int[] array, int i, int j)</code>
- */
- public static int[] swap(int[] array, int i, int j) {
- return (i == j) ? array : swap_(array, i, j);
- }
-
- /**
- * assume the indices are different
- */
- private static int[] swap_(int[] array, int i, int j) {
- int temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- return array;
- }
-
-
- // ********** Arrays enhancements **********
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(boolean[], boolean)
- */
- public static boolean[] fill(boolean[] array, boolean value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(boolean[], int, int, boolean)
- */
- public static boolean[] fill(boolean[] array, int fromIndex, int toIndex, boolean value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(byte[], byte)
- */
- public static byte[] fill(byte[] array, byte value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(byte[], int, int, byte)
- */
- public static byte[] fill(byte[] array, int fromIndex, int toIndex, byte value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(char[], char)
- */
- public static char[] fill(char[] array, char value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(char[], int, int, char)
- */
- public static char[] fill(char[] array, int fromIndex, int toIndex, char value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(double[], double)
- */
- public static double[] fill(double[] array, double value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(double[], int, int, double)
- */
- public static double[] fill(double[] array, int fromIndex, int toIndex, double value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(float[], float)
- */
- public static float[] fill(float[] array, float value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(float[], int, int, float)
- */
- public static float[] fill(float[] array, int fromIndex, int toIndex, float value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(int[], int)
- */
- public static int[] fill(int[] array, int value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(int[], int, int, int)
- */
- public static int[] fill(int[] array, int fromIndex, int toIndex, int value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(Object[], Object)
- */
- public static <E> E[] fill(E[] array, E value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(Object[], int, int, Object)
- */
- public static <E> E[] fill(E[] array, int fromIndex, int toIndex, E value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(long[], long)
- */
- public static long[] fill(long[] array, long value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(long[], int, int, long)
- */
- public static long[] fill(long[] array, int fromIndex, int toIndex, long value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(short[], short)
- */
- public static short[] fill(short[] array, short value) {
- Arrays.fill(array, value);
- return array;
- }
-
- /**
- * Return the array after it has been "filled".
- * @see Arrays#fill(short[], int, int, short)
- */
- public static short[] fill(short[] array, int fromIndex, int toIndex, short value) {
- Arrays.fill(array, fromIndex, toIndex, value);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(byte[])
- */
- public static byte[] sort(byte... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(byte[], int, int)
- */
- public static byte[] sort(byte[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(char[])
- */
- public static char[] sort(char... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(char[], int, int)
- */
- public static char[] sort(char[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(double[])
- */
- public static double[] sort(double... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(double[], int, int)
- */
- public static double[] sort(double[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(float[])
- */
- public static float[] sort(float... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(float[], int, int)
- */
- public static float[] sort(float[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(int[])
- */
- public static int[] sort(int... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(int[], int, int)
- */
- public static int[] sort(int[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(Object[])
- */
- public static <E> E[] sort(E... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(Object[], Comparator)
- */
- public static <E> E[] sort(E[] array, Comparator<? super E> comparator) {
- Arrays.sort(array, comparator);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(Object[], int, int)
- */
- public static <E> E[] sort(E[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(Object[], int, int, Comparator)
- */
- public static <E> E[] sort(E[] array, int fromIndex, int toIndex, Comparator<? super E> comparator) {
- Arrays.sort(array, fromIndex, toIndex, comparator);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(long[])
- */
- public static long[] sort(long... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(long[], int, int)
- */
- public static long[] sort(long[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(short[])
- */
- public static short[] sort(short... array) {
- Arrays.sort(array);
- return array;
- }
-
- /**
- * Return the array after it has been "sorted".
- * @see Arrays#sort(short[], int, int)
- */
- public static short[] sort(short[] array, int fromIndex, int toIndex) {
- Arrays.sort(array, fromIndex, toIndex);
- return array;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ArrayTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java
deleted file mode 100644
index 03130e89be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Association.java
+++ /dev/null
@@ -1,46 +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.utility.internal;
-
-/**
- * Straightforward definition of an object pairing.
- * The key is immutable.
- */
-public interface Association<K, V> {
-
- /**
- * Return the association's key.
- */
- K key();
-
- /**
- * Return the association's value.
- */
- V value();
-
- /**
- * Set the association's value.
- * Return the previous value.
- */
- V setValue(V value);
-
- /**
- * Return true if both the associations' keys and values
- * are equal.
- */
- boolean equals(Object o);
-
- /**
- * Return a hash code based on the association's
- * key and value.
- */
- int hashCode();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AsynchronousCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AsynchronousCommandExecutor.java
deleted file mode 100644
index 3ef4f41bbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/AsynchronousCommandExecutor.java
+++ /dev/null
@@ -1,168 +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.utility.internal;
-
-import java.util.concurrent.ThreadFactory;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This command executor will dispatch commands to be executed in a separate
- * thread, allowing calls to {@link CommandExecutor#execute(Command)} to return
- * immediately.
- * <p>
- * <strong>NB:</strong> The client-supplied commands should handle any
- * exception appropriately (e.g. log the exception and return gracefully) so
- * the command execution thread can continue executing.
- */
-public class AsynchronousCommandExecutor
- implements StatefulCommandExecutor
-{
- /**
- * This command queue is shared with the command execution/consumer thread.
- * Adding a command to it will trigger the command to be executed by the
- * command execution thread or, if another command is currently executing,
- * to execute the new command once the currently executing command has
- * finished executing.
- */
- final SynchronizedQueue<Command> commands = new SynchronizedQueue<Command>();
-
- /**
- * Most of the thread-related behavior is delegated to this coordinator.
- */
- private final ConsumerThreadCoordinator consumerThreadCoordinator;
-
-
- // ********** construction **********
-
- /**
- * Construct an asynchronous command executor.
- * Use simple JDK thread(s) for the command execution thread(s).
- * Allow the command execution thread(s) to be assigned JDK-generated names.
- */
- public AsynchronousCommandExecutor() {
- this(SimpleThreadFactory.instance(), null);
- }
-
- /**
- * Construct an asynchronous command executor.
- * Use the specified thread factory to construct the command execution thread(s).
- * Allow the command execution thread(s) to be assigned JDK-generated names.
- */
- public AsynchronousCommandExecutor(ThreadFactory threadFactory) {
- this(threadFactory, null);
- }
-
- /**
- * Construct an asynchronous command executor.
- * Use simple JDK thread(s) for the command execution thread(s).
- * Assign the command execution thread(s) the specified name.
- */
- public AsynchronousCommandExecutor(String threadName) {
- this(SimpleThreadFactory.instance(), threadName);
- }
-
- /**
- * Construct an asynchronous command executor.
- * Assign the command execution thread(s) the specified name.
- */
- public AsynchronousCommandExecutor(ThreadFactory threadFactory, String threadName) {
- super();
- this.consumerThreadCoordinator = this.buildConsumerThreadCoordinator(threadFactory, threadName);
- }
-
- private ConsumerThreadCoordinator buildConsumerThreadCoordinator(ThreadFactory threadFactory, String threadName) {
- return new ConsumerThreadCoordinator(this.buildConsumer(), threadFactory, threadName);
- }
-
- private ConsumerThreadCoordinator.Consumer buildConsumer() {
- return new Consumer();
- }
-
-
- // ********** CallbackStatefulCommandExecutor implementation **********
-
- /**
- * Build and start the command execution/consumer thread.
- * <p>
- * Note: We don't clear the command queue here; so if a command has been
- * added to the queue <em>before</em> getting here, the first command will
- * be executed promptly (albeit, asynchronously).
- * The command queue will be non-empty if:<ul>
- * <li>{@link #execute(Command)} was called after the command executor was
- * constructed but before {@link #start()} was called; or
- * <li>{@link #execute(Command)} was called after {@link #stop()} was called
- * but before {@link #start()} was called (to restart the command executor); or
- * <li>{@link #stop()} was called when there were still outstanding commands
- * remaining in the command queue
- * </ul>
- */
- public void start() {
- this.consumerThreadCoordinator.start();
- }
-
- /**
- * Put the specified command on the command queue, to be consumed by the
- * command execution thread.
- */
- public void execute(Command command) {
- this.commands.enqueue(command);
- }
-
- /**
- * Interrupt the command execution thread so that it stops executing at the
- * end of the current command. Suspend the current thread until
- * the command execution thread is finished executing. If any uncaught
- * exceptions were thrown while the execution thread was executing,
- * wrap them in a composite exception and throw the composite exception.
- */
- public void stop() {
- this.consumerThreadCoordinator.stop();
- }
-
-
- // ********** consumer **********
-
- /**
- * This implementation of {@link ConsumerThreadCoordinator.Consumer}
- * will execute the commands enqueued by the asynchronous command executor.
- * It will wait until the shared command queue is non-empty to begin executing the
- * commands in the queue. Once a comand is executed, the thread will quiesce until
- * another command is placed in the command queue. If a new command is
- * enqueued during the execution of another command (either recursively by
- * the command itself or by another thread),
- * the new command will be executed immediately after the currently
- * executing command is finished.
- * Stop the thread by calling {@link Thread#interrupt()}.
- */
- class Consumer
- implements ConsumerThreadCoordinator.Consumer
- {
- Consumer() {
- super();
- }
-
- /**
- * Wait until a command has been placed in the queue.
- */
- public void waitForProducer() throws InterruptedException {
- AsynchronousCommandExecutor.this.commands.waitUntilNotEmpty();
- }
-
- /**
- * Execute the first command in the queue and notify our listeners.
- */
- public void execute() {
- AsynchronousCommandExecutor.this.commands.dequeue().execute();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
deleted file mode 100644
index 5c3eb3e5b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Bag.java
+++ /dev/null
@@ -1,197 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * A collection that allows duplicate elements.
- * <p>
- * The <code>Bag</code> interface places additional stipulations,
- * beyond those inherited from the {@link java.util.Collection} interface,
- * on the contracts of the {@link #equals(Object)} and {@link #hashCode()} methods.
- *
- * @see HashBag
- */
-
-public interface Bag<E> extends java.util.Collection<E> {
-
- /**
- * Compares the specified object with this bag for equality. Returns
- * <code>true</code> if the specified object is also a bag, the two bags
- * have the same size, and every member of the specified bag is
- * contained in this bag with the same number of occurrences (or equivalently,
- * every member of this bag is contained in the specified bag with the same
- * number of occurrences). This definition ensures that the
- * equals method works properly across different implementations of the
- * bag interface.
- */
- boolean equals(Object o);
-
- /**
- * Returns the hash code value for this bag. The hash code of a bag is
- * defined to be the sum of the hash codes of the elements in the bag,
- * where the hashcode of a <code>null</code> element is defined to be zero.
- * This ensures that <code>b1.equals(b2)</code> implies that
- * <code>b1.hashCode() == b2.hashCode()</code> for any two bags
- * <code>b1</code> and <code>b2</code>, as required by the general
- * contract of the {@link Object#hashCode()} method.
- */
- int hashCode();
-
- /**
- * Return the number of times the specified object occurs in the bag.
- */
- int count(Object o);
-
- /**
- * Add the specified object the specified number of times to the bag.
- * Return whether the bag changed.
- */
- boolean add(E o, int count);
-
- /**
- * Remove the specified number of occurrences of the specified object
- * from the bag. Return whether the bag changed.
- */
- boolean remove(Object o, int count);
-
- /**
- * Return an iterator that returns each item in the bag
- * once and only once, irrespective of how many times
- * the item was added to the bag.
- */
- java.util.Iterator<E> uniqueIterator();
-
- /**
- * Return the number of unique items in the bag.
- */
- int uniqueCount();
-
- /**
- * Return an iterator that returns an entry for each item in the bag
- * once and only once, irrespective of how many times
- * the item was added to the bag. The entry will indicate the item's
- * count.
- */
- java.util.Iterator<Entry<E>> entries();
-
-
- /**
- * A bag entry (element-count pair).
- * The {@link Bag#entries()} method returns an iterator whose
- * elements are of this class. The <em>only</em> way to obtain a reference
- * to a bag entry is from the iterator returned by this method. These
- * <code>Bag.Entry</code> objects are valid <em>only</em> for the duration
- * of the iteration; more formally, the behavior of a bag entry is
- * undefined if the backing bag has been modified after the entry was
- * returned by the iterator, except through the {@link #setCount(int)}
- * operation on the bag entry.
- */
- interface Entry<E> {
-
- /**
- * Return the entry's element.
- */
- E getElement();
-
- /**
- * Return entry's count; i.e. the number of times the entry's element
- * occurs in the bag.
- * @see Bag#count(Object)
- */
- int getCount();
-
- /**
- * Set the entry's count; i.e. the number of times the entry's element
- * occurs in the bag. The new count must be a positive number.
- * Return the previous count of the entry's element.
- * NB: Use {@link Iterator#remove()} to set the
- * count to zero.
- */
- int setCount(int count);
-
- /**
- * Return whether the entry is equal to the specified object;
- * i.e. the specified object is a <code>Bag.Entry</code> and its
- * element and count are the same as the entry's.
- */
- boolean equals(Object obj);
-
- /**
- * Return the entry's hash code.
- */
- int hashCode();
-
- }
-
-
- final class Empty<E> extends AbstractCollection<E> implements Bag<E>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Bag INSTANCE = new Empty();
- @SuppressWarnings("unchecked")
- public static <T> Bag<T> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- @Override
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
- @Override
- public int size() {
- return 0;
- }
- public Iterator<E> uniqueIterator() {
- return EmptyIterator.instance();
- }
- public int uniqueCount() {
- return 0;
- }
- public int count(Object o) {
- return 0;
- }
- public Iterator<Bag.Entry<E>> entries() {
- return EmptyIterator.instance();
- }
- public boolean remove(Object o, int count) {
- return false;
- }
- public boolean add(E o, int count) {
- throw new UnsupportedOperationException();
- }
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof Bag<?>)) {
- return false;
- }
- return ((Bag<?>) o).size() == 0;
- }
- @Override
- public int hashCode() {
- return 0;
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.java
deleted file mode 100644
index 5991753dc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiFilter.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.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Filter;
-
-/**
- * Used by various "pluggable" classes to filter objects
- * in both directions.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiFilter<T> extends Filter<T> {
-
- /**
- * Return whether the specified object is "accepted" by the
- * "reverse" filter. What that means is determined by the client.
- */
- boolean reverseAccept(T o);
-
-
- final class Null<S> implements BidiFilter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiFilter INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> BidiFilter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // nothing is filtered - everything is accepted
- public boolean accept(S o) {
- return true;
- }
- // nothing is "reverse-filtered" - everything is accepted
- public boolean reverseAccept(S o) {
- return true;
- }
- @Override
- public String toString() {
- return "BidiFilter.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Opaque<S> implements BidiFilter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiFilter INSTANCE = new Opaque();
- @SuppressWarnings("unchecked")
- public static <R> BidiFilter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Opaque() {
- super();
- }
- // everything is filtered - nothing is accepted
- public boolean accept(S o) {
- return false;
- }
- // everything is "reverse-filtered" - nothing is accepted
- public boolean reverseAccept(S o) {
- return false;
- }
- @Override
- public String toString() {
- return "BidiFilter.Opaque"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Disabled<S> implements BidiFilter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiFilter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> BidiFilter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public boolean accept(S o) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public boolean reverseAccept(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiFilter.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java
deleted file mode 100644
index d11d24202b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiStringConverter.java
+++ /dev/null
@@ -1,149 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * into strings and vice versa.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiStringConverter<T> extends StringConverter<T> {
-
- /**
- * Convert the specified string into an object.
- * The semantics of "convert to object" is determined by the
- * contract between the client and the server.
- * Typically, if the string is null, null is returned.
- */
- T convertToObject(String s);
-
-
- final class Default<S> implements BidiStringConverter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiStringConverter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> BidiStringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply return the object's #toString() result
- public String convertToString(S o) {
- return (o == null) ? null : o.toString();
- }
- // simply return the string
- @SuppressWarnings("unchecked")
- public S convertToObject(String s) {
- return (S) s;
- }
- @Override
- public String toString() {
- return "BidiStringConverter.Default"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Disabled<S> implements BidiStringConverter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiStringConverter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> BidiStringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public String convertToString(S o) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public S convertToObject(String s) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiStringConverter.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class BooleanConverter implements BidiStringConverter<Boolean>, Serializable {
- public static final BidiStringConverter<Boolean> INSTANCE = new BooleanConverter();
- public static BidiStringConverter<Boolean> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private BooleanConverter() {
- super();
- }
- /** Return "true" if the Boolean is true, otherwise return "false". */
- public String convertToString(Boolean b) {
- return (b == null) ? null : b.toString();
- }
- /** Return Boolean.TRUE if the string is "true" (case-insensitive), otherwise return Boolean.FALSE. */
- public Boolean convertToObject(String s) {
- return (s == null) ? null : Boolean.valueOf(s);
- }
- @Override
- public String toString() {
- return "BidiStringConverter.BooleanConverter"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class IntegerConverter implements BidiStringConverter<Integer>, Serializable {
- public static final BidiStringConverter<Integer> INSTANCE = new IntegerConverter();
- public static BidiStringConverter<Integer> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private IntegerConverter() {
- super();
- }
- /** Integer's #toString() works well. */
- public String convertToString(Integer integer) {
- return (integer == null) ? null : integer.toString();
- }
- /** Convert the string to an Integer, if possible. */
- public Integer convertToObject(String s) {
- return (s == null) ? null : Integer.valueOf(s);
- }
- @Override
- public String toString() {
- return "BidiStringConverter.IntegerConverter"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java
deleted file mode 100644
index 83eca988c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BidiTransformer.java
+++ /dev/null
@@ -1,93 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * in both directions.
- *
- * If anyone can come up with a better class name
- * and/or method name, I would love to hear it. ~bjv
- */
-public interface BidiTransformer<T1, T2> extends Transformer<T1, T2> {
-
- /**
- * Return the "reverse-transformed" object.
- * The semantics of "reverse-transform" is determined by the
- * contract between the client and the server.
- */
- T1 reverseTransform(T2 o);
-
-
- final class Null<S1, S2> implements BidiTransformer<S1, S2>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiTransformer INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R1, R2> BidiTransformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // simply return the object, unchanged
- @SuppressWarnings("unchecked")
- public S2 transform(S1 o) {
- return (S2) o;
- }
- // simply return the object, unchanged
- @SuppressWarnings("unchecked")
- public S1 reverseTransform(S2 o) {
- return (S1) o;
- }
- @Override
- public String toString() {
- return "BidiTransformer.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Disabled<S1, S2> implements BidiTransformer<S1, S2>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final BidiTransformer INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R1, R2> BidiTransformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S2 transform(S1 o) {
- throw new UnsupportedOperationException();
- }
- // throw an exception
- public S1 reverseTransform(S2 o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "BidiTransformer.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java
deleted file mode 100644
index 77e00ecf31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BitTools.java
+++ /dev/null
@@ -1,214 +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.utility.internal;
-
-/**
- * Assorted bit tools
- */
-public final class BitTools {
-
- /**
- * Return whether the specified 'flags' has the specified
- * 'flagToCheck' set.
- */
- public static boolean flagIsSet(int flags, int flagToCheck) {
- return allFlagsAreSet(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has the specified
- * 'flagToCheck' turned off.
- */
- public static boolean flagIsOff(int flags, int flagToCheck) {
- return allFlagsAreOff(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagToCheck' set.
- */
- public static boolean onlyFlagIsSet(int flags, int flagToCheck) {
- return onlyFlagsAreSet(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagToCheck' turned off.
- */
- public static boolean onlyFlagIsOff(int flags, int flagToCheck) {
- return onlyFlagsAreOff(flags, flagToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' set.
- */
- public static boolean allFlagsAreSet(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) == flagsToCheck;
- }
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean allFlagsAreOff(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) == 0;
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' set.
- */
- public static boolean onlyFlagsAreSet(int flags, int flagsToCheck) {
- return allFlagsAreSet(flags, flagsToCheck) && allFlagsAreOff(flags, ~flagsToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean onlyFlagsAreOff(int flags, int flagsToCheck) {
- return allFlagsAreOff(flags, flagsToCheck) && allFlagsAreSet(flags, ~flagsToCheck);
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' set.
- */
- public static boolean anyFlagsAreSet(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) != 0;
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean anyFlagsAreOff(int flags, int flagsToCheck) {
- return (flags & flagsToCheck) != flagsToCheck;
- }
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' set.
- */
- public static boolean allFlagsAreSet(int flags, int... flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if ( ! allFlagsAreSet(flags, flagsToCheck[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified 'flags' has all the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean allFlagsAreOff(int flags, int... flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if ( ! allFlagsAreOff(flags, flagsToCheck[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' set.
- */
- public static boolean onlyFlagsAreSet(int flags, int... flagsToCheck) {
- int combinedFlags = orFlags(flagsToCheck);
- return allFlagsAreSet(flags, combinedFlags) && allFlagsAreOff(flags, ~combinedFlags);
- }
-
- /**
- * Return whether the specified 'flags' has ONLY the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean onlyFlagsAreOff(int flags, int... flagsToCheck) {
- int combinedFlags = orFlags(flagsToCheck);
- return allFlagsAreOff(flags, combinedFlags) && allFlagsAreSet(flags, ~combinedFlags);
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' set.
- */
- public static boolean anyFlagsAreSet(int flags, int... flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if (anyFlagsAreSet(flags, flagsToCheck[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified 'flags' has any one of the specified
- * 'flagsToCheck' turned off.
- */
- public static boolean anyFlagsAreOff(int flags, int... flagsToCheck) {
- for (int i = flagsToCheck.length; i-- > 0; ) {
- if (anyFlagsAreOff(flags, flagsToCheck[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * OR all the specified 'flags' together and return the result.
- */
- public static int orFlags(int... flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result |= flags[i];
- }
- return result;
- }
-
- /**
- * AND all the specified 'flags' together and return the result.
- */
- public static int andFlags(int... flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result &= flags[i];
- }
- return result;
- }
-
- /**
- * XOR all the specified 'flags' together and return the result.
- */
- public static int xorFlags(int... flags) {
- int last = flags.length - 1;
- int result = flags[last];
- for (int i = last; i-- > 0; ) {
- result ^= flags[i];
- }
- return result;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private BitTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanReference.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanReference.java
deleted file mode 100644
index 895f566f5d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanReference.java
+++ /dev/null
@@ -1,158 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Provide a container for passing a flag that can be changed by the recipient.
- *
- * @see SynchronizedBoolean
- */
-public class BooleanReference
- implements Cloneable, Serializable
-{
- /** Backing <code>boolean</code>. */
- private volatile boolean value;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a <code>boolean</code> reference with the specified initial value.
- */
- public BooleanReference(boolean value) {
- super();
- this.value = value;
- }
-
- /**
- * Create a <code>boolean</code> reference with an initial value of
- * <code>false</code>.
- */
- public BooleanReference() {
- this(false);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current <code>boolean</code> value.
- */
- public boolean getValue() {
- return this.value;
- }
-
- /**
- * Return whether the current <code>boolean</code> value is the specified
- * value.
- */
- public boolean is(boolean v) {
- return this.value == v;
- }
-
- /**
- * Return whether the current <code>boolean</code> value is not the
- * specified value.
- */
- public boolean isNot(boolean v) {
- return this.value != v;
- }
-
- /**
- * Return whether the current <code>boolean</code> value is
- * <code>true</code>.
- */
- public boolean isTrue() {
- return this.value;
- }
-
- /**
- * Return whether the current <code>boolean</code> value is
- * <code>false</code>.
- */
- public boolean isFalse() {
- return ! this.value;
- }
-
- /**
- * Set the <code>boolean</code> value.
- * Return the previous value.
- */
- public boolean setValue(boolean value) {
- boolean old = this.value;
- this.value = value;
- return old;
- }
-
- /**
- * Set the <code>boolean</code> value to the NOT of its current value.
- * Return the new value.
- */
- public boolean flip() {
- return this.value = ! this.value;
- }
-
- /**
- * Set the <code>boolean</code> value to the NOT of the specified value.
- * Return the previous value.
- */
- public boolean setNot(boolean v) {
- return this.setValue( ! v);
- }
-
- /**
- * Set the <code>boolean</code> value to <code>true</code>.
- * Return the previous value.
- */
- public boolean setTrue() {
- return this.setValue(true);
- }
-
- /**
- * Set the <code>boolean</code> value to <code>false</code>.
- * Return the previous value.
- */
- public boolean setFalse() {
- return this.setValue(false);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- return (o instanceof BooleanReference) &&
- (this.value == ((BooleanReference) o).value);
- }
-
- @Override
- public int hashCode() {
- return this.value ? 1 : 0;
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.value) + ']';
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanTools.java
deleted file mode 100644
index fac2a7e9c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/BooleanTools.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.utility.internal;
-
-/**
- * Assorted "Capital-B Boolean" operations.
- */
- // commented code is just playing around with building *everything* from NAND
-public final class BooleanTools {
-
- /**
- * Return the NOT of the specified Boolean.
- * Boolean#not()
- */
- public static Boolean not(Boolean b) {
- return Boolean.valueOf( ! b.booleanValue());
-// return nand(b, b);
- }
-
- /**
- * Return the AND of the specified Booleans.
- * Boolean#and(Boolean)
- */
- public static Boolean and(Boolean b1, Boolean b2) {
- return Boolean.valueOf(b1.booleanValue() && b2.booleanValue());
-// Boolean nand = nand(b1, b2);
-// return nand(nand, nand);
- }
-
- /**
- * Return the OR of the specified Booleans.
- * Boolean#or(Boolean)
- */
- public static Boolean or(Boolean b1, Boolean b2) {
- return Boolean.valueOf(b1.booleanValue() || b2.booleanValue());
-// Boolean nand = nand(b1, b2);
-// Boolean xor = nand(nand(b1, nand), nand(b2, nand));
-// Boolean and = nand(nand, nand);
-// Boolean nand2 = nand(xor, and);
-// return nand(nand(xor, nand2), nand(and, nand2));
- }
-
- /**
- * Return the XOR of the specified Booleans.
- * Boolean#xor(Boolean)
- */
- public static Boolean xor(Boolean b1, Boolean b2) {
- return and(or(b1, b2), nand(b1, b2));
-// Boolean nand = nand(b1, b2);
-// return nand(nand(b1, nand), nand(b2, nand));
- }
-
- /**
- * Return the NAND of the specified Booleans.
- * Boolean#nand(Boolean)
- */
- public static Boolean nand(Boolean b1, Boolean b2) {
- return not(and(b1, b2));
-// return Boolean.valueOf( ! (b1.booleanValue() && b2.booleanValue()));
- }
-
- /**
- * Return the NOR of the specified Booleans.
- * Boolean#nor(Boolean)
- */
- public static Boolean nor(Boolean b1, Boolean b2) {
- return not(or(b1, b2));
-// Boolean nand = nand(b1, b2);
-// Boolean xor = nand(nand(b1, nand), nand(b2, nand));
-// Boolean and = nand(nand, nand);
-// Boolean nand2 = nand(xor, and);
-// Boolean nand3 = nand(nand(xor, nand2), nand(and, nand2));
-// return nand(nand3, nand3);
- }
-
- /**
- * Return the XNOR of the specified Booleans.
- * Boolean#xnor(Boolean)
- */
- public static Boolean xnor(Boolean b1, Boolean b2) {
- return not(xor(b1, b2));
-// Boolean nand = nand(b1, b2);
-// Boolean xor = nand(nand(b1, nand), nand(b2, nand));
-// return nand(xor, xor);
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private BooleanTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassName.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassName.java
deleted file mode 100644
index 92ef041278..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ClassName.java
+++ /dev/null
@@ -1,431 +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.utility.internal;
-
-/**
- * Convenience methods related to Java class names as returned by
- * {@link java.lang.Class#getName()}.
- */
-public final class ClassName {
-
- public static final String VOID_CLASS_NAME = ReflectionTools.VOID_CLASS.getName();
- public static final String VOID_WRAPPER_CLASS_NAME = ReflectionTools.VOID_WRAPPER_CLASS.getName();
-
- public static final char REFERENCE_CLASS_CODE = 'L';
- public static final char REFERENCE_CLASS_NAME_DELIMITER = ';';
-
- /**
- * Return whether the specified class is an array type.
- * @see java.lang.Class#getName()
- */
- public static boolean isArray(String className) {
- return className.charAt(0) == '[';
- }
-
- /**
- * 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()
- */
- public static String getElementTypeName(String className) {
- int depth = getArrayDepth(className);
- if (depth == 0) {
- // the name is in the form: "java.lang.Object" or "int"
- return className;
- }
- return getElementTypeName_(className, depth);
- }
-
- /**
- * pre-condition: array depth is not zero
- */
- private static String getElementTypeName_(String className, int arrayDepth) {
- int last = className.length() - 1;
- if (className.charAt(arrayDepth) == REFERENCE_CLASS_CODE) {
- // the name is in the form: "[[[Ljava.lang.Object;"
- return className.substring(arrayDepth + 1, last); // drop the trailing ';'
- }
- // the name is in the form: "[[[I"
- return forCode(className.charAt(last));
- }
-
- /**
- * 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()
- */
- public static int getArrayDepth(String className) {
- int depth = 0;
- while (className.charAt(depth) == '[') {
- depth++;
- }
- return depth;
- }
-
- /**
- * Return the specified class's component type.
- * Return <code>null</code> if the specified class is not an array type.
- * @see java.lang.Class#getName()
- */
- public static String getComponentTypeName(String className) {
- switch (getArrayDepth(className)) {
- case 0:
- return null;
- case 1:
- return getElementTypeName_(className, 1);
- default:
- return className.substring(1);
- }
- }
-
- /**
- * Return the specified class's simple name.
- * Return an empty string if the specified class is anonymous.
- * <p>
- * The simple name of an array type is the simple name of the
- * component type with <code>"[]"</code> appended. In particular,
- * the simple name of an array type whose component type is
- * anonymous is simply <code>"[]"</code>.
- * @see java.lang.Class#getSimpleName()
- */
- public static String getSimpleName(String className) {
- return isArray(className) ?
- getSimpleName(getComponentTypeName(className)) + "[]" : //$NON-NLS-1$
- getSimpleName_(className);
- }
-
- /**
- * pre-condition: specified class is not an array type
- */
- private static String getSimpleName_(String className) {
- int index = className.lastIndexOf('$');
- if (index == -1) { // "top-level" class - strip package name
- return className.substring(className.lastIndexOf('.') + 1);
- }
-
- int len = className.length();
- for (int i = ++index; i < len; i++) {
- if ( ! charIsAsciiDigit(className.charAt(i))) {
- return className.substring(i); // "member" or "local" class
- }
- }
- // all the characters past the '$' are ASCII digits ("anonymous" class)
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return the specified class's package name (e.g.
- * <code>"java.lang.Object"</code> returns
- * <code>"java.lang"</code>).
- * Return an empty string if the specified class is:<ul>
- * <li>in the "default" package
- * <li>an array class
- * <li>a primtive class
- * </ul>
- * @see java.lang.Class#getPackage()
- * @see java.lang.Package#getName()
- */
- public static String getPackageName(String className) {
- if (isArray(className)) {
- return ""; //$NON-NLS-1$
- }
- int lastPeriod = className.lastIndexOf('.');
- return (lastPeriod == -1) ? "" : className.substring(0, lastPeriod); //$NON-NLS-1$
- }
-
- /**
- * 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 <code>'$'</code>).
- * A "top-level" class can be either the "primary" (public) class defined
- * in a file/compilation unit (i.e. the class with the same name as its
- * file's simple base name) or a "non-primary" (package visible) class
- * (i.e. the other top-level classes defined in a file).
- * A "top-level" class can contain any of the other types of classes.
- * @see java.lang.Class#getName()
- */
- public static boolean isTopLevel(String className) {
- if (isArray(className)) {
- return false;
- }
- return className.lastIndexOf('$') == -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 convention (i.e. the class
- * name ends with a <code>'$'</code> followed by a legal class name; e.g.
- * <code>"TopLevelClass$1LocalClass$MemberClass"</code>).
- * A "member" class can be either "nested" (static) or "inner";
- * but there is no way to determine which from the class's name.
- * A "member" class can contain "local", "anonymous", or other
- * "member" classes; and vice-versa.
- * @see java.lang.Class#getName()
- */
- public static boolean isMember(String className) {
- if (isArray(className)) {
- return false;
- }
- int index = className.lastIndexOf('$');
- if (index == -1) {
- return false; // "top-level" class
- }
- // the character immediately after the dollar sign cannot be an ASCII digit
- return ! charIsAsciiDigit(className.charAt(++index));
- }
-
- /**
- * Return whether the specified class is a "local" class,
- * as opposed to a "top-level", "member", or "anonymous" class,
- * using the standard JDK naming convention (i.e. the class name
- * ends with <code>"$nnnXXX"</code>,
- * where the <code>'$'</code> is
- * followed by a series of numeric digits which are followed by the
- * local class name; e.g. <code>"TopLevelClass$1LocalClass"</code>).
- * A "local" class can contain "member", "anonymous", or other
- * "local" classes; and vice-versa.
- * @see java.lang.Class#getName()
- */
- public static boolean isLocal(String className) {
- if (isArray(className)) {
- return false;
- }
- int index = className.lastIndexOf('$');
- if (index == -1) {
- return false; // "top-level" class
- }
- if ( ! charIsAsciiDigit(className.charAt(++index))) {
- return false; // "member" class
- }
- int len = className.length();
- for (int i = ++index; i < len; i++) {
- if ( ! charIsAsciiDigit(className.charAt(i))) {
- return true;
- }
- }
- // all the characters past the '$' are ASCII digits ("anonymous" class)
- 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 convention (i.e. the class
- * name ends with <code>"$nnn"</code> where all the characters past the
- * last <code>'$'</code> are ASCII numeric digits;
- * e.g. <code>"TopLevelClass$1"</code>).
- * An "anonymous" class can contain "member", "local", or other
- * "anonymous" classes; and vice-versa.
- * @see java.lang.Class#getName()
- */
- public static boolean isAnonymous(String className) {
- if (isArray(className)) {
- return false;
- }
- int index = className.lastIndexOf('$');
- if (index == -1) {
- return false; // "top-level" class
- }
- if ( ! charIsAsciiDigit(className.charAt(++index))) {
- return false; // "member" class
- }
- int len = className.length();
- for (int i = ++index; i < len; i++) {
- if ( ! charIsAsciiDigit(className.charAt(i))) {
- return false; // "local" class
- }
- }
- // all the characters past the '$' are ASCII digits ("anonymous" class)
- return true;
- }
-
- /**
- * {@link Character#isDigit(char)} returns <code>true</code> for some non-ASCII
- * digits. This method does not.
- */
- private static boolean charIsAsciiDigit(char c) {
- return ('0' <= c) && (c <= '9');
- }
-
- /**
- * Return whether the specified class is a "reference"
- * class (i.e. neither <code>void</code> nor one of the primitive variable classes,
- * <code>boolean</code>, <code>int</code>, <code>float</code>, etc.).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- public static boolean isReference(String className) {
- return ! isPrimitive(className);
- }
-
- /**
- * Return whether the specified class is a primitive
- * class (i.e. <code>void</code> or one of the primitive variable classes,
- * <code>boolean</code>, <code>int</code>, <code>float</code>, etc.).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- public static boolean isPrimitive(String className) {
- if (isArray(className) || (className.length() > ReflectionTools.MAX_PRIMITIVE_CLASS_NAME_LENGTH)) {
- return false; // performance tweak
- }
- for (ReflectionTools.Primitive primitive : ReflectionTools.PRIMITIVES) {
- if (className.equals(primitive.javaClass.getName())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. <code>java.lang.Void</code> or one of the primitive
- * variable wrapper classes, <code>java.lang.Boolean</code>,
- * <code>java.lang.Integer</code>, <code>java.lang.Float</code>, etc.).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- public static boolean isPrimitiveWrapper(String className) {
- if (isArray(className) || (className.length() > ReflectionTools.MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH)) {
- return false; // performance tweak
- }
- for (ReflectionTools.Primitive primitive : ReflectionTools.PRIMITIVES) {
- if (className.equals(primitive.wrapperClass.getName())) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. <code>boolean</code>, <code>int</code>, <code>float</code>, etc.,
- * but not <code>void</code>).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- public static boolean isVariablePrimitive(String className) {
- return isPrimitive(className)
- && ( ! className.equals(VOID_CLASS_NAME));
- }
-
- /**
- * Return whether the specified class is a "variable" primitive wrapper
- * class (i.e. <code>java.lang.Boolean</code>,
- * <code>java.lang.Integer</code>, <code>java.lang.Float</code>, etc.,
- * but not <code>java.lang.Void</code>).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- public static boolean isVariablePrimitiveWrapper(String className) {
- return isPrimitiveWrapper(className)
- && ( ! className.equals(VOID_WRAPPER_CLASS_NAME));
- }
-
- /**
- * Return the name of the primitive wrapper class corresponding to the specified
- * primitive class. Return <code>null</code> if the specified class is not a primitive.
- */
- public static String getWrapperClassName(String primitiveClassName) {
- for (ReflectionTools.Primitive primitive : ReflectionTools.PRIMITIVES) {
- if (primitive.javaClass.getName().equals(primitiveClassName)) {
- return primitive.wrapperClass.getName();
- }
- }
- return null;
- }
-
- /**
- * Return the name of the primitive class corresponding to the specified
- * primitive wrapper class. Return <code>null</code> if the specified class
- * is not a primitive wrapper.
- */
- public static String getPrimitiveClassName(String primitiveWrapperClassName) {
- for (ReflectionTools.Primitive primitive : ReflectionTools.PRIMITIVES) {
- if (primitive.wrapperClass.getName().equals(primitiveWrapperClassName)) {
- return primitive.javaClass.getName();
- }
- }
- return null;
- }
-
- /**
- * Return whether the two class names are equivalent, given autoboxing.
- * (e.g. "java.lang.Integer" and "int" should be equivalent)
- */
- public static boolean areAutoboxEquivalents(String className1, String className2) {
- return Tools.valuesAreEqual(className1, className2)
- || Tools.valuesAreEqual(getPrimitiveClassName(className1), className2)
- || Tools.valuesAreEqual(getWrapperClassName(className1), className2);
- }
-
-
- // ********** primitive codes **********
-
- /**
- * Return the primitive class name for the specified primitive class code.
- * Return <code>null</code> if the specified code
- * is not a primitive class code.
- * @see java.lang.Class#getName()
- */
- public static String forCode(int classCode) {
- return forCode((char) classCode);
- }
-
- /**
- * Return the primitive class name for the specified primitive class code.
- * Return <code>null</code> if the specified code
- * is not a primitive class code.
- * @see java.lang.Class#getName()
- */
- public static String forCode(char classCode) {
- Class<?> primitiveClass = ReflectionTools.getClassForCode(classCode);
- return (primitiveClass == null) ? null : primitiveClass.getName();
- }
-
- /**
- * Return the class code for the specified primitive class.
- * Return <code>0</code> if the specified class
- * is not a primitive class.
- * @see java.lang.Class#getName()
- */
- public static char getCodeForClassName(String primitiveClassName) {
- if (( ! isArray(primitiveClassName)) && (primitiveClassName.length() <= ReflectionTools.MAX_PRIMITIVE_CLASS_NAME_LENGTH)) {
- for (ReflectionTools.Primitive primitive : ReflectionTools.PRIMITIVES) {
- if (primitive.javaClass.getName().equals(primitiveClassName)) {
- return primitive.code;
- }
- }
- }
- return 0;
- }
-
- static void append(String className, StringBuilder sb) {
- sb.append(REFERENCE_CLASS_CODE);
- sb.append(className);
- sb.append(REFERENCE_CLASS_NAME_DELIMITER);
- }
-
-
- // ********** suppressed constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ClassName() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
deleted file mode 100644
index 3d1ae80a12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Classpath.java
+++ /dev/null
@@ -1,940 +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.utility.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * <code>Classpath</code> models a Java classpath, which consists of a list of
- * {@link Entry}s, each of which contain Java classes. The classpath can return
- * the names of classes found in it etc. There are a number of static
- * convenience methods that can be use to construct <code>Classpath</code>s
- * corresponding to the Java classpath etc.
- */
-public class Classpath
- implements Serializable
-{
- /** The entries in the classpath */
- private final Entry[] entries;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** static methods **********
-
- // ***** factory methods for "standard" classpaths *****
-
- /**
- * Return the Java "boot" classpath. This includes <code>rt.jar</code>.
- */
- public static Classpath bootClasspath() {
- return new Classpath(System.getProperty("sun.boot.class.path")); //$NON-NLS-1$
- }
-
- /**
- * Return a "virtual classpath" that contains all the jars
- * that would be used by the Java Extension Mechanism.
- */
- public static Classpath javaExtensionClasspath() {
- File[] dirs = javaExtensionDirectories();
- List<String> jarFileNames = new ArrayList<String>();
- for (File dir : dirs) {
- if (dir.isDirectory()) {
- addJarFileNamesTo(dir, jarFileNames);
- }
- }
- return new Classpath(jarFileNames);
- }
-
- /**
- * Return the Java "system" classpath.
- */
- public static Classpath javaClasspath() {
- return new Classpath(System.getProperty("java.class.path")); //$NON-NLS-1$
- }
-
- /**
- * Return the unretouched "complete" classpath.
- * This includes the boot classpath, the Java Extension
- * Mechanism classpath, and the normal "system" classpath.
- */
- public static Classpath completeClasspath() {
- return new Classpath(new Classpath[] {
- bootClasspath(),
- javaExtensionClasspath(),
- javaClasspath()
- });
- }
-
- /**
- * Return a classpath that contains the location of the specified class.
- */
- public static Classpath classpathFor(Class<?> javaClass) {
- return new Classpath(locationFor(javaClass));
- }
-
-
- // ***** file => class *****
-
- /**
- * Convert a relative file name to a class name; this will work for
- * any file that has a single extension beyond the base
- * class name:<ul>
- * <li><code>"java/lang/String.class"</code> is converted to <code>"java.lang.String"</code>
- * <li><code>"java/lang/String.java"</code> is converted to <code>"java.lang.String"</code>
- * </ul>
- */
- public static String convertToClassName(String classFileName) {
- String className = FileTools.stripExtension(classFileName);
- // do this for archive entry names
- className = className.replace('/', '.');
- // do this for O/S-specific file names
- if (File.separatorChar != '/') {
- className = className.replace(File.separatorChar, '.');
- }
- return className;
- }
-
- /**
- * Convert a file to a class name;
- * e.g. <code>File(java/lang/String.class)</code> is converted to
- * <code>"java.lang.String"</code>.
- */
- public static String convertToClassName(File classFile) {
- return convertToClassName(classFile.getPath());
- }
-
- /**
- * Convert a relative file name to a class;
- * e.g. <code>"java/lang/String.class"</code> is converted to
- * <code>java.lang.String.class</code>.
- */
- public static Class<?> convertToClass(String classFileName) throws ClassNotFoundException {
- return Class.forName(convertToClassName(classFileName));
- }
-
- /**
- * Convert a relative file to a class;
- * e.g. <code>File(java/lang/String.class)</code> is converted to
- * <code>java.lang.String.class</code>.
- */
- public static Class<?> convertToClass(File classFile) throws ClassNotFoundException {
- return convertToClass(classFile.getPath());
- }
-
-
- // ***** class => JAR entry *****
-
- /**
- * Convert a class name to an archive entry name base;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>"java/lang/String"</code>.
- */
- public static String convertToArchiveEntryNameBase(String className) {
- return className.replace('.', '/');
- }
-
- /**
- * Convert a class to an archive entry name base;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"java/lang/String"</code>.
- */
- public static String convertToArchiveEntryNameBase(Class<?> javaClass) {
- return convertToArchiveEntryNameBase(javaClass.getName());
- }
-
- /**
- * Convert a class name to an archive class file entry name;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>"java/lang/String.class"</code>.
- */
- public static String convertToArchiveClassFileEntryName(String className) {
- return convertToArchiveEntryNameBase(className) + ".class"; //$NON-NLS-1$
- }
-
- /**
- * Convert a class to an archive class file entry name;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"java/lang/String.class"</code>.
- */
- public static String convertToArchiveClassFileEntryName(Class<?> javaClass) {
- return convertToArchiveClassFileEntryName(javaClass.getName());
- }
-
-
- // ***** class => file (.class or .java) *****
-
- /**
- * Convert a class name to a file name base for the current O/S;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>"java/lang/String"</code> on Unix and
- * <code>"java\\lang\\String"</code> on Windows.
- */
- public static String convertToFileNameBase(String className) {
- return className.replace('.', File.separatorChar);
- }
-
- /**
- * Convert a class to a file name base for the current O/S;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"java/lang/String"</code> on Unix and
- * <code>"java\\lang\\String"</code> on Windows.
- */
- public static String convertToFileNameBase(Class<?> javaClass) {
- return convertToFileNameBase(javaClass.getName());
- }
-
- /**
- * Convert a class name to a class file name for the current O/S;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>"java/lang/String.class"</code> on Unix and
- * <code>"java\\lang\\String.class"</code> on Windows.
- */
- public static String convertToClassFileName(String className) {
- return convertToFileNameBase(className) + ".class"; //$NON-NLS-1$
- }
-
- /**
- * Convert a class to a class file name for the current O/S;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"java/lang/String.class"</code> on Unix and
- * <code>"java\\lang\\String.class"</code> on Windows.
- */
- public static String convertToClassFileName(Class<?> javaClass) {
- return convertToClassFileName(javaClass.getName());
- }
-
- /**
- * Convert a class name to a class file for the current O/S;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>File(java/lang/String.class)</code>.
- */
- public static File convertToClassFile(String className) {
- return new File(convertToClassFileName(className));
- }
-
- /**
- * Convert a class to a class file for the current O/S;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>File(java/lang/String.class)</code>.
- */
- public static File convertToClassFile(Class<?> javaClass) {
- return convertToClassFile(javaClass.getName());
- }
-
- /**
- * Convert a class name to a java file name for the current O/S;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>"java/lang/String.java"</code> on Unixl and
- * <code>"java\\lang\\String.java"</code> on Windows.
- */
- public static String convertToJavaFileName(String className) {
- return convertToFileNameBase(className) + ".java"; //$NON-NLS-1$
- }
-
- /**
- * Convert a class to a java file name for the current O/S;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"java/lang/String.java"</code> on Unix and
- * <code>"java\\lang\\String.java"</code> on Windows.
- */
- public static String convertToJavaFileName(Class<?> javaClass) {
- return convertToJavaFileName(javaClass.getName());
- }
-
- /**
- * Convert a class name to a java file for the current O/S;
- * e.g. <code>"java.lang.String"</code> is converted to
- * <code>File(java/lang/String.java)</code>.
- */
- public static File convertToJavaFile(String className) {
- return new File(convertToJavaFileName(className));
- }
-
- /**
- * Convert a class to a java file for the current O/S;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>File(java/lang/String.java)</code>.
- */
- public static File convertToJavaFile(Class<?> javaClass) {
- return convertToJavaFile(javaClass.getName());
- }
-
-
- // ***** class => resource *****
-
- /**
- * Convert a class to a resource name;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>"/java/lang/String.class"</code>.
- */
- public static String convertToResourceName(Class<?> javaClass) {
- return '/' + convertToArchiveClassFileEntryName(javaClass);
- }
-
- /**
- * Convert a class to a resource;
- * e.g. <code>java.lang.String.class</code> is converted to
- * <code>URL(jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class)</code>.
- */
- public static URL convertToResource(Class<?> javaClass) {
- return javaClass.getResource(convertToResourceName(javaClass));
- }
-
-
- // ***** utilities *****
-
- /**
- * Return whether the specified file is an archive file;
- * i.e. its name ends with <code>".zip"</code> or <code>".jar"</code>.
- */
- public static boolean fileNameIsArchive(String fileName) {
- String ext = FileTools.extension(fileName).toLowerCase();
- return ext.equals(".jar") || ext.equals(".zip"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Return whether the specified file is an archive file;
- * i.e. its name ends with <code>".zip"</code> or <code>".jar"</code>.
- */
- public static boolean fileIsArchive(File file) {
- return fileNameIsArchive(file.getName());
- }
-
- /**
- * Return what should be the fully-qualified file name
- * for the JRE runtime JAR;
- * e.g. <code>"C:\jdk1.4.2_04\jre\lib\rt.jar"</code>.
- */
- public static String rtJarName() {
- return locationFor(java.lang.Object.class);
- }
-
- /**
- * Return the location from where the specified class was loaded.
- */
- public static String locationFor(Class<?> javaClass) {
- URL url = convertToResource(javaClass);
- String path;
- try {
- path = FileTools.buildFile(url).getPath();
- } catch (URISyntaxException ex) {
- throw new RuntimeException(ex);
- }
- String protocol = url.getProtocol().toLowerCase();
- if (protocol.equals("jar")) { //$NON-NLS-1$
- // if the class is in a JAR, the URL will look something like this:
- // jar:file:/C:/jdk/1.4.2_04/jre/lib/rt.jar!/java/lang/String.class
- return path.substring(0, path.indexOf('!'));
- } else if (protocol.equals("file")) { //$NON-NLS-1$
- // if the class is in a directory, the URL will look something like this:
- // file:/C:/dev/main/mwdev/class/org/eclipse/dali/utility/Classpath.class
- return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1);
- } else if (protocol.equals("bundleresource")) { //$NON-NLS-1$
- // if the class is in a bundle resource (Eclipse?), the URL will look something like this:
- // bundleresource://43/org/eclipse/dali/utility/Classpath.class
- return path.substring(0, path.length() - convertToClassFileName(javaClass).length() - 1);
- }
-
- throw new IllegalStateException(url.toString());
- }
-
- /**
- * Return the directories used by the Java Extension Mechanism.
- */
- public static File[] javaExtensionDirectories() {
- return convertToFiles(javaExtensionDirectoryNames());
- }
-
- /**
- * Return the directory names used by the Java Extension Mechanism.
- */
- public static String[] javaExtensionDirectoryNames() {
- return System.getProperty("java.ext.dirs").split(File.pathSeparator); //$NON-NLS-1$
- }
-
-
- // ***** internal *****
-
- private static File[] convertToFiles(String[] fileNames) {
- File[] files = new File[fileNames.length];
- for (int i = fileNames.length; i-- > 0; ) {
- files[i] = new File(fileNames[i]);
- }
- return files;
- }
-
- private static void addJarFileNamesTo(File dir, List<String> jarFileNames) {
- File[] jarFiles = jarFilesIn(dir);
- for (File jarFile : jarFiles) {
- jarFileNames.add(FileTools.canonicalFile(jarFile).getPath());
- }
- }
-
- private static File[] jarFilesIn(File directory) {
- return directory.listFiles(jarFileFilter());
- }
-
- private static FileFilter jarFileFilter() {
- return new FileFilter() {
- public boolean accept(File file) {
- return FileTools.extension(file.getName()).toLowerCase().equals(".jar"); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** constructors **********
-
- /**
- * Construct a classpath with the specified entries.
- */
- private Classpath(Entry[] entries) {
- super();
- this.entries = entries;
- }
-
- /**
- * Construct a classpath with the specified entries.
- */
- public Classpath(String... fileNames) {
- this(buildEntries(fileNames));
- }
-
- /**
- * Skip empty file names because they will end up expanding to the current
- * working directory, which is not what we want. Empty file names actually
- * occur with some frequency; such as when the classpath has been built up
- * dynamically with too many separators. For example:<pre>
- * "C:\dev\foo.jar;;C:\dev\bar.jar"
- * </pre>will be parsed into three file names:<pre>
- * { "C:\dev\foo.jar", "", "C:\dev\bar.jar" }
- * </pre>
- */
- private static Entry[] buildEntries(String[] fileNames) {
- List<Entry> entries = new ArrayList<Entry>();
- for (String fileName : fileNames) {
- if ((fileName != null) && (fileName.length() != 0)) {
- entries.add(new Entry(fileName));
- }
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
- /**
- * Construct a classpath with the specified path.
- */
- public Classpath(String path) {
- this(path.split(File.pathSeparator));
- }
-
- /**
- * Construct a classpath with the specified entries.
- */
- public Classpath(Iterable<String> fileNames) {
- this(ArrayTools.array(fileNames, EMPTY_STRING_ARRAY));
- }
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
-
- /**
- * Consolidate the specified classpaths into a single classpath.
- */
- public Classpath(Classpath... classpaths) {
- this(consolidateEntries(classpaths));
- }
-
- private static Entry[] consolidateEntries(Classpath[] classpaths) {
- List<Entry> entries = new ArrayList<Entry>();
- for (Classpath classpath : classpaths) {
- CollectionTools.addAll(entries, classpath.getEntries());
- }
- return entries.toArray(new Entry[entries.size()]);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the classpath's entries.
- */
- public Iterable<Entry> getEntries() {
- return new ArrayIterable<Entry>(this.entries);
- }
-
- /**
- * Return the classpath's path.
- */
- public String getPath() {
- int max = this.entries.length - 1;
- if (max == -1) {
- return ""; //$NON-NLS-1$
- }
- StringBuilder sb = new StringBuilder(2000);
- // stop one short of the end of the array
- for (int i = 0; i < max; i++) {
- sb.append(this.entries[i].getFileName());
- sb.append(File.pathSeparatorChar);
- }
- sb.append(this.entries[max].getFileName());
- return sb.toString();
- }
-
- /**
- * Search the classpath for the specified (unqualified) file
- * and return its entry. Return null if an entry is not found.
- * For example, you could use this method to find the entry
- * for <code>"rt.jar"</code> or <code>"toplink.jar"</code>.
- */
- public Entry getEntryForFileNamed(String shortFileName) {
- for (Entry entry : this.entries) {
- if (entry.getFile().getName().equals(shortFileName)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Return the first entry file in the classpath
- * that contains the specified class.
- * Return null if an entry is not found.
- */
- public Entry getEntryForClassNamed(String className) {
- String relativeClassFileName = convertToClassFileName(className);
- String archiveEntryName = convertToArchiveClassFileEntryName(className);
- for (Entry entry : this.entries) {
- if (entry.contains(relativeClassFileName, archiveEntryName)) {
- return entry;
- }
- }
- return null;
- }
-
- /**
- * Return the names of all the classes discovered on the classpath,
- * with duplicates removed.
- * @see #classNames()
- */
- public Iterable<String> getClassNames() {
- return this.getClassNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * and accepted by the specified filter, with duplicates removed.
- * @see #classNames(Filter)
- */
- public Iterable<String> getClassNames(Filter<String> filter) {
- Collection<String> classNames = new HashSet<String>(10000);
- this.addClassNamesTo(classNames, filter);
- return classNames;
- }
-
- /**
- * Add the names of all the classes discovered on the classpath
- * to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames) {
- this.addClassNamesTo(classNames, Filter.Null.<String>instance());
- }
-
- /**
- * Add the names of all the classes discovered on the classpath
- * and accepted by the specified filter to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames, Filter<String> filter) {
- for (Entry entry : this.entries) {
- entry.addClassNamesTo(classNames, filter);
- }
- }
-
- /**
- * Return the names of all the classes discovered on the classpath.
- * Just a bit more performant than {@link #getClassNames()}.
- */
- public Iterator<String> classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * that are accepted by the specified filter.
- * Just a bit more performant than {@link #getClassNames(Filter)}.
- */
- public Iterator<String> classNames(Filter<String> filter) {
- return new CompositeIterator<String>(this.entryClassNamesIterators(filter));
- }
-
- private Iterator<Iterator<String>> entryClassNamesIterators(final Filter<String> filter) {
- return new TransformationIterator<Entry, Iterator<String>>(new ArrayIterator<Entry>(this.entries)) {
- @Override
- protected Iterator<String> transform(Entry entry) {
- return entry.classNames(filter);
- }
- };
- }
-
- /**
- * Return a "compressed" version of the classpath with its
- * duplicate entries eliminated.
- */
- public Classpath compressed() {
- return new Classpath(ArrayTools.removeDuplicateElements(this.entries));
- }
-
- /**
- * Convert the classpath to an array of URLs
- * (that can be used to instantiate a {@link java.net.URLClassLoader}).
- */
- public Iterable<URL> getURLs() {
- int len = this.entries.length;
- URL[] urls = new URL[len];
- for (int i = 0; i < len; i++) {
- urls[i] = this.entries[i].getURL();
- }
- return new ArrayIterable<URL>(urls);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getPath());
- }
-
-
- // ********** inner class **********
-
- /**
- * <code>Entry</code> models a Java classpath entry, which can be either a
- * directory containing <code>.class</code> files or a JAR file (or,
- * similarly, a <code>.zip</code> file). The entry can return the names of
- * classes found in it etc.
- */
- public static class Entry implements Serializable {
- private final String fileName;
- private final File file;
- private final File canonicalFile;
-
- private static final long serialVersionUID = 1L;
-
- Entry(String fileName) {
- super();
- if ((fileName == null) || (fileName.length() == 0)) {
- throw new IllegalArgumentException("'fileName' must be non-empty"); //$NON-NLS-1$
- }
- this.fileName = fileName;
- this.file = new File(fileName);
- this.canonicalFile = FileTools.canonicalFile(this.file);
- }
-
- public String getFileName() {
- return this.fileName;
- }
-
- public File getFile() {
- return this.file;
- }
-
- public File getCanonicalFile() {
- return this.canonicalFile;
- }
-
- public String getCanonicalFileName() {
- return this.canonicalFile.getAbsolutePath();
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Entry)) {
- return false;
- }
- return ((Entry) o).canonicalFile.equals(this.canonicalFile);
- }
-
- @Override
- public int hashCode() {
- return this.canonicalFile.hashCode();
- }
-
- /**
- * Return the entry's "canonical" URL.
- */
- public URL getURL() {
- try {
- return this.canonicalFile.toURI().toURL();
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * Return whether the entry contains the specified class.
- */
- public boolean contains(Class<?> javaClass) {
- return this.contains(javaClass.getName());
- }
-
- /**
- * Return whether the entry contains the specified class.
- */
- public boolean contains(String className) {
- return this.contains(convertToClassFileName(className), convertToArchiveClassFileEntryName(className));
- }
-
- /**
- * Return whether the entry contains either the specified relative
- * class file or the specified archive entry.
- * Not the prettiest signature, but it's internal....
- */
- boolean contains(String relativeClassFileName, String archiveEntryName) {
- if ( ! this.canonicalFile.exists()) {
- return false;
- }
- if (this.canonicalFile.isDirectory() && (new File(this.canonicalFile, relativeClassFileName)).exists()) {
- return true;
- }
- return (fileIsArchive(this.canonicalFile) && this.archiveContainsEntry(archiveEntryName));
- }
-
- /**
- * Return whether the entry's archive contains the specified entry.
- */
- private boolean archiveContainsEntry(String zipEntryName) {
- ZipFile zipFile = null;
- ZipEntry zipEntry = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- zipEntry = zipFile.getEntry(zipEntryName);
- } catch (IOException ex) {
- // something is wrong, leave the entry null
- } finally {
- try {
- if (zipFile != null) {
- zipFile.close();
- }
- } catch (IOException ex) {
- zipEntry = null; // something is wrong, clear out the entry
- }
- }
- return zipEntry != null;
- }
-
- /**
- * Return the names of all the classes discovered in the entry.
- * @see #classNames()
- */
- public Iterable<String> getClassNames() {
- return this.getClassNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered in the entry
- * and accepted by the specified filter.
- * @see #classNames(Filter)
- */
- public Iterable<String> getClassNames(Filter<String> filter) {
- Collection<String> classNames = new ArrayList<String>(2000);
- this.addClassNamesTo(classNames, filter);
- return classNames;
- }
-
- /**
- * Add the names of all the classes discovered in the entry
- * to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames) {
- this.addClassNamesTo(classNames, Filter.Null.<String>instance());
- }
-
- /**
- * Add the names of all the classes discovered in the entry
- * and accepted by the specified filter to the specified collection.
- */
- public void addClassNamesTo(Collection<String> classNames, Filter<String> filter) {
- if (this.canonicalFile.exists()) {
- if (this.canonicalFile.isDirectory()) {
- this.addClassNamesForDirectoryTo(classNames, filter);
- } else if (fileIsArchive(this.canonicalFile)) {
- this.addClassNamesForArchiveTo(classNames, filter);
- }
- }
- }
-
- /**
- * Add the names of all the classes discovered
- * under the entry's directory and accepted by
- * the specified filter to the specified collection.
- */
- private void addClassNamesForDirectoryTo(Collection<String> classNames, Filter<String> filter) {
- int start = this.canonicalFile.getAbsolutePath().length() + 1;
- for (Iterator<File> stream = this.classFilesForDirectory(); stream.hasNext(); ) {
- String className = convertToClassName(stream.next().getAbsolutePath().substring(start));
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
-
- /**
- * Return an iterator on all the class files discovered
- * under the entry's directory.
- */
- private Iterator<File> classFilesForDirectory() {
- return new FilteringIterator<File>(FileTools.filesInTree(this.canonicalFile)) {
- @Override
- protected boolean accept(File next) {
- return Entry.this.fileNameMightBeForClassFile(next.getName());
- }
- };
- }
-
- /**
- * Add the names of all the classes discovered
- * in the entry's archive file and accepted by the
- * specified filter to the specified collection.
- */
- private void addClassNamesForArchiveTo(Collection<String> classNames, Filter<String> filter) {
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- for (Enumeration<? extends ZipEntry> stream = zipFile.entries(); stream.hasMoreElements(); ) {
- ZipEntry zipEntry = stream.nextElement();
- String zipEntryName = zipEntry.getName();
- if (this.fileNameMightBeForClassFile(zipEntryName)) {
- String className = convertToClassName(zipEntryName);
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
- try {
- zipFile.close();
- } catch (IOException ex) {
- return;
- }
- }
-
- /**
- * Return whether the specified file might be a Java class file.
- * The file name must at least end with <code>".class"</code> and contain no spaces.
- * (Neither class names nor package names may contain spaces.)
- * Whether it actually is a class file will need to be determined by
- * a class loader.
- */
- boolean fileNameMightBeForClassFile(String name) {
- return FileTools.extension(name).toLowerCase().equals(".class") //$NON-NLS-1$
- && (name.indexOf(' ') == -1);
- }
-
- /**
- * Return the names of all the classes discovered on the classpath.
- * Just a bit more performant than {@link #getClassNames()}.
- */
- public Iterator<String> classNames() {
- return this.classNames(Filter.Null.<String>instance());
- }
-
- /**
- * Return the names of all the classes discovered on the classpath
- * that are accepted by the specified filter.
- * Just a bit more performant than {@link #getClassNames(Filter)}.
- */
- public Iterator<String> classNames(Filter<String> filter) {
- if (this.canonicalFile.exists()) {
- if (this.canonicalFile.isDirectory()) {
- return this.classNamesForDirectory(filter);
- }
- if (fileIsArchive(this.canonicalFile)) {
- return this.classNamesForArchive(filter);
- }
- }
- return EmptyIterator.instance();
- }
-
- /**
- * Return the names of all the classes discovered
- * under the entry's directory and accepted by
- * the specified filter.
- */
- private Iterator<String> classNamesForDirectory(Filter<String> filter) {
- return new FilteringIterator<String>(this.classNamesForDirectory(), filter);
- }
-
- /**
- * Transform the class files to class names.
- */
- private Iterator<String> classNamesForDirectory() {
- final int start = this.canonicalFile.getAbsolutePath().length() + 1;
- return new TransformationIterator<File, String>(this.classFilesForDirectory()) {
- @Override
- protected String transform(File f) {
- return convertToClassName(f.getAbsolutePath().substring(start));
- }
- };
- }
-
- /**
- * Return the names of all the classes discovered
- * in the entry's archive file and accepted by the
- * specified filter.
- */
- private Iterator<String> classNamesForArchive(Filter<String> filter) {
- // we can't simply wrap iterators here because we need to close the archive file...
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(this.canonicalFile);
- } catch (IOException ex) {
- return EmptyIterator.instance();
- }
- Collection<String> classNames = new HashSet<String>(zipFile.size());
- for (Enumeration<? extends ZipEntry> stream = zipFile.entries(); stream.hasMoreElements(); ) {
- ZipEntry zipEntry = stream.nextElement();
- String zipEntryName = zipEntry.getName();
- if (this.fileNameMightBeForClassFile(zipEntryName)) {
- String className = convertToClassName(zipEntryName);
- if (filter.accept(className)) {
- classNames.add(className);
- }
- }
- }
- try {
- zipFile.close();
- } catch (IOException ex) {
- return EmptyIterator.instance();
- }
- return classNames.iterator();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
deleted file mode 100644
index a3471ec3d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CollectionTools.java
+++ /dev/null
@@ -1,1933 +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.utility.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Random;
-import java.util.RandomAccess;
-import java.util.TreeSet;
-import java.util.Vector;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SuperIteratorWrapper;
-
-/**
- * {@link Collection}-related utility methods.
- */
-public final class CollectionTools {
-
- // ********** add all **********
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.addAll(Iterable iterable)</code>
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterable<? extends E> iterable) {
- return addAll(collection, iterable.iterator());
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.addAll(Iterable iterable)</code>
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterable<? extends E> iterable, int size) {
- return addAll(collection, iterable.iterator(), size);
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.addAll(Iterator iterator)</code>
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterator<? extends E> iterator) {
- return iterator.hasNext() ? addAll_(collection, iterator) : false;
- }
-
- /**
- * assume the iterator is not empty
- */
- private static <E> boolean addAll_(Collection<? super E> collection, Iterator<? extends E> iterator) {
- boolean modified = false;
- while (iterator.hasNext()) {
- modified |= collection.add(iterator.next());
- }
- return modified;
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.addAll(Iterator iterator)</code>
- */
- public static <E> boolean addAll(Collection<? super E> collection, Iterator<? extends E> iterator, int size) {
- return iterator.hasNext() ? collection.addAll(list(iterator, size)) : false;
- }
-
- /**
- * Add all the elements in the specified array
- * to the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.addAll(Object[] array)</code>
- */
- public static <E> boolean addAll(Collection<? super E> collection, E... array) {
- return (array.length == 0) ? false : addAll_(collection, array);
- }
-
- /**
- * assume the array is not empty
- */
- private static <E> boolean addAll_(Collection<? super E> collection, E... array) {
- boolean modified = false;
- for (E element : array) {
- modified |= collection.add(element);
- }
- return modified;
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * <p>
- * <code>List.addAll(Iterable iterable)</code>
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterable<E> iterable) {
- return addAll(list, index, iterable.iterator());
- }
-
- /**
- * Add all the elements returned by the specified iterable
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * <p>
- * <code>List.addAll(Iterable iterable)</code>
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterable<E> iterable, int size) {
- return addAll(list, index, iterable.iterator(), size);
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * <p>
- * <code>List.addAll(Iterator iterator)</code>
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterator<? extends E> iterator) {
- return iterator.hasNext() ? list.addAll(index, list(iterator)) : false;
- }
-
- /**
- * Add all the elements returned by the specified iterator
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * <p>
- * <code>List.addAll(Iterator iterator)</code>
- */
- public static <E> boolean addAll(List<? super E> list, int index, Iterator<? extends E> iterator, int size) {
- return iterator.hasNext() ? list.addAll(index, list(iterator, size)) : false;
- }
-
- /**
- * Add all the elements in the specified array
- * to the specified list at the specified index.
- * Return whether the list changed as a result.
- * <p>
- * <code>List.addAll(Object[] array)</code>
- */
- public static <E> boolean addAll(List<? super E> list, int index, E... array) {
- return (array.length == 0) ? false : list.addAll(index, Arrays.asList(array));
- }
-
-
- // ********** bag **********
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * <p>
- * <code>HashBag(Enumeration enumeration)</code>
- */
- public static <E> HashBag<E> bag(Enumeration<? extends E> enumeration) {
- return bag(enumeration, new HashBag<E>());
- }
-
- /**
- * Return a bag corresponding to the specified enumeration.
- * The specified enumeration size is a performance hint.
- * <p>
- * <code>HashBag(Enumeration enumeration)</code>
- */
- public static <E> HashBag<E> bag(Enumeration<? extends E> enumeration, int enumerationSize) {
- return bag(enumeration, new HashBag<E>(enumerationSize));
- }
-
- private static <E> HashBag<E> bag(Enumeration<? extends E> enumeration, HashBag<E> bag) {
- while (enumeration.hasMoreElements()) {
- bag.add(enumeration.nextElement());
- }
- return bag;
- }
-
- /**
- * Return a bag corresponding to the specified iterable.
- * <p>
- * <code>HashBag(Iterable iterable)</code>
- */
- public static <E> HashBag<E> bag(Iterable<? extends E> iterable) {
- return bag(iterable.iterator());
- }
-
- /**
- * Return a bag corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>HashBag(Iterable iterable)</code>
- */
- public static <E> HashBag<E> bag(Iterable<? extends E> iterable, int iterableSize) {
- return bag(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * <p>
- * <code>HashBag(Iterator iterator)</code>
- */
- public static <E> HashBag<E> bag(Iterator<? extends E> iterator) {
- return bag(iterator, new HashBag<E>());
- }
-
- /**
- * Return a bag corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>HashBag(Iterator iterator)</code>
- */
- public static <E> HashBag<E> bag(Iterator<? extends E> iterator, int iteratorSize) {
- return bag(iterator, new HashBag<E>(iteratorSize));
- }
-
- private static <E> HashBag<E> bag(Iterator<? extends E> iterator, HashBag<E> bag) {
- while (iterator.hasNext()) {
- bag.add(iterator.next());
- }
- return bag;
- }
-
- /**
- * Return a bag corresponding to the specified array.
- * <p>
- * <code>HashBag(Object[] array)</code>
- */
- public static <E> HashBag<E> bag(E... array) {
- int len = array.length;
- HashBag<E> bag = new HashBag<E>(len);
- for (E item : array) {
- bag.add(item);
- }
- return bag;
- }
-
-
- // ********** collection **********
-
- /**
- * Return a collection corresponding to the specified enumeration.
- */
- public static <E> HashBag<E> collection(Enumeration<? extends E> enumeration) {
- return bag(enumeration);
- }
-
- /**
- * Return a collection corresponding to the specified enumeration.
- * The specified enumeration size is a performance hint.
- */
- public static <E> HashBag<E> collection(Enumeration<? extends E> enumeration, int enumerationSize) {
- return bag(enumeration, enumerationSize);
- }
-
- /**
- * Return a collection corresponding to the specified iterable.
- */
- public static <E> HashBag<E> collection(Iterable<? extends E> iterable) {
- return collection(iterable.iterator());
- }
-
- /**
- * Return a collection corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- */
- public static <E> HashBag<E> collection(Iterable<? extends E> iterable, int iterableSize) {
- return collection(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a collection corresponding to the specified iterator.
- */
- public static <E> HashBag<E> collection(Iterator<? extends E> iterator) {
- return bag(iterator);
- }
-
- /**
- * Return a collection corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- */
- public static <E> HashBag<E> collection(Iterator<? extends E> iterator, int iteratorSize) {
- return bag(iterator, iteratorSize);
- }
-
- /**
- * Return a collection corresponding to the specified array.
- */
- public static <E> HashBag<E> collection(E... array) {
- return bag(array);
- }
-
-
- // ********** contains **********
-
- /**
- * Return whether the specified enumeration contains the
- * specified element.
- * <p>
- * <code>Enumeration.contains(Object o)</code>
- */
- public static boolean contains(Enumeration<?> enumeration, Object value) {
- if (value == null) {
- while (enumeration.hasMoreElements()) {
- if (enumeration.nextElement() == null) {
- return true;
- }
- }
- } else {
- while (enumeration.hasMoreElements()) {
- if (value.equals(enumeration.nextElement())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified iterable contains the
- * specified element.
- * <p>
- * <code>Iterable.contains(Object o)</code>
- */
- public static boolean contains(Iterable<?> iterable, Object value) {
- return contains(iterable.iterator(), value);
- }
-
- /**
- * Return whether the specified iterator contains the
- * specified element.
- * <p>
- * <code>Iterator.contains(Object o)</code>
- */
- public static boolean contains(Iterator<?> iterator, Object value) {
- if (value == null) {
- while (iterator.hasNext()) {
- if (iterator.next() == null) {
- return true;
- }
- }
- } else {
- while (iterator.hasNext()) {
- if (value.equals(iterator.next())) {
- return true;
- }
- }
- }
- return false;
- }
-
-
- // ********** contains all **********
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified iterable.
- * <p>
- * <code>Collection.containsAll(Iterable iterable)</code>
- */
- public static boolean containsAll(Collection<?> collection, Iterable<?> iterable) {
- return containsAll(collection, iterable.iterator());
- }
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified iterator.
- * <p>
- * <code>Collection.containsAll(Iterator iterator)</code>
- */
- public static boolean containsAll(Collection<?> collection, Iterator<?> iterator) {
- while (iterator.hasNext()) {
- if ( ! collection.contains(iterator.next())) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified collection contains all of the
- * elements in the specified array.
- * <p>
- * <code>Collection.containsAll(Object[] array)</code>
- */
- public static boolean containsAll(Collection<?> collection, Object... array) {
- for (int i = array.length; i-- > 0; ) {
- if ( ! collection.contains(array[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified collection.
- * <p>
- * <code>Iterable.containsAll(Collection collection)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, Collection<?> collection) {
- return containsAll(iterable.iterator(), collection);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified collection.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.containsAll(Collection collection)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, int iterableSize, Collection<?> collection) {
- return containsAll(iterable.iterator(), iterableSize, collection);
- }
-
- /**
- * Return whether the specified iterable 1 contains all of the
- * elements in the specified iterable 2.
- * <p>
- * <code>Iterable.containsAll(Iterable iterable)</code>
- */
- public static boolean containsAll(Iterable<?> iterable1, Iterable<?> iterable2) {
- return containsAll(iterable1.iterator(), iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterable 1 contains all of the
- * elements in the specified iterable 2.
- * The specified iterable 1 size is a performance hint.
- * <p>
- * <code>Iterable.containsAll(Iterable iterable)</code>
- */
- public static boolean containsAll(Iterable<?> iterable1, int iterable1Size, Iterable<?> iterable2) {
- return containsAll(iterable1.iterator(), iterable1Size, iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified iterator.
- * <p>
- * <code>Iterable.containsAll(Iterator iterator)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, Iterator<?> iterator) {
- return containsAll(iterable.iterator(), iterator);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified iterator.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.containsAll(Iterator iterator)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, int iterableSize, Iterator<?> iterator) {
- return containsAll(iterable.iterator(), iterableSize, iterator);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified array.
- * <p>
- * <code>Iterable.containsAll(Object[] array)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, Object... array) {
- return containsAll(iterable.iterator(), array);
- }
-
- /**
- * Return whether the specified iterable contains all of the
- * elements in the specified array.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.containsAll(Object[] array)</code>
- */
- public static boolean containsAll(Iterable<?> iterable, int iterableSize, Object... array) {
- return containsAll(iterable.iterator(), iterableSize, array);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified collection.
- * <p>
- * <code>Iterator.containsAll(Collection collection)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, Collection<?> collection) {
- return set(iterator).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified collection.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.containsAll(Collection collection)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, int iteratorSize, Collection<?> collection) {
- return set(iterator, iteratorSize).containsAll(collection);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * <p>
- * <code>Iterator.containsAll(Iterable iterable)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, Iterable<?> iterable) {
- return containsAll(set(iterator), iterable);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified iterable.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.containsAll(Iterable iterable)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, int iteratorSize, Iterable<?> iterable) {
- return containsAll(set(iterator, iteratorSize), iterable);
- }
-
- /**
- * Return whether the specified iterator 1 contains all of the
- * elements in the specified iterator 2.
- * <p>
- * <code>Iterator.containsAll(Iterator iterator)</code>
- */
- public static boolean containsAll(Iterator<?> iterator1, Iterator<?> iterator2) {
- return containsAll(set(iterator1), iterator2);
- }
-
- /**
- * Return whether the specified iterator 1 contains all of the
- * elements in the specified iterator 2.
- * The specified iterator 1 size is a performance hint.
- * <p>
- * <code>Iterator.containsAll(Iterator iterator)</code>
- */
- public static boolean containsAll(Iterator<?> iterator1, int iterator1Size, Iterator<?> iterator2) {
- return containsAll(set(iterator1, iterator1Size), iterator2);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified array.
- * <p>
- * <code>Iterator.containsAll(Object[] array)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, Object... array) {
- return containsAll(set(iterator), array);
- }
-
- /**
- * Return whether the specified iterator contains all of the
- * elements in the specified array.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.containsAll(Object[] array)</code>
- */
- public static boolean containsAll(Iterator<?> iterator, int iteratorSize, Object... array) {
- return containsAll(set(iterator, iteratorSize), array);
- }
-
-
- // ********** diff **********
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different, beginning at the end.
- * If the lists are identical, return -1.
- * If the lists are different sizes, return the index of the
- * last element in the longer list.
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- * <p>
- * <code>Collections.diffEnd(List list1, List list2)</code>
- */
- public static int diffEnd(List<?> list1, List<?> list2) {
- return ArrayTools.diffEnd(list1.toArray(), list2.toArray());
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- * <p>
- * <code>Collections.diffRange(List list1, List list2)</code>
- * @see #diffStart(List, List)
- * @see #diffEnd(List, List)
- */
- public static Range diffRange(List<?> list1, List<?> list2) {
- return ArrayTools.diffRange(list1.toArray(), list2.toArray());
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different. If the lists are identical, return
- * the size of the two lists (i.e. one past the last index).
- * If the lists are different sizes and all the elements in
- * the shorter list match their corresponding elements in
- * the longer list, return the size of the shorter list
- * (i.e. one past the last index of the shorter list).
- * Use the elements' {@link Object#equals()} method to compare the
- * elements.
- * <p>
- * <code>Collections.diffStart(List list1, List list2)</code>
- */
- public static int diffStart(List<?> list1, List<?> list2) {
- return ArrayTools.diffStart(list1.toArray(), list2.toArray());
- }
-
-
- // ********** identity diff **********
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different, beginning at the end.
- * If the lists are identical, return -1.
- * If the lists are different sizes, return the index of the
- * last element in the longer list.
- * Use object identity to compare the elements.
- * <p>
- * <code>Collections.identityDiffEnd(List list1, List list2)</code>
- */
- public static int identityDiffEnd(List<?> list1, List<?> list2) {
- return ArrayTools.identityDiffEnd(list1.toArray(), list2.toArray());
- }
-
- /**
- * Return the range of elements in the specified
- * arrays that are different.
- * If the arrays are identical, return [size, -1].
- * Use object identity to compare the elements.
- * <p>
- * <code>Collections.identityDiffStart(List list1, List list2)</code>
- * @see #identityDiffStart(List, List)
- * @see #identityDiffEnd(List, List)
- */
- public static Range identityDiffRange(List<?> list1, List<?> list2) {
- return ArrayTools.identityDiffRange(list1.toArray(), list2.toArray());
- }
-
- /**
- * Return the index of the first elements in the specified
- * lists that are different. If the lists are identical, return
- * the size of the two lists (i.e. one past the last index).
- * If the lists are different sizes and all the elements in
- * the shorter list match their corresponding elements in
- * the longer list, return the size of the shorter list
- * (i.e. one past the last index of the shorter list).
- * Use object identity to compare the elements.
- * <p>
- * <code>Collections.identityDiffStart(List list1, List list2)</code>
- */
- public static int identityDiffStart(List<?> list1, List<?> list2) {
- return ArrayTools.identityDiffStart(list1.toArray(), list2.toArray());
- }
-
-
- // ********** elements are equal **********
-
- /**
- * Return whether the specified iterables do not return the same elements
- * in the same order.
- */
- public static boolean elementsAreDifferent(Iterable<?> iterable1, Iterable<?> iterable2) {
- return elementsAreDifferent(iterable1.iterator(), iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterators do not return the same elements
- * in the same order.
- */
- public static boolean elementsAreDifferent(Iterator<?> iterator1, Iterator<?> iterator2) {
- return ! elementsAreEqual(iterator1, iterator2);
- }
-
- /**
- * Return whether the specified iterables return equal elements.
- * <p>
- * <code>Iterable.elementsAreEqual(Iterable iterable)</code>
- */
- public static boolean elementsAreEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
- return elementsAreEqual(iterable1.iterator(), iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterators return equal elements.
- * <p>
- * <code>Iterator.elementsAreEqual(Iterator iterator)</code>
- */
- public static boolean elementsAreEqual(Iterator<?> iterator1, Iterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- if (Tools.valuesAreDifferent(iterator1.next(), iterator2.next())) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
-
- // ********** elements are identical **********
-
- /**
- * Return whether the specified iterables return the same elements.
- * <p>
- * <code>Iterable.identical(Iterable iterable)</code>
- */
- public static boolean elementsAreIdentical(Iterable<?> iterable1, Iterable<?> iterable2) {
- return elementsAreIdentical(iterable1.iterator(), iterable2.iterator());
- }
-
- /**
- * Return whether the specified iterators return the same elements.
- * <p>
- * <code>Iterator.identical(Iterator iterator)</code>
- */
- public static boolean elementsAreIdentical(Iterator<?> iterator1, Iterator<?> iterator2) {
- while (iterator1.hasNext() && iterator2.hasNext()) {
- if (iterator1.next() != iterator2.next()) {
- return false;
- }
- }
- return ! (iterator1.hasNext() || iterator2.hasNext());
- }
-
-
- // ********** get **********
-
- /**
- * Return the element corresponding to the specified index
- * in the specified iterable.
- * <p>
- * <code>Iterable.get(int index)</code>
- */
- public static <E> E get(Iterable<? extends E> iterable, int index) {
- return get(iterable.iterator(), index);
- }
-
- /**
- * Return the element corresponding to the specified index
- * in the specified iterator.
- * <p>
- * <code>Iterator.get(int index)</code>
- */
- public static <E> E get(Iterator<? extends E> iterator, int index) {
- int i = 0;
- while (iterator.hasNext()) {
- E next = iterator.next();
- if (i++ == index) {
- return next;
- }
- }
- throw new IndexOutOfBoundsException(String.valueOf(index) + ':' + String.valueOf(i));
- }
-
-
- // ********** hash code **********
-
- public static int hashCode(Iterable<?> iterable) {
- if (iterable == null) {
- return 0;
- }
- int hash = 1;
- for (Object element : iterable) {
- hash = 31 * hash + (element == null ? 0 : element.hashCode());
- }
- return hash;
- }
-
-
- // ********** index of **********
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified iterable;
- * return -1 if there is no such index.
- * <p>
- * <code>Iterable.indexOf(Object o)</code>
- */
- public static int indexOf(Iterable<?> iterable, Object value) {
- return indexOf(iterable.iterator(), value);
- }
-
- /**
- * Return the index of the first occurrence of the
- * specified element in the specified iterator;
- * return -1 if there is no such index.
- * <p>
- * <code>Iterator.indexOf(Object o)</code>
- */
- public static int indexOf(Iterator<?> iterator, Object value) {
- if (value == null) {
- for (int i = 0; iterator.hasNext(); i++) {
- if (iterator.next() == null) {
- return i;
- }
- }
- } else {
- for (int i = 0; iterator.hasNext(); i++) {
- if (value.equals(iterator.next())) {
- return i;
- }
- }
- }
- return -1;
- }
-
-
- // ********** insertion index of **********
-
- /**
- * Return the maximum index of where the specified comparable object
- * should be inserted into the specified sorted list and still keep
- * the list sorted.
- */
- public static <E extends Comparable<? super E>> int insertionIndexOf(List<E> sortedList, Comparable<E> value) {
- int len = sortedList.size();
- for (int i = 0; i < len; i++) {
- if (value.compareTo(sortedList.get(i)) < 0) {
- return i;
- }
- }
- return len;
- }
-
- /**
- * Return the maximum index of where the specified object
- * should be inserted into the specified sorted list and still keep
- * the list sorted.
- */
- public static <E> int insertionIndexOf(List<E> sortedList, E value, Comparator<? super E> comparator) {
- int len = sortedList.size();
- for (int i = 0; i < len; i++) {
- if (comparator.compare(value, sortedList.get(i)) < 0) {
- return i;
- }
- }
- return len;
- }
-
-
- // ********** iterable/iterator **********
-
- /**
- * Return an iterable on the elements in the specified array.
- * <p>
- * <code>Arrays.iterable(Object[] array)</code>
- */
- public static <E> Iterable<E> iterable(E... array) {
- return new ArrayIterable<E>(array);
- }
-
- /**
- * Return an iterator on the elements in the specified array.
- * <p>
- * <code>Arrays.iterator(Object[] array)</code>
- */
- public static <E> Iterator<E> iterator(E... array) {
- return new ArrayIterator<E>(array);
- }
-
-
- // ********** last **********
-
- /**
- * Return the specified iterable's last element.
- * <p>
- * <code>Iterable.last()</code>
- *
- * @exception NoSuchElementException iterable is empty.
- */
- public static <E> E last(Iterable<E> iterable) {
- return last(iterable.iterator());
- }
-
- /**
- * Return the specified iterator's last element.
- * <p>
- * <code>Iterator.last()</code>
- *
- * @exception NoSuchElementException iterator is empty.
- */
- public static <E> E last(Iterator<E> iterator) {
- E last;
- do {
- last = iterator.next();
- } while (iterator.hasNext());
- return last;
- }
-
-
- // ********** last index of **********
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterable;
- * return -1 if there is no such index.
- * <p>
- * <code>Iterable.lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterable<?> iterable, Object value) {
- return lastIndexOf(iterable.iterator(), value);
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterable;
- * return -1 if there is no such index.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterable<?> iterable, int iterableSize, Object value) {
- return lastIndexOf(iterable.iterator(), iterableSize, value);
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterator;
- * return -1 if there is no such index.
- * <p>
- * <code>Iterator.lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterator<?> iterator, Object value) {
- return iterator.hasNext() ? list(iterator).lastIndexOf(value) : -1;
- }
-
- /**
- * Return the index of the last occurrence of the
- * specified element in the specified iterator;
- * return -1 if there is no such index.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.lastIndexOf(Object o)
- */
- public static int lastIndexOf(Iterator<?> iterator, int iteratorSize, Object value) {
- return iterator.hasNext() ? list(iterator, iteratorSize).lastIndexOf(value) : -1;
- }
-
-
- // ********** list **********
-
- /**
- * Return a list corresponding to the specified iterable.
- * <p>
- * <code>Iterable.toList()</code>
- */
- public static <E> ArrayList<E> list(Iterable<? extends E> iterable) {
- return list(iterable.iterator());
- }
-
- /**
- * Return a list corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.toList()</code>
- */
- public static <E> ArrayList<E> list(Iterable<? extends E> iterable, int iterableSize) {
- return list(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * <p>
- * <code>Iterator.toList()</code>
- */
- public static <E> ArrayList<E> list(Iterator<? extends E> iterator) {
- return list(iterator, new ArrayList<E>());
- }
-
- /**
- * Return a list corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.toList()</code>
- */
- public static <E> ArrayList<E> list(Iterator<? extends E> iterator, int iteratorSize) {
- return list(iterator, new ArrayList<E>(iteratorSize));
- }
-
- private static <E> ArrayList<E> list(Iterator<? extends E> iterator, ArrayList<E> list) {
- while (iterator.hasNext()) {
- list.add(iterator.next());
- }
- return list;
- }
-
- /**
- * Return a list corresponding to the specified array.
- * Unlike {@link Arrays#asList(Object[])}, the list
- * is modifiable and is not backed by the array.
- */
- public static <E> ArrayList<E> list(E... array) {
- return new ArrayList<E>(Arrays.asList(array));
- }
-
- /**
- * Return a list iterator for the specified array.
- * <p>
- * <code>Arrays.listIterator(Object[] array)</code>
- */
- public static <E> ListIterator<E> listIterator(E... array) {
- return listIterator(array, 0);
- }
-
- /**
- * Return a list iterator for the specified array
- * starting at the specified position in the array.
- * <p>
- * <code>Arrays.listIterator(Object[] array, int index)</code>
- */
- public static <E> ListIterator<E> listIterator(E[] array, int start) {
- return listIterator(array, start, array.length - start);
- }
-
- /**
- * Return a list iterator for the specified array
- * starting at the specified position in the array.
- * <p>
- * <code>Arrays.listIterator(Object[] array, int index, int length)</code>
- */
- public static <E> ListIterator<E> listIterator(E[] array, int start, int length) {
- return new ArrayListIterator<E>(array, start, length);
- }
-
-
- // ********** move **********
-
- /**
- * Move an element from the specified source index to the specified target
- * index. Return the altered list.
- * <p>
- * <code>List.move(int targetIndex, int sourceIndex)</code>
- */
- public static <E> List<E> move(List<E> list, int targetIndex, int sourceIndex) {
- return (targetIndex == sourceIndex) ? list : move_(list, targetIndex, sourceIndex);
- }
-
- /**
- * assume targetIndex != sourceIndex
- */
- private static <E> List<E> move_(List<E> list, int targetIndex, int sourceIndex) {
- if (list instanceof RandomAccess) {
- // move elements, leaving the list in place
- E temp = list.get(sourceIndex);
- if (targetIndex < sourceIndex) {
- for (int i = sourceIndex; i-- > targetIndex; ) {
- list.set(i + 1, list.get(i));
- }
- } else {
- for (int i = sourceIndex; i < targetIndex; i++) {
- list.set(i, list.get(i + 1));
- }
- }
- list.set(targetIndex, temp);
- } else {
- // remove the element and re-add it at the target index
- list.add(targetIndex, list.remove(sourceIndex));
- }
- return list;
- }
-
- /**
- * Move elements from the specified source index to the specified target
- * index. Return the altered list.
- * <p>
- * <code>List.move(int targetIndex, int sourceIndex, int length)</code>
- */
- public static <E> List<E> move(List<E> list, int targetIndex, int sourceIndex, int length) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return list;
- }
- if (length == 1) {
- return move_(list, targetIndex, sourceIndex);
- }
- if (list instanceof RandomAccess) {
- // move elements, leaving the list in place
- ArrayList<E> temp = new ArrayList<E>(list.subList(sourceIndex, sourceIndex + length));
- if (targetIndex < sourceIndex) {
- for (int i = sourceIndex; i-- > targetIndex; ) {
- list.set(i + length, list.get(i));
- }
- } else {
- for (int i = sourceIndex; i < targetIndex; i++) {
- list.set(i, list.get(i + length));
- }
- }
- for (int i = 0; i < length; i++) {
- list.set(targetIndex + i, temp.get(i));
- }
- } else {
- // remove the elements and re-add them at the target index
- list.addAll(targetIndex, removeElementsAtIndex(list, sourceIndex, length));
- }
- return list;
- }
-
-
- // ********** remove all **********
-
- /**
- * Remove all the elements returned by the specified iterable
- * from the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.removeAll(Iterable iterable)</code>
- */
- public static boolean removeAll(Collection<?> collection, Iterable<?> iterable) {
- return removeAll(collection, iterable.iterator());
- }
-
- /**
- * Remove all the elements returned by the specified iterable
- * from the specified collection.
- * Return whether the collection changed as a result.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Collection.removeAll(Iterable iterable)</code>
- */
- public static boolean removeAll(Collection<?> collection, Iterable<?> iterable, int iterableSize) {
- return removeAll(collection, iterable.iterator(), iterableSize);
- }
-
- /**
- * Remove all the elements returned by the specified iterator
- * from the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.removeAll(Iterator iterator)</code>
- */
- public static boolean removeAll(Collection<?> collection, Iterator<?> iterator) {
- return iterator.hasNext() ? collection.removeAll(set(iterator)) : false;
- }
-
- /**
- * Remove all the elements returned by the specified iterator
- * from the specified collection.
- * Return whether the collection changed as a result.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Collection.removeAll(Iterator iterator)</code>
- */
- public static boolean removeAll(Collection<?> collection, Iterator<?> iterator, int iteratorSize) {
- return iterator.hasNext() ? collection.removeAll(set(iterator, iteratorSize)) : false;
- }
-
- /**
- * Remove all the elements in the specified array
- * from the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.removeAll(Object[] array)</code>
- */
- public static boolean removeAll(Collection<?> collection, Object... array) {
- return (array.length == 0) ? false : collection.removeAll(set(array));
- }
-
-
- // ********** remove all occurrences **********
-
- /**
- * Remove all occurrences of the specified element
- * from the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.removeAllOccurrences(Object value)</code>
- */
- public static boolean removeAllOccurrences(Collection<?> collection, Object value) {
- boolean modified = false;
- Iterator<?> stream = collection.iterator();
- if (value == null) {
- while (stream.hasNext()) {
- if (stream.next() == null) {
- stream.remove();
- modified = true;
- }
- }
- } else {
- while (stream.hasNext()) {
- if (value.equals(stream.next())) {
- stream.remove();
- modified = true;
- }
- }
- }
- return modified;
- }
-
-
- // ********** remove elements at index **********
-
- /**
- * Remove the elements at the specified index.
- * Return the removed elements.
- * <p>
- * <code>List.remove(int index, int length)</code>
- */
- public static <E> ArrayList<E> removeElementsAtIndex(List<E> list, int index, int length) {
- List<E> subList = list.subList(index, index + length);
- ArrayList<E> result = new ArrayList<E>(subList);
- subList.clear();
- return result;
- }
-
-
- // ********** remove duplicate elements **********
-
- /**
- * Remove any duplicate elements from the specified list,
- * while maintaining the order.
- * Return whether the list changed as a result.
- */
- public static <E> boolean removeDuplicateElements(List<E> list) {
- int size = list.size();
- if ((size == 0) || (size == 1)) {
- return false;
- }
- return removeDuplicateElements(list, size);
- }
-
- /**
- * assume list is non-empty
- */
- static <E> boolean removeDuplicateElements(List<E> list, int size) {
- LinkedHashSet<E> temp = new LinkedHashSet<E>(size); // take advantage of hashed look-up
- boolean modified = false;
- for (E item : list) {
- if ( ! temp.add(item)) {
- modified = true; // duplicate item
- }
- }
- if (modified) {
- int i = 0;
- for (E e : temp) {
- list.set(i, e);
- i++;
- }
- int tempSize = temp.size();
- for (i = list.size(); i-- > tempSize; ) {
- list.remove(i); // pull off the end
- }
- }
- return modified;
- }
-
-
- // ********** retain all **********
-
- /**
- * Retain only the elements in the specified iterable
- * in the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.retainAll(Iterable iterable)</code>
- */
- public static boolean retainAll(Collection<?> collection, Iterable<?> iterable) {
- return retainAll(collection, iterable.iterator());
- }
-
- /**
- * Retain only the elements in the specified iterable
- * in the specified collection.
- * Return whether the collection changed as a result.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Collection.retainAll(Iterable iterable)</code>
- */
- public static boolean retainAll(Collection<?> collection, Iterable<?> iterable, int iterableSize) {
- return retainAll(collection, iterable.iterator(), iterableSize);
- }
-
- /**
- * Retain only the elements in the specified iterator
- * in the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.retainAll(Iterator iterator)</code>
- */
- public static boolean retainAll(Collection<?> collection, Iterator<?> iterator) {
- if (iterator.hasNext()) {
- return collection.retainAll(set(iterator));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
- /**
- * Retain only the elements in the specified iterator
- * in the specified collection.
- * Return whether the collection changed as a result.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Collection.retainAll(Iterator iterator)</code>
- */
- public static boolean retainAll(Collection<?> collection, Iterator<?> iterator, int iteratorSize) {
- if (iterator.hasNext()) {
- return collection.retainAll(set(iterator, iteratorSize));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
- /**
- * Retain only the elements in the specified array
- * in the specified collection.
- * Return whether the collection changed as a result.
- * <p>
- * <code>Collection.retainAll(Object[] array)</code>
- */
- public static boolean retainAll(Collection<?> collection, Object... array) {
- if (array.length > 0) {
- return collection.retainAll(set(array));
- }
- if (collection.isEmpty()) {
- return false;
- }
- collection.clear();
- return true;
- }
-
-
- // ********** reverse list **********
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterable.
- * <p>
- * <code>Iterable.reverseList()</code>
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable) {
- return reverseList(iterable.iterator());
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.reverseList()</code>
- */
- public static <E> List<E> reverseList(Iterable<? extends E> iterable, int iterableSize) {
- return reverseList(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterator.
- * <p>
- * <code>Iterator.reverseList()</code>
- */
- public static <E> List<E> reverseList(Iterator<? extends E> iterator) {
- return reverse(list(iterator));
- }
-
- /**
- * Return a list with entries in reverse order from those
- * returned by the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.reverseList()</code>
- */
- public static <E> List<E> reverseList(Iterator<? extends E> iterator, int size) {
- return reverse(list(iterator, size));
- }
-
-
- // ********** rotate **********
-
- /**
- * Return the list after it has been "rotated" by one position.
- * <p>
- * <code>List.rotate()</code>
- */
- public static <E> List<E> rotate(List<E> list) {
- return rotate(list, 1);
- }
-
-
- // ********** set **********
-
- /**
- * Return a set corresponding to the specified iterable.
- * <p>
- * <code>HashSet(Iterable iterable)</code>
- */
- public static <E> HashSet<E> set(Iterable<? extends E> iterable) {
- return set(iterable.iterator());
- }
-
- /**
- * Return a set corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>HashSet(Iterable iterable)</code>
- */
- public static <E> HashSet<E> set(Iterable<? extends E> iterable, int iterableSize) {
- return set(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a set corresponding to the specified iterator.
- * <p>
- * <code>HashSet(Iterator iterator)</code>
- */
- public static <E> HashSet<E> set(Iterator<? extends E> iterator) {
- return set(iterator, new HashSet<E>());
- }
-
- /**
- * Return a set corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>HashSet(Iterator iterator)</code>
- */
- public static <E> HashSet<E> set(Iterator<? extends E> iterator, int iteratorSize) {
- return set(iterator, new HashSet<E>(iteratorSize));
- }
-
- private static <E> HashSet<E> set(Iterator<? extends E> iterator, HashSet<E> set) {
- while (iterator.hasNext()) {
- set.add(iterator.next());
- }
- return set;
- }
-
- /**
- * Return a set corresponding to the specified array.
- * <p>
- * <code>HashSet(Object[] array)</code>
- */
- public static <E> HashSet<E> set(E... array) {
- HashSet<E> set = new HashSet<E>(array.length);
- for (int i = array.length; i-- > 0;) {
- set.add(array[i]);
- }
- return set;
- }
-
-
- // ********** singleton iterator **********
-
- /**
- * Return an iterator that returns only the single,
- * specified object.
- * <p>
- * <code>Object.toIterator()</code>
- */
- public static <E> Iterator<E> singletonIterator(E value) {
- return new SingleElementIterator<E>(value);
- }
-
- /**
- * Return a list iterator that returns only the single,
- * specified object.
- * <p>
- * <code>Object.toListIterator()</code>
- */
- public static <E> ListIterator<E> singletonListIterator(E value) {
- return new SingleElementListIterator<E>(value);
- }
-
-
- // ********** size **********
-
- /**
- * Return the number of elements returned by the specified iterable.
- * <p>
- * <code>Iterable.size()</code>
- */
- public static int size(Iterable<?> iterable) {
- return size(iterable.iterator());
- }
-
- /**
- * Return the number of elements returned by the specified iterator.
- * <p>
- * <code>Iterator.size()</code>
- */
- public static int size(Iterator<?> iterator) {
- int size = 0;
- while (iterator.hasNext()) {
- iterator.next();
- size++;
- }
- return size;
- }
-
- /**
- * Return whether the specified iterable is empty
- * (Shortcuts the iterator rather than calculating the entire size)
- */
- public static boolean isEmpty(Iterable<?> iterable) {
- return isEmpty(iterable.iterator());
- }
-
- /**
- * Return whether the specified iterator is empty
- * (Shortcuts the iterator rather than calculating the entire size)
- */
- public static boolean isEmpty(Iterator<?> iterator) {
- return ! iterator.hasNext();
- }
-
-
- // ********** sort **********
-
- /**
- * Return an iterable containing the sorted elements of the specified iterable.
- * <p>
- * <code>Iterable.sort()</code>
- */
- public static <E extends Comparable<? super E>> Iterable<E> sort(Iterable<E> iterable) {
- return sort(iterable, null);
- }
-
- /**
- * Return an iterable containing the sorted elements of the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.sort()</code>
- */
- public static <E extends Comparable<? super E>> Iterable<E> sort(Iterable<E> iterable, int iterableSize) {
- return sort(iterable, null, iterableSize);
- }
-
- /**
- * Return an iterable containing the sorted elements of the specified iterable.
- * <p>
- * <code>Iterable.sort(Comparator comparator)</code>
- */
- public static <E> Iterable<E> sort(Iterable<E> iterable, Comparator<? super E> comparator) {
- return sort(list(iterable), comparator);
- }
-
- /**
- * Return an iterable containing the sorted elements of the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>Iterable.sort(Comparator comparator)</code>
- */
- public static <E> Iterable<E> sort(Iterable<E> iterable, Comparator<? super E> comparator, int iterableSize) {
- return sort(list(iterable, iterableSize), comparator);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- * <p>
- * <code>Iterator.sort()</code>
- */
- public static <E extends Comparable<? super E>> ListIterator<E> sort(Iterator<? extends E> iterator) {
- return sort(iterator, null);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.sort()</code>
- */
- public static <E extends Comparable<? super E>> ListIterator<E> sort(Iterator<? extends E> iterator, int iteratorSize) {
- return sort(iterator, null, iteratorSize);
- }
-
- /**
- * Return the iterator after it has been "sorted".
- * <p>
- * <code>Iterator.sort(Comparator comparator)</code>
- */
- public static <E> ListIterator<E> sort(Iterator<? extends E> iterator, Comparator<? super E> comparator) {
- return sort(list(iterator), comparator).listIterator();
- }
-
- /**
- * Return the iterator after it has been "sorted".
- * The specified iterator size is a performance hint.
- * <p>
- * <code>Iterator.sort(Comparator comparator)</code>
- */
- public static <E> ListIterator<E> sort(Iterator<? extends E> iterator, Comparator<? super E> comparator, int iteratorSize) {
- return sort(list(iterator, iteratorSize), comparator).listIterator();
- }
-
-
- // ********** sorted set **********
-
- /**
- * Return a sorted set corresponding to the specified iterable.
- * <p>
- * <code>TreeSet(Iterable iterable)</code>
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterable<? extends E> iterable) {
- return sortedSet(iterable.iterator());
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>TreeSet(Iterable iterable)</code>
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterable<? extends E> iterable, int iterableSize) {
- return sortedSet(iterable.iterator(), iterableSize);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable
- * and comparator.
- * <p>
- * <code>TreeSet(Iterable iterable, Comparator c)</code>
- */
- public static <E> TreeSet<E> sortedSet(Iterable<? extends E> iterable, Comparator<? super E> comparator) {
- return sortedSet(iterable.iterator(), comparator);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterable
- * and comparator.
- * The specified iterable size is a performance hint.
- * <p>
- * <code>TreeSet(Iterable iterable, Comparator c)</code>
- */
- public static <E> TreeSet<E> sortedSet(Iterable<? extends E> iterable, Comparator<? super E> comparator, int iterableSize) {
- return sortedSet(iterable.iterator(), comparator, iterableSize);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator.
- * <p>
- * <code>TreeSet(Iterator iterator)</code>
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterator<? extends E> iterator) {
- return sortedSet(iterator, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>TreeSet(Iterator iterator)</code>
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(Iterator<? extends E> iterator, int iteratorSize) {
- return sortedSet(iterator, null, iteratorSize);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator
- * and comparator.
- * <p>
- * <code>TreeSet(Iterator iterator, Comparator c)</code>
- */
- public static <E> TreeSet<E> sortedSet(Iterator<? extends E> iterator, Comparator<? super E> comparator) {
- return sortedSet(list(iterator), comparator);
- }
-
- /**
- * Return a sorted set corresponding to the specified iterator
- * and comparator.
- * The specified iterator size is a performance hint.
- * <p>
- * <code>TreeSet(Iterator iterator, Comparator c)</code>
- */
- public static <E> TreeSet<E> sortedSet(Iterator<? extends E> iterator, Comparator<? super E> comparator, int iteratorSize) {
- return sortedSet(list(iterator, iteratorSize), comparator);
- }
-
- private static <E> TreeSet<E> sortedSet(List<E> list, Comparator<? super E> comparator) {
- TreeSet<E> sortedSet = new TreeSet<E>(comparator);
- sortedSet.addAll(list);
- return sortedSet;
- }
-
- /**
- * Return a sorted set corresponding to the specified array.
- * <p>
- * <code>TreeSet(Object[] array)</code>
- */
- public static <E extends Comparable<? super E>> TreeSet<E> sortedSet(E... array) {
- return sortedSet(array, null);
- }
-
- /**
- * Return a sorted set corresponding to the specified array
- * and comparator.
- * <p>
- * <code>TreeSet(Object[] array, Comparator c)</code>
- */
- public static <E> TreeSet<E> sortedSet(E[] array, Comparator<? super E> comparator) {
- TreeSet<E> sortedSet = new TreeSet<E>(comparator);
- sortedSet.addAll(Arrays.asList(array));
- return sortedSet;
- }
-
-
- // ********** Old School Vector **********
-
- /**
- * Return a vector corresponding to the specified iterable.
- * This is useful for legacy code that requires a {@link Vector}.
- * <p>
- * <code>Vector(Iterable iterable)</code>
- */
- public static <E> Vector<E> vector(Iterable<? extends E> iterable) {
- return vector(iterable.iterator());
- }
-
- /**
- * Return a vector corresponding to the specified iterable.
- * This is useful for legacy code that requires a {@link Vector}.
- * <p>
- * <code>Vector(Iterable iterable, int size)</code>
- */
- public static <E> Vector<E> vector(Iterable<? extends E> iterable, int size) {
- return vector(iterable.iterator(), size);
- }
-
- /**
- * Return a vector corresponding to the specified iterator.
- * This is useful for legacy code that requires a {@link Vector}.
- * <p>
- * <code>Vector(Iterator iterator)</code>
- */
- public static <E> Vector<E> vector(Iterator<? extends E> iterator) {
- return vector(iterator, new Vector<E>());
- }
-
- /**
- * Return a vector corresponding to the specified iterator.
- * This is useful for legacy code that requires a {@link Vector}.
- * <p>
- * <code>Vector(Iterator iterator, int size)</code>
- */
- public static <E> Vector<E> vector(Iterator<? extends E> iterator, int size) {
- return vector(iterator, new Vector<E>(size));
- }
-
- private static <E> Vector<E> vector(Iterator<? extends E> iterator, Vector<E> v) {
- while (iterator.hasNext()) {
- v.addElement(iterator.next());
- }
- return v;
- }
-
- /**
- * Return a vector corresponding to the specified array.
- * This is useful for legacy code that requires a {@link Vector}.
- * <p>
- * <code>Vector(Object... array)</code>
- */
- public static <E> Vector<E> vector(E... array) {
- Vector<E> v = new Vector<E>(array.length);
- for (E item : array) {
- v.addElement(item);
- }
- return v;
- }
-
-
- // ********** single-use Iterable **********
-
- /**
- * Return a one-use {@link Iterable} for the specified {@link Iterator}.
- * Throw an {@link IllegalStateException} if {@link Iterable#iterator()}
- * is called more than once.
- * As such, this utility should only be used in one-use situations, such as
- * a foreach loop.
- */
- public static <E> Iterable<E> iterable(Iterator<? extends E> iterator) {
- return new SingleUseIterable<E>(iterator);
- }
-
- /**
- * This is a one-time use iterable that can return a single iterator.
- * Once the iterator is returned the iterable is no longer valid.
- * As such, this utility should only be used in one-time use situations,
- * such as a 'for-each' loop.
- */
- public static class SingleUseIterable<E> implements Iterable<E> {
- private Iterator<E> iterator;
-
- public SingleUseIterable(Iterator<? extends E> iterator) {
- super();
- if (iterator == null) {
- throw new NullPointerException();
- }
- this.iterator = new SuperIteratorWrapper<E>(iterator);
- }
-
- public Iterator<E> iterator() {
- if (this.iterator == null) {
- throw new IllegalStateException("This method has already been called."); //$NON-NLS-1$
- }
- Iterator<E> result = this.iterator;
- this.iterator = null;
- return result;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
- }
-
-
- // ********** java.util.Collections enhancements **********
-
- /**
- * Return the destination list after the source list has been copied into it.
- * @see Collections#copy(List, List)
- */
- public static <E> List<E> copy(List<E> dest, List<? extends E> src) {
- Collections.copy(dest, src);
- return dest;
- }
-
- /**
- * Return the list after it has been "filled".
- * @see Collections#fill(List, Object)
- */
- public static <E> List<E> fill(List<E> list, E value) {
- Collections.fill(list, value);
- return list;
- }
-
- /**
- * Return the list after it has been "reversed".
- * @see Collections#reverse(List)
- */
- public static <E> List<E> reverse(List<E> list) {
- Collections.reverse(list);
- return list;
- }
-
- /**
- * Return the list after it has been "rotated".
- * @see Collections#rotate(List, int)
- */
- public static <E> List<E> rotate(List<E> list, int distance) {
- Collections.rotate(list, distance);
- return list;
- }
-
- /**
- * Return the list after it has been "shuffled".
- * @see Collections#shuffle(List)
- */
- public static <E> List<E> shuffle(List<E> list) {
- Collections.shuffle(list);
- return list;
- }
-
- /**
- * Return the list after it has been "shuffled".
- * @see Collections#shuffle(List, Random)
- */
- public static <E> List<E> shuffle(List<E> list, Random random) {
- Collections.shuffle(list, random);
- return list;
- }
-
- /**
- * Return the list after it has been "sorted".
- * NB: The list is sorted in place as a side-effect.
- * @see Collections#sort(List)
- */
- public static <E extends Comparable<? super E>> List<E> sort(List<E> list) {
- Collections.sort(list);
- return list;
- }
-
- /**
- * Return the list after it has been "sorted".
- * NB: The list is sorted in place as a side-effect.
- * @see Collections#sort(List, Comparator)
- */
- public static <E> List<E> sort(List<E> list, Comparator<? super E> comparator) {
- Collections.sort(list, comparator);
- return list;
- }
-
- /**
- * Return the list after the specified elements have been "swapped".
- * @see Collections#swap(List, int, int)
- */
- public static <E> List<E> swap(List<E> list, int i, int j) {
- Collections.swap(list, i, j);
- return list;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private CollectionTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CommandRunnable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CommandRunnable.java
deleted file mode 100644
index c2bd4e23fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CommandRunnable.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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Wrap a Command so it can be used as a Runnable.
- */
-public class CommandRunnable implements Runnable {
- protected final Command command;
-
- public CommandRunnable(Command command) {
- super();
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- }
-
- public void run() {
- this.command.execute();
- }
-
- @Override
- public String toString() {
- return "Runnable[" + this.command.toString() +']'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeCommand.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeCommand.java
deleted file mode 100644
index cfea4d33a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeCommand.java
+++ /dev/null
@@ -1,44 +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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-
-/**
- * <code>CompositeCommand</code> provides support for treating a collection of
- * {@link Command}s as a single command.
- */
-public class CompositeCommand
- implements Command
-{
- private final Iterable<Command> commands;
-
- public CompositeCommand(Command... commands) {
- this(new ArrayIterable<Command>(commands));
- }
-
- public CompositeCommand(Iterable<Command> commands) {
- super();
- this.commands = commands;
- }
-
- public void execute() {
- for (Command command : this.commands) {
- command.execute();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.commands);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java
deleted file mode 100644
index 5407997813..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/CompositeException.java
+++ /dev/null
@@ -1,44 +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.utility.internal;
-
-import java.util.Collection;
-
-/**
- * Provide a way for multiple exceptions to be packaged and reported.
- */
-public class CompositeException
- extends RuntimeException
-{
- private final Throwable[] exceptions;
- private static final long serialVersionUID = 1L;
-
-
- /**
- * The specified exceptions list must not be empty.
- */
- public CompositeException(Collection<Throwable> exceptions) {
- this(exceptions.toArray(new Throwable[exceptions.size()]));
- }
-
- /**
- * The specified exceptions list must not be empty.
- */
- public CompositeException(Throwable[] exceptions) {
- // grab the first exception and make it the "cause"
- super(exceptions[0]);
- this.exceptions = exceptions;
- }
-
- public Throwable[] getExceptions() {
- return this.exceptions;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ConsumerThreadCoordinator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ConsumerThreadCoordinator.java
deleted file mode 100644
index 6ffe878435..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ConsumerThreadCoordinator.java
+++ /dev/null
@@ -1,253 +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.utility.internal;
-
-import java.util.Vector;
-import java.util.concurrent.ThreadFactory;
-
-/**
- * A <code>ConsumerThreadCoordinator</code> controls the creation,
- * starting, and stopping of a general purpose "consumer" thread. Construct
- * the coordinator with a {@link Consumer} that both waits for the producer
- * to "produce" something to "consume" and, once the wait is over,
- * "consumes" whatever is available.
- * <p>
- * <strong>NB:</strong> The client-supplied consumer should handle any
- * exception appropriately (e.g. log the exception and return gracefully) so
- * the thread can continue executing.
- */
-public class ConsumerThreadCoordinator {
- /**
- * The runnable passed to the consumer thread each time it is built.
- */
- private final Runnable runnable;
-
- /**
- * Client-supplied thread factory. Defaults to a straightforward
- * implementation.
- */
- private final ThreadFactory threadFactory;
-
- /**
- * Optional, client-supplied name for the consumer thread.
- * If null, the JDK assigns a name.
- */
- private final String threadName;
-
- /**
- * The consumer is executed on this thread. A new thread is built
- * for every start/stop cycle (since a thread cannot be started more than
- * once).
- */
- private volatile Thread thread;
-
- /**
- * A list of the uncaught exceptions thrown by the consumer
- * during the current start/stop cycle.
- */
- final Vector<Throwable> exceptions = new Vector<Throwable>();
-
-
- // ********** construction **********
-
- /**
- * Construct a consumer thread coordinator for the specified consumer.
- * Use simple JDK thread(s) for the consumer thread(s).
- * Allow the consumer thread(s) to be assigned JDK-generated names.
- */
- public ConsumerThreadCoordinator(Consumer consumer) {
- this(consumer, SimpleThreadFactory.instance());
- }
-
- /**
- * Construct a consumer thread coordinator for the specified consumer.
- * Use the specified thread factory to construct the consumer thread(s).
- * Allow the consumer thread(s) to be assigned JDK-generated names.
- */
- public ConsumerThreadCoordinator(Consumer consumer, ThreadFactory threadFactory) {
- this(consumer, threadFactory, null);
- }
-
- /**
- * Construct a consumer thread coordinator for the specified consumer.
- * Assign the consumer thread(s) the specified name.
- * Use simple JDK thread(s) for the consumer thread(s).
- */
- public ConsumerThreadCoordinator(Consumer consumer, String threadName) {
- this(consumer, SimpleThreadFactory.instance(), threadName);
- }
-
- /**
- * Construct a consumer thread coordinator for the specified consumer.
- * Use the specified thread factory to construct the consumer thread(s).
- * Assign the consumer thread(s) the specified name.
- */
- public ConsumerThreadCoordinator(Consumer consumer, ThreadFactory threadFactory, String threadName) {
- super();
- this.runnable = this.buildRunnable(consumer);
- this.threadFactory = threadFactory;
- this.threadName = threadName;
- }
-
- private Runnable buildRunnable(Consumer consumer) {
- return new RunnableConsumer(consumer);
- }
-
-
- // ********** Lifecycle support **********
-
- /**
- * Build and start the consumer thread.
- */
- public synchronized void start() {
- if (this.thread != null) {
- throw new IllegalStateException("Not stopped."); //$NON-NLS-1$
- }
- this.thread = this.buildThread();
- this.thread.start();
- }
-
- private Thread buildThread() {
- Thread t = this.threadFactory.newThread(this.runnable);
- if (this.threadName != null) {
- t.setName(this.threadName);
- }
- return t;
- }
-
- /**
- * Interrupt the consumer thread so that it stops executing at the
- * end of its current iteration. Suspend the current thread until
- * the consumer thread is finished executing. If any uncaught
- * exceptions were thrown while the consumer thread was executing,
- * wrap them in a composite exception and throw the composite exception.
- */
- public synchronized void stop() {
- if (this.thread == null) {
- throw new IllegalStateException("Not started."); //$NON-NLS-1$
- }
- this.thread.interrupt();
- try {
- this.thread.join();
- } catch (InterruptedException ex) {
- // the thread that called #stop() was interrupted while waiting to
- // join the consumer thread - ignore;
- // 'thread' is still "interrupted", so its #run() loop will still stop
- // after its current execution - we just won't wait around for it...
- }
- this.thread = null;
-
- if (this.exceptions.size() > 0) {
- Throwable[] temp = this.exceptions.toArray(new Throwable[this.exceptions.size()]);
- this.exceptions.clear();
- throw new CompositeException(temp);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.thread);
- }
-
-
- // ********** consumer thread runnable **********
-
- /**
- * This implementation of {@link Runnable} is a long-running consumer that
- * will repeatedly execute the consumer {@link Consumer#execute()} method.
- * With each iteration, the consumer thread will wait
- * until the other consumer method, {@link Consumer#waitForProducer()}, allows the
- * consumer thread to proceed (i.e. there is something for the consumer to
- * consume). Once {@link Consumer#execute()} is finished, the thread will quiesce
- * until {@link Consumer#waitForProducer()} returns again.
- * Stop the thread by calling {@link Thread#interrupt()}.
- */
- private class RunnableConsumer
- implements Runnable
- {
- /**
- * Client-supplied consumer that controls waiting for something to consume
- * and the consuming itself.
- */
- private final Consumer consumer;
-
- RunnableConsumer(Consumer consumer) {
- super();
- this.consumer = consumer;
- }
-
- /**
- * Loop while this thread has not been interrupted by another thread.
- * In each loop: Pause execution until {@link Consumer#waitForProducer()}
- * allows us to proceed.
- * <p>
- * If this thread is interrupted <em>during</em> {@link Consumer#execute()},
- * the call to {@link Thread#interrupted()} will stop the loop. If this thread is
- * interrupted during the call to {@link Consumer#waitForProducer()},
- * we will catch the {@link InterruptedException} and stop the loop also.
- */
- public void run() {
- while ( ! Thread.interrupted()) {
- try {
- this.consumer.waitForProducer();
- } catch (InterruptedException ex) {
- // we were interrupted while waiting, must be Quittin' Time
- return;
- }
- this.execute();
- }
- }
-
- /**
- * Execute the consumer {@link Consumer#execute()} method.
- * Do not allow any unhandled exceptions to kill the thread.
- * Store them up for later pain.
- * @see ConsumerThreadCoordinator#stop()
- */
- private void execute() {
- try {
- this.execute_();
- } catch (Throwable ex) {
- ConsumerThreadCoordinator.this.exceptions.add(ex);
- }
- }
-
- /**
- * Subclass-implemented behavior: consume stuff.
- */
- private void execute_() {
- this.consumer.execute();
- }
-
- }
-
-
- // ********** consumer interface **********
-
- /**
- * Interface implemented by clients that controls:<ul>
- * <li>when the consumer thread suspends, waiting for something to consume
- * <li>the consuming of whatever is being produced
- * </ul>
- */
- public interface Consumer {
- /**
- * Wait for something to consume.
- * Throw an {@link InterruptedException} if the thread is interrupted.
- */
- void waitForProducer() throws InterruptedException;
-
- /**
- * Consume whatever is currently available.
- */
- void execute();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ExceptionHandler.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ExceptionHandler.java
deleted file mode 100644
index 28bda106d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ExceptionHandler.java
+++ /dev/null
@@ -1,87 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Simple interface for allowing clients to pass an exception handler to a
- * service (e.g. to log the exception). This is particularly helpful if the
- * service executes on another, possibly inaccessible, thread.
- * <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 ExceptionHandler {
-
- /**
- * The specified exception was thrown. Handle it appropriately.
- */
- void handleException(Throwable t);
-
- /**
- * Singleton implementation of the exception handler interface that does
- * nothing with the exception.
- */
- final class Null implements ExceptionHandler, Serializable {
- public static final ExceptionHandler INSTANCE = new Null();
- public static ExceptionHandler instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void handleException(Throwable t) {
- // do nothing
- }
- @Override
- public String toString() {
- return "ExceptionHandler.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 exception handler interface that
- * wraps the exception in a runtime exception and throws it.
- */
- final class Runtime implements ExceptionHandler, Serializable {
- public static final ExceptionHandler INSTANCE = new Runtime();
- public static ExceptionHandler instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Runtime() {
- super();
- }
- public void handleException(Throwable t) {
- // re-throw the exception unchecked
- throw new RuntimeException(t);
- }
- @Override
- public String toString() {
- return "ExceptionHandler.Runtime"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
deleted file mode 100644
index 788bc0aff8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/FileTools.java
+++ /dev/null
@@ -1,1002 +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.utility.internal;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.channels.FileChannel;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Assorted file tools:
- * - delete entire trees of directories and files
- * - build iterators on entire trees of directories and files
- * - build a temporary directory
- * - "canonize" files
- */
-public final class FileTools {
-
- public static final String USER_HOME_DIRECTORY_NAME = System.getProperty("user.home"); //$NON-NLS-1$
- public static final String USER_TEMPORARY_DIRECTORY_NAME = System.getProperty("java.io.tmpdir"); //$NON-NLS-1$
- public static String DEFAULT_TEMPORARY_DIRECTORY_NAME = "tmpdir"; //$NON-NLS-1$
- public static final String CURRENT_WORKING_DIRECTORY_NAME = System.getProperty("user.dir"); //$NON-NLS-1$
-
- /** A list of some invalid file name characters.
- : is the filename separator in MacOS and the drive indicator in DOS
- * is a DOS wildcard character
- | is a DOS redirection character
- & is our own escape character
- / is the filename separator in Unix and the command option tag in DOS
- \ is the filename separator in DOS/Windows and the escape character in Unix
- ; is ???
- ? is a DOS wildcard character
- [ is ???
- ] is ???
- = is ???
- + is ???
- < is a DOS redirection character
- > is a DOS redirection character
- " is used by DOS to delimit file names with spaces
- , is ???
- */
- public static final char[] INVALID_FILENAME_CHARACTERS = { ':', '*', '|', '&', '/', '\\', ';', '?', '[', ']', '=', '+', '<', '>', '"', ',' };
-
- /** This encoder will convert strings into valid file names. */
- public static final XMLStringEncoder FILE_NAME_ENCODER = new XMLStringEncoder(INVALID_FILENAME_CHARACTERS);
-
- /** Windows files that are redirected to devices etc. */
- @SuppressWarnings("nls")
- private static final String[] WINDOWS_RESERVED_FILE_NAMES = {
- "con",
- "aux",
- "com1", "com2", "com3", "com4", "com5", "com6", "com7", "com8", "com9",
- "lpt1", "lpt2", "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9",
- "prn",
- "nul"
- };
-
- /** The default length of a shortened file name. */
- public static final int MAXIMUM_SHORTENED_FILE_NAME_LENGTH = 60;
-
-
- // ********** deleting directories **********
-
- /**
- * Delete the specified directory and all of its contents.
- * <em>USE WITH CARE.</em>
- * File#deleteAll()?
- */
- public static void deleteDirectory(String directoryName) {
- deleteDirectory(new File(directoryName));
- }
-
- /**
- * Delete the specified directory and all of its contents.
- * <em>USE WITH CARE.</em>
- * File#deleteAll()?
- */
- public static void deleteDirectory(File directory) {
- deleteDirectoryContents(directory);
- if ( ! directory.delete()) {
- throw new RuntimeException("unable to delete directory: " + directory.getAbsolutePath()); //$NON-NLS-1$
- }
- }
-
- /**
- * Delete the contents of the specified directory
- * (but not the directory itself).
- * <em>USE WITH CARE.</em>
- * File#deleteFiles()
- */
- public static void deleteDirectoryContents(String directoryName) {
- deleteDirectoryContents(new File(directoryName));
- }
-
- /**
- * Delete the contents of the specified directory
- * (but not the directory itself).
- * <em>USE WITH CARE.</em>
- * File#deleteFiles()
- */
- public static void deleteDirectoryContents(File directory) {
- for (File file : directory.listFiles()) {
- if (file.isDirectory()) {
- deleteDirectory(file); // recurse through subdirectories
- } else {
- if ( ! file.delete()) {
- throw new RuntimeException("unable to delete file: " + file.getAbsolutePath()); //$NON-NLS-1$
- }
- }
- }
- }
-
-
- // ********** copying files **********
-
- /**
- * Copies the content of the source file to the destination file.
- * File#copy(File destinationFile)
- */
- public static void copyToFile(File sourceFile, File destinationFile)
- throws IOException
- {
- FileChannel sourceChannel = new FileInputStream(sourceFile).getChannel();
- FileChannel destinationChannel = new FileOutputStream(destinationFile).getChannel();
- try {
- destinationChannel.transferFrom(sourceChannel, 0, sourceChannel.size());
- } finally {
- sourceChannel.close();
- destinationChannel.close();
- }
- }
-
- /**
- * Copies the content of the source file to a file by
- * the same name in the destination directory.
- * File#copyToDirectory(File destinationDirectory)
- */
- public static void copyToDirectory(File sourceFile, File destinationDirectory)
- throws IOException
- {
- File destinationFile = new File(destinationDirectory, sourceFile.getName());
- if ( ! destinationFile.exists() && ! destinationFile.createNewFile()) {
- throw new RuntimeException("createNewFile() failed: " + destinationFile); //$NON-NLS-1$
- }
- copyToFile(sourceFile, destinationFile);
- }
-
-
- // ********** iteratoring over files and directories **********
-
- /**
- * Return an iterator on all the files in the specified directory.
- * The iterator will skip over subdirectories.
- * File#files()
- */
- public static Iterator<File> filesIn(String directoryName) {
- return filesIn(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the files in the specified directory.
- * The iterator will skip over subdirectories.
- * File#files()
- */
- public static Iterator<File> filesIn(File directory) {
- return filesIn(directory.listFiles());
- }
-
- private static Iterator<File> filesIn(File[] files) {
- return new FilteringIterator<File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(File next) {
- return next.isFile();
- }
- };
- }
-
- /**
- * Return an iterator on all the subdirectories
- * in the specified directory.
- * File#subDirectories()
- */
- public static Iterator<File> directoriesIn(String directoryName) {
- return directoriesIn(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the subdirectories
- * in the specified directory.
- * File#subDirectories()
- */
- public static Iterator<File> directoriesIn(File directory) {
- return directoriesIn(directory.listFiles());
- }
-
- private static Iterator<File> directoriesIn(File[] files) {
- return new FilteringIterator<File>(new ArrayIterator<File>(files)) {
- @Override
- protected boolean accept(File next) {
- return next.isDirectory();
- }
- };
- }
-
- /**
- * Return an iterator on all the files under the specified
- * directory, recursing into subdirectories.
- * The iterator will skip over the subdirectories themselves.
- * File#filesRecurse()
- */
- public static Iterator<File> filesInTree(String directoryName) {
- return filesInTree(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the files under the specified
- * directory, recursing into subdirectories.
- * The iterator will skip over the subdirectories themselves.
- * File#filesRecurse()
- */
- public static Iterator<File> filesInTree(File directory) {
- return filesInTreeAsSet(directory).iterator();
- }
-
- private static Set<File> filesInTreeAsSet(File directory) {
- Set<File> files = new HashSet<File>(10000);
- addFilesInTreeTo(directory, files);
- return files;
- }
-
- private static void addFilesInTreeTo(File directory, Collection<File> allFiles) {
- for (File file : directory.listFiles()) {
- if (file.isFile()) {
- allFiles.add(file);
- } else if (file.isDirectory()) {
- addFilesInTreeTo(file, allFiles);
- }
- }
- }
-
- /**
- * Return an iterator on all the directories under the specified
- * directory, recursing into subdirectories.
- * File#subDirectoriesRecurse()
- */
- public static Iterator<File> directoriesInTree(String directoryName) {
- return directoriesInTree(new File(directoryName));
- }
-
- /**
- * Return an iterator on all the directories under the specified
- * directory, recursing into subdirectories.
- * File#subDirectoriesRecurse()
- */
- @SuppressWarnings("unchecked")
- public static Iterator<File> directoriesInTree(File directory) {
- File[] files = directory.listFiles();
- return new CompositeIterator<File>(directoriesIn(files), directoriesInTrees(directoriesIn(files)));
- }
-
- private static Iterator<File> directoriesInTrees(Iterator<File> directories) {
- return new CompositeIterator<File>(
- new TransformationIterator<File, Iterator<File>>(directories) {
- @Override
- protected Iterator<File> transform(File next) {
- return FileTools.directoriesInTree(next);
- }
- }
- );
- }
-
-
- // ********** short file 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);
- }
-
- /**
- * Strip the extension from the specified file's name
- * and return the result. If the file's name has no
- * extension, it is returned unchanged
- * File#basePath()
- */
- public static String stripExtension(File file) {
- return stripExtension(file.getPath());
- }
-
- /**
- * Return the extension, including the dot, of the specified file name.
- * If the file name has no extension, return an empty string.
- * File#extension()
- */
- public static String extension(String fileName) {
- int index = fileName.lastIndexOf('.');
- if (index == -1) {
- return ""; //$NON-NLS-1$
- }
- return fileName.substring(index);
- }
-
- /**
- * Return the extension, including the dot, of the specified file's name.
- * If the file's name has no extension, return an empty string.
- * File#extension()
- */
- public static String extension(File file) {
- return extension(file.getPath());
- }
-
-
- // ********** temporary directories **********
-
- /**
- * Build and return an empty temporary directory with the specified
- * name. If the directory already exists, it will be cleared out.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File emptyTemporaryDirectory(String name) {
- File dir = new File(userTemporaryDirectory(), name);
- if (dir.exists()) {
- deleteDirectoryContents(dir);
- } else {
- mkdirs(dir);
- }
- return dir;
- }
-
- private static void mkdirs(File dir) {
- if ( ! dir.mkdirs()) {
- throw new RuntimeException("mkdirs() failed: " + dir); //$NON-NLS-1$
- }
- }
-
- /**
- * Build and return an empty temporary directory with a
- * name of "tmpdir". If the directory already exists, it will be cleared out.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File emptyTemporaryDirectory() {
- return emptyTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Build and return a temporary directory with the specified
- * name. If the directory already exists, it will be left unchanged;
- * if it does not already exist, it will be created.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File temporaryDirectory(String name) {
- File dir = new File(userTemporaryDirectory(), name);
- if ( ! dir.exists()) {
- mkdirs(dir);
- }
- return dir;
- }
-
- /**
- * Build and return a temporary directory with a name of
- * "tmpdir". If the directory already exists, it will be left unchanged;
- * if it does not already exist, it will be created.
- * This directory will be a subdirectory of the Java temporary directory,
- * as indicated by the System property "java.io.tmpdir".
- */
- public static File temporaryDirectory() {
- return temporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Build and return a *new* temporary directory with the specified
- * prefix. The prefix will be appended with a number that
- * is incremented, starting with 1, until a non-pre-existing directory
- * is found and successfully created. This directory will be a
- * subdirectory of the Java temporary directory, as indicated by
- * the System property "java.io.tmpdir".
- */
- public static File newTemporaryDirectory(String prefix) {
- if ( ! prefix.endsWith(".")) { //$NON-NLS-1$
- prefix = prefix + '.';
- }
- File dir;
- int i = 0;
- do {
- i++;
- dir = new File(userTemporaryDirectory(), prefix + i);
- } while ( ! dir.mkdirs());
- return dir;
- }
-
- /**
- * Build and return a *new* temporary directory with a
- * prefix of "tmpdir". This prefix will be appended with a number that
- * is incremented, starting with 1, until a non-pre-existing directory
- * is found and successfully created. This directory will be a
- * subdirectory of the Java temporary directory, as indicated by
- * the System property "java.io.tmpdir".
- */
- public static File newTemporaryDirectory() {
- return newTemporaryDirectory(DEFAULT_TEMPORARY_DIRECTORY_NAME);
- }
-
-
- // ********** resource files **********
-
- /**
- * Build and return a file for the specified resource.
- * The resource name must be fully-qualified, i.e. it cannot be relative
- * to the package name/directory.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File resourceFile(String resourceName) throws URISyntaxException {
- if ( ! resourceName.startsWith("/")) { //$NON-NLS-1$
- throw new IllegalArgumentException(resourceName);
- }
- return resourceFile(resourceName, FileTools.class);
- }
-
- /**
- * Build and return a file for the specified resource.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File resourceFile(String resourceName, Class<?> javaClass) throws URISyntaxException {
- URL url = javaClass.getResource(resourceName);
- return buildFile(url);
- }
-
- /**
- * Build and return a file for the specified URL.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File buildFile(URL url) throws URISyntaxException {
- return buildFile(url.getFile());
- }
-
- /**
- * Build and return a file for the specified file name.
- * NB: There is a bug in jdk1.4.x the prevents us from getting
- * a resource that has spaces (or other special characters) in
- * its name.... (see Sun's Java bug 4466485)
- */
- public static File buildFile(String fileName) throws URISyntaxException {
- URI uri = new URI(fileName);
- File file = new File(uri.getPath());
- return file;
- }
-
-
- // ********** "canonical" files **********
-
- /**
- * Convert the specified file into a "canonical" file.
- */
- public static File canonicalFile(File file) {
- try {
- return file.getCanonicalFile();
- } catch (IOException ioexception) {
- // settle for the absolute file
- return file.getAbsoluteFile();
- }
- }
-
- /**
- * Build an iterator that will convert the specified files
- * into "canonical" files.
- */
- public static Iterator<File> canonicalFiles(Iterator<File> files) {
- return new TransformationIterator<File, File>(files) {
- @Override
- protected File transform(File next) {
- return canonicalFile(next);
- }
- };
- }
-
- /**
- * Build an iterator that will convert the specified files
- * into "canonical" files.
- */
- public static Iterator<File> canonicalFiles(Collection<File> files) {
- return canonicalFiles(files.iterator());
- }
-
- /**
- * Convert the specified file name into a "canonical" file name.
- */
- public static String canonicalFileName(String fileName) {
- return canonicalFile(new File(fileName)).getAbsolutePath();
- }
-
- /**
- * Build an iterator that will convert the specified file names
- * into "canonical" file names.
- */
- public static Iterator<String> canonicalFileNames(Iterator<String> fileNames) {
- return new TransformationIterator<String, String>(fileNames) {
- @Override
- protected String transform(String next) {
- return canonicalFileName(next);
- }
- };
- }
-
- /**
- * Build an iterator that will convert the specified file names
- * into "canonical" file names.
- */
- public static Iterator<String> canonicalFileNames(Collection<String> fileNames) {
- return canonicalFileNames(fileNames.iterator());
- }
-
-
- // ********** file name validation **********
-
- /**
- * Return whether the specified file name is invalid.
- */
- public static boolean fileNameIsInvalid(String filename) {
- return ! fileNameIsValid(filename);
- }
-
- /**
- * Return whether the specified file name is valid.
- */
- public static boolean fileNameIsValid(String filename) {
- int len = filename.length();
- for (int i = 0; i < len; i++) {
- char filenameChar = filename.charAt(i);
- if (ArrayTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Convert the illegal characters in the specified file name to
- * the specified character and return the result.
- */
- public static String convertToValidFileName(String filename, char replacementChar) {
- int len = filename.length();
- StringBuilder sb = new StringBuilder(len);
- for (int i = 0; i < len; i++) {
- char filenameChar = filename.charAt(i);
- if (ArrayTools.contains(INVALID_FILENAME_CHARACTERS, filenameChar)) {
- sb.append(replacementChar);
- } else {
- sb.append(filenameChar);
- }
- }
- return sb.toString();
- }
-
- /**
- * Convert the illegal characters in the specified file name to
- * periods ('.') and return the result.
- */
- public static String convertToValidFileName(String filename) {
- return convertToValidFileName(filename, '.');
- }
-
- /**
- * Return whether the specified file name is "reserved"
- * (i.e. it cannot be used for "user" files). Windows reserves
- * a number of file names (e.g. CON, AUX, PRN).
- */
- public static boolean fileNameIsReserved(String fileName) {
- // Unix/Linux does not have any "reserved" file names (I think...)
- return Tools.osIsWindows() && ArrayTools.contains(WINDOWS_RESERVED_FILE_NAMES, fileName.toLowerCase());
- }
-
- /**
- * Return whether the specified file contains any "reserved"
- * components.
- * Windows reserves a number of file names (e.g. CON, AUX, PRN);
- * and these file names cannot be used for either the names of
- * files or directories.
- */
- public static boolean fileHasAnyReservedComponents(File file) {
- File temp = file;
- while (temp != null) {
- if (fileNameIsReserved(temp.getName())) {
- return true;
- }
- temp = temp.getParentFile();
- }
- return false;
- }
-
-
- // ********** shortened file names **********
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(URL url) {
- return shortenFileName(url, MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(URL url, int maxLength) {
- File file;
- try {
- file = buildFile(url);
- } catch (URISyntaxException e) {
- file = new File(url.getFile());
- }
- return shortenFileName(file, maxLength);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(File file) {
- return shortenFileName(file, MAXIMUM_SHORTENED_FILE_NAME_LENGTH);
- }
-
- /**
- * Return a shorter version of the absolute file name for the specified file.
- * The shorter version will not be longer than the maximum length.
- * The first directory (usually the drive letter) and the file name or the
- * last directory will always be added to the generated string regardless of
- * the maximum length allowed.
- */
- public static String shortenFileName(File file, int maxLength) {
- String absoluteFileName = canonicalFile(file).getAbsolutePath();
- if (absoluteFileName.length() <= maxLength) {
- // no need to shorten
- return absoluteFileName;
- }
-
- // break down the path into its components
- String fs = File.separator;
- String[] paths = absoluteFileName.split('\\' + fs);
-
- if (paths.length <= 1) {
- // e.g. "C:\"
- return paths[0];
- }
-
- if (paths.length == 2) {
- // e.g. "C:\MyReallyLongFileName.ext" or "C:\MyReallyLongDirectoryName"
- // return the complete file name since this is a minimum requirement,
- // regardless of the maximum length allowed
- return absoluteFileName;
- }
-
- StringBuilder sb = new StringBuilder();
- sb.append(paths[0]); // always add the first directory, which is usually the drive letter
-
- // Keep the index of insertion into the string buffer
- int insertIndex = sb.length();
-
- sb.append(fs);
- sb.append(paths[paths.length - 1]); // append the file name or the last directory
-
- maxLength -= 4; // -4 for "/..."
-
- int currentLength = sb.length() - 4; // -4 for "/..."
- int leftIndex = 1; // 1 to skip the root directory
- int rightIndex = paths.length - 2; // -1 for the file name or the last directory
-
- boolean canAddFromLeft = true;
- boolean canAddFromRight = true;
-
- // Add each directory, the insertion is going in both direction: left and
- // right, once a side can't be added, the other side is still continuing
- // until both can't add anymore
- while (true) {
- if (!canAddFromLeft && !canAddFromRight)
- break;
-
- if (canAddFromRight) {
- String rightDirectory = paths[rightIndex];
- int rightLength = rightDirectory.length();
-
- // Add the directory on the right side of the loop
- if (currentLength + rightLength + 1 <= maxLength) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, rightDirectory);
-
- currentLength += rightLength + 1;
- rightIndex--;
-
- // The right side is now overlapping the left side, that means
- // we can't add from the right side anymore
- if (leftIndex >= rightIndex) {
- canAddFromRight = false;
- }
- } else {
- canAddFromRight = false;
- }
- }
-
- if (canAddFromLeft) {
- String leftDirectory = paths[leftIndex];
- int leftLength = leftDirectory.length();
-
- // Add the directory on the left side of the loop
- if (currentLength + leftLength + 1 <= maxLength) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, leftDirectory);
-
- insertIndex += leftLength + 1;
- currentLength += leftLength + 1;
- leftIndex++;
-
- // The left side is now overlapping the right side, that means
- // we can't add from the left side anymore
- if (leftIndex >= rightIndex) {
- canAddFromLeft = false;
- }
- } else {
- canAddFromLeft = false;
- }
- }
- }
-
- if (leftIndex <= rightIndex) {
- sb.insert(insertIndex, fs);
- sb.insert(insertIndex + 1, "..."); //$NON-NLS-1$
- }
-
- return sb.toString();
- }
-
-
- // ********** system properties **********
-
- /**
- * Return a file representing the user's home directory.
- */
- public static File userHomeDirectory() {
- return new File(USER_HOME_DIRECTORY_NAME);
- }
-
- /**
- * Return a file representing the user's temporary directory.
- */
- public static File userTemporaryDirectory() {
- return new File(USER_TEMPORARY_DIRECTORY_NAME);
- }
-
- /**
- * Return a file representing the current working directory.
- */
- public static File currentWorkingDirectory() {
- return new File(CURRENT_WORKING_DIRECTORY_NAME);
- }
-
-
- // ********** miscellaneous **********
-
- /**
- * Return only the files that fit the filter.
- * File#files(FileFilter fileFilter)
- */
- public static Iterator<File> filter(Iterator<File> files, final FileFilter fileFilter) {
- return new FilteringIterator<File>(files) {
- @Override
- protected boolean accept(File next) {
- return fileFilter.accept(next);
- }
- };
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, relative to the specified directory.
- * Linux/Unix/Mac:
- * convertToRelativeFile(/foo/bar/baz.java, /foo)
- * => bar/baz.java
- * Windows:
- * convertToRelativeFile(C:\foo\bar\baz.java, C:\foo)
- * => bar/baz.java
- * The file can be either a file or a directory; the directory
- * *should* be a directory.
- * If the file is already relative or it cannot be made relative
- * to the directory, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToRelativeFile(final File file, final File dir) {
- // check whether the file is already relative
- if ( ! file.isAbsolute()) {
- return file; // return unchanged
- }
-
- File cFile = canonicalFile(file);
- File cDir = canonicalFile(dir);
-
- // the two are the same directory
- if (cFile.equals(cDir)) {
- return new File("."); //$NON-NLS-1$
- }
-
- File[] filePathFiles = pathFiles(cFile);
- File[] dirPathFiles = pathFiles(cDir);
-
- // Windows only (?): the roots are different - e.g. D:\ vs. C:\
- if ( ! dirPathFiles[0].equals(filePathFiles[0])) {
- return file; // return unchanged
- }
-
- // at this point we know the root is the same, now find how much is in common
- int i = 0; // this will point at the first miscompare
- while ((i < dirPathFiles.length) && (i < filePathFiles.length)) {
- if (dirPathFiles[i].equals(filePathFiles[i])) {
- i++;
- } else {
- break;
- }
- }
- // save our current position
- int firstMismatch = i;
-
- // check whether the file is ABOVE the directory: ../..
- if (firstMismatch == filePathFiles.length) {
- return relativeParentFile(dirPathFiles.length - firstMismatch);
- }
-
- // build a new file from the path beyond the matching portions
- File diff = new File(filePathFiles[i].getName());
- while (++i < filePathFiles.length) {
- diff = new File(diff, filePathFiles[i].getName());
- }
-
- // check whether the file is BELOW the directory: subdir1/subdir2/file.ext
- if (firstMismatch == dirPathFiles.length) {
- return diff;
- }
-
- // the file must be a PEER of the directory: ../../subdir1/subdir2/file.ext
- return new File(relativeParentFile(dirPathFiles.length - firstMismatch), diff.getPath());
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, relative to the current working directory.
- * Linux/Unix/Mac (CWD = /foo):
- * convertToRelativeFile(/foo/bar/baz.java)
- * => bar/baz.java
- * Windows (CWD = C:\foo):
- * convertToRelativeFile(C:\foo\bar\baz.java)
- * => bar/baz.java
- * The file can be either a file or a directory.
- * If the file is already relative or it cannot be made relative
- * to the directory, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToRelativeFile(final File file) {
- return convertToRelativeFile(file, currentWorkingDirectory());
- }
-
- /**
- * Return an array of files representing the path to the specified
- * file. For example:
- * C:/foo/bar/baz.txt =>
- * { C:/, C:/foo, C:/foo/bar, C:/foo/bar/baz.txt }
- */
- private static File[] pathFiles(File file) {
- List<File> path = new ArrayList<File>();
- for (File f = file; f != null; f = f.getParentFile()) {
- path.add(f);
- }
- Collections.reverse(path);
- return path.toArray(new File[path.size()]);
- }
-
- /**
- * Return a file with the specified (non-zero) number of relative
- * file names, e.g. xxx(3) => ../../..
- */
- private static File relativeParentFile(int len) {
- if (len <= 0) {
- throw new IllegalArgumentException("length must be greater than zero: " + len); //$NON-NLS-1$
- }
- File result = new File(".."); //$NON-NLS-1$
- for (int i = len - 1; i-- > 0; ) {
- result = new File(result, ".."); //$NON-NLS-1$
- }
- return result;
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, absolute to the specified directory.
- * Linux/Unix/Mac:
- * convertToAbsoluteFile(bar/baz.java, /foo)
- * => /foo/bar/baz.java
- * Windows:
- * convertToAbsoluteFile(bar/baz.java, C:\foo)
- * => C:\foo\bar\baz.java
- * The file can be either a file or a directory; the directory
- * *should* be a directory.
- * If the file is already absolute, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToAbsoluteFile(final File file, final File dir) {
- // check whether the file is already absolute
- if (file.isAbsolute()) {
- return file; // return unchanged
- }
- return canonicalFile(new File(dir, file.getPath()));
- }
-
- /**
- * Return a file that is a re-specification of the specified
- * file, absolute to the current working directory.
- * Linux/Unix/Mac (CWD = /foo):
- * convertToAbsoluteFile(bar/baz.java)
- * => /foo/bar/baz.java
- * Windows (CWD = C:\foo):
- * convertToAbsoluteFile(bar/baz.java)
- * => C:\foo\bar\baz.java
- * The file can be either a file or a directory.
- * If the file is already absolute, it will be returned unchanged.
- *
- * NB: This method has been tested on Windows and Linux,
- * but not Mac (but the Mac is Unix-based these days, so
- * it shouldn't be a problem...).
- */
- public static File convertToAbsoluteFile(final File file) {
- return convertToAbsoluteFile(file, currentWorkingDirectory());
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private FileTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
deleted file mode 100644
index 7be6149149..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/HashBag.java
+++ /dev/null
@@ -1,877 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the {@link Bag} interface, backed by a
- * hash table. It makes no guarantees as to the iteration order of
- * the bag's elements; in particular, it does not guarantee the order
- * will remain constant over time. This class permits the <code>null</code>
- * element.
- * <p>
- * This class offers constant time performance for the basic operations
- * (<code>add</code>, <code>remove</code>, <code>contains</code> and
- * <code>size</code>), assuming the hash function disperses the elements
- * properly among the buckets. Iterating over this bag requires time
- * proportional to the sum of the bag's size (the number of elements) plus the
- * "capacity" of the backing hash table (the number of buckets). Thus, it is
- * important not to set the initial capacity too high (or the load factor too
- * low) if iteration performance is important.
- * <p>
- * <strong>Note that this implementation is not synchronized.</strong> If multiple
- * threads access a bag concurrently, and at least one of the threads modifies
- * the bag, it <em>must</em> be synchronized externally. This is typically
- * accomplished by synchronizing on some object that naturally encapsulates
- * the bag. If no such object exists, the bag should be "wrapped" using the
- * <code>Collections.synchronizedCollection</code> method. This is
- * best done at creation time, to prevent accidental unsynchronized access
- * to the bag:
- * <pre>
- * Collection c = Collections.synchronizedCollection(new HashBag(...));
- * </pre>
- * <p>
- * The iterators returned by this class's <code>iterator</code> method are
- * <em>fail-fast</em>: if the bag is modified at any time after the iterator is
- * created, in any way except through the iterator's own <code>remove</code>
- * method, the iterator throws a {@link ConcurrentModificationException}.
- * Thus, in the face of concurrent modification, the iterator fails quickly
- * and cleanly, rather than risking arbitrary, non-deterministic behavior at
- * an undetermined time in the future.
- * <p>
- * Note that the fail-fast behavior of an iterator cannot be guaranteed
- * as it is, generally speaking, impossible to make any hard guarantees in the
- * presence of unsynchronized concurrent modification. Fail-fast iterators
- * throw <code>ConcurrentModificationException</code> on a best-effort basis.
- * Therefore, it would be wrong to write a program that depended on this
- * exception for its correctness: <em>the fail-fast behavior of iterators
- * should be used only to detect bugs.</em>
- *
- * @param <E> the type of elements maintained by the bag
- *
- * @see Collection
- * @see Bag
- * @see SynchronizedBag
- * @see Collections#synchronizedCollection(Collection)
- * @see IdentityHashBag
- */
-public class HashBag<E>
- extends AbstractCollection<E>
- implements Bag<E>, Cloneable, Serializable
-{
- /** The hash table. Resized as necessary. Length MUST Always be a power of two. */
- transient Entry<E>[] table;
-
- /** The total number of entries in the bag. */
- transient int size = 0;
-
- /** The number of UNIQUE entries in the bag. */
- transient int uniqueCount = 0;
-
- /**
- * The hash table is rehashed when its size exceeds this threshold. (The
- * value of this field is <code>(int) (capacity * loadFactor)</code>.)
- *
- * @serial
- */
- private int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- private final float loadFactor;
-
- /**
- * The number of times this bag has been structurally modified.
- * Structural modifications are those that change the number of entries in
- * the bag or otherwise modify its internal structure (e.g. rehash).
- * This field is used to make iterators on this bag fail-fast.
- *
- * @see java.util.ConcurrentModificationException
- */
- transient int modCount = 0;
-
- /**
- * The default initial capacity - MUST be a power of two.
- */
- private static final int DEFAULT_INITIAL_CAPACITY = 16;
-
- /**
- * The maximum capacity, used if a higher value is implicitly specified
- * by either of the constructors with arguments.
- * MUST be a power of two <= (1 << 30).
- */
- private static final int MAXIMUM_CAPACITY = 1 << 30;
-
- /**
- * The load factor used when none specified in constructor.
- */
- private static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
- /**
- * Construct a new, empty bag with the
- * default capacity, which is 16, and load factor, which is 0.75.
- */
- public HashBag() {
- this(DEFAULT_INITIAL_CAPACITY);
- }
-
- /**
- * Construct a new, empty bag with the specified initial capacity
- * and the default load factor, which is 0.75.
- *
- * @param initialCapacity the initial capacity
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero
- */
- public HashBag(int initialCapacity) {
- this(initialCapacity, DEFAULT_LOAD_FACTOR, false); // false = do not validate parms
- }
-
- /**
- * Construct a new, empty bag with
- * the specified initial capacity and load factor.
- *
- * @param initialCapacity the initial capacity
- * @param loadFactor the load factor
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero or if the load factor is non-positive
- */
- public HashBag(int initialCapacity, float loadFactor) {
- this(initialCapacity, loadFactor, true); // true = validate parms
- }
-
- private HashBag(int initialCapacity, float loadFactor, boolean validateParms) {
- super();
- int capacity = initialCapacity;
- if (validateParms) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Illegal Initial Capacity: " + capacity); //$NON-NLS-1$
- }
- if (capacity > MAXIMUM_CAPACITY) {
- capacity = MAXIMUM_CAPACITY;
- }
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load factor: " + loadFactor); //$NON-NLS-1$
- }
-
- // find a power of 2 >= 'initialCapacity'
- capacity = 1;
- while (capacity < initialCapacity) {
- capacity <<= 1;
- }
- }
-
- this.loadFactor = loadFactor;
- this.table = this.buildTable(capacity);
- this.threshold = (int) (capacity * loadFactor);
- }
-
- /**
- * Construct a new bag containing the elements in the specified
- * collection. The bag's load factor will be the default, which is 0.75,
- * and its initial capacity will be sufficient to hold all the elements in
- * the specified collection.
- *
- * @param c the collection whose elements are to be placed into this bag.
- */
- public HashBag(Collection<? extends E> c) {
- this(Math.max((int) (c.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR);
- this.addAll_(c);
- }
-
- /**
- * Return a hash for the specified object.
- */
- private int hash(Object o) {
- return (o == null) ? 0 : this.tweakHash(o.hashCode());
- }
-
- /**
- * Tweak the specified hash, to defend against poor implementations
- * of {@link Object#hashCode()}.
- */
- private int tweakHash(int h) {
- h ^= (h >>> 20) ^ (h >>> 12);
- return h ^ (h >>> 7) ^ (h >>> 4);
- }
-
- /**
- * Return the index for the specified hash.
- */
- private int index(int hash) {
- return this.index(hash, this.table.length);
- }
-
- /**
- * Return the index for the specified hash
- * within a table with the specified length.
- */
- int index(int hash, int length) {
- return hash & (length - 1);
- }
-
- /**
- * Internal {@link #addAll(Collection)} for construction and cloning.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void addAll_(Iterable<? extends E> c) {
- for (E e : c) {
- this.add_(e);
- }
- }
-
- /**
- * Internal {@link #add(Object)} for construction and cloning.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void add_(E o) {
- this.add_(o, 1);
- }
-
- /**
- * Internal {@link #add(Object, int)} for construction, cloning, and serialization.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void add_(E o, int cnt) {
- int hash = this.hash(o);
- int index = this.index(hash);
- for (Entry<E> e = this.table[index]; e != null; e = e.next) {
- Object eo;
- if ((e.hash == hash) && (((eo = e.object) == o) || ((o != null) && o.equals(eo)))) {
- e.count += cnt;
- this.size += cnt;
- return;
- }
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, this.table[index]);
- this.table[index] = e;
- this.size += cnt;
- this.uniqueCount++;
- }
-
- /**
- * This implementation simply returns the maintained size.
- */
- @Override
- public int size() {
- return this.size;
- }
-
- /**
- * This implementation simply compares the maintained size to zero.
- */
- @Override
- public boolean isEmpty() {
- return this.size == 0;
- }
-
- /**
- * Search for the object's entry in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- private Entry<E> getEntry(Object o) {
- int hash = this.hash(o);
- for (Entry<E> e = this.table[this.index(hash)]; e != null; e = e.next) {
- Object eo;
- if ((e.hash == hash) && (((eo = e.object) == o) || ((o != null) && o.equals(eo)))) {
- return e;
- }
- }
- return null;
- }
-
- @Override
- public boolean contains(Object o) {
- return this.getEntry(o) != null;
- }
-
- public int count(Object o) {
- Entry<E> e = this.getEntry(o);
- return (e == null) ? 0 : e.count;
- }
-
- /**
- * Rehash the contents of the bag into a new hash table
- * with a larger capacity. This method is called when the
- * number of different elements in the bag exceeds its
- * capacity and load factor.
- */
- private void rehash() {
- Entry<E>[] oldTable = this.table;
- int oldCapacity = oldTable.length;
-
- if (oldCapacity == MAXIMUM_CAPACITY) {
- this.threshold = Integer.MAX_VALUE;
- return;
- }
-
- int newCapacity = 2 * oldCapacity;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- for (int i = oldCapacity; i-- > 0; ) {
- for (Entry<E> old = oldTable[i]; old != null; ) {
- Entry<E> e = old;
- old = old.next;
-
- int index = this.index(e.hash, newCapacity);
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
-
- this.table = newTable;
- this.threshold = (int) (newCapacity * this.loadFactor);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean add(E o) {
- return this.add(o, 1);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- public boolean add(E o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- this.modCount++;
- int hash = this.hash(o);
- int index = this.index(hash);
-
- // if the object is already in the bag, simply bump its count
- for (Entry<E> e = this.table[index]; e != null; e = e.next) {
- Object eo;
- if ((e.hash == hash) && (((eo = e.object) == o) || ((o != null) && o.equals(eo)))) {
- e.count += cnt;
- this.size += cnt;
- return true;
- }
- }
-
- // rehash the table if we are going to exceed the threshold
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- index = this.index(hash); // need to re-calculate the index
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, this.table[index]);
- this.table[index] = e;
- this.size += cnt;
- this.uniqueCount++;
- return true;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings({ "rawtypes", "unchecked" } )
- private Entry<E> buildEntry(int hash, Object o, int cnt, Entry next) {
- return new Entry<E>(hash, (E) o, cnt, (Entry<E>) next);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean remove(Object o) {
- return this.remove(o, 1);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- public boolean remove(Object o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- int hash = this.hash(o);
- int index = this.index(hash);
-
- for (Entry<E> e = this.table[index], prev = null; e != null; prev = e, e = e.next) {
- Object eo;
- if ((e.hash == hash) && (((eo = e.object) == o) || ((o != null) && o.equals(eo)))) {
- this.modCount++;
- cnt = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt;
- // if we are removing the last element(s), remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- this.table[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.size -= cnt;
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * This implementation simply clears out all of the hash table buckets.
- */
- @Override
- public void clear() {
- Entry<E>[] tab = this.table;
- this.modCount++;
- for (int i = tab.length; i-- > 0; ) {
- tab[i] = null;
- }
- this.size = 0;
- this.uniqueCount = 0;
- }
-
- /**
- * Returns a shallow copy of this bag: the elements
- * themselves are not cloned.
- *
- * @return a shallow copy of this bag.
- */
- @Override
- public HashBag<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- HashBag<E> clone = (HashBag<E>) super.clone();
- clone.table = this.buildTable(this.table.length);
- clone.size = 0;
- clone.uniqueCount = 0;
- clone.modCount = 0;
- clone.addAll_(this);
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new InternalError();
- }
- }
-
-
- /**
- * Hash table collision list entry.
- */
- private static class Entry<E> implements Bag.Entry<E> {
- final int hash;
- final E object;
- int count;
- Entry<E> next;
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- // ***** Bag.Entry implementation
- public E getElement() {
- return this.object;
- }
-
- public int getCount() {
- return this.count;
- }
-
- public int setCount(int count) {
- if (count <= 0) {
- throw new IllegalArgumentException("count must be greater than zero: " + count); //$NON-NLS-1$
- }
- int old = this.count;
- this.count = count;
- return old;
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry<?>)) {
- return false;
- }
- @SuppressWarnings("rawtypes")
- Bag.Entry e = (Bag.Entry) o;
- return (this.count == e.getCount()) &&
- Tools.valuesAreEqual(this.object, e.getElement());
- }
-
- @Override
- public int hashCode() {
- E o = this.object;
- return (o == null) ? 0 : (this.count * o.hashCode());
- }
-
- @Override
- public String toString() {
- return this.object + "=>" + this.count; //$NON-NLS-1$
- }
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- return (this.size == 0) ? EMPTY_ITERATOR : new HashIterator();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<E> uniqueIterator() {
- return (this.size == 0) ? EMPTY_ITERATOR : new UniqueIterator();
- }
-
- public int uniqueCount() {
- return this.uniqueCount;
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Bag.Entry<E>> entries() {
- return (this.size == 0) ? EMPTY_ITERATOR : new EntryIterator();
- }
-
-
- /**
- * Empty iterator that does just about nothing.
- */
- @SuppressWarnings("rawtypes")
- private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- @SuppressWarnings("rawtypes")
- private static class EmptyIterator implements Iterator {
-
- EmptyIterator() {
- super();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new IllegalStateException();
- }
- }
-
-
- private class HashIterator implements Iterator<E> {
- private int index = HashBag.this.table.length; // start at the end of the table
- private Entry<E> nextEntry = null;
- private int nextEntryCount = 0;
- private Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = HashBag.this.modCount;
-
- HashIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = HashBag.this.table;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public E next() {
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = HashBag.this.table;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntryCount++;
- if (this.nextEntryCount == e.count) {
- this.nextEntry = e.next;
- this.nextEntryCount = 0;
- }
- return e.object;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- int slot = HashBag.this.index(this.lastReturnedEntry.hash, HashBag.this.table.length);
- for (Entry<E> e = HashBag.this.table[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- HashBag.this.modCount++;
- this.expectedModCount++;
- e.count--;
- if (e.count == 0) {
- // if we are removing the last one, remove the entry from the table
- if (prev == null) {
- HashBag.this.table[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- HashBag.this.uniqueCount--;
- } else {
- // slide back the count to account for the just-removed element
- this.nextEntryCount--;
- }
- HashBag.this.size--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class EntryIterator implements Iterator<Entry<E>> {
- private int index = HashBag.this.table.length; // start at the end of the table
- private Entry<E> nextEntry = null;
- private Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = HashBag.this.modCount;
-
- EntryIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = HashBag.this.table;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public Entry<E> next() {
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = HashBag.this.table;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntry = e.next;
- return e;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (HashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- int slot = HashBag.this.index(this.lastReturnedEntry.hash, HashBag.this.table.length);
- for (Entry<E> e = HashBag.this.table[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- HashBag.this.modCount++;
- this.expectedModCount++;
- // remove the entry from the table
- if (prev == null) {
- HashBag.this.table[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- HashBag.this.uniqueCount--;
- HashBag.this.size -= this.lastReturnedEntry.count;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class UniqueIterator implements Iterator<E> {
- private EntryIterator entryIterator = new EntryIterator();
-
- UniqueIterator() {
- super();
- }
-
- public boolean hasNext() {
- return this.entryIterator.hasNext();
- }
-
- public E next() {
- return this.entryIterator.next().object;
- }
-
- public void remove() {
- this.entryIterator.remove();
- }
-
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ( ! (o instanceof Bag<?>)) {
- return false;
- }
- @SuppressWarnings("unchecked")
- Bag<E> b = (Bag<E>) o;
- if (b.size() != this.size()) {
- return false;
- }
- if (b.uniqueCount() != this.uniqueCount()) {
- return false;
- }
- for (Iterator<Bag.Entry<E>> stream = b.entries(); stream.hasNext(); ) {
- Bag.Entry<E> entry = stream.next();
- if (entry.getCount() != this.count(entry.getElement())) {
- return false;
- }
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (E o : this) {
- if (o != null) {
- h += o.hashCode();
- }
- }
- return h;
- }
-
- /**
- * Save the state of this bag to a stream (i.e. serialize it).
- *
- * @serialData Emit the capacity of the bag (int),
- * followed by the number of unique elements in the bag (int),
- * followed by all of the bag's elements (each an Object) and
- * their counts (each an int), in no particular order.
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- // write out the threshold, load factor, and any hidden stuff
- s.defaultWriteObject();
-
- // write out number of buckets
- s.writeInt(this.table.length);
-
- // write out number of unique elements
- s.writeInt(this.uniqueCount);
-
- // write out elements and counts (alternating)
- if (this.uniqueCount > 0) {
- for (Entry<E> entry : this.table) {
- while (entry != null) {
- s.writeObject(entry.object);
- s.writeInt(entry.count);
- entry = entry.next;
- }
- }
- }
- }
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Reconstitute the bag from a stream (i.e. deserialize it).
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- // read in the threshold, loadfactor, and any hidden stuff
- s.defaultReadObject();
-
- // read in number of buckets and allocate the bucket array
- this.table = this.buildTable(s.readInt());
-
- // read in number of unique elements
- int unique = s.readInt();
-
- // read the elements and counts, and put the elements in the bag
- for (int i = 0; i < unique; i++) {
- @SuppressWarnings("unchecked")
- E element = (E) s.readObject();
- int elementCount = s.readInt();
- this.add_(element, elementCount);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
deleted file mode 100644
index ca10caa115..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IdentityHashBag.java
+++ /dev/null
@@ -1,924 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.AbstractCollection;
-import java.util.Collection;
-import java.util.ConcurrentModificationException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-/**
- * This class implements the {@link Bag} interface with a
- * hash table, using object-identity in place of object-equality when
- * comparing elements. In other words, in an <code>IdentityHashBag</code>,
- * two objects <code>o1</code> and <code>o2</code> are considered
- * equal if and only if <code>(o1 == o2)</code>. (In normal {@link Bag}
- * implementations (like {@link HashBag}) two objects <code>o1</code>
- * and <code>o2</code> are considered equal if and only if
- * <code>(o1 == null ? o2 == null : o1.equals(o2))</code>.)
- * <p>
- * <strong>
- * This class is <em>not</em> a general-purpose {@link Bag}
- * implementation! While this class implements the {@link Bag} interface, it
- * intentionally violates {@link Bag}'s general contract, which mandates the
- * use of the <code>equals</code> method when comparing objects. This class is
- * designed for use only in the rare cases wherein object-identity
- * semantics are required.
- * </strong>
- * <p>
- * This class makes no guarantees as to the iteration order of
- * the bag's elements; in particular, it does not guarantee that the order
- * will remain constant over time. This class permits the <code>null</code>
- * element.
- * <p>
- * This class offers constant time performance for the basic operations
- * (<code>add</code>, <code>remove</code>, <code>contains</code> and
- * <code>size</code>), assuming the system identity hash function
- * ({@link System#identityHashCode(Object)}) disperses elements properly
- * among the buckets. Iterating over this bag requires time
- * proportional to the sum of the bag's size (the number of elements) plus the
- * "capacity" of the backing hash table (the number of buckets). Thus, it is
- * important not to set the initial capacity too high (or the load factor too
- * low) if iteration performance is important.
- * <p>
- * <strong>Note that this implementation is not synchronized.</strong> If multiple
- * threads access a bag concurrently, and at least one of the threads modifies
- * the bag, it <em>must</em> be synchronized externally. This is typically
- * accomplished by synchronizing on some object that naturally encapsulates
- * the bag. If no such object exists, the bag should be "wrapped" using the
- * <code>Collections.synchronizedCollection</code> method. This is
- * best done at creation time, to prevent accidental unsynchronized access
- * to the bag:
- * <pre>
- * Collection c = Collections.synchronizedCollection(new IdentityHashBag(...));
- * </pre>
- * <p>
- * The iterators returned by this class's <code>iterator</code> method are
- * <em>fail-fast</em>: if the bag is modified at any time after the iterator is
- * created, in any way except through the iterator's own <code>remove</code>
- * method, the iterator throws a {@link ConcurrentModificationException}.
- * Thus, in the face of concurrent modification, the iterator fails quickly
- * and cleanly, rather than risking arbitrary, non-deterministic behavior at
- * an undetermined time in the future.
- * <p>
- * Note that the fail-fast behavior of an iterator cannot be guaranteed
- * as it is, generally speaking, impossible to make any hard guarantees in the
- * presence of unsynchronized concurrent modification. Fail-fast iterators
- * throw <code>ConcurrentModificationException</code> on a best-effort basis.
- * Therefore, it would be wrong to write a program that depended on this
- * exception for its correctness: <em>the fail-fast behavior of iterators
- * should be used only to detect bugs.</em>
- *
- * @param <E> the type of elements maintained by the bag
- *
- * @see Collection
- * @see Bag
- * @see SynchronizedBag
- * @see Collections#synchronizedCollection(Collection)
- * @see HashBag
- */
-public class IdentityHashBag<E>
- extends AbstractCollection<E>
- implements Bag<E>, Cloneable, Serializable
-{
- /** The hash table. Resized as necessary. Length MUST Always be a power of two. */
- transient Entry<E>[] table;
-
- /** The total number of entries in the bag. */
- transient int size = 0;
-
- /** The number of UNIQUE entries in the bag. */
- transient int uniqueCount = 0;
-
- /**
- * The hash table is rehashed when its size exceeds this threshold. (The
- * value of this field is <code>(int) (capacity * loadFactor)</code>.)
- *
- * @serial
- */
- private int threshold;
-
- /**
- * The load factor for the hash table.
- *
- * @serial
- */
- private final float loadFactor;
-
- /**
- * The number of times this bag has been structurally modified.
- * Structural modifications are those that change the number of entries in
- * the bag or otherwise modify its internal structure (e.g. rehash).
- * This field is used to make iterators on this bag fail-fast.
- *
- * @see java.util.ConcurrentModificationException
- */
- transient int modCount = 0;
-
- /**
- * The default initial capacity - MUST be a power of two.
- */
- private static final int DEFAULT_INITIAL_CAPACITY = 16;
-
- /**
- * The maximum capacity, used if a higher value is implicitly specified
- * by either of the constructors with arguments.
- * MUST be a power of two <= (1 << 30).
- */
- private static final int MAXIMUM_CAPACITY = 1 << 30;
-
- /**
- * The load factor used when none specified in constructor.
- */
- private static final float DEFAULT_LOAD_FACTOR = 0.75f;
-
- /**
- * Construct a new, empty bag with the
- * default capacity, which is 16, and load factor, which is 0.75.
- */
- public IdentityHashBag() {
- this(DEFAULT_INITIAL_CAPACITY);
- }
-
- /**
- * Construct a new, empty bag with the specified initial capacity
- * and the default load factor, which is 0.75.
- *
- * @param initialCapacity the initial capacity
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero
- */
- public IdentityHashBag(int initialCapacity) {
- this(initialCapacity, DEFAULT_LOAD_FACTOR, false); // false = do not validate parms
- }
-
- /**
- * Construct a new, empty bag with
- * the specified initial capacity and load factor.
- *
- * @param initialCapacity the initial capacity
- * @param loadFactor the load factor
- * @throws IllegalArgumentException if the initial capacity is less
- * than zero or if the load factor is non-positive
- */
- public IdentityHashBag(int initialCapacity, float loadFactor) {
- this(initialCapacity, loadFactor, true); // true = validate parms
- }
-
- private IdentityHashBag(int initialCapacity, float loadFactor, boolean validateParms) {
- super();
- int capacity = initialCapacity;
- if (validateParms) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Illegal Initial Capacity: " + capacity); //$NON-NLS-1$
- }
- if (capacity > MAXIMUM_CAPACITY) {
- capacity = MAXIMUM_CAPACITY;
- }
- if (loadFactor <= 0 || Float.isNaN(loadFactor)) {
- throw new IllegalArgumentException("Illegal Load factor: " + loadFactor); //$NON-NLS-1$
- }
-
- // find a power of 2 >= 'initialCapacity'
- capacity = 1;
- while (capacity < initialCapacity) {
- capacity <<= 1;
- }
- }
-
- this.loadFactor = loadFactor;
- this.table = this.buildTable(capacity);
- this.threshold = (int) (capacity * loadFactor);
- }
-
- /**
- * Construct a new bag containing the elements in the specified
- * collection. The bag's load factor will be the default, which is 0.75,
- * and its initial capacity will be sufficient to hold all the elements in
- * the specified collection.
- *
- * @param c the collection whose elements are to be placed into this bag.
- */
- public IdentityHashBag(Collection<? extends E> c) {
- this(Math.max((int) (c.size() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_INITIAL_CAPACITY), DEFAULT_LOAD_FACTOR);
- this.addAll_(c);
- }
-
- /**
- * Return a index for the specified object.
- */
- private int index(Object o) {
- return this.index(this.hash(o));
- }
-
- /**
- * Return a hash for the specified object.
- */
- private int hash(Object o) {
- return (o == null) ? 0 : this.tweakHash(System.identityHashCode(o));
- }
-
- /**
- * Tweak the specified hash.
- */
- private int tweakHash(int h) {
- return h;
-// h ^= (h >>> 20) ^ (h >>> 12);
-// return h ^ (h >>> 7) ^ (h >>> 4);
- }
-
- /**
- * Return the index for the specified hash.
- */
- private int index(int hash) {
- return this.index(hash, this.table.length);
- }
-
- /**
- * Return the index for the specified hash
- * within a table with the specified length.
- */
- int index(int hash, int length) {
- return hash & (length - 1);
- }
-
- /**
- * Internal {@link #addAll(Collection)} for construction and cloning.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void addAll_(Iterable<? extends E> c) {
- for (E e : c) {
- this.add_(e);
- }
- }
-
- /**
- * Internal {@link #add(Object)} for construction and cloning.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void add_(E o) {
- this.add_(o, 1);
- }
-
- /**
- * Internal {@link #add(Object, int)} for construction, cloning, and serialization.
- * (No check for re-hash; no change to mod count; no return value.)
- */
- private void add_(E o, int cnt) {
- int hash = this.hash(o);
- int index = this.index(hash);
- for (Entry<E> e = this.table[index]; e != null; e = e.next) {
- if (e.object == o) {
- e.count += cnt;
- this.size += cnt;
- return;
- }
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, this.table[index]);
- this.table[index] = e;
- this.size += cnt;
- this.uniqueCount++;
- }
-
- /**
- * This implementation simply returns the maintained size.
- */
- @Override
- public int size() {
- return this.size;
- }
-
- /**
- * This implementation simply compares the maintained size to zero.
- */
- @Override
- public boolean isEmpty() {
- return this.size == 0;
- }
-
- /**
- * Search for the object's entry in the hash table by calculating
- * the object's identity hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- private Entry<E> getEntry(Object o) {
- for (Entry<E> e = this.table[this.index(o)]; e != null; e = e.next) {
- if (e.object == o) {
- return e;
- }
- }
- return null;
- }
-
- @Override
- public boolean contains(Object o) {
- return this.getEntry(o) != null;
- }
-
- public int count(Object o) {
- Entry<E> e = this.getEntry(o);
- return (e == null) ? 0 : e.count;
- }
-
- /**
- * Rehash the contents of the bag into a new hash table
- * with a larger capacity. This method is called when the
- * number of different elements in the bag exceeds its
- * capacity and load factor.
- */
- private void rehash() {
- Entry<E>[] oldTable = this.table;
- int oldCapacity = oldTable.length;
-
- if (oldCapacity == MAXIMUM_CAPACITY) {
- this.threshold = Integer.MAX_VALUE;
- return;
- }
-
- int newCapacity = 2 * oldCapacity;
- Entry<E>[] newTable = this.buildTable(newCapacity);
-
- for (int i = oldCapacity; i-- > 0; ) {
- for (Entry<E> old = oldTable[i]; old != null; ) {
- Entry<E> e = old;
- old = old.next;
-
- int index = this.index(e.hash, newCapacity);
- e.next = newTable[index];
- newTable[index] = e;
- }
- }
-
- this.table = newTable;
- this.threshold = (int) (newCapacity * this.loadFactor);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private Entry<E>[] buildTable(int capacity) {
- return new Entry[capacity];
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's identity hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean add(E o) {
- return this.add(o, 1);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's identity hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- public boolean add(E o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- this.modCount++;
- int hash = this.hash(o);
- int index = this.index(hash);
-
- // if the object is already in the bag, simply bump its count
- for (Entry<E> e = this.table[index]; e != null; e = e.next) {
- if (e.object == o) {
- e.count += cnt;
- this.size += cnt;
- return true;
- }
- }
-
- // rehash the table if we are going to exceed the threshold
- if (this.uniqueCount >= this.threshold) {
- this.rehash();
- index = this.index(hash); // need to re-calculate the index
- }
-
- // create the new entry and put it in the table
- Entry<E> e = this.buildEntry(hash, o, cnt, this.table[index]);
- this.table[index] = e;
- this.size += cnt;
- this.uniqueCount++;
- return true;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private Entry<E> buildEntry(int hash, Object o, int cnt, Entry next) {
- return new Entry<E>(hash, (E) o, cnt, (Entry<E>) next);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's identity hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- @Override
- public boolean remove(Object o) {
- return this.remove(o, 1);
- }
-
- /**
- * This implementation searches for the object in the hash table by calculating
- * the object's identity hash code and examining the entries in the corresponding hash
- * table bucket.
- */
- public boolean remove(Object o, int cnt) {
- if (cnt <= 0) {
- return false;
- }
- int index = this.index(o);
-
- for (Entry<E> e = this.table[index], prev = null; e != null; prev = e, e = e.next) {
- if (e.object == o) {
- this.modCount++;
- cnt = (cnt < e.count) ? cnt : e.count;
- e.count -= cnt;
- // if we are removing the last element(s), remove the entry from the table
- if (e.count == 0) {
- if (prev == null) {
- this.table[index] = e.next;
- } else {
- prev.next = e.next;
- }
- this.uniqueCount--;
- }
- this.size -= cnt;
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * This implementation uses object-identity to determine whether the
- * specified collection contains a particular element.
- */
- @Override
- public boolean removeAll(Collection<?> c) {
- return super.removeAll(new IdentityHashBag<Object>(c));
- }
-
- /**
- * This implementation uses object-identity to determine whether the
- * specified collection contains a particular element.
- */
- @Override
- public boolean retainAll(Collection<?> c) {
- return super.retainAll(new IdentityHashBag<Object>(c));
- }
-
- /**
- * This implementation simply clears out all of the hash table buckets.
- */
- @Override
- public void clear() {
- Entry<E>[] tab = this.table;
- this.modCount++;
- for (int i = tab.length; i-- > 0; ) {
- tab[i] = null;
- }
- this.size = 0;
- this.uniqueCount = 0;
- }
-
- /**
- * Returns a shallow copy of this bag: the elements
- * themselves are not cloned.
- *
- * @return a shallow copy of this bag.
- */
- @Override
- public IdentityHashBag<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- IdentityHashBag<E> clone = (IdentityHashBag<E>) super.clone();
- clone.table = this.buildTable(this.table.length);
- clone.size = 0;
- clone.uniqueCount = 0;
- clone.modCount = 0;
- clone.addAll_(this);
- return clone;
- } catch (CloneNotSupportedException e) {
- throw new InternalError();
- }
- }
-
-
- /**
- * Hash table collision list entry.
- */
- private static class Entry<E> implements Bag.Entry<E> {
- final int hash; // cache the hash for re-hashes
- final E object;
- int count;
- Entry<E> next;
-
- Entry(int hash, E object, int count, Entry<E> next) {
- this.hash = hash;
- this.object = object;
- this.count = count;
- this.next = next;
- }
-
- // ***** Bag.Entry implementation
- public E getElement() {
- return this.object;
- }
-
- public int getCount() {
- return this.count;
- }
-
- public int setCount(int count) {
- if (count <= 0) {
- throw new IllegalArgumentException("count must be greater than zero: " + count); //$NON-NLS-1$
- }
- int old = this.count;
- this.count = count;
- return old;
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Bag.Entry<?>)) {
- return false;
- }
- @SuppressWarnings("rawtypes")
- Bag.Entry e = (Bag.Entry) o;
- return (this.object == e.getElement())
- && (this.count == e.getCount());
- }
-
- @Override
- public int hashCode() {
- E o = this.object;
- return (o == null) ? 0 : (this.count * o.hashCode());
- }
-
- @Override
- public String toString() {
- return this.object + "=>" + this.count; //$NON-NLS-1$
- }
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- return (this.size == 0) ? EMPTY_ITERATOR : new HashIterator();
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<E> uniqueIterator() {
- return (this.size == 0) ? EMPTY_ITERATOR : new UniqueIterator();
- }
-
- public int uniqueCount() {
- return this.uniqueCount;
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<Bag.Entry<E>> entries() {
- return (this.size == 0) ? EMPTY_ITERATOR : new EntryIterator();
- }
-
-
- /**
- * Empty iterator that does just about nothing.
- */
- @SuppressWarnings("rawtypes")
- private static final Iterator EMPTY_ITERATOR = new EmptyIterator();
-
- @SuppressWarnings("rawtypes")
- private static class EmptyIterator implements Iterator {
-
- EmptyIterator() {
- super();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public Object next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new IllegalStateException();
- }
- }
-
-
- private class HashIterator implements Iterator<E> {
- private int index = IdentityHashBag.this.table.length; // start at the end of the table
- private Entry<E> nextEntry = null;
- private int nextEntryCount = 0;
- private Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = IdentityHashBag.this.modCount;
-
- HashIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = IdentityHashBag.this.table;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public E next() {
- if (IdentityHashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = IdentityHashBag.this.table;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntryCount++;
- if (this.nextEntryCount == e.count) {
- this.nextEntry = e.next;
- this.nextEntryCount = 0;
- }
- return e.object;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (IdentityHashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- int slot = IdentityHashBag.this.index(this.lastReturnedEntry.hash, IdentityHashBag.this.table.length);
- for (Entry<E> e = IdentityHashBag.this.table[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- IdentityHashBag.this.modCount++;
- this.expectedModCount++;
- e.count--;
- if (e.count == 0) {
- // if we are removing the last one, remove the entry from the table
- if (prev == null) {
- IdentityHashBag.this.table[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- IdentityHashBag.this.uniqueCount--;
- } else {
- // slide back the count to account for the just-removed element
- this.nextEntryCount--;
- }
- IdentityHashBag.this.size--;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class EntryIterator implements Iterator<Entry<E>> {
- private int index = IdentityHashBag.this.table.length; // start at the end of the table
- private Entry<E> nextEntry = null;
- private Entry<E> lastReturnedEntry = null;
-
- /**
- * The modCount value that the iterator believes that the backing
- * bag should have. If this expectation is violated, the iterator
- * has detected a concurrent modification.
- */
- private int expectedModCount = IdentityHashBag.this.modCount;
-
- EntryIterator() {
- super();
- }
-
- public boolean hasNext() {
- Entry<E> e = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = IdentityHashBag.this.table;
- // Use locals for faster loop iteration
- while ((e == null) && (i > 0)) {
- e = tab[--i]; // move backwards through the table
- }
- this.nextEntry = e;
- this.index = i;
- return e != null;
- }
-
- public Entry<E> next() {
- if (IdentityHashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- Entry<E> et = this.nextEntry;
- int i = this.index;
- Entry<E>[] tab = IdentityHashBag.this.table;
- // Use locals for faster loop iteration
- while ((et == null) && (i > 0)) {
- et = tab[--i]; // move backwards through the table
- }
- this.nextEntry = et;
- this.index = i;
- if (et == null) {
- throw new NoSuchElementException();
- }
- Entry<E> e = this.lastReturnedEntry = this.nextEntry;
- this.nextEntry = e.next;
- return e;
- }
-
- public void remove() {
- if (this.lastReturnedEntry == null) {
- throw new IllegalStateException();
- }
- if (IdentityHashBag.this.modCount != this.expectedModCount) {
- throw new ConcurrentModificationException();
- }
- int slot = IdentityHashBag.this.index(this.lastReturnedEntry.hash, IdentityHashBag.this.table.length);
- for (Entry<E> e = IdentityHashBag.this.table[slot], prev = null; e != null; prev = e, e = e.next) {
- if (e == this.lastReturnedEntry) {
- IdentityHashBag.this.modCount++;
- this.expectedModCount++;
- // remove the entry from the table
- if (prev == null) {
- IdentityHashBag.this.table[slot] = e.next;
- } else {
- prev.next = e.next;
- }
- IdentityHashBag.this.uniqueCount--;
- IdentityHashBag.this.size -= this.lastReturnedEntry.count;
- this.lastReturnedEntry = null; // it cannot be removed again
- return;
- }
- }
- throw new ConcurrentModificationException();
- }
-
- }
-
-
- private class UniqueIterator implements Iterator<E> {
- private EntryIterator entryIterator = new EntryIterator();
-
- UniqueIterator() {
- super();
- }
-
- public boolean hasNext() {
- return this.entryIterator.hasNext();
- }
-
- public E next() {
- return this.entryIterator.next().object;
- }
-
- public void remove() {
- this.entryIterator.remove();
- }
-
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- } else if (o instanceof IdentityHashBag<?>) {
- @SuppressWarnings("unchecked")
- IdentityHashBag<E> b = (IdentityHashBag<E>) o;
- if (b.size() != this.size()) {
- return false;
- }
- if (b.uniqueCount() != this.uniqueCount()) {
- return false;
- }
- for (Iterator<Bag.Entry<E>> stream = b.entries(); stream.hasNext(); ) {
- Bag.Entry<E> entry = stream.next();
- if (entry.getCount() != this.count(entry.getElement())) {
- return false;
- }
- }
- return true;
- } else {
- return this.equals_(o);
- }
-// } else if (o instanceof Bag<?>) {
-// // hmmm...
-// return new HashBag<Object>(this).equals(o);
-// } else {
-// return false;
-// }
- }
-
- private boolean equals_(Object o) {
- // hmmm...
- return (o instanceof Bag<?>) &&
- new HashBag<Object>(this).equals(o);
- }
-
- @Override
- public int hashCode() {
- int h = 0;
- for (E o : this) {
- h += System.identityHashCode(o);
- }
- return h;
- }
-
- /**
- * Save the state of this bag to a stream (i.e. serialize it).
- *
- * @serialData Emit the capacity of the bag (int),
- * followed by the number of unique elements in the bag (int),
- * followed by all of the bag's elements (each an Object) and
- * their counts (each an int), in no particular order.
- */
- private void writeObject(java.io.ObjectOutputStream s)
- throws java.io.IOException {
- // write out the threshold, load factor, and any hidden stuff
- s.defaultWriteObject();
-
- // write out number of buckets
- s.writeInt(this.table.length);
-
- // write out number of unique elements
- s.writeInt(this.uniqueCount);
-
- // write out elements and counts (alternating)
- if (this.uniqueCount > 0) {
- for (Entry<E> entry : this.table) {
- while (entry != null) {
- s.writeObject(entry.object);
- s.writeInt(entry.count);
- entry = entry.next;
- }
- }
- }
- }
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Reconstitute the bag from a stream (i.e. deserialize it).
- */
- private void readObject(java.io.ObjectInputStream s)
- throws java.io.IOException, ClassNotFoundException {
- // read in the threshold, loadfactor, and any hidden stuff
- s.defaultReadObject();
-
- // read in number of buckets and allocate the bucket array
- this.table = this.buildTable(s.readInt());
-
- // read in number of unique elements
- int unique = s.readInt();
-
- // read the elements and counts, and put the elements in the bag
- for (int i = 0; i < unique; i++) {
- @SuppressWarnings("unchecked")
- E element = (E) s.readObject();
- int elementCount = s.readInt();
- this.add_(element, elementCount);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IntReference.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IntReference.java
deleted file mode 100644
index f3bf9df0d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/IntReference.java
+++ /dev/null
@@ -1,297 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * This class can be used wherever a mutable integer object is needed.
- * It is a cross between an <code>int</code> and an {@link Integer}.
- * It can be stored in a standard container (e.g. {@link java.util.Collection})
- * but can be modified. It is also useful passing a value that can be changed
- * by the recipient.
- *
- * @see SynchronizedInt
- */
-public final class IntReference
- implements Comparable<IntReference>, Cloneable, Serializable
-{
- /** Backing <code>int</code>. */
- private volatile int value = 0;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a <code>int</code> reference with the specified initial value.
- */
- public IntReference(int count) {
- super();
- this.value = count;
- }
-
- /**
- * Construct a <code>int</code> reference with an initial value of zero.
- */
- public IntReference() {
- this(0);
- }
-
-
- // ********** methods **********
-
- /**
- * Return the current value.
- */
- public int getValue() {
- return this.value;
- }
-
- /**
- * Return whether the current value is equal to the specified value.
- */
- public boolean equals(int v) {
- return this.value == v;
- }
-
- /**
- * Return whether the current value is not equal to the specified value.
- */
- public boolean notEquals(int v) {
- return this.value != v;
- }
-
- /**
- * Return whether the current value is zero.
- */
- public boolean isZero() {
- return this.value == 0;
- }
-
- /**
- * Return whether the current value is not zero.
- */
- public boolean isNotZero() {
- return this.value != 0;
- }
-
- /**
- * Return whether the current value is greater than the specified value.
- */
- public boolean isGreaterThan(int v) {
- return this.value > v;
- }
-
- /**
- * Return whether the current value is greater than or equal to the
- * specified value.
- */
- public boolean isGreaterThanOrEqual(int v) {
- return this.value >= v;
- }
-
- /**
- * Return whether the current value is less than the specified value.
- */
- public boolean isLessThan(int v) {
- return this.value < v;
- }
-
- /**
- * Return whether the current value is less than or equal to the
- * specified value.
- */
- public boolean isLessThanOrEqual(int v) {
- return this.value <= v;
- }
-
- /**
- * Return whether the current value is positive.
- */
- public boolean isPositive() {
- return this.isGreaterThan(0);
- }
-
- /**
- * Return whether the current value is not positive
- * (i.e. negative or zero).
- */
- public boolean isNotPositive() {
- return this.isLessThanOrEqual(0);
- }
-
- /**
- * Return whether the current value is negative.
- */
- public boolean isNegative() {
- return this.isLessThan(0);
- }
-
- /**
- * Return whether the current value is not negative
- * (i.e. zero or positive).
- */
- public boolean isNotNegative() {
- return this.isGreaterThanOrEqual(0);
- }
-
- /**
- * Set the value. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public int setValue(int value) {
- int old = this.value;
- this.value = value;
- return old;
- }
-
- /**
- * Set the value to the absolute value of the current value.
- * Return the new value.
- */
- public int abs() {
- return this.value = Math.abs(this.value);
- }
-
- /**
- * Set the value to the negative value of the current value.
- * Return the new value.
- */
- public int neg() {
- return this.value = -this.value;
- }
-
- /**
- * Set the value to zero. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public int setZero() {
- return this.setValue(0);
- }
-
- /**
- * Set the value to the current value plus the specified value.
- * Return the new value.
- */
- public int add(int v) {
- return this.value += v;
- }
-
- /**
- * Increment and return the value.
- */
- public int increment() {
- return ++this.value;
- }
-
- /**
- * Set the value to the current value minus the specified value.
- * Return the new value.
- */
- public int subtract(int v) {
- return this.value -= v;
- }
-
- /**
- * Decrement and return the value.
- */
- public int decrement() {
- return --this.value;
- }
-
- /**
- * Set the value to the current value times the specified value.
- * Return the new value.
- */
- public int multiply(int v) {
- return this.value *= v;
- }
-
- /**
- * Set the value to the current value divided by the specified value.
- * Return the new value.
- */
- public int divide(int v) {
- return this.value /= v;
- }
-
- /**
- * Set the value to the remainder of the current value divided by the
- * specified value.
- * Return the new value.
- */
- public int remainder(int v) {
- return this.value %= v;
- }
-
- /**
- * Set the value to the minimum of the current value and the specified value.
- * Return the new value.
- */
- public int min(int v) {
- return this.value = Math.min(this.value, v);
- }
-
- /**
- * Set the value to the maximum of the current value and the specified value.
- * Return the new value.
- */
- public int max(int v) {
- return this.value = Math.max(this.value, v);
- }
-
- /**
- * Set the value to the current value raised to the power of the'
- * specified value.
- * Return the new value.
- */
- public int pow(int v) {
- return this.value = (int) Math.pow(this.value, v);
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(IntReference ir) {
- int v = ir.getValue();
- return this.value < v ? -1 : (this.value == v ? 0 : 1);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- return (o instanceof IntReference) &&
- (this.value == ((IntReference) o).value);
- }
-
- @Override
- public int hashCode() {
- return this.value;
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.value) + ']';
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java
deleted file mode 100644
index f8e92adcab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCTools.java
+++ /dev/null
@@ -1,349 +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.utility.internal;
-
-import java.sql.Types;
-import java.util.HashMap;
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * Helper methods for dealing with the JDBC API.
- */
-public final class JDBCTools {
-
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeForClassNamed(String className) {
- JavaToJDBCTypeMapping mapping = javaToJDBCTypeMapping(className);
- return (mapping == null) ? DEFAULT_JDBC_TYPE : mapping.getJDBCType();
- }
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeFor(Class<?> javaClass) {
- return jdbcTypeForClassNamed(javaClass.getName());
- }
-
- /**
- * Return the JDBC type corresponding to the specified class.
- * @see java.sql.Types
- */
- public static JDBCType jdbcTypeFor(JavaType javaType) {
- return jdbcTypeForClassNamed(javaType.getJavaClassName());
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeForJDBCTypeNamed(String jdbcTypeName) {
- JDBCToJavaTypeMapping mapping = jdbcToJavaTypeMapping(jdbcTypeName);
- return (mapping == null) ? DEFAULT_JAVA_TYPE : mapping.getJavaType();
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeFor(JDBCType jdbcType) {
- return javaTypeForJDBCTypeNamed(jdbcType.name());
- }
-
- /**
- * Return the Java type corresponding to the specified JDBC type.
- * @see java.sql.Types
- */
- public static JavaType javaTypeForJDBCTypeCode(int jdbcTypeCode) {
- return javaTypeFor(JDBCType.type(jdbcTypeCode));
- }
-
-
- // ********** internal stuff **********
-
-
- // ********** JDBC => Java **********
-
- /**
- * JDBC => Java type mappings, keyed by JDBC type name (e.g. "VARCHAR")
- */
- private static HashMap<String, JDBCToJavaTypeMapping> JDBC_TO_JAVA_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized
- private static final JavaType DEFAULT_JAVA_TYPE = new SimpleJavaType(java.lang.Object.class); // TODO Object is the default?
-
-
- private static JDBCToJavaTypeMapping jdbcToJavaTypeMapping(String jdbcTypeName) {
- return jdbcToJavaTypeMappings().get(jdbcTypeName);
- }
-
- private static synchronized HashMap<String, JDBCToJavaTypeMapping> jdbcToJavaTypeMappings() {
- if (JDBC_TO_JAVA_TYPE_MAPPINGS == null) {
- JDBC_TO_JAVA_TYPE_MAPPINGS = buildJDBCToJavaTypeMappings();
- }
- return JDBC_TO_JAVA_TYPE_MAPPINGS;
- }
-
- private static HashMap<String, JDBCToJavaTypeMapping> buildJDBCToJavaTypeMappings() {
- HashMap<String, JDBCToJavaTypeMapping> mappings = new HashMap<String, JDBCToJavaTypeMapping>();
- addJDBCToJavaTypeMappingsTo(mappings);
- return mappings;
- }
-
- /**
- * hard code the default mappings from the JDBC types to the
- * appropriate Java types
- * @see java.sql.Types
- * see "JDBC 3.0 Specification" Appendix B
- */
- private static void addJDBCToJavaTypeMappingsTo(HashMap<String, JDBCToJavaTypeMapping> mappings) {
- addJDBCToJavaTypeMappingTo(Types.ARRAY, java.sql.Array.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BIGINT, long.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BIT, boolean.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BLOB, java.sql.Blob.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.BOOLEAN, boolean.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.CHAR, java.lang.String.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.CLOB, java.sql.Clob.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DATALINK, java.net.URL.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DATE, java.sql.Date.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DECIMAL, java.math.BigDecimal.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.DISTINCT, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.DOUBLE, double.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.FLOAT, double.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.INTEGER, int.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.JAVA_OBJECT, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.LONGVARBINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.LONGVARCHAR, java.lang.String.class, mappings);
- // not sure why this is defined in java.sql.Types
-// addJDBCToJavaTypeMappingTo(Types.NULL, java.lang.Object.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.NUMERIC, java.math.BigDecimal.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.OTHER, java.lang.Object.class, mappings); // ???
- addJDBCToJavaTypeMappingTo(Types.REAL, float.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.REF, java.sql.Ref.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.SMALLINT, short.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.STRUCT, java.sql.Struct.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TIME, java.sql.Time.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TIMESTAMP, java.sql.Timestamp.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.TINYINT, byte.class, mappings);
- addJDBCToJavaTypeMappingTo(Types.VARBINARY, byte[].class, mappings);
- addJDBCToJavaTypeMappingTo(Types.VARCHAR, java.lang.String.class, mappings);
- }
-
- private static void addJDBCToJavaTypeMappingTo(int jdbcTypeCode, Class<?> javaClass, HashMap<String, JDBCToJavaTypeMapping> mappings) {
- // check for duplicates
- JDBCType jdbcType = JDBCType.type(jdbcTypeCode);
- Object prev = mappings.put(jdbcType.name(), buildJDBCToJavaTypeMapping(jdbcType, javaClass));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate JDBC type: " + jdbcType.name()); //$NON-NLS-1$
- }
- }
-
- private static JDBCToJavaTypeMapping buildJDBCToJavaTypeMapping(JDBCType jdbcType, Class<?> javaClass) {
- return new JDBCToJavaTypeMapping(jdbcType, new SimpleJavaType(javaClass));
- }
-
-
- // ********** Java => JDBC **********
-
- /**
- * Java => JDBC type mappings, keyed by Java class name (e.g. "java.lang.Object")
- */
- private static HashMap<String, JavaToJDBCTypeMapping> JAVA_TO_JDBC_TYPE_MAPPINGS; // pseudo 'final' - lazy-initialized
- private static final JDBCType DEFAULT_JDBC_TYPE = JDBCType.type(Types.VARCHAR); // TODO VARCHAR is the default?
-
-
- private static JavaToJDBCTypeMapping javaToJDBCTypeMapping(String className) {
- return javaToJDBCTypeMappings().get(className);
- }
-
- private static synchronized HashMap<String, JavaToJDBCTypeMapping> javaToJDBCTypeMappings() {
- if (JAVA_TO_JDBC_TYPE_MAPPINGS == null) {
- JAVA_TO_JDBC_TYPE_MAPPINGS = buildJavaToJDBCTypeMappings();
- }
- return JAVA_TO_JDBC_TYPE_MAPPINGS;
- }
-
- private static HashMap<String, JavaToJDBCTypeMapping> buildJavaToJDBCTypeMappings() {
- HashMap<String, JavaToJDBCTypeMapping> mappings = new HashMap<String, JavaToJDBCTypeMapping>();
- addJavaToJDBCTypeMappingsTo(mappings);
- return mappings;
- }
-
- /**
- * hard code the default mappings from the Java types to the
- * appropriate JDBC types
- * @see java.sql.Types
- * see "JDBC 3.0 Specification" Appendix B
- */
- private static void addJavaToJDBCTypeMappingsTo(HashMap<String, JavaToJDBCTypeMapping> mappings) {
- // primitives
- addJavaToJDBCTypeMappingTo(boolean.class, Types.BIT, mappings);
- addJavaToJDBCTypeMappingTo(byte.class, Types.TINYINT, mappings);
- addJavaToJDBCTypeMappingTo(double.class, Types.DOUBLE, mappings);
- addJavaToJDBCTypeMappingTo(float.class, Types.REAL, mappings);
- addJavaToJDBCTypeMappingTo(int.class, Types.INTEGER, mappings);
- addJavaToJDBCTypeMappingTo(long.class, Types.BIGINT, mappings);
- addJavaToJDBCTypeMappingTo(short.class, Types.SMALLINT, mappings);
-
- // reference classes
- addJavaToJDBCTypeMappingTo(java.lang.Boolean.class, Types.BIT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Byte.class, Types.TINYINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Double.class, Types.DOUBLE, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Float.class, Types.REAL, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Integer.class, Types.INTEGER, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Long.class, Types.BIGINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Short.class, Types.SMALLINT, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.String.class, Types.VARCHAR, mappings);
- addJavaToJDBCTypeMappingTo(java.math.BigDecimal.class, Types.NUMERIC, mappings);
- addJavaToJDBCTypeMappingTo(java.net.URL.class, Types.DATALINK, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Array.class, Types.ARRAY, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Blob.class, Types.BLOB, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Clob.class, Types.CLOB, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Date.class, Types.DATE, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Ref.class, Types.REF, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Struct.class, Types.STRUCT, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Time.class, Types.TIME, mappings);
- addJavaToJDBCTypeMappingTo(java.sql.Timestamp.class, Types.TIMESTAMP, mappings);
-
- // arrays
- addJavaToJDBCTypeMappingTo(byte[].class, Types.VARBINARY, mappings);
- addJavaToJDBCTypeMappingTo(java.lang.Byte[].class, Types.VARBINARY, mappings);
- }
-
- private static void addJavaToJDBCTypeMappingTo(Class<?> javaClass, int jdbcTypeCode, HashMap<String, JavaToJDBCTypeMapping> mappings) {
- // check for duplicates
- Object prev = mappings.put(javaClass.getName(), buildJavaToJDBCTypeMapping(javaClass, jdbcTypeCode));
- if (prev != null) {
- throw new IllegalArgumentException("duplicate Java class: " + ((JavaToJDBCTypeMapping) prev).getJavaType().declaration()); //$NON-NLS-1$
- }
- }
-
- private static JavaToJDBCTypeMapping buildJavaToJDBCTypeMapping(Class<?> javaClass, int jdbcTypeCode) {
- return new JavaToJDBCTypeMapping(new SimpleJavaType(javaClass), JDBCType.type(jdbcTypeCode));
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private JDBCTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- // ********** member classes **********
-
- /**
- * JDBC => Java
- */
- static class JDBCToJavaTypeMapping {
- private final JDBCType jdbcType;
- private final JavaType javaType;
-
- JDBCToJavaTypeMapping(JDBCType jdbcType, JavaType javaType) {
- super();
- this.jdbcType = jdbcType;
- this.javaType = javaType;
- }
-
- public JDBCType getJDBCType() {
- return this.jdbcType;
- }
-
- public JavaType getJavaType() {
- return this.javaType;
- }
-
- public boolean maps(int jdbcTypeCode) {
- return this.jdbcType.code() == jdbcTypeCode;
- }
-
- public boolean maps(String jdbcTypeName) {
- return this.jdbcType.name().equals(jdbcTypeName);
- }
-
- public boolean maps(JDBCType type) {
- return this.jdbcType == type;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuilder sb) {
- this.jdbcType.appendTo(sb);
- sb.append(" => "); //$NON-NLS-1$
- this.javaType.appendDeclarationTo(sb);
- }
-
- }
-
- /**
- * Java => JDBC
- */
- static class JavaToJDBCTypeMapping {
- private final JavaType javaType;
- private final JDBCType jdbcType;
-
- JavaToJDBCTypeMapping(JavaType javaType, JDBCType jdbcType) {
- super();
- this.javaType = javaType;
- this.jdbcType = jdbcType;
- }
-
- public JavaType getJavaType() {
- return this.javaType;
- }
-
- public JDBCType getJDBCType() {
- return this.jdbcType;
- }
-
- public boolean maps(JavaType jt) {
- return this.javaType.equals(jt);
- }
-
- public boolean maps(String elementTypeName, int arrayDepth) {
- return this.javaType.equals(elementTypeName, arrayDepth);
- }
-
- public boolean maps(String javaClassName) {
- return this.javaType.describes(javaClassName);
- }
-
- public boolean maps(Class<?> javaClass) {
- return this.javaType.describes(javaClass);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- this.appendTo(sb);
- return sb.toString();
- }
-
- public void appendTo(StringBuilder sb) {
- this.javaType.appendDeclarationTo(sb);
- sb.append(" => "); //$NON-NLS-1$
- this.jdbcType.appendTo(sb);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java
deleted file mode 100644
index 4a15651163..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/JDBCType.java
+++ /dev/null
@@ -1,162 +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.utility.internal;
-
-import java.io.Serializable;
-import java.lang.reflect.Field;
-import java.sql.Types;
-
-/**
- * Associate the Java constant and the JDBC type name.
- * These are derived from java.sql.Types.
- *
- * @see java.sql.Types
- */
-public final class JDBCType
- implements Cloneable, Serializable
-{
-
- /**
- * the constant name (e.g. VARCHAR)
- */
- private final String name;
-
- /**
- * the JDBC code used by JDBC drivers
- */
- private final int code;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a JDBC type with the specified name and type code.
- * This is private because all the possible JDBC types are built and
- * stored in the static array TYPES.
- * @see #types()
- */
- private JDBCType(String name, int code) {
- super();
- this.name = name;
- this.code = code;
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the name of the type, as defined in java.sql.Types.
- */
- public String name() {
- return this.name;
- }
-
-
- /**
- * Return the type code, as defined in java.sql.Types.
- */
- public int code() {
- return this.code;
- }
-
-
- // ********** printing and displaying **********
-
- public void appendTo(StringBuilder sb) {
- sb.append(this.name);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.appendTo(sb);
- sb.append(')');
- return sb.toString();
- }
-
- @Override
- public JDBCType clone() {
- try {
- return (JDBCType) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-
- // ********** static stuff **********
-
- /**
- * all the JDBC type defined in java.sql.Types
- */
- private static JDBCType[] TYPES; // pseudo 'final' - lazy-initialized
-
-
- public synchronized static JDBCType[] types() {
- if (TYPES == null) {
- TYPES = buildTypes();
- }
- return TYPES;
- }
-
- /**
- * Return the JDBC type for the specified type code (e.g. Types.VARCHAR).
- * @see java.sql.Types
- */
- public static JDBCType type(int code) {
- JDBCType[] types = types();
- for (int i = types.length; i-- > 0; ) {
- if (types[i].code() == code) {
- return types[i];
- }
- }
- throw new IllegalArgumentException("invalid JDBC type code: " + code); //$NON-NLS-1$
- }
-
- /**
- * Return the JDBC type for the specified type name (e.g. "VARCHAR").
- * @see java.sql.Types
- */
- public static JDBCType type(String name) {
- JDBCType[] types = types();
- for (int i = types.length; i-- > 0; ) {
- if (types[i].name().equals(name)) {
- return types[i];
- }
- }
- throw new IllegalArgumentException("invalid JDBC type name: " + name); //$NON-NLS-1$
- }
-
- /**
- * build up the JDBC types via reflection
- * @see java.sql.Types
- */
- private static JDBCType[] buildTypes() {
- Field[] fields = Types.class.getDeclaredFields();
- int len = fields.length;
- JDBCType[] types = new JDBCType[len];
- for (int i = len; i-- > 0; ) {
- String name = fields[i].getName();
- int code;
- try {
- code = ((Integer) fields[i].get(null)).intValue();
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex); // shouldn't happen...
- }
- types[i] = new JDBCType(name, code);
- }
- return types;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java
deleted file mode 100644
index e93b78ccd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ListenerList.java
+++ /dev/null
@@ -1,171 +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.utility.internal;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.lang.reflect.Array;
-import java.util.Arrays;
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-
-/**
- * Maintain a thread-safe list of listeners that does not allow adding
- * duplicate listeners or removing non-listeners.
- */
-public class ListenerList<L extends EventListener>
- implements Serializable
-{
- /**
- * We can mark this volatile and not synchronize the read methods because
- * we never change the <em>contents</em> of the array.
- */
- private transient volatile L[] listeners;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a listener list for listeners of the specified type.
- */
- public ListenerList(Class<L> listenerClass) {
- super();
- this.listeners = this.buildListenerArray(listenerClass, 0);
- }
-
- /**
- * Construct a listener list for listeners of the specified type.
- * Add the specified listener to the list.
- */
- public ListenerList(Class<L> listenerClass, L listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listeners = this.buildListenerArray(listenerClass, 1);
- this.listeners[0] = listener;
- }
-
- @SuppressWarnings("unchecked")
- private L[] buildListenerArray(Class<L> listenerClass, int length) {
- return (L[]) Array.newInstance(listenerClass, length);
- }
-
- /**
- * Return the listeners.
- */
- public Iterable<L> getListeners() {
- return new ArrayIterable<L>(this.listeners);
- }
-
- /**
- * Return the number of listeners.
- */
- public int size() {
- return this.listeners.length;
- }
-
- /**
- * Return whether the listener list has no listeners.
- */
- public boolean isEmpty() {
- return this.listeners.length == 0;
- }
-
- /**
- * Add the specified listener to the listener list.
- * Duplicate listeners are not allowed.
- */
- public synchronized void add(L listener) {
- if (listener == null) {
- throw new NullPointerException();
- }
- if (ArrayTools.contains(this.listeners, listener)) {
- throw new IllegalArgumentException("duplicate listener: " + listener); //$NON-NLS-1$
- }
- this.listeners = ArrayTools.add(this.listeners, listener);
- }
-
- /**
- * Remove the specified listener from the listener list.
- * Removing a listener that is not on the list is not allowed.
- */
- public synchronized void remove(L listener) {
- if (listener == null) {
- throw new NullPointerException();
- }
- int index = ArrayTools.indexOf(this.listeners, listener);
- if (index == -1) {
- throw new IllegalArgumentException("unregistered listener: " + listener); //$NON-NLS-1$
- }
- this.listeners = ArrayTools.removeElementAtIndex(this.listeners, index);
- }
-
- /**
- * Clear the listener list.
- */
- public synchronized void clear() {
- this.listeners = ArrayTools.clear(this.listeners);
- }
-
- /**
- * Return the type of listeners held by the listener list.
- */
- @SuppressWarnings("unchecked")
- public Class<L> getListenerType() {
- return (Class<L>) this.listeners.getClass().getComponentType();
- }
-
- @Override
- public String toString() {
- return Arrays.toString(this.listeners);
- }
-
-
- // ********** serialization **********
-
- /**
- * Silently drop any non-serializable listeners.
- */
- private synchronized void writeObject(ObjectOutputStream s) throws IOException {
- // write out any hidden stuff
- s.defaultWriteObject();
-
- @SuppressWarnings("unchecked")
- Class<L> listenerClass = (Class<L>) this.listeners.getClass().getComponentType();
- s.writeObject(listenerClass);
-
- // only write out serializable listeners
- for (L listener : this.listeners) {
- if (listener instanceof Serializable) {
- s.writeObject(listener);
- }
- }
-
- s.writeObject(null);
- }
-
- @SuppressWarnings("unchecked")
- private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- // read in any hidden stuff
- s.defaultReadObject();
-
- Class<L> listenerClass = (Class<L>) s.readObject();
- this.listeners = this.buildListenerArray(listenerClass, 0);
- Object o;
- while ((o = s.readObject()) != null) {
- this.listeners = ArrayTools.add(this.listeners, (L) o);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java
deleted file mode 100644
index 7f1a7c76a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NameTools.java
+++ /dev/null
@@ -1,374 +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.utility.internal;
-
-import java.beans.Introspector;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.SortedSet;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-/**
- * Various helper methods for generating names.
- */
-public final class NameTools {
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are case-sensitive
- * (i.e. "Root" and "root" are both allowed).
- */
- public static String uniqueNameFor(String rootName, Iterator<String> existingNames) {
- return uniqueNameFor(rootName, CollectionTools.set(existingNames));
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are case-sensitive
- * (i.e. "Root" and "root" are both allowed).
- */
- public static String uniqueNameFor(String rootName, Collection<String> existingNames) {
- return uniqueNameFor(rootName, existingNames, rootName);
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are NOT case-sensitive
- * (i.e. "Root" and "root" are NOT both allowed).
- */
- public static String uniqueNameForIgnoreCase(String rootName, Iterator<String> existingNames) {
- return uniqueNameForIgnoreCase(rootName, CollectionTools.set(existingNames));
- }
-
- /**
- * Given a "root" name and a set of existing names, generate a unique
- * name that is either the "root" name or some variation on the "root"
- * name (e.g. "root2", "root3",...). The names are NOT case-sensitive
- * (i.e. "Root" and "root" are NOT both allowed).
- */
- public static String uniqueNameForIgnoreCase(String rootName, Collection<String> existingNames) {
- return uniqueNameFor(rootName, convertToLowerCase(existingNames), rootName.toLowerCase());
- }
-
- /**
- * use the suffixed "template" name to perform the comparisons, but RETURN
- * the suffixed "root" name; this allows case-insensitive comparisons
- * (i.e. the "template" name has been morphed to the same case as
- * the "existing" names, while the "root" name has not, but the "root" name
- * is what the client wants morphed to be unique)
- */
- private static String uniqueNameFor(String rootName, Collection<String> existingNames, String templateName) {
- if ( ! existingNames.contains(templateName)) {
- return rootName;
- }
- String uniqueName = templateName;
- for (int suffix = 2; true; suffix++) {
- if ( ! existingNames.contains(uniqueName + suffix)) {
- return rootName.concat(String.valueOf(suffix));
- }
- }
- }
-
- /**
- * Convert the specified collection of strings to a collection of the same
- * strings converted to lower case.
- */
- private static HashSet<String> convertToLowerCase(Collection<String> strings) {
- HashSet<String> result = new HashSet<String>(strings.size());
- for (String string : strings) {
- result.add(string.toLowerCase());
- }
- return result;
- }
-
- /**
- * Build a fully-qualified name for the specified database object.
- * Variations:
- * catalog.schema.name
- * catalog..name
- * schema.name
- * name
- */
- public static String buildQualifiedDatabaseObjectName(String catalog, String schema, String name) {
- if (name == null) {
- return null;
- }
- if ((catalog == null) && (schema == null)) {
- return name;
- }
-
- StringBuilder sb = new StringBuilder(100);
- if (catalog != null) {
- sb.append(catalog);
- sb.append('.');
- }
- if (schema != null) {
- sb.append(schema);
- }
- sb.append('.');
- sb.append(name);
- return sb.toString();
- }
-
- /**
- * The set of reserved words in the Java programming language.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- @SuppressWarnings("nls")
- public static final String[] JAVA_RESERVED_WORDS = new String[] {
- "abstract",
- "assert", // jdk 1.4
- "boolean",
- "break",
- "byte",
- "case",
- "catch",
- "char",
- "class",
- "const", // unused
- "continue",
- "default",
- "do",
- "double",
- "else",
- "enum", // jdk 1.5
- "extends",
- "false",
- "final",
- "finally",
- "float",
- "for",
- "goto", // unused
- "if",
- "implements",
- "import",
- "instanceof",
- "int",
- "interface",
- "long",
- "native",
- "new",
- "null",
- "package",
- "private",
- "protected",
- "public",
- "return",
- "short",
- "static",
- "strictfp", // jdk 1.2
- "super",
- "switch",
- "synchronized",
- "this",
- "throw",
- "throws",
- "transient",
- "true",
- "try",
- "void",
- "volatile",
- "while"
- };
-
- /**
- * The set of reserved words in the Java programming language.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- public static final SortedSet<String> JAVA_RESERVED_WORDS_SET =
- Collections.unmodifiableSortedSet(CollectionTools.sortedSet(JAVA_RESERVED_WORDS));
-
- /**
- * Return the set of Java programming language reserved words.
- * These words cannot be used as identifiers (i.e. names).
- * http://java.sun.com/docs/books/tutorial/java/nutsandbolts/_keywords.html
- */
- public static Iterator<String> javaReservedWords() {
- return new ArrayIterator<String>(JAVA_RESERVED_WORDS);
- }
-
- /**
- * Return whether the specified string consists of Java identifier
- * characters (but may be a reserved word).
- */
- public static boolean stringConsistsOfJavaIdentifierCharacters(String string) {
- if (string.length() == 0) {
- return false;
- }
- return stringConsistsOfJavaIdentifierCharacters_(string.toCharArray());
- }
-
- /**
- * Return whether the specified string consists of Java identifier
- * characters (but may be a reserved word).
- */
- public static boolean stringConsistsOfJavaIdentifierCharacters(char[] string) {
- if (string.length == 0) {
- return false;
- }
- return stringConsistsOfJavaIdentifierCharacters_(string);
- }
-
- /**
- * The specified string must not be empty.
- */
- private static boolean stringConsistsOfJavaIdentifierCharacters_(char[] string) {
- if ( ! Character.isJavaIdentifierStart(string[0])) {
- return false;
- }
- for (int i = string.length; i-- > 1; ) { // NB: end with 1
- if ( ! Character.isJavaIdentifierPart(string[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string is a valid Java identifier.
- */
- public static boolean stringIsLegalJavaIdentifier(String string) {
- return stringConsistsOfJavaIdentifierCharacters(string)
- && ! JAVA_RESERVED_WORDS_SET.contains(string);
- }
-
- /**
- * Return whether the specified string is a valid Java identifier.
- */
- public static boolean stringIsLegalJavaIdentifier(char[] string) {
- return stringConsistsOfJavaIdentifierCharacters(string)
- && ! JAVA_RESERVED_WORDS_SET.contains(new String(string));
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting an underscore '_' for any invalid characters
- * in the string and appending an underscore '_' to the string if
- * it is a Java reserved word.
- */
- public static String convertToJavaIdentifier(String string) {
- return convertToJavaIdentifier(string, '_');
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting the specified character for any invalid characters
- * in the string and, if necessary, appending the specified character
- * to the string until it is not a Java reserved word.
- */
- public static String convertToJavaIdentifier(String string, char c) {
- if (string.length() == 0) {
- return string;
- }
- if (JAVA_RESERVED_WORDS_SET.contains(string)) {
- // a reserved word is a valid identifier, we just need to tweak it a bit
- checkCharIsJavaIdentifierPart(c);
- return convertToJavaIdentifier(string + c, c);
- }
- char[] array = string.toCharArray();
- return convertToJavaIdentifier_(array, c) ? new String(array) : string;
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting an underscore '_' for any invalid characters
- * in the string and appending an underscore '_' to the string if
- * it is a Java reserved word.
- */
- public static char[] convertToJavaIdentifier(char[] string) {
- return convertToJavaIdentifier(string, '_');
- }
-
- /**
- * Convert the specified string to a valid Java identifier
- * by substituting the specified character for any invalid characters
- * in the string and, if necessary, appending the specified character
- * to the string until it is not a Java reserved word.
- */
- public static char[] convertToJavaIdentifier(char[] string, char c) {
- if (string.length == 0) {
- return string;
- }
- if (JAVA_RESERVED_WORDS_SET.contains(new String(string))) {
- // a reserved word is a valid identifier, we just need to tweak it a bit
- checkCharIsJavaIdentifierPart(c);
- return convertToJavaIdentifier(ArrayTools.add(string, c), c);
- }
- convertToJavaIdentifier_(string, c);
- return string;
- }
-
- /**
- * The specified string must not be empty.
- * Return whether the string was modified.
- */
- private static boolean convertToJavaIdentifier_(char[] string, char c) {
- boolean mod = false;
- if ( ! Character.isJavaIdentifierStart(string[0])) {
- checkCharIsJavaIdentifierStart(c);
- string[0] = c;
- mod = true;
- }
- checkCharIsJavaIdentifierPart(c);
- for (int i = string.length; i-- > 1; ) { // NB: end with 1
- if ( ! Character.isJavaIdentifierPart(string[i])) {
- string[i] = c;
- mod = true;
- }
- }
- return mod;
- }
-
- private static void checkCharIsJavaIdentifierStart(char c) {
- if ( ! Character.isJavaIdentifierStart(c)) {
- throw new IllegalArgumentException("invalid Java identifier start char: '" + c + '\''); //$NON-NLS-1$
- }
- }
-
- private static void checkCharIsJavaIdentifierPart(char c) {
- if ( ! Character.isJavaIdentifierPart(c)) {
- throw new IllegalArgumentException("invalid Java identifier part char: '" + c + '\''); //$NON-NLS-1$
- }
- }
-
- /**
- * Convert the specified method name to a property name.
- */
- public static String convertGetterMethodNameToPropertyName(String methodName) {
- int beginIndex = 0;
- if (methodName.startsWith("get")) { //$NON-NLS-1$
- beginIndex = 3;
- } else if (methodName.startsWith("is")) { //$NON-NLS-1$
- beginIndex = 2;
- } else {
- return methodName; // return method name unchanged?
- }
- return Introspector.decapitalize(methodName.substring(beginIndex));
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private NameTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NonNullBooleanTransformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NonNullBooleanTransformer.java
deleted file mode 100644
index dcb59b97e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NonNullBooleanTransformer.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.utility.internal;
-
-/**
- * A <code>NonNullBooleanTransformer</code> will transform a possibly-null
- * {@link Boolean} to a non-null {@link Boolean}:<ul>
- * <li>When the original {@link Boolean} is <em>not</em> <code>null</code>,
- * the transformer will return it unchanged.
- * <li>When the original {@link Boolean} is <code>null</code>,
- * the transformer will return its client-specified "null value"
- * ({@link Boolean#TRUE} or {@link Boolean#FALSE}).
- * </ul>
- */
-public final class NonNullBooleanTransformer
- implements Transformer<Boolean, Boolean>
-{
- // not null
- private final Boolean nullValue;
-
- /**
- * A {@link Transformer} that will return the original {@link Boolean} when
- * it is non-<code>null</code>; otherwise the {@link Transformer} will return
- * {@link Boolean#TRUE}.
- */
- public static final Transformer<Boolean, Boolean> TRUE = new NonNullBooleanTransformer(Boolean.TRUE);
-
- /**
- * A {@link Transformer} that will return the original {@link Boolean} when
- * it is non-<code>null</code>; otherwise the {@link Transformer} will return
- * {@link Boolean#FALSE}.
- */
- public static final Transformer<Boolean, Boolean> FALSE = new NonNullBooleanTransformer(Boolean.FALSE);
-
- /**
- * Return a transformer that will return the specified value if the original
- * value is <code>null</code>. Throw a {@link NullPointerException} if the
- * specified value is <code>null</code>.
- */
- public Transformer<Boolean, Boolean> valueOf(Boolean b) {
- return valueOf(b.booleanValue());
- }
-
- /**
- * Return a transformer that will return the {@link Boolean} corresponding
- * to the specified value if the original value is <code>null</code>.
- */
- public Transformer<Boolean, Boolean> valueOf(boolean b) {
- return b ? TRUE : FALSE;
- }
-
- /**
- * Ensure only 2 constant versions.
- */
- private NonNullBooleanTransformer(Boolean nullValue) {
- super();
- if (nullValue == null) {
- throw new NullPointerException();
- }
- this.nullValue = nullValue;
- }
-
- public Boolean transform(Boolean b) {
- return (b != null) ? b : this.nullValue;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nullValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotBooleanTransformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotBooleanTransformer.java
deleted file mode 100644
index 998f22a674..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotBooleanTransformer.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.utility.internal;
-
-/**
- * A <code>NotBooleanTransformer</code> will transform a
- * {@link Boolean} to its NOT value:<ul>
- * <li>If the original {@link Boolean} is {@link Boolean#TRUE},
- * the transformer will return {@link Boolean#FALSE}.
- * <li>If the original {@link Boolean} is {@link Boolean#FALSE},
- * the transformer will return {@link Boolean#TRUE}.
- * <li>If the original {@link Boolean} is <code>null</code>,
- * the transformer will return <code>null</code>.
- * </ul>
- */
-public class NotBooleanTransformer
- implements BidiTransformer<Boolean, Boolean>
-{
- public static final BidiTransformer<Boolean, Boolean> INSTANCE = new NotBooleanTransformer();
-
- public static BidiTransformer<Boolean, Boolean> instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private NotBooleanTransformer() {
- super();
- }
-
- public Boolean transform(Boolean b) {
- return (b == null) ? null : BooleanTools.not(b);
- }
-
- public Boolean reverseTransform(Boolean b) {
- return (b == null) ? null : BooleanTools.not(b);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotNullFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotNullFilter.java
deleted file mode 100644
index 386325b160..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NotNullFilter.java
+++ /dev/null
@@ -1,51 +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.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Filter;
-
-/**
- * This filter accepts only non-null objects.
- */
-public final class NotNullFilter<T>
- implements Filter<T>, Serializable
-{
- @SuppressWarnings("rawtypes")
- public static final Filter INSTANCE = new NotNullFilter();
-
- @SuppressWarnings("unchecked")
- public static <R> Filter<R> instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private NotNullFilter() {
- super();
- }
-
- // accept only non-null objects
- public boolean accept(T o) {
- return o != null;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
deleted file mode 100644
index 457485e6d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/NullList.java
+++ /dev/null
@@ -1,153 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * A "null" list is a bit different from an "empty" list: it allows clients to
- * add/remove elements to/from it but never changes. This is useful
- * for passing to methods that require a "collecting parameter" but the
- * client will ignore the resulting "collection".
- */
-public final class NullList<E>
- implements List<E>, Serializable
-{
-
- // singleton
- @SuppressWarnings("rawtypes")
- private static final NullList INSTANCE = new NullList();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <E> List<E> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NullList() {
- super();
- }
-
- public boolean add(E o) {
- return false; // the list did not change
- }
-
- public void add(int index, E element) {
- // ignore
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return false; // the list did not change
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return false; // the list did not change
- }
-
- public void clear() {
- // ignore
- }
-
- public boolean contains(Object o) {
- return false;
- }
-
- public boolean containsAll(Collection<?> c) {
- return c.isEmpty();
- }
-
- public E get(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public int indexOf(Object o) {
- return -1;
- }
-
- public boolean isEmpty() {
- return true;
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- public int lastIndexOf(Object o) {
- return -1;
- }
-
- public ListIterator<E> listIterator() {
- return EmptyListIterator.instance();
- }
-
- public ListIterator<E> listIterator(int index) {
- return EmptyListIterator.instance();
- }
-
- public boolean remove(Object o) {
- return false; // the list did not change
- }
-
- public E remove(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public boolean removeAll(Collection<?> c) {
- return false; // the list did not change
- }
-
- public boolean retainAll(Collection<?> c) {
- return false; // the list did not change
- }
-
- public E set(int index, E element) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public int size() {
- return 0;
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- return this;
- }
-
- private static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public Object[] toArray() {
- return EMPTY_OBJECT_ARRAY;
- }
-
- public <T> T[] toArray(T[] a) {
- return a;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ObjectReference.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ObjectReference.java
deleted file mode 100644
index e294cc1d7e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ObjectReference.java
+++ /dev/null
@@ -1,132 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Provide a container for passing an object that can be changed by the recipient.
- *
- * @see SynchronizedObject
- */
-public class ObjectReference<V>
- implements Cloneable, Serializable
-{
- /** Backing value. */
- private volatile V value;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create an object reference with the specified initial value.
- */
- public ObjectReference(V value) {
- super();
- this.value = value;
- }
-
- /**
- * Create an object reference with an initial value of
- * <code>null</code>.
- */
- public ObjectReference() {
- this(null);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current value.
- */
- public V getValue() {
- return this.value;
- }
-
- /**
- * Return whether the current value is equal to the specified value.
- */
- public boolean valueEquals(V v) {
- return Tools.valuesAreEqual(this.value, v);
- }
-
- /**
- * Return whether the current value is not equal to the specified value.
- */
- public boolean valueNotEqual(V v) {
- return Tools.valuesAreDifferent(this.value, v);
- }
-
- /**
- * Return whether the current value is <code>null</code>.
- */
- public boolean isNull() {
- return this.value == null;
- }
-
- /**
- * Return whether the current value is not <code>null</code>.
- */
- public boolean isNotNull() {
- return this.value != null;
- }
-
- /**
- * Set the value.
- * Return the previous value.
- */
- public V setValue(V value) {
- V old = this.value;
- this.value = value;
- return old;
- }
-
- /**
- * Set the value to <code>null</code>.
- * Return the previous value.
- */
- public V setNull() {
- return this.setValue(null);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public ObjectReference<V> clone() {
- try {
- @SuppressWarnings("unchecked")
- ObjectReference<V> clone = (ObjectReference<V>) super.clone();
- return clone;
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- return (obj instanceof ObjectReference<?>) &&
- Tools.valuesAreEqual(this.value, ((ObjectReference<?>) obj).value);
- }
-
- @Override
- public int hashCode() {
- return (this.value == null) ? 0 : this.value.hashCode();
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.value) + ']';
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Queue.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Queue.java
deleted file mode 100644
index 43dc547f3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Queue.java
+++ /dev/null
@@ -1,75 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.NoSuchElementException;
-
-/**
- * Interface defining the classic queue behavior,
- * without the backdoors allowed by {@link java.util.Queue}.
- *
- * @param <E> the type of elements contained by the queue
- */
-public interface Queue<E> {
-
- /**
- * "Enqueue" the specified item to the tail of the queue.
- */
- void enqueue(E o);
-
- /**
- * "Dequeue" an item from the head of the queue.
- */
- E dequeue();
-
- /**
- * Return the item on the head of the queue
- * without removing it from the queue.
- */
- E peek();
-
- /**
- * Return whether the queue is empty.
- */
- boolean isEmpty();
-
-
- final class Empty<E> implements Queue<E>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Queue INSTANCE = new Empty();
- @SuppressWarnings("unchecked")
- public static <T> Queue<T> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- public void enqueue(E o) {
- throw new UnsupportedOperationException();
- }
- public E dequeue() {
- throw new NoSuchElementException();
- }
- public E peek() {
- throw new NoSuchElementException();
- }
- public boolean isEmpty() {
- return true;
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java
deleted file mode 100644
index 9173ad9c17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Range.java
+++ /dev/null
@@ -1,87 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * This simple container class simply puts a bit of semantics
- * around a pair of numbers.
- */
-public class Range
- implements Cloneable, Serializable
-{
- /** The starting index of the range. */
- public final int start;
-
- /** The ending index of the range. */
- public final int end;
-
- /**
- * The size can be negative if the ending index
- * is less than the starting index.
- */
- public final int size;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct with the specified start and end,
- * both of which are immutable.
- */
- public Range(int start, int end) {
- super();
- this.start = start;
- this.end = end;
- this.size = end - start + 1;
- }
-
- /**
- * Return whether the range includes the specified
- * index.
- */
- public boolean includes(int index) {
- return (this.start <= index) && (index <= this.end);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if ( ! (o instanceof Range)) {
- return false;
- }
- Range otherRange = (Range) o;
- return (this.start == otherRange.start)
- && (this.end == otherRange.end);
- }
-
- @Override
- public int hashCode() {
- return this.start ^ this.end;
- }
-
- @Override
- public Range clone() {
- try {
- return (Range) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public String toString() {
- return '[' + this.start + ", " + this.end + ']'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReflectionTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReflectionTools.java
deleted file mode 100644
index 22bb534cef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReflectionTools.java
+++ /dev/null
@@ -1,1544 +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.utility.internal;
-
-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.ArrayList;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-
-/**
- * Convenience methods related to the <code>java.lang.reflect</code> 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.
- * <p>
- * In most cases, all exceptions are handled and wrapped in
- * {@link java.lang.RuntimeException}s; so these methods should
- * be used when there should be no problems using reflection (i.e.
- * the referenced members are presumably present etc.).
- * <p>
- * There are also a number of methods whose names
- * end with an underscore. These methods declare the expected checked
- * exceptions (e.g. {@link NoSuchMethodException}, {@link NoSuchFieldException}).
- * These methods can be used to probe
- * for methods, fields, etc. that should be present but might not be.
- */
-public final class ReflectionTools {
-
- public static final Class<?>[] ZERO_PARAMETER_TYPES = new Class[0];
- public static final Object[] ZERO_ARGUMENTS = new Object[0];
- private static final String CR = StringTools.CR;
-
- public static final Class<?> VOID_CLASS = void.class;
- public static final Class<java.lang.Void> VOID_WRAPPER_CLASS = java.lang.Void.class;
-
-
- // ********** fields **********
-
- /**
- * Get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Object.getFieldValue(String fieldName)</code>
- */
- public static Object getFieldValue(Object object, String fieldName) {
- try {
- return getFieldValue_(object, fieldName);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(object, fieldName), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(object, fieldName), ex);
- }
- }
-
- /**
- * Get a field value, given the containing object and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Object.getFieldValue(String fieldName)</code>
- */
- public static Object getFieldValue_(Object object, String fieldName)
- throws NoSuchFieldException, IllegalAccessException
- {
- return getField_(object, fieldName).get(object);
- }
-
- /**
- * Get a static field value, given the containing class and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Class.getStaticFieldValue(String fieldName)</code>
- */
- public static Object getStaticFieldValue(Class<?> javaClass, String fieldName) {
- try {
- return getStaticFieldValue_(javaClass, fieldName);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(javaClass, fieldName), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(javaClass, fieldName), ex);
- }
- }
-
- /**
- * Get a static field value, given the containing class and field name.
- * Return its result.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Class.getStaticFieldValue(String fieldName)</code>
- */
- public static Object getStaticFieldValue_(Class<?> javaClass, String fieldName)
- throws NoSuchFieldException, IllegalAccessException
- {
- return getField_(javaClass, fieldName).get(null);
- }
-
- /**
- * Set a field value, given the containing object, field name, and new value.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Object.setFieldValue(String fieldName, Object value)</code>
- */
- public static void setFieldValue(Object object, String fieldName, Object value) {
- try {
- setFieldValue_(object, fieldName, value);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(object, fieldName), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(object, fieldName), ex);
- }
- }
-
- /**
- * Set a field value, given the containing object, field name, and new value.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Object.setFieldValue(String fieldName, Object value)</code>
- */
- public static void setFieldValue_(Object object, String fieldName, Object value)
- throws NoSuchFieldException, IllegalAccessException
- {
- getField_(object, fieldName).set(object, value);
- }
-
- /**
- * Set a static field value, given the containing class, field name, and new value.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Class.setStaticFieldValue(String fieldName, Object value)</code>
- */
- public static void setStaticFieldValue(Class<?> javaClass, String fieldName, Object value) {
- try {
- setStaticFieldValue_(javaClass, fieldName, value);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(javaClass, fieldName), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(javaClass, fieldName), ex);
- }
- }
-
- /**
- * Set a static field value, given the containing class, field name, and new value.
- * Useful for accessing private, package, or protected fields.
- * <p>
- * <code>Class.setStaticFieldValue(String fieldName, Object value)</code>
- */
- public static void setStaticFieldValue_(Class<?> javaClass, String fieldName, Object value)
- throws NoSuchFieldException, IllegalAccessException
- {
- getField_(javaClass, fieldName).set(null, value);
- }
-
- /**
- * 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.
- * Make any private/package/protected field accessible.
- * <p>
- * <code>Object.getField(String fieldName)</code>
- */
- public static Field getField(Object object, String fieldName) {
- try {
- return getField_(object, fieldName);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(object, fieldName), ex);
- }
- }
-
- /**
- * 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.
- * Make any private/package/protected field accessible.
- * <p>
- * <code>Object.getField(String fieldName)</code>
- */
- public static Field getField_(Object object, String fieldName)
- throws NoSuchFieldException
- {
- return getField_(object.getClass(), fieldName);
- }
-
- /**
- * 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.
- * Make any private/package/protected field accessible.
- */
- public static Field getField(Class<?> javaClass, String fieldName) {
- try {
- return getField_(javaClass, fieldName);
- } catch (NoSuchFieldException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedFieldName(javaClass, fieldName), ex);
- }
- }
-
- /**
- * 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.
- * Make any private/package/protected field accessible.
- */
- public static Field getField_(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;
- }
- return getField_(superclass, fieldName); // recurse
- }
- field.setAccessible(true);
- return field;
- }
-
- /**
- * Return all the fields for the
- * specified class, including inherited fields.
- * Make any private/package/protected fields accessible.
- * <p>
- * <code>Class.getAllFields()</code>
- */
- public static Iterable<Field> getAllFields(Class<?> javaClass) {
- ArrayList<Field> fields = new ArrayList<Field>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- addDeclaredFieldsTo(tempClass, fields);
- }
- return fields;
- }
-
- /*
- * Add the declared fields for the specified class
- * to the specified list.
- */
- private static void addDeclaredFieldsTo(Class<?> javaClass, ArrayList<Field> fields) {
- for (Field field : getDeclaredFields(javaClass)) {
- fields.add(field);
- }
- }
-
- /**
- * Return the declared fields for the specified class.
- * Make any private/package/protected fields accessible.
- * <p>
- * <code>Class.getAccessibleDeclaredFields()</code>
- */
- public static Iterable<Field> getDeclaredFields(Class<?> javaClass) {
- Field[] fields = javaClass.getDeclaredFields();
- for (Field field : fields) {
- field.setAccessible(true);
- }
- return new ArrayIterable<Field>(fields);
- }
-
-
- // ********** methods **********
-
- /**
- * Convenience method.
- * Execute a zero-argument method, given the receiver and method name.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName)</code>
- */
- public static Object executeMethod(Object receiver, String methodName) {
- return executeMethod(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Execute a one-argument method, given the receiver,
- * method name, parameter type, and argument.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName, Class<?> parameterType, Object argument)</code>
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?> parameterType, Object argument) {
- return executeMethod(receiver, methodName, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and arguments.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName, Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object executeMethod(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] arguments) {
- return executeMethod(getMethod(receiver, methodName, parameterTypes), receiver, arguments);
- }
-
- /**
- * Execute the specified method, given the receiver and arguments.
- * Return its result.
- * Useful for invoking cached methods.
- */
- public static Object executeMethod(Method method, Object receiver, Object[] arguments) {
- try {
- return method.invoke(receiver, arguments);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + method, ex);
- } catch (InvocationTargetException ex) {
- throw new RuntimeException(method + CR + ex.getTargetException(), ex);
- }
- }
-
- /**
- * Convenience method.
- * Execute a zero-argument method,
- * given the receiver and method name.
- * Return its result.
- * Throw an exception if the method is not defined.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName)</code>
- */
- public static Object executeMethod_(Object receiver, String methodName)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return executeMethod_(receiver, methodName, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Execute a method, given the receiver,
- * method name, parameter type, and argument.
- * Return its result.
- * Throw an exception if the method is not defined.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName, Class<?> parameterType, Object argument)</code>
- */
- public static Object executeMethod_(Object receiver, String methodName, Class<?> parameterType, Object argument)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return executeMethod_(receiver, methodName, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Execute a method, given the receiver,
- * method name, parameter types, and arguments.
- * Return its result.
- * Throw an exception if the method is not defined.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Object.execute(String methodName, Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object executeMethod_(Object receiver, String methodName, Class<?>[] parameterTypes, Object[] arguments)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return getMethod_(receiver, methodName, parameterTypes).invoke(receiver, arguments);
- }
-
- /**
- * 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.
- * <p>
- * <code>Class.executeStaticMethod(String methodName)</code>
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName) {
- return executeStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Execute a static method, given the class,
- * method name, parameter type, and argument.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Class.executeStaticMethod(String methodName, Class<?> parameterType, Object argument)</code>
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterType, Object argument) {
- return executeStaticMethod(javaClass, methodName, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Execute a static method, given the class,
- * method name, parameter types, and arguments.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Class.executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object executeStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] arguments) {
- try {
- return executeStaticMethod_(javaClass, methodName, parameterTypes, arguments);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), ex);
- } catch (InvocationTargetException ex) {
- throw new RuntimeException(buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes) + CR + ex.getTargetException(), ex);
- }
- }
-
- /**
- * 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.
- * <p>
- * <code>Class.executeStaticMethod(String methodName)</code>
- */
- public static Object executeStaticMethod_(Class<?> javaClass, String methodName)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return executeStaticMethod_(javaClass, methodName, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Execute a static method, given the class,
- * method name, parameter type, and argument.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Class.executeStaticMethod(String methodName, Class<?> parameterType, Object argument)</code>
- */
- public static Object executeStaticMethod_(Class<?> javaClass, String methodName, Class<?> parameterType, Object argument)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return executeStaticMethod_(javaClass, methodName, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Execute a static method, given the class,
- * method name, parameter types, and arguments.
- * Return its result.
- * Useful for invoking private, package, or protected methods.
- * <p>
- * <code>Class.executeStaticMethod(String methodName, Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object executeStaticMethod_(Class<?> javaClass, String methodName, Class<?>[] parameterTypes, Object[] arguments)
- throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
- {
- return getStaticMethod_(javaClass, methodName, parameterTypes).invoke(null, arguments);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Class<?> javaClass, String methodName) {
- return getMethod(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(Class<?> javaClass, String methodName)
- throws NoSuchMethodException
- {
- return getMethod_(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Class<?> javaClass, String methodName, Class<?> parameterType) {
- return getMethod(javaClass, methodName, new Class[] {parameterType});
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(Class<?> javaClass, String methodName, Class<?> parameterType)
- throws NoSuchMethodException
- {
- return getMethod_(javaClass, methodName, new Class[] {parameterType});
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) {
- try {
- return getMethod_(javaClass, methodName, parameterTypes);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), ex);
- }
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(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 getMethod_(superclass, methodName, parameterTypes);
- }
- method.setAccessible(true);
- return method;
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Object object, String methodName) {
- return getMethod(object.getClass(), methodName);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(Object object, String methodName)
- throws NoSuchMethodException
- {
- return getMethod_(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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Object object, String methodName, Class<?>[] parameterTypes) {
- return getMethod(object.getClass(), methodName, parameterTypes);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(Object object, String methodName, Class<?>[] parameterTypes)
- throws NoSuchMethodException
- {
- return getMethod_(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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod(Object object, String methodName, Class<?> parameterType) {
- return getMethod(object.getClass(), methodName, parameterType);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getMethod_(Object object, String methodName, Class<?> parameterType)
- throws NoSuchMethodException
- {
- return getMethod_(object.getClass(), methodName, parameterType);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod(Class<?> javaClass, String methodName) {
- return getStaticMethod(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod(Class<?> javaClass, String methodName, Class<?> parameterTypes) {
- return getStaticMethod(javaClass, methodName, new Class[] {parameterTypes});
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod(Class<?> javaClass, String methodName, Class<?>[] parameterTypes) {
- try {
- return getStaticMethod_(javaClass, methodName, parameterTypes);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes), ex);
- }
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod_(Class<?> javaClass, String methodName)
- throws NoSuchMethodException
- {
- return getStaticMethod_(javaClass, methodName, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod_(Class<?> javaClass, String methodName, Class<?> parameterTypes)
- throws NoSuchMethodException
- {
- return getStaticMethod_(javaClass, methodName, new Class[] {parameterTypes});
- }
-
- /**
- * 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.
- * Make any private/package/protected method accessible.
- */
- public static Method getStaticMethod_(Class<?> javaClass, String methodName, Class<?>[] parameterTypes)
- throws NoSuchMethodException
- {
- Method method = getMethod_(javaClass, methodName, parameterTypes);
- if (Modifier.isStatic(method.getModifiers())) {
- return method;
- }
- throw new NoSuchMethodException(buildFullyQualifiedMethodSignature(javaClass, methodName, parameterTypes));
- }
-
- /**
- * Return all the methods for the
- * specified class, including inherited methods.
- * Make any private/package/protected methods accessible.
- * <p>
- * <code>Class.getAllMethods()</code>
- */
- public static Iterable<Method> getAllMethods(Class<?> javaClass) {
- ArrayList<Method> methods = new ArrayList<Method>();
- for (Class<?> tempClass = javaClass; tempClass != null; tempClass = tempClass.getSuperclass()) {
- addDeclaredMethodsTo(tempClass, methods);
- }
- return methods;
- }
-
- /*
- * Add the declared methods for the specified class
- * to the specified list.
- */
- private static void addDeclaredMethodsTo(Class<?> javaClass, ArrayList<Method> methods) {
- for (Method method : getDeclaredMethods(javaClass)) {
- methods.add(method);
- }
- }
-
- /**
- * Return the declared methods for the specified class.
- * Make any private/package/protected methods accessible.
- * <p>
- * <code>Class.getAccessibleDeclaredMethods()</code>
- */
- public static Iterable<Method> getDeclaredMethods(Class<?> javaClass) {
- Method[] methods = javaClass.getDeclaredMethods();
- for (Method method : methods) {
- method.setAccessible(true);
- }
- return new ArrayIterable<Method>(methods);
- }
-
-
- // ********** constructors **********
-
- /**
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getDefaultConstructor()</code>
- */
- public static <T> Constructor<T> getDefaultConstructor(Class<T> javaClass) {
- return getConstructor(javaClass);
- }
-
- /**
- * Convenience method.
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor()</code>
- */
- public static <T> Constructor<T> getConstructor(Class<T> javaClass) {
- return getConstructor(javaClass, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Convenience method.
- * Return the constructor for the specified class
- * and formal parameter type.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor(Class<?> parameterType)</code>
- */
- public static <T> Constructor<T> getConstructor(Class<T> javaClass, Class<?> parameterType) {
- return getConstructor(javaClass, new Class[] {parameterType});
- }
-
- /**
- * Return the constructor for the specified class
- * and formal parameter types.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor(Class<?>[] parameterTypes)</code>
- */
- public static <T> Constructor<T> getConstructor(Class<T> javaClass, Class<?>[] parameterTypes) {
- try {
- return getConstructor_(javaClass, parameterTypes);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedConstructorSignature(javaClass, parameterTypes), ex);
- }
- }
-
- /**
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getDefaultConstructor()</code>
- */
- public static <T> Constructor<T> getDefaultConstructor_(Class<T> javaClass)
- throws NoSuchMethodException
- {
- return getConstructor_(javaClass);
- }
-
- /**
- * Convenience method.
- * Return the default (zero-argument) constructor
- * for the specified class.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor()</code>
- */
- public static <T> Constructor<T> getConstructor_(Class<T> javaClass)
- throws NoSuchMethodException
- {
- return getConstructor_(javaClass, ZERO_PARAMETER_TYPES);
- }
-
- /**
- * Convenience method.
- * Return the constructor for the specified class
- * and formal parameter type.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor(Class<?> parameterType)</code>
- */
- public static <T> Constructor<T> getConstructor_(Class<T> javaClass, Class<?> parameterType)
- throws NoSuchMethodException
- {
- return getConstructor_(javaClass, new Class[] {parameterType});
- }
-
- /**
- * Return the constructor for the specified class
- * and formal parameter types.
- * Make any private/package/protected constructor accessible.
- * <p>
- * <code>Class.getConstructor(Class<?>[] parameterTypes)</code>
- */
- public static <T> Constructor<T> getConstructor_(Class<T> javaClass, Class<?>[] parameterTypes)
- throws NoSuchMethodException
- {
- Constructor<T> constructor = javaClass.getDeclaredConstructor(parameterTypes);
- constructor.setAccessible(true);
- return constructor;
- }
-
- /**
- * Return the declared constructors for the specified class.
- * Make any private/package/protected constructors accessible.
- * <p>
- * <code>Class.getAccessibleDeclaredConstructors()</code>
- */
- public static <T> Iterable<Constructor<T>> getDeclaredConstructors(Class<T> javaClass) {
- @SuppressWarnings("unchecked")
- Constructor<T>[] constructors = (Constructor<T>[]) javaClass.getDeclaredConstructors();
- for (Constructor<T> constructor : constructors) {
- constructor.setAccessible(true);
- }
- return new ArrayIterable<Constructor<T>>(constructors);
- }
-
-
- // ********** classes **********
-
- /**
- * 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 the specified class (without the checked exception).
- */
- public static Class<?> classForName(String className, boolean initialize, ClassLoader classLoader) {
- try {
- return Class.forName(className, initialize, classLoader);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(className, ex);
- }
- }
-
- /**
- * 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.
- * <p>
- * <code>Class.getArrayDepth()</code>
- */
- public static int getArrayDepth(Class<?> javaClass) {
- int depth = 0;
- while (javaClass.isArray()) {
- depth++;
- javaClass = javaClass.getComponentType();
- }
- return depth;
- }
-
- /**
- * 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.
- * <p>
- * <code>Class.getElementType()</code>
- */
- public static Class<?> getElementType(Class<?> javaClass) {
- while (javaClass.isArray()) {
- javaClass = javaClass.getComponentType();
- }
- return javaClass;
- }
-
- /**
- * Return the wrapper class corresponding to the specified
- * primitive class. Return <code>null</code> if the specified class
- * is not a primitive class.
- * <p>
- * <code>Class.getWrapperClass()</code>
- */
- public static Class<?> getWrapperClass(Class<?> primitiveClass) {
- for (Primitive primitive : PRIMITIVES) {
- if (primitive.javaClass == primitiveClass) {
- return primitive.wrapperClass;
- }
- }
- return null;
- }
-
- /**
- * Return whether the specified class is a primitive wrapper
- * class (i.e. <code>java.lang.Void</code> or one of the primitive
- * variable wrapper classes, <code>java.lang.Boolean</code>,
- * <code>java.lang.Integer</code>, <code>java.lang.Float</code>, etc.).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- * <p>
- * <code>Class.isPrimitiveWrapper()</code>
- */
- public static boolean classIsPrimitiveWrapper(Class<?> javaClass) {
- if (javaClass.isArray() || (javaClass.getName().length() > MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH)) {
- return false; // performance tweak
- }
- for (Primitive primitive : PRIMITIVES) {
- if (javaClass == primitive.wrapperClass) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified class is a "variable" primitive wrapper
- * class (i.e. <code>java.lang.Boolean</code>,
- * <code>java.lang.Integer</code>, <code>java.lang.Float</code>, etc.,
- * but not <code>java.lang.Void</code>).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- * <p>
- * <code>Class.isVariablePrimitiveWrapper()</code>
- */
- public static boolean classIsVariablePrimitiveWrapper(Class<?> javaClass) {
- return classIsPrimitiveWrapper(javaClass)
- && (javaClass != VOID_WRAPPER_CLASS);
- }
-
- /**
- * Return whether the specified class is a "variable" primitive
- * class (i.e. <code>boolean</code>, <code>int</code>,
- * <code>float</code>, etc., but not <code>void</code>).
- * <p>
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- * <p>
- * <code>Class.isVariablePrimitive()</code>
- */
- public static boolean classIsVariablePrimitive(Class<?> javaClass) {
- return javaClass.isPrimitive() && (javaClass != VOID_CLASS);
- }
-
- /**
- * Return the primitive class for the specified primitive class code.
- * Return <code>null</code> if the specified code
- * is not a primitive class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> getClassForCode(int classCode) {
- return getClassForCode((char) classCode);
- }
-
- /**
- * Return the primitive class for the specified primitive class code.
- * Return <code>null</code> if the specified code
- * is not a primitive class code.
- * @see java.lang.Class#getName()
- */
- public static Class<?> getClassForCode(char classCode) {
- for (Primitive primitive : PRIMITIVES) {
- if (primitive.code == classCode) {
- return primitive.javaClass;
- }
- }
- return null;
- }
-
- /**
- * Return the class code for the specified primitive class.
- * Return <code>0</code> if the specified class
- * is not a primitive class.
- * @see java.lang.Class#getName()
- */
- public static char getCodeForClass(Class<?> primitiveClass) {
- if (( ! primitiveClass.isArray()) && (primitiveClass.getName().length() <= MAX_PRIMITIVE_CLASS_NAME_LENGTH)) {
- for (Primitive primitive : PRIMITIVES) {
- if (primitive.javaClass == primitiveClass) {
- return primitive.code;
- }
- }
- }
- return 0;
- }
-
-
- // ********** instantiation **********
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * <p>
- * <code>Class.newInstance()</code>
- */
- public static Object newInstance(String className) {
- return newInstance(className, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and argument.
- * <p>
- * <code>Class.newInstance(Class<?> parameterType, Object argument)</code>
- */
- public static Object newInstance(String className, Class<?> parameterType, Object argument) {
- return newInstance(className, parameterType, argument, null);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and arguments.
- * <p>
- * <code>Class.newInstance(Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] arguments) {
- return newInstance(className, parameterTypes, arguments, null);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * Use the specified class loader to load the class.
- * <p>
- * <code>Class.newInstance()</code>
- */
- public static Object newInstance(String className, ClassLoader classLoader) {
- return newInstance(classForName(className, false, classLoader));
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter type and argument.
- * <p>
- * <code>Class.newInstance(Class<?> parameterType, Object argument)</code>
- */
- public static Object newInstance(String className, Class<?> parameterType, Object argument, ClassLoader classLoader) {
- return newInstance(classForName(className, false, classLoader), parameterType, argument);
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and arguments.
- * <p>
- * <code>Class.newInstance(Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static Object newInstance(String className, Class<?>[] parameterTypes, Object[] arguments, ClassLoader classLoader) {
- return newInstance(classForName(className, false, classLoader), parameterTypes, arguments);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * <p>
- * <code>Class.newInstance()</code>
- */
- public static <T> T newInstance(Class<T> javaClass) {
- return newInstance(javaClass, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and argument.
- * <p>
- * <code>Class.newInstance(Class<?> parameterType, Object argument)</code>
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?> parameterType, Object argument) {
- return newInstance(javaClass, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and arguments.
- * <p>
- * <code>Class.newInstance(Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static <T> T newInstance(Class<T> javaClass, Class<?>[] parameterTypes, Object[] arguments) {
- try {
- return newInstance_(javaClass, parameterTypes, arguments);
- } catch (InstantiationException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedConstructorSignature(javaClass, parameterTypes), ex);
- } catch (IllegalAccessException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedConstructorSignature(javaClass, parameterTypes), ex);
- } catch (InvocationTargetException ex) {
- throw new RuntimeException(buildFullyQualifiedConstructorSignature(javaClass, parameterTypes) + CR + ex.getTargetException(), ex);
- } catch (NoSuchMethodException ex) {
- throw new RuntimeException(ex + CR + buildFullyQualifiedConstructorSignature(javaClass, parameterTypes), ex);
- }
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * using the class's default (zero-argument) constructor.
- * <p>
- * <code>Class.newInstance()</code>
- */
- public static <T> T newInstance_(Class<T> javaClass)
- throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return newInstance_(javaClass, ZERO_PARAMETER_TYPES, ZERO_ARGUMENTS);
- }
-
- /**
- * Convenience method.
- * Return a new instance of the specified class,
- * given the constructor parameter type and argument.
- * <p>
- * <code>Class.newInstance(Class<?> parameterType, Object argument)</code>
- */
- public static <T> T newInstance_(Class<T> javaClass, Class<?> parameterType, Object argument)
- throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return newInstance_(javaClass, new Class[] {parameterType}, new Object[] {argument});
- }
-
- /**
- * Return a new instance of the specified class,
- * given the constructor parameter types and arguments.
- * <p>
- * <code>Class.newInstance(Class<?>[] parameterTypes, Object[] arguments)</code>
- */
- public static <T> T newInstance_(Class<T> javaClass, Class<?>[] parameterTypes, Object[] arguments)
- throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return getConstructor_(javaClass, parameterTypes).newInstance(arguments);
- }
-
-
- // ********** type declarations **********
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> getClassForTypeDeclaration(String typeDeclaration) {
- return getClassForTypeDeclaration(typeDeclaration, null);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> getClassForTypeDeclaration_(String typeDeclaration)
- throws ClassNotFoundException
- {
- return getClassForTypeDeclaration_(typeDeclaration, null);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> getClassForTypeDeclaration(String typeDeclaration, ClassLoader classLoader) {
- TypeDeclaration td = buildTypeDeclaration(typeDeclaration);
- return getClassForTypeDeclaration(td.elementTypeName, td.arrayDepth, classLoader);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> getClassForTypeDeclaration_(String typeDeclaration, ClassLoader classLoader)
- throws ClassNotFoundException
- {
- TypeDeclaration td = buildTypeDeclaration(typeDeclaration);
- return getClassForTypeDeclaration_(td.elementTypeName, td.arrayDepth, classLoader);
- }
-
- private static TypeDeclaration buildTypeDeclaration(String typeDeclaration) {
- typeDeclaration = StringTools.removeAllWhitespace(typeDeclaration);
- int arrayDepth = getArrayDepthForTypeDeclaration_(typeDeclaration);
- String elementTypeName = getElementTypeNameForTypeDeclaration_(typeDeclaration, arrayDepth);
- return new TypeDeclaration(elementTypeName, arrayDepth);
- }
-
- /**
- * Return the array depth for the specified "type declaration"; e.g.<ul>
- * <li><code>"int[]"</code> returns <code>1</code>
- * <li><code>"java.lang.String[][][]"</code> returns <code>3</code>
- * </ul>
- */
- public static int getArrayDepthForTypeDeclaration(String typeDeclaration) {
- return getArrayDepthForTypeDeclaration_(StringTools.removeAllWhitespace(typeDeclaration));
- }
-
- /**
- * pre-condition: no whitespace in the type declaration.
- */
- private static int getArrayDepthForTypeDeclaration_(String typeDeclaration) {
- int last = typeDeclaration.length() - 1;
- int depth = 0;
- int close = last;
- while (typeDeclaration.charAt(close) == ']') {
- if (typeDeclaration.charAt(close - 1) == '[') {
- depth++;
- } else {
- throw new IllegalArgumentException("invalid type declaration: " + typeDeclaration); //$NON-NLS-1$
- }
- close = last - (depth * 2);
- }
- return depth;
- }
-
- /**
- * Return the element type name for the specified "type declaration"; e.g.<ul>
- * <li><code>"int[]"</code> returns <code>"int"</code>
- * <li><code>"java.lang.String[][][]"</code> returns <code>"java.lang.String"</code>
- * </ul>
- */
- public static String getElementTypeNameForTypeDeclaration(String typeDeclaration) {
- typeDeclaration = StringTools.removeAllWhitespace(typeDeclaration);
- return getElementTypeNameForTypeDeclaration_(typeDeclaration, getArrayDepthForTypeDeclaration_(typeDeclaration));
- }
-
- /**
- * Return the element type name for the specified "type declaration"; e.g.<ul>
- * <li><code>"int[]"</code> returns <code>"int"</code>
- * <li><code>"java.lang.String[][][]"</code> returns <code>"java.lang.String"</code>
- * </ul>
- * Useful for clients that have already queried the type declaration's array depth.
- */
- public static String getElementTypeNameForTypeDeclaration(String typeDeclaration, int arrayDepth) {
- return getElementTypeNameForTypeDeclaration_(StringTools.removeAllWhitespace(typeDeclaration), arrayDepth);
- }
-
- /**
- * pre-condition: no whitespace in the type declaration.
- */
- private static String getElementTypeNameForTypeDeclaration_(String typeDeclaration, int arrayDepth) {
- return typeDeclaration.substring(0, typeDeclaration.length() - (arrayDepth * 2));
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> getClassForTypeDeclaration(String elementTypeName, int arrayDepth) {
- return getClassForTypeDeclaration(elementTypeName, arrayDepth, null);
- }
-
- /**
- * Return the class for the specified "type declaration".
- */
- public static Class<?> getClassForTypeDeclaration_(String elementTypeName, int arrayDepth)
- throws ClassNotFoundException
- {
- return getClassForTypeDeclaration_(elementTypeName, arrayDepth, null);
- }
-
- /**
- * Return the class for the specified "type declaration",
- * using the specified class loader.
- */
- public static Class<?> getClassForTypeDeclaration(String elementTypeName, int arrayDepth, ClassLoader classLoader) {
- try {
- return getClassForTypeDeclaration_(elementTypeName, arrayDepth, classLoader);
- } catch (ClassNotFoundException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * 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<?> getClassForTypeDeclaration_(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() <= MAX_PRIMITIVE_CLASS_NAME_LENGTH) { // performance tweak
- for (Primitive primitive : PRIMITIVES) {
- if (primitive.javaClass.getName().equals(elementTypeName)) {
- pcc = primitive;
- 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('[');
- }
- if (pcc == null) {
- ClassName.append(elementTypeName, sb);
- } else {
- sb.append(pcc.code);
- }
- return Class.forName(sb.toString(), false, classLoader);
- }
-
- /**
- * Return the class name for the specified "type declaration"; e.g.<ul>
- * <li><code>"int"</code> returns <code>"int"</code>
- * <li><code>"int[]"</code> returns <code>"[I"</code>
- * <li><code>"java.lang.String"</code> returns <code>"java.lang.String"</code>
- * <li><code>"java.lang.String[][][]"</code> returns <code>"[[[Ljava.lang.String;"</code>
- * </ul>
- * @see java.lang.Class#getName()
- */
- public static String getClassNameForTypeDeclaration(String typeDeclaration) {
- TypeDeclaration td = buildTypeDeclaration(typeDeclaration);
- return getClassNameForTypeDeclaration(td.elementTypeName, td.arrayDepth);
- }
-
- /**
- * Return the class name for the specified "type declaration".
- * @see java.lang.Class#getName()
- */
- public static String getClassNameForTypeDeclaration(String elementTypeName, int arrayDepth) {
- // non-array
- if (arrayDepth == 0) {
- return elementTypeName;
- }
-
- if (elementTypeName.equals(ClassName.VOID_CLASS_NAME)) {
- throw new IllegalArgumentException('\'' + ClassName.VOID_CLASS_NAME + "' must have an array depth of zero: " + arrayDepth + '.'); //$NON-NLS-1$
- }
- // array
- StringBuilder sb = new StringBuilder(100);
- for (int i = arrayDepth; i-- > 0; ) {
- sb.append('[');
- }
-
- // look for a primitive first
- Primitive pcc = null;
- if (elementTypeName.length() <= MAX_PRIMITIVE_CLASS_NAME_LENGTH) { // performance tweak
- for (Primitive primitive : PRIMITIVES) {
- if (primitive.javaClass.getName().equals(elementTypeName)) {
- pcc = primitive;
- break;
- }
- }
- }
-
- if (pcc == null) {
- ClassName.append(elementTypeName, sb);
- } else {
- sb.append(pcc.code);
- }
-
- return sb.toString();
- }
-
-
- // ********** exception messages **********
-
- /**
- * Return a string representation of the specified constructor.
- */
- private static String buildFullyQualifiedConstructorSignature(Class<?> javaClass, Class<?>[] parameterTypes) {
- return buildFullyQualifiedMethodSignature(javaClass, null, parameterTypes);
- }
-
- /**
- * Return a string representation of the specified field.
- */
- private static String buildFullyQualifiedFieldName(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 buildFullyQualifiedFieldName(Object object, String fieldName) {
- return buildFullyQualifiedFieldName(object.getClass(), fieldName);
- }
-
- /**
- * Return a string representation of the specified method.
- */
- private static String buildFullyQualifiedMethodSignature(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(", "); //$NON-NLS-1$
- }
- sb.append(parameterTypes[max].getName());
- }
- sb.append(')');
- return sb.toString();
- }
-
-
- // ********** primitive constants **********
-
- static final Iterable<Primitive> PRIMITIVES = buildPrimitives();
-
- 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';
-
- static final int MAX_PRIMITIVE_CLASS_NAME_LENGTH = calculateMaxPrimitiveClassNameLength();
- static final int MAX_PRIMITIVE_WRAPPER_CLASS_NAME_LENGTH = calculateMaxPrimitiveWrapperClassNameLength();
-
- private static int calculateMaxPrimitiveClassNameLength() {
- int max = -1;
- for (Primitive primitive : PRIMITIVES) {
- int len = primitive.javaClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- private static int calculateMaxPrimitiveWrapperClassNameLength() {
- int max = -1;
- for (Primitive primitive : PRIMITIVES) {
- int len = primitive.wrapperClass.getName().length();
- if (len > max) {
- max = len;
- }
- }
- return max;
- }
-
- /**
- * <strong>NB:</strong> <code>void.class.isPrimitive() == true</code>
- */
- private static Iterable<Primitive> buildPrimitives() {
- Primitive[] array = new Primitive[9];
- array[0] = new Primitive(BYTE_CODE, java.lang.Byte.class);
- array[1] = new Primitive(CHAR_CODE, java.lang.Character.class);
- array[2] = new Primitive(DOUBLE_CODE, java.lang.Double.class);
- array[3] = new Primitive(FLOAT_CODE, java.lang.Float.class);
- array[4] = new Primitive(INT_CODE, java.lang.Integer.class);
- array[5] = new Primitive(LONG_CODE, java.lang.Long.class);
- array[6] = new Primitive(SHORT_CODE, java.lang.Short.class);
- array[7] = new Primitive(BOOLEAN_CODE, java.lang.Boolean.class);
- array[8] = new Primitive(VOID_CODE, java.lang.Void.class);
- return new ArrayIterable<Primitive>(array);
- }
-
-
- // ********** member classes **********
-
- static class Primitive {
- final char code;
- final Class<?> javaClass;
- final Class<?> wrapperClass;
- private static final String WRAPPER_CLASS_TYPE_FIELD_NAME = "TYPE"; //$NON-NLS-1$
- // e.g. java.lang.Boolean.TYPE => boolean.class
- Primitive(char code, Class<?> wrapperClass) {
- this.code = code;
- this.wrapperClass = wrapperClass;
- this.javaClass = (Class<?>) getStaticFieldValue(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;
- }
- }
-
-
- // ********** suppressed constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private ReflectionTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java
deleted file mode 100644
index 10c01f80f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ReverseComparator.java
+++ /dev/null
@@ -1,40 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Comparator;
-
-/**
- * This comparator will reverse the order of the specified comparator.
- * If the comparator is null, the natural ordering of the objects will be used.
- */
-public class ReverseComparator<E extends Comparable<? super E>>
- implements Comparator<E>, Serializable
-{
- private final Comparator<E> comparator;
-
- public ReverseComparator() {
- this(null);
- }
-
- public ReverseComparator(Comparator<E> comparator) {
- super();
- this.comparator = comparator;
- }
-
- public int compare(E e1, E e2) {
- return (this.comparator == null) ?
- e2.compareTo(e1)
- :
- this.comparator.compare(e2, e1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/RunnableCommand.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/RunnableCommand.java
deleted file mode 100644
index 5b15ee088e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/RunnableCommand.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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Wrap a Runnable so it can be used as a Command.
- */
-public class RunnableCommand implements Command {
- protected final Runnable runnable;
-
- public RunnableCommand(Runnable runnable) {
- super();
- if (runnable == null) {
- throw new NullPointerException();
- }
- this.runnable = runnable;
- }
-
- public void execute() {
- this.runnable.run();
- }
-
- @Override
- public String toString() {
- return "Command[" + this.runnable.toString() +']'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.java
deleted file mode 100644
index 6e05103f44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleAssociation.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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Straightforward implementation of {@ link Association}.
- */
-public class SimpleAssociation<K, V>
- extends AbstractAssociation<K, V>
- implements Cloneable, Serializable
-{
- private final K key;
- private V value;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct an association with the specified key
- * and a null value.
- */
- public SimpleAssociation(K key) {
- super();
- this.key = key;
- }
-
- /**
- * Construct an association with the specified key and value.
- */
- public SimpleAssociation(K key, V value) {
- this(key);
- this.value = value;
- }
-
-
- public K key() {
- return this.key;
- }
-
- public synchronized V value() {
- return this.value;
- }
-
- public synchronized V setValue(V value) {
- V old = this.value;
- this.value = value;
- return old;
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public synchronized SimpleAssociation<K, V> clone() {
- try {
- return (SimpleAssociation<K, V>) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleCommandExecutor.java
deleted file mode 100644
index bac600b2bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleCommandExecutor.java
+++ /dev/null
@@ -1,46 +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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Straightforward implementation of {@link StatefulCommandExecutor}.
- */
-public class SimpleCommandExecutor
- implements StatefulCommandExecutor
-{
- private boolean active = false;
-
- public SimpleCommandExecutor() {
- super();
- }
-
- public void start() {
- if (this.active) {
- throw new IllegalStateException("Not stopped."); //$NON-NLS-1$
- }
- this.active = true;
- }
-
- public void execute(Command command) {
- if (this.active) {
- command.execute();
- }
- }
-
- public void stop() {
- if ( ! this.active) {
- throw new IllegalStateException("Not started."); //$NON-NLS-1$
- }
- this.active = false;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
deleted file mode 100644
index 9477c0f7fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleFilter.java
+++ /dev/null
@@ -1,107 +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.utility.internal;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.Filter;
-
-/**
- * Simple, abstract implementation of <code>Filter</code>
- * that holds on to a criterion object that can be used in the
- * <code>accept(Object)</code> or <code>reject(Object)</code>
- * methods. Subclasses can override either of these methods,
- * depending on which is easier to implement. Note that at least
- * one of these methods <em>must</em> be overridden or
- * an infinite loop will occur. If both of them are overridden,
- * only the <code>accept(Object)</code> method will be used.
- * <p>
- * Simplifies the implementation of straightforward inner classes.
- * Here is an example of a filter that can be used by a
- * <code>FilteringIterator</code> to return only those strings
- * in the nested iterator start with "prefix":
- * <pre>
- * Filter<String> filter = new SimpleFilter<String>("prefix") {
- * public boolean accept(String o) {
- * return o.startsWith((String) criterion);
- * }
- * };
- * </pre>
- */
-public abstract class SimpleFilter<T, S>
- implements Filter<T>, Cloneable, Serializable
-{
- protected final S criterion;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * More useful constructor. The specified criterion can
- * be used by a subclass to "accept" or "reject" objects.
- */
- protected SimpleFilter(S criterion) {
- super();
- this.criterion = criterion;
- }
-
- /**
- * Construct a simple filter with a null criterion
- */
- protected SimpleFilter() {
- this(null);
- }
-
- /**
- * Return whether the the specified object should be "rejected".
- * The semantics of "rejected" is determined by the client.
- */
- protected boolean reject(T o) {
- return ! this.accept(o);
- }
-
- /**
- * Return whether the the specified object should be "accepted".
- * The semantics of "accepted" is determined by the client.
- */
- public boolean accept(T o) {
- return ! this.reject(o);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public SimpleFilter<T, S> clone() {
- try {
- return (SimpleFilter<T, S>) super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof SimpleFilter<?, ?>)) {
- return false;
- }
- SimpleFilter<?, ?> other = (SimpleFilter<?, ?>) o;
- return (this.criterion == null) ?
- (other.criterion == null) : this.criterion.equals(other.criterion);
- }
-
- @Override
- public int hashCode() {
- return (this.criterion == null) ? 0 : this.criterion.hashCode();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.criterion);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java
deleted file mode 100644
index 3a94acea21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleJavaType.java
+++ /dev/null
@@ -1,213 +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.utility.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.JavaType;
-
-/**
- * Straightforward implementation of the {@link JavaType} interface.
- */
-public final class SimpleJavaType
- implements JavaType, Cloneable, Serializable
-{
-
- /**
- * store the type as a name, so we can reference classes
- * that are not loaded
- */
- private final String elementTypeName;
-
- /**
- * non-array types have an array depth of zero
- */
- private final int arrayDepth;
-
- private static final String BRACKETS = "[]"; //$NON-NLS-1$
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a Java type with the specified element type and array depth.
- */
- public SimpleJavaType(String elementTypeName, int arrayDepth) {
- super();
- if ((elementTypeName == null) || (elementTypeName.length() == 0)) {
- throw new IllegalArgumentException("The element type name is required."); //$NON-NLS-1$
- }
- if (ClassName.getArrayDepth(elementTypeName) != 0) { // e.g. "[Ljava.lang.Object;"
- throw new IllegalArgumentException("The element type must not be an array: " + elementTypeName + '.'); //$NON-NLS-1$
- }
- if (arrayDepth < 0) {
- throw new IllegalArgumentException("The array depth must be greater than or equal to zero: " + arrayDepth + '.'); //$NON-NLS-1$
- }
- if (elementTypeName.equals(void.class.getName()) && (arrayDepth != 0)) {
- throw new IllegalArgumentException("'void' must have an array depth of zero: " + arrayDepth + '.'); //$NON-NLS-1$
- }
- this.elementTypeName = elementTypeName;
- this.arrayDepth = arrayDepth;
- }
-
- /**
- * Construct a Java type for the specified class.
- * The class name can be in one of the following forms:<ul><code>
- * <li>java.lang.Object
- * <li>int
- * <li>java.util.Map$Entry
- * <li>[Ljava.lang.Object;
- * <li>[I
- * <li>[Ljava.util.Map$Entry;
- * </code></ul>
- */
- public SimpleJavaType(String javaClassName) {
- this(ClassName.getElementTypeName(javaClassName), ClassName.getArrayDepth(javaClassName));
- }
-
- /**
- * Construct a Java type for the specified class.
- */
- public SimpleJavaType(Class<?> javaClass) {
- this(javaClass.getName());
- }
-
-
- // ********** accessors **********
-
- public String getElementTypeName() {
- return this.elementTypeName;
- }
-
- public int getArrayDepth() {
- return this.arrayDepth;
- }
-
-
- // ********** queries **********
-
- public boolean isArray() {
- return this.arrayDepth > 0;
- }
-
- public boolean isPrimitive() {
- return (this.arrayDepth == 0) && ClassName.isPrimitive(this.elementTypeName);
- }
-
- public boolean isPrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassName.isPrimitiveWrapper(this.elementTypeName);
- }
-
- public boolean isVariablePrimitive() {
- return (this.arrayDepth == 0) && ClassName.isVariablePrimitive(this.elementTypeName);
- }
-
- public boolean isVariablePrimitiveWrapper() {
- return (this.arrayDepth == 0) && ClassName.isVariablePrimitiveWrapper(this.elementTypeName);
- }
-
- public Class<?> getJavaClass() throws ClassNotFoundException {
- return ReflectionTools.getClassForTypeDeclaration(this.elementTypeName, this.arrayDepth);
- }
-
- public String getJavaClassName() {
- return ReflectionTools.getClassNameForTypeDeclaration(this.elementTypeName, this.arrayDepth);
- }
-
-
- // ********** comparison **********
-
- public boolean equals(String otherElementTypeName, int otherArrayDepth) {
- return (this.arrayDepth == otherArrayDepth)
- && this.elementTypeName.equals(otherElementTypeName);
- }
-
- public boolean describes(String className) {
- return this.equals(ClassName.getElementTypeName(className), ClassName.getArrayDepth(className));
- }
-
- public boolean describes(Class<?> javaClass) {
- return this.describes(javaClass.getName());
- }
-
- public boolean equals(JavaType other) {
- return this.equals(other.getElementTypeName(), other.getArrayDepth());
- }
-
- @Override
- public boolean equals(Object o) {
- return (this == o) ? true : (o instanceof JavaType) ? this.equals((JavaType) o) : false;
- }
-
- @Override
- public int hashCode() {
- return this.elementTypeName.hashCode() ^ this.arrayDepth;
- }
-
-
- // ********** printing and displaying **********
-
- public String declaration() {
- if (this.arrayDepth == 0) {
- return this.getElementTypeNameDeclaration();
- }
- StringBuilder sb = new StringBuilder(this.elementTypeName.length() + (2 * this.arrayDepth));
- this.appendDeclarationTo(sb);
- return sb.toString();
- }
-
- public void appendDeclarationTo(StringBuilder sb) {
- sb.append(this.getElementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- sb.append(BRACKETS);
- }
- }
-
- public void printDeclarationOn(PrintWriter pw) {
- pw.print(this.getElementTypeNameDeclaration());
- for (int i = this.arrayDepth; i-- > 0; ) {
- pw.print(BRACKETS);
- }
- }
-
- /**
- * The <code>'$'</code> version of the name is used in {@link Class#forName(String)},
- * but the <code>'.'</code> version of the name is used in source code.
- * Very irritating....
- */
- private String getElementTypeNameDeclaration() {
- return this.elementTypeName.replace('$', '.');
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.appendDeclarationTo(sb);
- sb.append(')');
- return sb.toString();
- }
-
-
- // ********** cloning **********
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java
deleted file mode 100644
index 9145f47b85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleMethodSignature.java
+++ /dev/null
@@ -1,240 +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.utility.internal;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-
-/**
- * Straightforward implementation of the MethodSignature interface.
- */
-public final class SimpleMethodSignature
- implements MethodSignature, Cloneable, Serializable
-{
- private final String name;
-
- /**
- * store the parameter types as names, so we can reference classes
- * that are not loaded
- */
- private final JavaType[] parameterTypes;
-
- public static final JavaType[] EMPTY_PARAMETER_TYPES = new JavaType[0];
-
- private static final String PARAMETER_SEPARATOR = ", "; //$NON-NLS-1$
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a method signature with the specified name and
- * no parameter types.
- */
- public SimpleMethodSignature(String name) {
- this(name, EMPTY_PARAMETER_TYPES);
- }
-
- /**
- * Construct a method signature with the specified name and parameter
- * types.
- */
- public SimpleMethodSignature(String name, JavaType... parameterTypes) {
- super();
- if ((name == null) || (name.length() == 0)) {
- throw new IllegalArgumentException("The name is required."); //$NON-NLS-1$
- }
- if (parameterTypes == null) {
- throw new IllegalArgumentException("The parameter types are required."); //$NON-NLS-1$
- }
- checkParameterTypes(parameterTypes);
- this.name = name;
- this.parameterTypes = parameterTypes;
- }
-
- private static void checkParameterTypes(JavaType[] parameterTypes) {
- for (int i = 0; i < parameterTypes.length; i++) {
- if (parameterTypes[i] == null) {
- throw new IllegalArgumentException("Missing parameter type: " + i); //$NON-NLS-1$
- }
- if (parameterTypes[i].getElementTypeName().equals(void.class.getName())) {
- throw new IllegalArgumentException("A parameter type of 'void' is not allowed: " + i); //$NON-NLS-1$
- }
- }
- }
-
- /**
- * Construct a method signature with the specified name and parameter
- * types.
- */
- public SimpleMethodSignature(String name, String... parameterTypeNames) {
- this(name, buildParameterTypes(parameterTypeNames));
- }
-
- private static JavaType[] buildParameterTypes(String[] parameterTypeNames) {
- if (parameterTypeNames == null) {
- throw new IllegalArgumentException("The parameter type names are required."); //$NON-NLS-1$
- }
- JavaType[] parameterTypes = new JavaType[parameterTypeNames.length];
- for (int i = 0; i < parameterTypeNames.length; i++) {
- if (parameterTypeNames[i] == null) {
- throw new IllegalArgumentException("Missing parameter type name: " + i); //$NON-NLS-1$
- }
- parameterTypes[i] = new SimpleJavaType(parameterTypeNames[i]);
- }
- return parameterTypes;
- }
-
- /**
- * Construct a method signature with the specified name and parameter
- * types.
- */
- public SimpleMethodSignature(String name, Class<?>... parameterJavaClasses) {
- this(name, buildParameterTypeNames(parameterJavaClasses));
- }
-
- private static String[] buildParameterTypeNames(Class<?>[] parameterJavaClasses) {
- if (parameterJavaClasses == null) {
- throw new IllegalArgumentException("The parameter Java classes are required."); //$NON-NLS-1$
- }
- String[] parameterTypeNames = new String[parameterJavaClasses.length];
- for (int i = 0; i < parameterJavaClasses.length; i++) {
- if (parameterJavaClasses[i] == null) {
- throw new IllegalArgumentException("Missing parameter Java class: " + i); //$NON-NLS-1$
- }
- parameterTypeNames[i] = parameterJavaClasses[i].getName();
- }
- return parameterTypeNames;
- }
-
- /**
- * Construct a method signature for the specified Java method.
- */
- public SimpleMethodSignature(Method method) {
- this(method.getName(), method.getParameterTypes());
- }
-
-
- // ********** accessors **********
-
- public String getName() {
- return this.name;
- }
-
- public JavaType[] getParameterTypes() {
- return this.parameterTypes;
- }
-
-
- // ********** comparison **********
-
- public boolean describes(Method method) {
- return this.name.equals(method.getName())
- && this.parameterTypesDescribe(method.getParameterTypes());
- }
-
- private boolean parameterTypesDescribe(Class<?>[] otherParameterTypes) {
- JavaType[] localParameterTypes = this.parameterTypes;
- int len = localParameterTypes.length;
- if (otherParameterTypes.length != len) {
- return false;
- }
- for (int i = len; i-- > 0; ) {
- if ( ! localParameterTypes[i].describes(otherParameterTypes[i])) {
- return false;
- }
- }
- return true;
- }
-
- public boolean equals(String otherName, JavaType[] otherParameterTypes) {
- return this.name.equals(otherName)
- && Arrays.equals(this.parameterTypes, otherParameterTypes);
- }
-
- public boolean equals(MethodSignature other) {
- return this.equals(other.getName(), other.getParameterTypes());
- }
-
- @Override
- public boolean equals(Object o) {
- return (this == o) ? true : (o instanceof MethodSignature) ? this.equals((MethodSignature) o) : false;
- }
-
- @Override
- public int hashCode() {
- return this.name.hashCode() ^ Arrays.hashCode(this.parameterTypes);
- }
-
-
- // ********** printing and displaying **********
-
- public String getSignature() {
- StringBuilder sb = new StringBuilder(200);
- this.appendSignatureTo(sb);
- return sb.toString();
- }
-
- public void appendSignatureTo(StringBuilder sb) {
- sb.append(this.name);
- sb.append('(');
- JavaType[] localParameterTypes = this.parameterTypes;
- int len = localParameterTypes.length;
- for (int i = 0; i < len; i++) {
- if (i != 0) {
- sb.append(PARAMETER_SEPARATOR);
- }
- localParameterTypes[i].appendDeclarationTo(sb);
- }
- sb.append(')');
- }
-
- public void printSignatureOn(PrintWriter pw) {
- pw.print(this.name);
- pw.print('(');
- JavaType[] localParameterTypes = this.parameterTypes;
- int len = localParameterTypes.length;
- for (int i = 0; i < len; i++) {
- if (i != 0) {
- pw.print(PARAMETER_SEPARATOR);
- }
- localParameterTypes[i].printDeclarationOn(pw);
- }
- pw.print(')');
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder(200);
- sb.append(this.getClass().getSimpleName());
- sb.append('(');
- this.appendSignatureTo(sb);
- sb.append(')');
- return sb.toString();
- }
-
-
- // ********** cloning **********
-
- @Override
- public Object clone() {
- try {
- return super.clone();
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleQueue.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleQueue.java
deleted file mode 100644
index 89a73e1454..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleQueue.java
+++ /dev/null
@@ -1,90 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * Straightforward implementation of the {@link Queue} interface.
- */
-public class SimpleQueue<E>
- implements Queue<E>, Cloneable, Serializable
-{
- private LinkedList<E> elements;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct an empty queue.
- */
- public SimpleQueue() {
- super();
- this.elements = new LinkedList<E>();
- }
-
- /**
- * Construct a queue containing the elements of the specified
- * collection. The queue will dequeue its elements in the same
- * order they are returned by the collection's iterator (i.e. the
- * first element returned by the collection's iterator will be the
- * first element returned by {@link #dequeue()}).
- */
- public SimpleQueue(Collection<? extends E> c) {
- super();
- this.elements = new LinkedList<E>(c);
- }
-
-
- // ********** Queue implementation **********
-
- public void enqueue(E o) {
- this.elements.addLast(o);
- }
-
- public E dequeue() {
- return this.elements.removeFirst();
- }
-
- public E peek() {
- return this.elements.getFirst();
- }
-
- public boolean isEmpty() {
- return this.elements.isEmpty();
- }
-
-
- // ********** Cloneable implementation **********
-
- @Override
- public SimpleQueue<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- SimpleQueue<E> clone = (SimpleQueue<E>) super.clone();
- @SuppressWarnings("unchecked")
- LinkedList<E> ll = (LinkedList<E>) this.elements.clone();
- clone.elements = ll;
- return clone;
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.peek());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
deleted file mode 100644
index ffdea0c519..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStack.java
+++ /dev/null
@@ -1,100 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.EmptyStackException;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-/**
- * Straightforward implementation of the {@link Stack} interface.
- */
-public class SimpleStack<E>
- implements Stack<E>, Cloneable, Serializable
-{
- private LinkedList<E> elements;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct an empty stack.
- */
- public SimpleStack() {
- super();
- this.elements = new LinkedList<E>();
- }
-
- /**
- * Construct a stack containing the elements of the specified
- * collection. The stack will pop its elements in reverse of the
- * order they are returned by the collection's iterator (i.e. the
- * last element returned by the collection's iterator will be the
- * first element returned by {@link #pop()}).
- */
- public SimpleStack(Collection<? extends E> collection) {
- super();
- this.elements = new LinkedList<E>(collection);
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E element) {
- this.elements.addLast(element);
- }
-
- public E pop() {
- try {
- return this.elements.removeLast();
- } catch (NoSuchElementException ex) {
- throw new EmptyStackException();
- }
- }
-
- public E peek() {
- try {
- return this.elements.getLast();
- } catch (NoSuchElementException ex) {
- throw new EmptyStackException();
- }
- }
-
- public boolean isEmpty() {
- return this.elements.isEmpty();
- }
-
-
- // ********** standard methods **********
-
- @Override
- public SimpleStack<E> clone() {
- try {
- @SuppressWarnings("unchecked")
- SimpleStack<E> clone = (SimpleStack<E>) super.clone();
- @SuppressWarnings("unchecked")
- LinkedList<E> ll = (LinkedList<E>) this.elements.clone();
- clone.elements = ll;
- return clone;
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.peek());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java
deleted file mode 100644
index 0992387d8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleStringMatcher.java
+++ /dev/null
@@ -1,259 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.regex.Pattern;
-import org.eclipse.jpt.utility.Filter;
-
-// TODO the regex code is not very fast - we could probably do better,
-// hand-coding the matching algorithm (eclipse StringMatcher?)
-/**
- * This class implements a simple string-matching algorithm that is a little
- * more user-friendly than standard regular expressions. Instantiate a
- * string matcher with a filter pattern and then you can use the matcher
- * to determine whether another string (or object) matches the pattern.
- * You can also specify whether the matching should be case-sensitive.
- *
- * The pattern can contain two "meta-characters":
- * '*' will match any set of zero or more characters
- * '?' will match any single character
- *
- * Subclasses can override #prefix() and/or #suffix() to change what
- * strings are prepended or appended to the original pattern string.
- * This can offer a slight performance improvement over concatenating
- * strings before calling #setPatternString(String).
- * By default, a '*' is appended to every string.
- *
- * This class also uses the string-matching algorithm to "filter" objects
- * (and, as a result, also implements the Filter interface).
- * A string converter is used to determine what string aspect of the
- * object is compared to the pattern. By default the string returned
- * by the object's #toString() method is passed to the pattern matcher.
- */
-public class SimpleStringMatcher<T>
- implements StringMatcher, Filter<T>, Serializable
-{
-
- /** An adapter that converts the objects into strings to be matched with the pattern. */
- private StringConverter<T> stringConverter;
-
- /** The string used to construct the regular expression pattern. */
- private String patternString;
-
- /** Whether the matcher ignores case - the default is true. */
- private boolean ignoresCase;
-
- /** The regular expression pattern built from the pattern string. */
- private Pattern pattern;
-
- /** A list of the meta-characters we need to escape if found in the pattern string. */
- public static final char[] REG_EX_META_CHARS = { '(', '[', '{', '\\', '^', '$', '|', ')', '?', '*', '+', '.' };
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a string matcher with an pattern that will match
- * any string and ignore case.
- */
- public SimpleStringMatcher() {
- this("*"); //$NON-NLS-1$
- }
-
- /**
- * Construct a string matcher with the specified pattern
- * that will ignore case.
- */
- public SimpleStringMatcher(String patternString) {
- this(patternString, true);
- }
-
- /**
- * Construct a string matcher with the specified pattern that will
- * ignore case as specified.
- */
- public SimpleStringMatcher(String patternString, boolean ignoresCase) {
- super();
- this.patternString = patternString;
- this.ignoresCase = ignoresCase;
- this.initialize();
- }
-
-
- // ********** initialization **********
-
- protected void initialize() {
- this.stringConverter = StringConverter.Default.instance();
- this.rebuildPattern();
- }
-
- /**
- * Given the current pattern string and case-sensitivity setting,
- * re-build the regular expression pattern.
- */
- protected synchronized void rebuildPattern() {
- this.pattern = this.buildPattern();
- }
-
- /**
- * Given the current pattern string and case-sensitivity setting,
- * build and return a regular expression pattern that can be used
- * to match strings.
- */
- protected Pattern buildPattern() {
- int patternFlags = 0x0;
- if (this.ignoresCase) {
- patternFlags = Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE;
- }
- return Pattern.compile(this.convertToRegEx(this.patternString), patternFlags);
- }
-
-
- // ********** StringMatcher implementation **********
-
- public synchronized void setPatternString(String patternString) {
- this.patternString = patternString;
- this.rebuildPattern();
- }
-
- /**
- * Return whether the specified string matches the pattern.
- */
- public synchronized boolean matches(String string) {
- return this.pattern.matcher(string).matches();
- }
-
-
- // ********** Filter implementation **********
-
- public synchronized boolean accept(T o) {
- return this.matches(this.stringConverter.convertToString(o));
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the string converter used to convert the objects
- * passed to the matcher into strings.
- */
- public synchronized StringConverter<T> stringConverter() {
- return this.stringConverter;
- }
-
- /**
- * Set the string converter used to convert the objects
- * passed to the matcher into strings.
- */
- public synchronized void setStringConverter(StringConverter<T> stringConverter) {
- this.stringConverter = stringConverter;
- }
-
- /**
- * Return the original pattern string.
- */
- public synchronized String patternString() {
- return this.patternString;
- }
-
- /**
- * Return whether the matcher ignores case.
- */
- public synchronized boolean ignoresCase() {
- return this.ignoresCase;
- }
-
- /**
- * Set whether the matcher ignores case.
- */
- public synchronized void setIgnoresCase(boolean ignoresCase) {
- this.ignoresCase = ignoresCase;
- this.rebuildPattern();
- }
-
- /**
- * Return the regular expression pattern.
- */
- public synchronized Pattern pattern() {
- return this.pattern;
- }
-
-
- // ********** other public API **********
-
- /**
- * Return the regular expression corresponding to
- * the original pattern string.
- */
- public synchronized String regularExpression() {
- return this.convertToRegEx(this.patternString);
- }
-
-
- // ********** converting **********
-
- /**
- * Convert the specified string to a regular expression.
- */
- protected String convertToRegEx(String string) {
- StringBuffer sb = new StringBuffer(string.length() + 10);
- this.convertToRegExOn(this.prefix(), sb);
- this.convertToRegExOn(string, sb);
- this.convertToRegExOn(this.suffix(), sb);
- return sb.toString();
- }
-
- /**
- * Return any prefix that should be prepended to the original
- * string. By default, there is no prefix.
- */
- protected String prefix() {
- return ""; //$NON-NLS-1$
- }
-
- /**
- * Return any suffix that should be appended to the original
- * string. Since this class is typically used in UI situation where
- * the user is typing in a pattern used to filter a list, the default
- * suffix is a wildcard character.
- */
- protected String suffix() {
- return "*"; //$NON-NLS-1$
- }
-
- /**
- * Convert the specified string to a regular expression.
- */
- protected void convertToRegExOn(String string, StringBuffer sb) {
- char[] charArray = string.toCharArray();
- int length = charArray.length;
- for (int i = 0; i < length; i++) {
- char c = charArray[i];
- // convert user-friendly meta-chars into regex meta-chars
- if (c == '*') {
- sb.append(".*"); //$NON-NLS-1$
- continue;
- }
- if (c == '?') {
- sb.append('.');
- continue;
- }
- // escape regex meta-chars
- if (ArrayTools.contains(REG_EX_META_CHARS, c)) {
- sb.append('\\');
- }
- sb.append(c);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleThreadFactory.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleThreadFactory.java
deleted file mode 100644
index ce3600f9a4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SimpleThreadFactory.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.utility.internal;
-
-import java.util.concurrent.ThreadFactory;
-
-/**
- * A <code>SimpleThreadFactory</code> is a straightforward implementation of
- * the JDK {@link ThreadFactory}.
- */
-public class SimpleThreadFactory
- implements ThreadFactory
-{
- // singleton
- private static final SimpleThreadFactory INSTANCE = new SimpleThreadFactory();
-
- /**
- * Return the singleton.
- */
- public static ThreadFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private SimpleThreadFactory() {
- super();
- }
-
- public Thread newThread(Runnable r) {
- return new Thread(r);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.java
deleted file mode 100644
index 765c10e284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Stack.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.utility.internal;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-
-/**
- * Interface defining the classic stack behavior,
- * without the backdoors allowed by {@link java.util.Stack}.
- *
- * @param <E> the type of elements contained by the stack
- */
-public interface Stack<E> {
-
- /**
- * "Push" the specified item on to the top of the stack.
- */
- void push(E element);
-
- /**
- * "Pop" an item from the top of the stack.
- */
- E pop();
-
- /**
- * Return the item on the top of the stack
- * without removing it from the stack.
- */
- E peek();
-
- /**
- * Return whether the stack is empty.
- */
- boolean isEmpty();
-
-
- final class Empty<E> implements Stack<E>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Stack INSTANCE = new Empty();
- @SuppressWarnings("unchecked")
- public static <T> Stack<T> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Empty() {
- super();
- }
- public void push(E element) {
- throw new UnsupportedOperationException();
- }
- public E pop() {
- throw new EmptyStackException();
- }
- public E peek() {
- throw new EmptyStackException();
- }
- public boolean isEmpty() {
- return true;
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StatefulCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StatefulCommandExecutor.java
deleted file mode 100644
index d4fd37a110..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StatefulCommandExecutor.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.utility.internal;
-
-import org.eclipse.jpt.utility.CommandExecutor;
-
-/**
- * This interface allows clients to control how a command is executed.
- * This is useful when the server provides the command but the client provides
- * the context (e.g. the client would like to dispatch the command to the UI
- * thread).
- */
-public interface StatefulCommandExecutor
- extends CommandExecutor
-{
- /**
- * Start the command executor.
- */
- void start();
-
- /**
- * Stop the command executor.
- */
- void stop();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
deleted file mode 100644
index de981a3017..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringConverter.java
+++ /dev/null
@@ -1,80 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Used by various "pluggable" classes to transform objects
- * into strings.
- */
-public interface StringConverter<T> {
-
- /**
- * Convert the specified object into a string.
- * The semantics of "convert" is determined by the
- * contract between the client and the server.
- */
- String convertToString(T o);
-
-
- final class Default<S> implements StringConverter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final StringConverter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> StringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // simply return the object's #toString() result
- public String convertToString(S o) {
- return (o == null) ? null : o.toString();
- }
- @Override
- public String toString() {
- return "StringConverter.Default"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Disabled<S> implements StringConverter<S>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final StringConverter INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> StringConverter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public String convertToString(S o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "StringConverter.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java
deleted file mode 100644
index 7b12900612..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringMatcher.java
+++ /dev/null
@@ -1,65 +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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * This interface defines a simple API for allowing "pluggable"
- * string matchers that can be configured with a pattern string
- * then used to determine what strings match the pattern.
- */
-public interface StringMatcher {
-
- /**
- * Set the pattern string used to determine future
- * matches. The format and semantics of the pattern
- * string are determined by the contract between the
- * client and the server.
- */
- void setPatternString(String patternString);
-
- /**
- * Return whether the specified string matches the
- * established pattern string. The semantics of a match
- * is determined by the contract between the
- * client and the server.
- */
- boolean matches(String string);
-
-
- final class Null implements StringMatcher, Serializable {
- public static final StringMatcher INSTANCE = new Null();
- public static StringMatcher instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void setPatternString(String patternString) {
- // ignore the pattern string
- }
- public boolean matches(String string) {
- // everything is a match
- return true;
- }
- @Override
- public String toString() {
- return "StringMatcher.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
deleted file mode 100644
index 71beb434e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/StringTools.java
+++ /dev/null
@@ -1,4485 +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.utility.internal;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * Convenience methods related to the java.lang.String class.
- *
- * As of jdk 1.5, it's tempting to convert all of these methods to use
- * java.lang.Appendable (instead of StringBuffer, StringBuilder, and Writer);
- * but all the Appendable methods throw java.io.IOException (yech) and we
- * [might?] get a bit better performance invoking methods on classes than
- * we get on interfaces. :-)
- */
-public final class StringTools {
-
- /** carriage return */
- public static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- /** double quote */
- public static final char QUOTE = '"';
-
- /** parenthesis */
- public static final char OPEN_PARENTHESIS = '(';
- public static final char CLOSE_PARENTHESIS = ')';
-
- /** brackets */
- public static final char OPEN_BRACKET = '[';
- public static final char CLOSE_BRACKET = ']';
-
- /** brackets */
- public static final char OPEN_BRACE = '{';
- public static final char CLOSE_BRACE = '}';
-
- /** brackets */
- public static final char OPEN_CHEVRON = '<';
- public static final char CLOSE_CHEVRON = '>';
-
- /** empty string */
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
- /** empty char array */
- public static final char[] EMPTY_CHAR_ARRAY = new char[0];
-
-
-
- // ********** padding/truncating **********
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#pad(int)
- */
- public static String pad(String string, int length) {
- return pad(string, length, ' ');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, Writer)
- */
- public static void padOn(String string, int length, Writer writer) {
- padOn(string, length, ' ', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuffer)
- */
- public static void padOn(String string, int length, StringBuffer sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuilder)
- */
- public static void padOn(String string, int length, StringBuilder sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#pad(int, char)
- */
- public static String pad(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- return string;
- }
- return pad_(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, Writer)
- */
- public static void padOn(String string, int length, char c, Writer writer) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- padOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuffer)
- */
- public static void padOn(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuilder)
- */
- public static void padOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#pad(int)
- */
- public static char[] pad(char[] string, int length) {
- return pad(string, length, ' ');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, writer)
- */
- public static void padOn(char[] string, int length, Writer writer) {
- padOn(string, length, ' ', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuffer)
- */
- public static void padOn(char[] string, int length, StringBuffer sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOn(int, StringBuilder)
- */
- public static void padOn(char[] string, int length, StringBuilder sb) {
- padOn(string, length, ' ', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#pad(int, char)
- */
- public static char[] pad(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- return string;
- }
- return pad_(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, Writer)
- */
- public static void padOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- padOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuffer)
- */
- public static void padOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOn(int, char, StringBuilder)
- */
- public static void padOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncate(int)
- */
- public static String padOrTruncate(String string, int length) {
- return padOrTruncate(string, length, ' ');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, Writer)
- */
- public static void padOrTruncateOn(String string, int length, Writer writer) {
- padOrTruncateOn(string, length, ' ', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuffer)
- */
- public static void padOrTruncateOn(String string, int length, StringBuffer sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuilder)
- */
- public static void padOrTruncateOn(String string, int length, StringBuilder sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncate(int, char)
- */
- public static String padOrTruncate(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- return string.substring(0, length);
- }
- return pad_(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, Writer)
- */
- public static void padOrTruncateOn(String string, int length, char c, Writer writer) {
- int stringLength = string.length();
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string.substring(0, length), writer);
- } else {
- padOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuffer)
- */
- public static void padOrTruncateOn(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(0, length));
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuilder)
- */
- public static void padOrTruncateOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(0, length));
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncate(int)
- */
- public static char[] padOrTruncate(char[] string, int length) {
- return padOrTruncate(string, length, ' ');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, Writer)
- */
- public static void padOrTruncateOn(char[] string, int length, Writer writer) {
- padOrTruncateOn(string, length, ' ', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuffer)
- */
- public static void padOrTruncate(char[] string, int length, StringBuffer sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with spaces at the end.
- * String#padOrTruncateOn(int, StringBuilder)
- */
- public static void padOrTruncate(char[] string, int length, StringBuilder sb) {
- padOrTruncateOn(string, length, ' ', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncate(int, char)
- */
- public static char[] padOrTruncate(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- char[] result = new char[length];
- System.arraycopy(string, 0, result, 0, length);
- return result;
- }
- return pad_(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, Writer)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string, 0, length, writer);
- } else {
- padOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuffer)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, 0, length);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, it is truncated.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the end.
- * String#padOrTruncateOn(int, char, StringBuilder)
- */
- public static void padOrTruncateOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, 0, length);
- } else {
- padOn_(string, length, c, sb);
- }
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static String pad_(String string, int length, char c) {
- return new String(pad_(string.toCharArray(), length, c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, Writer writer) {
- writeStringOn(string, writer);
- fill_(string, length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, Writer writer) {
- fill_(string.length(), length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, Writer writer) {
- fill_(string.length, length, c, writer);
- }
-
- /*
- * Add enough characters to the specified writer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, Writer writer) {
- writeStringOn(ArrayTools.fill(new char[length - stringLength], c), writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, StringBuffer sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, StringBuffer sb) {
- fill_(string.length(), length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, StringBuffer sb) {
- fill_(string.length, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string buffer to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, StringBuffer sb) {
- sb.append(ArrayTools.fill(new char[length - stringLength], c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(String string, int length, char c, StringBuilder sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(String string, int length, char c, StringBuilder sb) {
- fill_(string.length(), length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(char[] string, int length, char c, StringBuilder sb) {
- fill_(string.length, length, c, sb);
- }
-
- /*
- * Add enough characters to the specified string builder to compensate for
- * the difference between the specified string and specified length.
- */
- private static void fill_(int stringLength, int length, char c, StringBuilder sb) {
- sb.append(ArrayTools.fill(new char[length - stringLength], c));
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static char[] pad_(char[] string, int length, char c) {
- char[] result = new char[length];
- int stringLength = string.length;
- System.arraycopy(string, 0, result, 0, stringLength);
- Arrays.fill(result, stringLength, length, c);
- return result;
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(char[] string, int length, char c, Writer writer) {
- writeStringOn(string, writer);
- fill_(string, length, c, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(char[] string, int length, char c, StringBuffer sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void padOn_(char[] string, int length, char c, StringBuilder sb) {
- sb.append(string);
- fill_(string, length, c, sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPad(int)
- */
- public static String zeroPad(String string, int length) {
- return frontPad(string, length, '0');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, Writer)
- */
- public static void zeroPadOn(String string, int length, Writer writer) {
- frontPadOn(string, length, '0', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuffer)
- */
- public static void zeroPadOn(String string, int length, StringBuffer sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuilder)
- */
- public static void zeroPadOn(String string, int length, StringBuilder sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPad(int, char)
- */
- public static String frontPad(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- return string;
- }
- return frontPad_(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, Writer)
- */
- public static void frontPadOn(String string, int length, char c, Writer writer) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- frontPadOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuffer)
- */
- public static void frontPadOn(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuilder)
- */
- public static void frontPadOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPad(int)
- */
- public static char[] zeroPad(char[] string, int length) {
- return frontPad(string, length, '0');
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, Writer)
- */
- public static void zeroPadOn(char[] string, int length, Writer writer) {
- frontPadOn(string, length, '0', writer);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuffer)
- */
- public static void zeroPadOn(char[] string, int length, StringBuffer sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOn(int, StringBuilder)
- */
- public static void zeroPadOn(char[] string, int length, StringBuilder sb) {
- frontPadOn(string, length, '0', sb);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPad(int, char)
- */
- public static char[] frontPad(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- return string;
- }
- return frontPad_(string, length, c);
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, Writer)
- */
- public static void frontPadOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else {
- frontPadOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuffer)
- */
- public static void frontPadOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, an IllegalArgumentException is thrown.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOn(int, char, StringBuilder)
- */
- public static void frontPadOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength > length) {
- throw new IllegalArgumentException("String is too long: " + stringLength + " > " + length); //$NON-NLS-1$ //$NON-NLS-2$
- }
- if (stringLength == length) {
- sb.append(string);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncate(int)
- */
- public static String zeroPadOrTruncate(String string, int length) {
- return frontPadOrTruncate(string, length, '0');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, Writer)
- */
- public static void zeroPadOrTruncateOn(String string, int length, Writer writer) {
- frontPadOrTruncateOn(string, length, '0', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuffer)
- */
- public static void zeroPadOrTruncateOn(String string, int length, StringBuffer sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuilder)
- */
- public static void zeroPadOrTruncateOn(String string, int length, StringBuilder sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncate(int, char)
- */
- public static String frontPadOrTruncate(String string, int length, char c) {
- int stringLength = string.length();
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- return string.substring(stringLength - length);
- }
- return frontPad_(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, Writer)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, Writer writer) {
- int stringLength = string.length();
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string.substring(stringLength - length), writer);
- } else {
- frontPadOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuffer)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, StringBuffer sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(stringLength - length));
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuilder)
- */
- public static void frontPadOrTruncateOn(String string, int length, char c, StringBuilder sb) {
- int stringLength = string.length();
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string.substring(stringLength - length));
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncate(int)
- */
- public static char[] zeroPadOrTruncate(char[] string, int length) {
- return frontPadOrTruncate(string, length, '0');
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, Writer)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, Writer writer) {
- frontPadOrTruncateOn(string, length, '0', writer);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuffer)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, StringBuffer sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with zeros at the front.
- * String#zeroPadOrTruncateOn(int, StringBuilder)
- */
- public static void zeroPadOrTruncateOn(char[] string, int length, StringBuilder sb) {
- frontPadOrTruncateOn(string, length, '0', sb);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncate(int, char)
- */
- public static char[] frontPadOrTruncate(char[] string, int length, char c) {
- int stringLength = string.length;
- if (stringLength == length) {
- return string;
- }
- if (stringLength > length) {
- char[] result = new char[length];
- System.arraycopy(string, stringLength - length, result, 0, length);
- return result;
- }
- return frontPad_(string, length, c);
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, Writer)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, Writer writer) {
- int stringLength = string.length;
- if (stringLength == length) {
- writeStringOn(string, writer);
- } else if (stringLength > length) {
- writeStringOn(string, stringLength - length, length, writer);
- } else {
- frontPadOn_(string, length, c, writer);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuffer)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, StringBuffer sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, stringLength - length, length);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /**
- * Pad or truncate the specified string to the specified length.
- * If the string is already the specified length, it is returned unchanged.
- * If it is longer than the specified length, only the last part of the string is returned.
- * If it is shorter than the specified length, it is padded with the
- * specified character at the front.
- * String#frontPadOrTruncateOn(int, char, StringBuilder)
- */
- public static void frontPadOrTruncateOn(char[] string, int length, char c, StringBuilder sb) {
- int stringLength = string.length;
- if (stringLength == length) {
- sb.append(string);
- } else if (stringLength > length) {
- sb.append(string, stringLength - length, length);
- } else {
- frontPadOn_(string, length, c, sb);
- }
- }
-
- /*
- * Front-pad the specified string without validating the parms.
- */
- private static String frontPad_(String string, int length, char c) {
- return new String(frontPad_(string.toCharArray(), length, c));
- }
-
- /*
- * Zero-pad the specified string without validating the parms.
- */
- private static char[] frontPad_(char[] string, int length, char c) {
- char[] result = new char[length];
- int stringLength = string.length;
- int padLength = length - stringLength;
- System.arraycopy(string, 0, result, padLength, stringLength);
- Arrays.fill(result, 0, padLength, c);
- return result;
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(String string, int length, char c, Writer writer) {
- fill_(string, length, c, writer);
- writeStringOn(string, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, Writer writer) {
- fill_(string, length, c, writer);
- writeStringOn(string, writer);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(String string, int length, char c, StringBuffer sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, StringBuffer sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(String string, int length, char c, StringBuilder sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
- /*
- * Pad the specified string without validating the parms.
- */
- private static void frontPadOn_(char[] string, int length, char c, StringBuilder sb) {
- fill_(string, length, c, sb);
- sb.append(string);
- }
-
-
- // ********** delimiting/quoting **********
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static String quote(String string) {
- return delimit(string, QUOTE);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(String string, Writer writer) {
- delimitOn(string, QUOTE, writer);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(String string, StringBuffer sb) {
- delimitOn(string, QUOTE, sb);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(String string, StringBuilder sb) {
- delimitOn(string, QUOTE, sb);
- }
-
- /**
- * Delimit each of the specified strings with double quotes.
- * Escape any occurrences of a double quote in a string with another
- * double quote.
- */
- public static Iterator<String> quote(Iterator<String> strings) {
- return delimit(strings, QUOTE);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static String delimit(String string, char delimiter) {
- return new String(delimit(string.toCharArray(), delimiter));
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(String string, char delimiter, Writer writer) {
- delimitOn(string.toCharArray(), delimiter, writer);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(String string, char delimiter, StringBuffer sb) {
- delimitOn(string.toCharArray(), delimiter, sb);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(String string, char delimiter, StringBuilder sb) {
- delimitOn(string.toCharArray(), delimiter, sb);
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in a string with another delimiter.
- */
- public static Iterable<String> delimit(Iterable<String> strings, char delimiter) {
- return new TransformationIterable<String, String>(strings, new CharStringDelimiter(delimiter));
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in a string with another delimiter.
- */
- public static Iterator<String> delimit(Iterator<String> strings, char delimiter) {
- return new TransformationIterator<String, String>(strings, new CharStringDelimiter(delimiter));
- }
-
- private static class CharStringDelimiter implements Transformer<String, String> {
- private char delimiter;
- CharStringDelimiter(char delimiter) {
- super();
- this.delimiter = delimiter;
- }
- public String transform(String string) {
- return StringTools.delimit(string, this.delimiter);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static String delimit(String string, String delimiter) {
- if (delimiter.length() == 1) {
- return delimit(string, delimiter.charAt(0));
- }
- return new String(delimit(string.toCharArray(), delimiter.toCharArray()));
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(String string, String delimiter, Writer writer) {
- if (delimiter.length() == 1) {
- delimitOn(string, delimiter.charAt(0), writer);
- } else {
- delimitOn(string.toCharArray(), delimiter.toCharArray(), writer);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(String string, String delimiter, StringBuffer sb) {
- if (delimiter.length() == 1) {
- delimitOn(string, delimiter.charAt(0), sb);
- } else {
- delimitOn(string.toCharArray(), delimiter.toCharArray(), sb);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(String string, String delimiter, StringBuilder sb) {
- if (delimiter.length() == 1) {
- delimitOn(string, delimiter.charAt(0), sb);
- } else {
- delimitOn(string.toCharArray(), delimiter.toCharArray(), sb);
- }
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in a string with
- * another delimiter.
- */
- public static Iterable<String> delimit(Iterable<String> strings, String delimiter) {
- return (delimiter.length() == 1) ?
- delimit(strings, delimiter.charAt(0)) :
- new TransformationIterable<String, String>(strings, new StringStringDelimiter(delimiter));
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in a string with
- * another delimiter.
- */
- public static Iterator<String> delimit(Iterator<String> strings, String delimiter) {
- return (delimiter.length() == 1) ?
- delimit(strings, delimiter.charAt(0)) :
- new TransformationIterator<String, String>(strings, new StringStringDelimiter(delimiter));
- }
-
- private static class StringStringDelimiter implements Transformer<String, String> {
- private String delimiter;
- StringStringDelimiter(String delimiter) {
- super();
- this.delimiter = delimiter;
- }
- public String transform(String string) {
- return StringTools.delimit(string, this.delimiter);
- }
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static char[] quote(char[] string) {
- return delimit(string, QUOTE);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(char[] string, Writer writer) {
- delimitOn(string, QUOTE, writer);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(char[] string, StringBuffer sb) {
- delimitOn(string, QUOTE, sb);
- }
-
- /**
- * Delimit the specified string with double quotes.
- * Escape any occurrences of a double quote in the string with another
- * double quote.
- */
- public static void quoteOn(char[] string, StringBuilder sb) {
- delimitOn(string, QUOTE, sb);
- }
-
- /**
- * Delimit each of the specified strings with double quotes.
- * Escape any occurrences of a double quote in a string with another
- * double quote.
- */
- // cannot name method simply 'quote' because of type-erasure...
- public static Iterator<char[]> quoteCharArrays(Iterator<char[]> strings) {
- return delimitCharArrays(strings, QUOTE);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static char[] delimit(char[] string, char delimiter) {
- StringBuilder sb = new StringBuilder(string.length + 2);
- delimitOn(string, delimiter, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(char[] string, char delimiter, Writer writer) {
- writeCharOn(delimiter, writer);
- writeStringOn(string, delimiter, writer);
- writeCharOn(delimiter, writer);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(char[] string, char delimiter, StringBuffer sb) {
- sb.append(delimiter);
- for (char c : string) {
- if (c == delimiter) {
- sb.append(c);
- }
- sb.append(c);
- }
- sb.append(delimiter);
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in the string with another delimiter.
- */
- public static void delimitOn(char[] string, char delimiter, StringBuilder sb) {
- sb.append(delimiter);
- for (char c : string) {
- if (c == delimiter) {
- sb.append(c);
- }
- sb.append(c);
- }
- sb.append(delimiter);
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in a string with another delimiter.
- */
- // cannot name method simply 'delimit' because of type-erasure...
- public static Iterable<char[]> delimitCharArrays(Iterable<char[]> strings, char delimiter) {
- return new TransformationIterable<char[], char[]>(strings, new CharCharArrayDelimiter(delimiter));
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of the delimiter in a string with another delimiter.
- */
- // cannot name method simply 'delimit' because of type-erasure...
- public static Iterator<char[]> delimitCharArrays(Iterator<char[]> strings, char delimiter) {
- return new TransformationIterator<char[], char[]>(strings, new CharCharArrayDelimiter(delimiter));
- }
-
- private static class CharCharArrayDelimiter implements Transformer<char[], char[]> {
- private char delimiter;
- CharCharArrayDelimiter(char delimiter) {
- super();
- this.delimiter = delimiter;
- }
- public char[] transform(char[] string) {
- return StringTools.delimit(string, this.delimiter);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static char[] delimit(char[] string, char[] delimiter) {
- int delimiterLength = delimiter.length;
- if (delimiterLength == 1) {
- return delimit(string, delimiter[0]);
- }
- int stringLength = string.length;
- char[] result = new char[stringLength+(2*delimiterLength)];
- System.arraycopy(delimiter, 0, result, 0, delimiterLength);
- System.arraycopy(string, 0, result, delimiterLength, stringLength);
- System.arraycopy(delimiter, 0, result, stringLength+delimiterLength, delimiterLength);
- return result;
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(char[] string, char[] delimiter, Writer writer) {
- if (delimiter.length == 1) {
- delimitOn(string, delimiter[0], writer);
- } else {
- writeStringOn(delimiter, writer);
- writeStringOn(string, writer);
- writeStringOn(delimiter, writer);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(char[] string, char[] delimiter, StringBuffer sb) {
- if (delimiter.length == 1) {
- delimitOn(string, delimiter[0], sb);
- } else {
- sb.append(delimiter);
- sb.append(string);
- sb.append(delimiter);
- }
- }
-
- /**
- * Delimit the specified string with the specified delimiter; i.e. put a copy of
- * the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in the string with
- * another delimiter.
- */
- public static void delimitOn(char[] string, char[] delimiter, StringBuilder sb) {
- if (delimiter.length == 1) {
- delimitOn(string, delimiter[0], sb);
- } else {
- sb.append(delimiter);
- sb.append(string);
- sb.append(delimiter);
- }
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in a string with
- * another delimiter.
- */
- // cannot name method simply 'delimit' because of type-erasure...
- public static Iterable<char[]> delimitCharArrays(Iterable<char[]> strings, char[] delimiter) {
- return new TransformationIterable<char[], char[]>(strings, new CharArrayCharArrayDelimiter(delimiter));
- }
-
- /**
- * Delimit each of the specified strings with the specified delimiter; i.e. put a
- * copy of the delimiter at the front and back of the resulting string.
- * Escape any occurrences of a single-character delimiter in a string with
- * another delimiter.
- */
- // cannot name method simply 'delimit' because of type-erasure...
- public static Iterator<char[]> delimitCharArrays(Iterator<char[]> strings, char[] delimiter) {
- return new TransformationIterator<char[], char[]>(strings, new CharArrayCharArrayDelimiter(delimiter));
- }
-
- private static class CharArrayCharArrayDelimiter implements Transformer<char[], char[]> {
- private char[] delimiter;
- CharArrayCharArrayDelimiter(char[] delimiter) {
- super();
- this.delimiter = delimiter;
- }
- public char[] transform(char[] string) {
- return StringTools.delimit(string, this.delimiter);
- }
- }
-
-
- // ********** delimiting queries **********
-
- /**
- * Return whether the specified string is quoted: "\"foo\"".
- */
- public static boolean stringIsQuoted(String string) {
- return stringIsDelimited(string, QUOTE);
- }
-
- /**
- * Return whether the specified string is parenthetical: "(foo)".
- */
- public static boolean stringIsParenthetical(String string) {
- return stringIsDelimited(string, OPEN_PARENTHESIS, CLOSE_PARENTHESIS);
- }
-
- /**
- * Return whether the specified string is bracketed: "[foo]".
- */
- public static boolean stringIsBracketed(String string) {
- return stringIsDelimited(string, OPEN_BRACKET, CLOSE_BRACKET);
- }
-
- /**
- * Return whether the specified string is braced: "{foo}".
- */
- public static boolean stringIsBraced(String string) {
- return stringIsDelimited(string, OPEN_BRACE, CLOSE_BRACE);
- }
-
- /**
- * Return whether the specified string is chevroned: "<foo>".
- */
- public static boolean stringIsChevroned(String string) {
- return stringIsDelimited(string, OPEN_CHEVRON, CLOSE_CHEVRON);
- }
-
- /**
- * Return whether the specified string is delimited by the specified
- * character.
- */
- public static boolean stringIsDelimited(String string, char c) {
- return stringIsDelimited(string, c, c);
- }
-
- /**
- * Return whether the specified string is delimited by the specified
- * characters.
- */
- public static boolean stringIsDelimited(String string, char start, char end) {
- int len = string.length();
- if (len < 2) {
- return false;
- }
- return stringIsDelimited(string.toCharArray(), start, end, len);
- }
-
- /**
- * Return whether the specified string is quoted: "\"foo\"".
- */
- public static boolean stringIsQuoted(char[] string) {
- return stringIsDelimited(string, QUOTE);
- }
-
- /**
- * Return whether the specified string is parenthetical: "(foo)".
- */
- public static boolean stringIsParenthetical(char[] string) {
- return stringIsDelimited(string, OPEN_PARENTHESIS, CLOSE_PARENTHESIS);
- }
-
- /**
- * Return whether the specified string is bracketed: "[foo]".
- */
- public static boolean stringIsBracketed(char[] string) {
- return stringIsDelimited(string, OPEN_BRACKET, CLOSE_BRACKET);
- }
-
- /**
- * Return whether the specified string is braced: "{foo}".
- */
- public static boolean stringIsBraced(char[] string) {
- return stringIsDelimited(string, OPEN_BRACE, CLOSE_BRACE);
- }
-
- /**
- * Return whether the specified string is chevroned: "<foo>".
- */
- public static boolean stringIsChevroned(char[] string) {
- return stringIsDelimited(string, OPEN_CHEVRON, CLOSE_CHEVRON);
- }
-
- /**
- * Return whether the specified string is delimited by the specified
- * character.
- */
- public static boolean stringIsDelimited(char[] string, char c) {
- return stringIsDelimited(string, c, c);
- }
-
- /**
- * Return whether the specified string is delimited by the specified
- * characters.
- */
- public static boolean stringIsDelimited(char[] string, char start, char end) {
- int len = string.length;
- if (len < 2) {
- return false;
- }
- return stringIsDelimited(string, start, end, len);
- }
-
- private static boolean stringIsDelimited(char[] s, char start, char end, int len) {
- return (s[0] == start) && (s[len - 1] == end);
- }
-
-
- // ********** undelimiting **********
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static String undelimit(String string) {
- int len = string.length() - 2;
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + string + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return EMPTY_STRING;
- }
- return new String(undelimit_(string.toCharArray(), len));
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static String undelimit(String string, int count) {
- int len = string.length() - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + string + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return EMPTY_STRING;
- }
- return new String(undelimit(string.toCharArray(), len, count));
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static char[] undelimit(char[] string) {
- int len = string.length - 2;
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return EMPTY_CHAR_ARRAY;
- }
- return undelimit_(string, len);
- }
-
- private static char[] undelimit_(char[] string, int length) {
- StringBuilder sb = new StringBuilder(length);
- undelimitOn_(string, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static char[] undelimit(char[] string, int count) {
- int len = string.length - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return EMPTY_CHAR_ARRAY;
- }
- return undelimit(string, len, count);
- }
-
- private static char[] undelimit(char[] string, int len, int count) {
- char[] result = new char[len];
- System.arraycopy(string, count, result, 0, len);
- return result;
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(String string, Writer writer) {
- undelimitOn(string.toCharArray(), writer);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(String string, int count, Writer writer) {
- int len = string.length() - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + string + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- writeStringOn(string, count, len, writer);
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(String string, StringBuffer sb) {
- undelimitOn(string.toCharArray(), sb);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(String string, int count, StringBuffer sb) {
- int len = string.length() - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + string + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- sb.append(string, count, count + len);
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(String string, StringBuilder sb) {
- undelimitOn(string.toCharArray(), sb);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(String string, int count, StringBuilder sb) {
- int len = string.length() - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + string + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- sb.append(string, count, count + len);
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(char[] string, Writer writer) {
- int len = string.length - 2;
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- undelimitOn_(string, writer);
- }
-
- /**
- * pre-condition: string is at least 3 characters long
- */
- private static void undelimitOn_(char[] string, Writer writer) {
- char delimiter = string[0]; // the first char is the delimiter
- char c = string[0];
- char next = string[1];
- int i = 1;
- int last = string.length - 1;
- do {
- c = next;
- writeCharOn(c, writer);
- i++;
- next = string[i];
- if (c == delimiter) {
- if ((next != delimiter) || (i == last)) {
- // an embedded delimiter must be followed by another delimiter
- return;
- }
- i++;
- next = string[i];
- }
- } while (i != last);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(char[] string, int count, Writer writer) {
- int len = string.length - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- writeStringOn(string, count, len, writer);
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(char[] string, StringBuffer sb) {
- int len = string.length - 2;
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- undelimitOn_(string, sb);
- }
-
- /**
- * pre-condition: string is at least 3 characters long
- */
- private static void undelimitOn_(char[] string, StringBuffer sb) {
- char delimiter = string[0]; // the first char is the delimiter
- char c = string[0];
- char next = string[1];
- int i = 1;
- int last = string.length - 1;
- do {
- c = next;
- sb.append(c);
- i++;
- next = string[i];
- if (c == delimiter) {
- if ((next != delimiter) || (i == last)) {
- // an embedded delimiter must be followed by another delimiter
- return;
- }
- i++;
- next = string[i];
- }
- } while (i != last);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(char[] string, int count, StringBuffer sb) {
- int len = string.length - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- sb.append(string, count, len);
- }
-
- /**
- * Remove the delimiters from the specified string, removing any escape
- * characters. Throw an IllegalArgumentException if the string is too short
- * to undelimit (i.e. length < 2).
- */
- public static void undelimitOn(char[] string, StringBuilder sb) {
- int len = string.length - 2;
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- undelimitOn_(string, sb);
- }
-
- /**
- * pre-condition: string is at least 3 characters long
- */
- private static void undelimitOn_(char[] string, StringBuilder sb) {
- char delimiter = string[0]; // the first char is the delimiter
- char c = string[0];
- char next = string[1];
- int i = 1;
- int last = string.length - 1;
- do {
- c = next;
- sb.append(c);
- i++;
- next = string[i];
- if (c == delimiter) {
- if ((next != delimiter) || (i == last)) {
- // an embedded delimiter must be followed by another delimiter
- return;
- }
- i++;
- next = string[i];
- }
- } while (i != last);
- }
-
- /**
- * Remove the first and last count characters from the specified string.
- * If the string is too short to be undelimited, throw an
- * IllegalArgumentException.
- * Use this method to undelimit strings that do not escape embedded
- * delimiters.
- */
- public static void undelimitOn(char[] string, int count, StringBuilder sb) {
- int len = string.length - (2 * count);
- if (len < 0) {
- throw new IllegalArgumentException("invalid string: \"" + new String(string) + '"'); //$NON-NLS-1$
- }
- if (len == 0) {
- return;
- }
- sb.append(string, count, len);
- }
-
-
- // ********** removing characters **********
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and return the result.
- * String#removeFirstOccurrence(char)
- */
- public static String removeFirstOccurrence(String string, char c) {
- int index = string.indexOf(c);
- if (index == -1) {
- // character not found
- return string;
- }
- if (index == 0) {
- // character found at the front of string
- return string.substring(1);
- }
- int last = string.length() - 1;
- if (index == last) {
- // character found at the end of string
- return string.substring(0, last);
- }
- // character found somewhere in the middle of the string
- return string.substring(0, index).concat(string.substring(index + 1));
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, Writer)
- */
- public static void removeFirstOccurrenceOn(String string, char c, Writer writer) {
- int index = string.indexOf(c);
- if (index == -1) {
- writeStringOn(string, writer);
- } else {
- removeCharAtIndexOn(string.toCharArray(), index, writer);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuffer)
- */
- public static void removeFirstOccurrenceOn(String string, char c, StringBuffer sb) {
- int index = string.indexOf(c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeCharAtIndexOn(string.toCharArray(), index, sb);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuilder)
- */
- public static void removeFirstOccurrenceOn(String string, char c, StringBuilder sb) {
- int index = string.indexOf(c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeCharAtIndexOn(string.toCharArray(), index, sb);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and return the result.
- * String#removeFirstOccurrence(char)
- */
- public static char[] removeFirstOccurrence(char[] string, char c) {
- int index = ArrayTools.indexOf(string, c);
- if (index == -1) {
- // character not found
- return string;
- }
- int last = string.length - 1;
- char[] result = new char[last];
- if (index == 0) {
- // character found at the front of string
- System.arraycopy(string, 1, result, 0, last);
- } else if (index == last) {
- // character found at the end of string
- System.arraycopy(string, 0, result, 0, last);
- } else {
- // character found somewhere in the middle of the string
- System.arraycopy(string, 0, result, 0, index);
- System.arraycopy(string, index + 1, result, index, last - index);
- }
- return result;
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, Writer)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, Writer writer) {
- int index = ArrayTools.indexOf(string, c);
- if (index == -1) {
- writeStringOn(string, writer);
- } else {
- removeCharAtIndexOn(string, index, writer);
- }
- }
-
- private static void removeCharAtIndexOn(char[] string, int index, Writer writer) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- writeStringOn(string, 1, last, writer);
- } else if (index == last) {
- // character found at the end of string
- writeStringOn(string, 0, last, writer);
- } else {
- // character found somewhere in the middle of the string
- writeStringOn(string, 0, index, writer);
- writeStringOn(string, index + 1, last - index, writer);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuffer)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, StringBuffer sb) {
- int index = ArrayTools.indexOf(string, c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeCharAtIndexOn(string, index, sb);
- }
- }
-
- private static void removeCharAtIndexOn(char[] string, int index, StringBuffer sb) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- sb.append(string, 1, last);
- } else if (index == last) {
- // character found at the end of string
- sb.append(string, 0, last);
- } else {
- // character found somewhere in the middle of the string
- sb.append(string, 0, index);
- sb.append(string, index + 1, last - index);
- }
- }
-
- /**
- * Remove the first occurrence of the specified character
- * from the specified string and print the result on the specified stream.
- * String#removeFirstOccurrenceOn(char, StringBuilder)
- */
- public static void removeFirstOccurrenceOn(char[] string, char c, StringBuilder sb) {
- int index = ArrayTools.indexOf(string, c);
- if (index == -1) {
- sb.append(string);
- } else {
- removeCharAtIndexOn(string, index, sb);
- }
- }
-
- private static void removeCharAtIndexOn(char[] string, int index, StringBuilder sb) {
- int last = string.length - 1;
- if (index == 0) {
- // character found at the front of string
- sb.append(string, 1, last);
- } else if (index == last) {
- // character found at the end of string
- sb.append(string, 0, last);
- } else {
- // character found somewhere in the middle of the string
- sb.append(string, 0, index);
- sb.append(string, index + 1, last - index);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and return the result.
- * String#removeAllOccurrences(char)
- */
- public static String removeAllOccurrences(String string, char c) {
- int first = string.indexOf(c);
- return (first == -1) ? string : new String(removeAllOccurrences_(string.toCharArray(), c, first));
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, Writer)
- */
- public static void removeAllOccurrencesOn(String string, char c, Writer writer) {
- int first = string.indexOf(c);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, writer);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, StringBuffer)
- */
- public static void removeAllOccurrencesOn(String string, char c, StringBuffer sb) {
- int first = string.indexOf(c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, sb);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the specified stream.
- * String#removeAllOccurrencesOn(char, StringBuilder)
- */
- public static void removeAllOccurrencesOn(String string, char c, StringBuilder sb) {
- int first = string.indexOf(c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string.toCharArray(), c, first, sb);
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and return the result.
- * String#removeAllOccurrences(char)
- */
- public static char[] removeAllOccurrences(char[] string, char c) {
- int first = ArrayTools.indexOf(string, c);
- return (first == -1) ? string : removeAllOccurrences_(string, c, first);
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static char[] removeAllOccurrences_(char[] string, char c, int first) {
- StringBuilder sb = new StringBuilder(string.length);
- removeAllOccurrencesOn_(string, c, first, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and write the result to the
- * specified writer.
- * String#removeAllOccurrencesOn(char, Writer)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, Writer writer) {
- int first = ArrayTools.indexOf(string, c);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllOccurrencesOn_(string, c, first, writer);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, Writer writer) {
- writeStringOn(string, 0, first, writer);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- if (d != c) {
- writeCharOn(d, writer);
- }
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllOccurrencesOn(char, StringBuffer)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, StringBuffer sb) {
- int first = ArrayTools.indexOf(string, c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string, c, first, sb);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, StringBuffer sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- if (d != c) {
- sb.append(d);
- }
- }
- }
-
- /**
- * Remove all occurrences of the specified character
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllOccurrencesOn(char, StringBuilder)
- */
- public static void removeAllOccurrencesOn(char[] string, char c, StringBuilder sb) {
- int first = ArrayTools.indexOf(string, c);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllOccurrencesOn_(string, c, first, sb);
- }
- }
-
- /*
- * The index of the first matching character is passed in.
- */
- private static void removeAllOccurrencesOn_(char[] string, char c, int first, StringBuilder sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char d = string[i];
- if (d != c) {
- sb.append(d);
- }
- }
- }
-
- /**
- * Remove all the spaces from the specified string and return the result.
- * String#removeAllSpaces()
- */
- public static String removeAllSpaces(String string) {
- return removeAllOccurrences(string, ' ');
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified writer.
- * String#removeAllSpacesOn(Writer)
- */
- public static void removeAllSpacesOn(String string, Writer writer) {
- removeAllOccurrencesOn(string, ' ', writer);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified
- * string buffer.
- * String#removeAllSpacesOn(StringBuffer)
- */
- public static void removeAllSpacesOn(String string, StringBuffer sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the specified
- * string builder.
- * String#removeAllSpacesOn(StringBuilder)
- */
- public static void removeAllSpacesOn(String string, StringBuilder sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces from the specified string and return the result.
- * String#removeAllSpaces()
- */
- public static char[] removeAllSpaces(char[] string) {
- return removeAllOccurrences(string, ' ');
- }
-
- /**
- * Remove all the spaces
- * from the specified string and write the result to the
- * specified writer.
- * String#removeAllSpacesOn(Writer)
- */
- public static void removeAllSpacesOn(char[] string, Writer writer) {
- removeAllOccurrencesOn(string, ' ', writer);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllSpacesOn(StringBuffer)
- */
- public static void removeAllSpacesOn(char[] string, StringBuffer sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the spaces
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllSpacesOn(StringBuilder)
- */
- public static void removeAllSpacesOn(char[] string, StringBuilder sb) {
- removeAllOccurrencesOn(string, ' ', sb);
- }
-
- /**
- * Remove all the whitespace from the specified string and return the result.
- * String#removeAllWhitespace()
- */
- public static String removeAllWhitespace(String string) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- return (first == -1) ? string : new String(removeAllWhitespace_(string2, first));
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified writer.
- * String#removeAllWhitespaceOn(Writer)
- */
- public static void removeAllWhitespaceOn(String string, Writer writer) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllWhitespaceOn_(string2, first, writer);
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllWhitespaceOn(StringBuffer)
- */
- public static void removeAllWhitespaceOn(String string, StringBuffer sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllWhitespaceOn(StringBuilder)
- */
- public static void removeAllWhitespaceOn(String string, StringBuilder sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Remove all the whitespace from the specified string and return the result.
- * String#removeAllWhitespace()
- */
- public static char[] removeAllWhitespace(char[] string) {
- int first = indexOfWhitespace_(string);
- return (first == -1) ? string : removeAllWhitespace_(string, first);
- }
-
- private static int indexOfWhitespace_(char[] string) {
- int len = string.length;
- for (int i = 0; i < len; i++) {
- if (Character.isWhitespace(string[i])) {
- return i;
- }
- }
- return -1;
- }
-
- /*
- * The index of the first non-whitespace character is passed in.
- */
- private static char[] removeAllWhitespace_(char[] string, int first) {
- StringBuilder sb = new StringBuilder(string.length);
- removeAllWhitespaceOn_(string, first, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified writer.
- * String#removeAllWhitespaceOn(Writer)
- */
- public static void removeAllWhitespaceOn(char[] string, Writer writer) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- removeAllWhitespaceOn_(string, first, writer);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, Writer writer) {
- writeStringOn(string, 0, first, writer);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- writeCharOn(c, writer);
- }
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string buffer.
- * String#removeAllWhitespaceOn(StringBuffer)
- */
- public static void removeAllWhitespaceOn(char[] string, StringBuffer sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, StringBuffer sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- sb.append(c);
- }
- }
- }
-
- /**
- * Remove all the whitespace
- * from the specified string and append the result to the
- * specified string builder.
- * String#removeAllWhitespaceOn(StringBuilder)
- */
- public static void removeAllWhitespaceOn(char[] string, StringBuilder sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- removeAllWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void removeAllWhitespaceOn_(char[] string, int first, StringBuilder sb) {
- sb.append(string, 0, first);
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if ( ! Character.isWhitespace(c)) {
- sb.append(c);
- }
- }
- }
-//===============================
- /**
- * Compress the whitespace in the specified string and return the result.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespace()
- */
- public static String compressWhitespace(String string) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- return (first == -1) ? string : new String(compressWhitespace_(string2, first));
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified writer.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(Writer)
- */
- public static void compressWhitespaceOn(String string, Writer writer) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- compressWhitespaceOn_(string2, first, writer);
- }
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified string buffer.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(StringBuffer)
- */
- public static void compressWhitespaceOn(String string, StringBuffer sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- compressWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified string builder.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(StringBuilder)
- */
- public static void compressWhitespaceOn(String string, StringBuilder sb) {
- char[] string2 = string.toCharArray();
- int first = indexOfWhitespace_(string2);
- if (first == -1) {
- sb.append(string);
- } else {
- compressWhitespaceOn_(string2, first, sb);
- }
- }
-
- /**
- * Compress the whitespace in the specified string and return the result.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespace()
- */
- public static char[] compressWhitespace(char[] string) {
- int first = indexOfWhitespace_(string);
- return (first == -1) ? string : compressWhitespace_(string, first);
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static char[] compressWhitespace_(char[] string, int first) {
- StringBuilder sb = new StringBuilder(string.length);
- compressWhitespaceOn_(string, first, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified writer.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(Writer)
- */
- public static void compressWhitespaceOn(char[] string, Writer writer) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- writeStringOn(string, writer);
- } else {
- compressWhitespaceOn_(string, first, writer);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void compressWhitespaceOn_(char[] string, int first, Writer writer) {
- writeStringOn(string, 0, first, writer);
- boolean spaceWritten = false;
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if (Character.isWhitespace(c)) {
- if (spaceWritten) {
- // skip subsequent whitespace characters
- } else {
- // replace first whitespace character with a space
- spaceWritten = true;
- writeCharOn(' ', writer);
- }
- } else {
- spaceWritten = false;
- writeCharOn(c, writer);
- }
- }
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified string buffer.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(StringBuffer)
- */
- public static void compressWhitespaceOn(char[] string, StringBuffer sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- compressWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void compressWhitespaceOn_(char[] string, int first, StringBuffer sb) {
- sb.append(string, 0, first);
- boolean spaceWritten = false;
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if (Character.isWhitespace(c)) {
- if (spaceWritten) {
- // skip subsequent whitespace characters
- } else {
- // replace first whitespace character with a space
- spaceWritten = true;
- sb.append(' ');
- }
- } else {
- spaceWritten = false;
- sb.append(c);
- }
- }
- }
-
- /**
- * Compress the whitespace
- * in the specified string and append the result to the
- * specified string builder.
- * The whitespace is compressed by replacing any occurrence of one or more
- * whitespace characters with a single space.
- * String#compressWhitespaceOn(StringBuilder)
- */
- public static void compressWhitespaceOn(char[] string, StringBuilder sb) {
- int first = indexOfWhitespace_(string);
- if (first == -1) {
- sb.append(string);
- } else {
- compressWhitespaceOn_(string, first, sb);
- }
- }
-
- /*
- * The index of the first whitespace character is passed in.
- */
- private static void compressWhitespaceOn_(char[] string, int first, StringBuilder sb) {
- sb.append(string, 0, first);
- boolean spaceWritten = false;
- int len = string.length;
- for (int i = first; i < len; i++) {
- char c = string[i];
- if (Character.isWhitespace(c)) {
- if (spaceWritten) {
- // skip subsequent whitespace characters
- } else {
- // replace first whitespace character with a space
- spaceWritten = true;
- sb.append(' ');
- }
- } else {
- spaceWritten = false;
- sb.append(c);
- }
- }
- }
-
-
- // ********** common prefix **********
-
- /**
- * Return the length of the common prefix shared by the specified strings.
- * String#commonPrefixLength(String)
- */
- public static int commonPrefixLength(String s1, String s2) {
- return commonPrefixLength(s1.toCharArray(), s2.toCharArray());
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings.
- */
- public static int commonPrefixLength(char[] s1, char[] s2) {
- return commonPrefixLength_(s1, s2, Math.min(s1.length, s2.length));
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum.
- * String#commonPrefixLength(String, int)
- */
- public static int commonPrefixLength(String s1, String s2, int max) {
- return commonPrefixLength(s1.toCharArray(), s2.toCharArray(), max);
- }
-
- /**
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum.
- */
- public static int commonPrefixLength(char[] s1, char[] s2, int max) {
- return commonPrefixLength_(s1, s2, Math.min(max, Math.min(s1.length, s2.length)));
- }
-
- /*
- * Return the length of the common prefix shared by the specified strings;
- * but limit the length to the specified maximum. Assume the specified
- * maximum is less than the lengths of the specified strings.
- */
- private static int commonPrefixLength_(char[] s1, char[] s2, int max) {
- for (int i = 0; i < max; i++) {
- if (s1[i] != s2[i]) {
- return i;
- }
- }
- return max; // all the characters up to 'max' are the same
- }
-
-
- // ********** capitalization **********
-
- /*
- * no zero-length check or lower case check
- */
- private static char[] capitalize_(char[] string) {
- string[0] = Character.toUpperCase(string[0]);
- return string;
- }
-
- /**
- * Modify and return the specified string with
- * its first letter capitalized.
- */
- public static char[] capitalize(char[] string) {
- if ((string.length == 0) || Character.isUpperCase(string[0])) {
- return string;
- }
- return capitalize_(string);
- }
-
- /**
- * Return the specified string with its first letter capitalized.
- * String#capitalize()
- */
- public static String capitalize(String string) {
- if ((string.length() == 0) || Character.isUpperCase(string.charAt(0))) {
- return string;
- }
- return new String(capitalize_(string.toCharArray()));
- }
-
- /**
- * Modify each of the specified strings, capitalizing the first letter of
- * each.
- */
- public static Iterable<String> capitalize(Iterable<String> strings) {
- return new TransformationIterable<String, String>(strings, STRING_CAPITALIZER);
- }
-
- /**
- * Modify each of the specified strings, capitalizing the first letter of
- * each.
- */
- public static Iterator<String> capitalize(Iterator<String> strings) {
- return new TransformationIterator<String, String>(strings, STRING_CAPITALIZER);
- }
-
- private static final Transformer<String, String> STRING_CAPITALIZER = new Transformer<String, String>() {
- public String transform(String string) {
- return StringTools.capitalize(string);
- }
- };
-
- /**
- * Modify each of the specified strings, capitalizing the first letter of
- * each.
- */
- // cannot name method simply 'capitalize' because of type-erasure...
- public static Iterable<char[]> capitalizeCharArrays(Iterable<char[]> strings) {
- return new TransformationIterable<char[], char[]>(strings, CHAR_ARRAY_CAPITALIZER);
- }
-
- /**
- * Modify each of the specified strings, capitalizing the first letter of
- * each.
- */
- // cannot name method simply 'capitalize' because of type-erasure...
- public static Iterator<char[]> capitalizeCharArrays(Iterator<char[]> strings) {
- return new TransformationIterator<char[], char[]>(strings, CHAR_ARRAY_CAPITALIZER);
- }
-
- private static final Transformer<char[], char[]> CHAR_ARRAY_CAPITALIZER = new Transformer<char[], char[]>() {
- public char[] transform(char[] string) {
- return StringTools.capitalize(string);
- }
- };
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(char[] string, StringBuffer sb) {
- sb.append(Character.toUpperCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, StringBuffer sb) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- sb.append(string);
- } else {
- capitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- * String#capitalizeOn(StringBuffer)
- */
- public static void capitalizeOn(String string, StringBuffer sb) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- sb.append(string);
- } else {
- capitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(char[] string, StringBuilder sb) {
- sb.append(Character.toUpperCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, StringBuilder sb) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- sb.append(string);
- } else {
- capitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter capitalized.
- * String#capitalizeOn(StringBuffer)
- */
- public static void capitalizeOn(String string, StringBuilder sb) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- sb.append(string);
- } else {
- capitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void capitalizeOn_(char[] string, Writer writer) {
- writeCharOn(Character.toUpperCase(string[0]), writer);
- writeStringOn(string, 1, string.length - 1, writer);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- */
- public static void capitalizeOn(char[] string, Writer writer) {
- if (string.length == 0) {
- return;
- }
- if (Character.isUpperCase(string[0])) {
- writeStringOn(string, writer);
- } else {
- capitalizeOn_(string, writer);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter capitalized.
- * String#capitalizeOn(Writer)
- */
- public static void capitalizeOn(String string, Writer writer) {
- if (string.length() == 0) {
- return;
- }
- if (Character.isUpperCase(string.charAt(0))) {
- writeStringOn(string, writer);
- } else {
- capitalizeOn_(string.toCharArray(), writer);
- }
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static char[] uncapitalize_(char[] string) {
- string[0] = Character.toLowerCase(string[0]);
- return string;
- }
-
- private static boolean stringNeedNotBeUncapitalized_(char[] string) {
- if (string.length == 0) {
- return true;
- }
- if (Character.isLowerCase(string[0])) {
- return true;
- }
- // if both the first and second characters are capitalized,
- // return the string unchanged
- if ((string.length > 1)
- && Character.isUpperCase(string[1])
- && Character.isUpperCase(string[0])){
- return true;
- }
- return false;
- }
-
- /**
- * Modify and return the specified string with its
- * first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static char[] uncapitalize(char[] string) {
- if (stringNeedNotBeUncapitalized_(string)) {
- return string;
- }
- return uncapitalize_(string);
- }
-
- private static boolean stringNeedNotBeUncapitalized_(String string) {
- if (string.length() == 0) {
- return true;
- }
- if (Character.isLowerCase(string.charAt(0))) {
- return true;
- }
- // if both the first and second characters are capitalized,
- // return the string unchanged
- if ((string.length() > 1)
- && Character.isUpperCase(string.charAt(1))
- && Character.isUpperCase(string.charAt(0))){
- return true;
- }
- return false;
- }
-
- /**
- * Return the specified string with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalize()
- */
- public static String uncapitalize(String string) {
- if (stringNeedNotBeUncapitalized_(string)) {
- return string;
- }
- return new String(uncapitalize_(string.toCharArray()));
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static void uncapitalizeOn_(char[] string, StringBuffer sb) {
- sb.append(Character.toLowerCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static void uncapitalizeOn(char[] string, StringBuffer sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalizeOn(StringBuffer)
- */
- public static void uncapitalizeOn(String string, StringBuffer sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or lower case check
- */
- private static void uncapitalizeOn_(char[] string, StringBuilder sb) {
- sb.append(Character.toLowerCase(string[0]));
- sb.append(string, 1, string.length - 1);
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static void uncapitalizeOn(char[] string, StringBuilder sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string, sb);
- }
- }
-
- /**
- * Append the specified string to the specified string builder
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalizeOn(StringBuffer)
- */
- public static void uncapitalizeOn(String string, StringBuilder sb) {
- if (stringNeedNotBeUncapitalized_(string)) {
- sb.append(string);
- } else {
- uncapitalizeOn_(string.toCharArray(), sb);
- }
- }
-
- /*
- * no zero-length check or upper case check
- */
- private static void uncapitalizeOn_(char[] string, Writer writer) {
- writeCharOn(Character.toLowerCase(string[0]), writer);
- writeStringOn(string, 1, string.length - 1, writer);
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- */
- public static void uncapitalizeOn(char[] string, Writer writer) {
- if (stringNeedNotBeUncapitalized_(string)) {
- writeStringOn(string, writer);
- } else {
- uncapitalizeOn_(string, writer);
- }
- }
-
- /**
- * Append the specified string to the specified string buffer
- * with its first letter converted to lower case.
- * (Unless both the first and second letters are upper case,
- * in which case the string is returned unchanged.)
- * String#uncapitalizeOn(Writer)
- */
- public static void uncapitalizeOn(String string, Writer writer) {
- if (stringNeedNotBeUncapitalized_(string)) {
- writeStringOn(string, writer);
- } else {
- uncapitalizeOn_(string.toCharArray(), writer);
- }
- }
-
-
- // ********** #toString() helper methods **********
-
- /**
- * Build a "standard" #toString() result for the specified object
- * and additional information:
- * ClassName[00F3EE42] (add'l info)
- */
- public static String buildToStringFor(Object o, Object additionalInfo) {
- StringBuilder sb = new StringBuilder();
- buildSimpleToStringOn(o, sb);
- sb.append('(');
- sb.append(additionalInfo);
- sb.append(')');
- return sb.toString();
- }
-
- /**
- * Build a "standard" simple #toString() result for the specified object:
- * ClassName[00F3EE42]
- */
- public static String buildToStringFor(Object o) {
- StringBuilder sb = new StringBuilder();
- buildSimpleToStringOn(o, sb);
- return sb.toString();
- }
-
- /**
- * Append a "standard" simple #toString() for the specified object to
- * the specified string buffer:
- * ClassName[00F3EE42]
- */
- public static void buildSimpleToStringOn(Object o, StringBuffer sb) {
- sb.append(buildToStringClassName(o.getClass()));
- sb.append('[');
- // use System#identityHashCode(Object), since Object#hashCode() may be overridden
- sb.append(zeroPad(Integer.toHexString(System.identityHashCode(o)).toUpperCase(), 8));
- sb.append(']');
- }
-
- /**
- * Append a "standard" simple #toString() for the specified object to
- * the specified string builder:
- * ClassName[00F3EE42]
- */
- public static void buildSimpleToStringOn(Object o, StringBuilder sb) {
- sb.append(buildToStringClassName(o.getClass()));
- sb.append('[');
- // use System#identityHashCode(Object), since Object#hashCode() may be overridden
- sb.append(zeroPad(Integer.toHexString(System.identityHashCode(o)).toUpperCase(), 8));
- sb.append(']');
- }
-
- /**
- * Return a name suitable for a <code>#toString()</code> implementation.
- * {@link Class#getSimpleName()} isn't quite good enough for anonymous
- * classes; since it returns an empty string. This method will return the
- * name of the anonymous class's super class, which is a bit more helpful.
- */
- public static String buildToStringClassName(Class<?> javaClass) {
- String simpleName = javaClass.getSimpleName();
- return simpleName.equals("") ? //$NON-NLS-1$
- buildToStringClassName(javaClass.getSuperclass()) : // recurse
- simpleName;
- }
-
- public static <T> String append(StringBuilder sb, T[] array) {
- return append(sb, new ArrayListIterator<T>(array));
- }
-
- public static <T> String append(StringBuilder sb, Iterable<T> iterable) {
- return append(sb, iterable.iterator());
- }
-
- public static <T> String append(StringBuilder sb, Iterator<T> iterator) {
- sb.append('[');
- while (iterator.hasNext()) {
- sb.append(iterator.next());
- if (iterator.hasNext()) {
- sb.append(", "); //$NON-NLS-1$
- }
- }
- sb.append(']');
- return sb.toString();
- }
-
-
- // ********** 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);
- }
-
- /**
- * Return whether the specified string is null, empty, or contains
- * only whitespace characters.
- */
- public static boolean stringIsEmpty(char[] string) {
- if (string == null) {
- return true;
- }
- int len = string.length;
- if (len == 0) {
- return true;
- }
- return stringIsEmpty_(string, len);
- }
-
- private static boolean stringIsEmpty_(char[] s, int len) {
- for (int i = len; i-- > 0; ) {
- if ( ! Character.isWhitespace(s[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string is non-null, non-empty, and does
- * not contain only whitespace characters.
- */
- public static boolean stringIsNotEmpty(String string) {
- return ! stringIsEmpty(string);
- }
-
- /**
- * Return whether the specified string is non-null, non-empty, and does
- * not contain only whitespace characters.
- */
- public static boolean stringIsNotEmpty(char[] string) {
- return ! stringIsEmpty(string);
- }
-
- /**
- * Return whether the specified strings are equal.
- * Check for nulls.
- */
- public static boolean stringsAreEqual(String s1, String s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- return s1.equals(s2);
- }
-
- /**
- * Return whether the specified strings are equal.
- * Check for nulls.
- */
- public static boolean stringsAreEqual(char[] s1, char[] s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- int len = s1.length;
- if (len != s2.length) {
- return false;
- }
- for (int i = len; i-- > 0; ) {
- if (s1[i] != s2[i]) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified strings are equal, ignoring case.
- * Check for nulls.
- */
- public static boolean stringsAreEqualIgnoreCase(String s1, String s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- return s1.equalsIgnoreCase(s2);
- }
-
- /**
- * Return whether the specified strings are equal, ignoring case.
- * Check for nulls.
- */
- public static boolean stringsAreEqualIgnoreCase(char[] s1, char[] s2) {
- if ((s1 == null) && (s2 == null)) {
- return true; // both are null
- }
- if ((s1 == null) || (s2 == null)) {
- return false; // one is null but the other is not
- }
- int len = s1.length;
- if (len != s2.length) {
- return false;
- }
- for (int i = len; i-- > 0; ) {
- if ( ! charactersAreEqualIgnoreCase(s1[i], s2[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string starts with the specified prefix,
- * ignoring case.
- */
- public static boolean stringStartsWithIgnoreCase(char[] string, char[] prefix) {
- int prefixLength = prefix.length;
- if (string.length < prefixLength) {
- return false;
- }
- for (int i = prefixLength; i-- > 0; ) {
- if ( ! charactersAreEqualIgnoreCase(string[i], prefix[i])) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Return whether the specified string starts with the specified prefix,
- * ignoring case.
- */
- public static boolean stringStartsWithIgnoreCase(String string, String prefix) {
- return string.regionMatches(true, 0, prefix, 0, prefix.length());
- }
-
- /**
- * Return whether the specified characters are are equal, ignoring case.
- * @see java.lang.String#regionMatches(boolean, int, String, int, int)
- */
- public static boolean charactersAreEqualIgnoreCase(char c1, char c2) {
- // something about the Georgian alphabet requires us to check lower case also
- return (c1 == c2)
- || (Character.toUpperCase(c1) == Character.toUpperCase(c2))
- || (Character.toLowerCase(c1) == Character.toLowerCase(c2));
- }
-
- /**
- * Return whether the specified string is uppercase.
- */
- public static boolean stringIsUppercase(String string) {
- return (string.length() == 0) ? false : stringIsUppercase_(string);
- }
-
- /**
- * Return whether the specified string is uppercase.
- */
- public static boolean stringIsUppercase(char[] string) {
- return (string.length == 0) ? false : stringIsUppercase_(new String(string));
- }
-
- private static boolean stringIsUppercase_(String string) {
- return string.equals(string.toUpperCase());
- }
-
- /**
- * Return whether the specified string is lowercase.
- */
- public static boolean stringIsLowercase(String string) {
- return (string.length() == 0) ? false : stringIsLowercase_(string);
- }
-
- /**
- * Return whether the specified string is lowercase.
- */
- public static boolean stringIsLowercase(char[] string) {
- return (string.length == 0) ? false : stringIsLowercase_(new String(string));
- }
-
- private static boolean stringIsLowercase_(String string) {
- return string.equals(string.toLowerCase());
- }
-
-
- // ********** convert camel case to all caps **********
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static String convertCamelCaseToAllCaps(String camelCaseString) {
- int len = camelCaseString.length();
- if (len == 0) {
- return camelCaseString;
- }
- return new String(convertCamelCaseToAllCaps_(camelCaseString.toCharArray(), len));
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static char[] convertCamelCaseToAllCaps(char[] camelCaseString) {
- int len = camelCaseString.length;
- if (len == 0) {
- return camelCaseString;
- }
- return convertCamelCaseToAllCaps_(camelCaseString, len);
- }
-
- private static char[] convertCamelCaseToAllCaps_(char[] camelCaseString, int len) {
- StringBuilder sb = new StringBuilder(len * 2);
- convertCamelCaseToAllCapsOn_(camelCaseString, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, StringBuffer sb) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, sb);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, StringBuffer sb) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int len, StringBuffer sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- sb.append('_');
- }
- sb.append(Character.toUpperCase(c));
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, StringBuilder sb) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, sb);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, StringBuilder sb) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int len, StringBuilder sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- sb.append('_');
- }
- sb.append(Character.toUpperCase(c));
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, Writer writer) {
- int len = camelCaseString.length();
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), len, writer);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, Writer writer) {
- int len = camelCaseString.length;
- if (len != 0) {
- convertCamelCaseToAllCapsOn_(camelCaseString, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int len, Writer writer) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- writeCharOn('_', writer);
- }
- writeCharOn(Character.toUpperCase(c), writer);
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static String convertCamelCaseToAllCaps(String camelCaseString, int maxLength) {
- int len = camelCaseString.length();
- if ((len == 0) || (maxLength == 0)) {
- return camelCaseString;
- }
- return new String(convertCamelCaseToAllCaps_(camelCaseString.toCharArray(), maxLength, len));
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static char[] convertCamelCaseToAllCaps(char[] camelCaseString, int maxLength) {
- int len = camelCaseString.length;
- if ((len == 0) || (maxLength == 0)) {
- return camelCaseString;
- }
- return convertCamelCaseToAllCaps_(camelCaseString, maxLength, len);
- }
-
- private static char[] convertCamelCaseToAllCaps_(char[] camelCaseString, int maxLength, int len) {
- StringBuilder sb = new StringBuilder(maxLength);
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, StringBuffer sb) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, sb);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, StringBuffer sb) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int maxLength, int len, StringBuffer sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- sb.append('_');
- if (sb.length() == maxLength) {
- return;
- }
- }
- sb.append(Character.toUpperCase(c));
- if (sb.length() == maxLength) {
- return;
- }
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, StringBuilder sb) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, sb);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, StringBuilder sb) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, sb);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int maxLength, int len, StringBuilder sb) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- sb.append('_');
- if (sb.length() == maxLength) {
- return;
- }
- }
- sb.append(Character.toUpperCase(c));
- if (sb.length() == maxLength) {
- return;
- }
- prev = c;
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(String camelCaseString, int maxLength, Writer writer) {
- int len = camelCaseString.length();
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString.toCharArray(), maxLength, len, writer);
- }
- }
-
- /**
- * Convert the specified "camel case" string to an "all caps" string:
- * "largeProject" -> "LARGE_PROJECT"
- * Limit the resulting string to the specified maximum length.
- */
- public static void convertCamelCaseToAllCapsOn(char[] camelCaseString, int maxLength, Writer writer) {
- int len = camelCaseString.length;
- if ((len != 0) && (maxLength != 0)) {
- convertCamelCaseToAllCapsOn_(camelCaseString, maxLength, len, writer);
- }
- }
-
- private static void convertCamelCaseToAllCapsOn_(char[] camelCaseString, int maxLength, int len, Writer writer) {
- char prev = 0; // assume 0 is not a valid char
- char c = 0;
- char next = camelCaseString[0];
- int writerLength = 0;
- for (int i = 1; i <= len; i++) { // NB: start at 1 and end at len!
- c = next;
- next = ((i == len) ? 0 : camelCaseString[i]);
- if (camelCaseWordBreak_(prev, c, next)) {
- writeCharOn('_', writer);
- if (++writerLength == maxLength) {
- return;
- }
- }
- writeCharOn(Character.toUpperCase(c), writer);
- if (++writerLength == maxLength) {
- return;
- }
- prev = c;
- }
- }
-
- /*
- * Return whether the specified series of characters occur at
- * a "camel case" work break:
- * "*aa" -> false
- * "*AA" -> false
- * "*Aa" -> false
- * "AaA" -> false
- * "AAA" -> false
- * "aa*" -> false
- * "AaA" -> false
- * "aAa" -> true
- * "AA*" -> false
- * "AAa" -> true
- * where '*' == any char
- */
- private static boolean camelCaseWordBreak_(char prev, char c, char next) {
- if (prev == 0) { // start of string
- return false;
- }
- if (Character.isLowerCase(c)) {
- return false;
- }
- if (Character.isLowerCase(prev)) {
- return true;
- }
- if (next == 0) { // end of string
- return false;
- }
- return Character.isLowerCase(next);
- }
-
-
- // ********** convert underscores to camel case **********
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "LargeProject"
- * Capitalize the first letter.
- */
- public static String convertUnderscoresToCamelCase(String underscoreString) {
- return convertUnderscoresToCamelCase(underscoreString, true);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "LargeProject"
- * Capitalize the first letter.
- */
- public static char[] convertUnderscoresToCamelCase(char[] underscoreString) {
- return convertUnderscoresToCamelCase(underscoreString, true);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static String convertUnderscoresToCamelCase(String underscoreString, boolean capitalizeFirstLetter) {
- int len = underscoreString.length();
- if (len == 0) {
- return underscoreString;
- }
- return new String(convertUnderscoresToCamelCase_(underscoreString.toCharArray(), capitalizeFirstLetter, len));
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static char[] convertUnderscoresToCamelCase(char[] underscoreString, boolean capitalizeFirstLetter) {
- int len = underscoreString.length;
- if (len == 0) {
- return underscoreString;
- }
- return convertUnderscoresToCamelCase_(underscoreString, capitalizeFirstLetter, len);
- }
-
- private static char[] convertUnderscoresToCamelCase_(char[] underscoreString, boolean capitalizeFirstLetter, int len) {
- StringBuilder sb = new StringBuilder(len);
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, sb);
- return convertToCharArray(sb);
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, sb);
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, StringBuffer sb) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, sb);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(char[] underscoreString, boolean capitalizeFirstLetter, int len, StringBuffer sb) {
- char prev = 0;
- char c = 0;
- boolean first = true;
- for (int i = 0; i < len; i++) {
- prev = c;
- c = underscoreString[i];
- if (c == '_') {
- continue;
- }
- if (first) {
- first = false;
- sb.append(capitalizeFirstLetter ? Character.toUpperCase(c) : Character.toLowerCase(c));
- } else {
- sb.append((prev == '_') ? Character.toUpperCase(c) : Character.toLowerCase(c));
- }
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, StringBuilder sb) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, sb);
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, StringBuilder sb) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, sb);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(char[] underscoreString, boolean capitalizeFirstLetter, int len, StringBuilder sb) {
- char prev = 0;
- char c = 0;
- boolean first = true;
- for (int i = 0; i < len; i++) {
- prev = c;
- c = underscoreString[i];
- if (c == '_') {
- continue;
- }
- if (first) {
- first = false;
- sb.append(capitalizeFirstLetter ? Character.toUpperCase(c) : Character.toLowerCase(c));
- } else {
- sb.append((prev == '_') ? Character.toUpperCase(c) : Character.toLowerCase(c));
- }
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(String underscoreString, boolean capitalizeFirstLetter, Writer writer) {
- int len = underscoreString.length();
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString.toCharArray(), capitalizeFirstLetter, len, writer);
- }
- }
-
- /**
- * Convert the specified "underscore" string to a "camel case" string:
- * "LARGE_PROJECT" -> "largeProject"
- * Optionally capitalize the first letter.
- */
- public static void convertUnderscoresToCamelCaseOn(char[] underscoreString, boolean capitalizeFirstLetter, Writer writer) {
- int len = underscoreString.length;
- if (len != 0) {
- convertUnderscoresToCamelCaseOn_(underscoreString, capitalizeFirstLetter, len, writer);
- }
- }
-
- private static void convertUnderscoresToCamelCaseOn_(char[] underscoreString, boolean capitalizeFirstLetter, int len, Writer writer) {
- char prev = 0;
- char c = 0;
- boolean first = true;
- for (int i = 0; i < len; i++) {
- prev = c;
- c = underscoreString[i];
- if (c == '_') {
- continue;
- }
- if (first) {
- first = false;
- writeCharOn(capitalizeFirstLetter ? Character.toUpperCase(c) : Character.toLowerCase(c), writer);
- } else {
- writeCharOn((prev == '_') ? Character.toUpperCase(c) : Character.toLowerCase(c), writer);
- }
- }
- }
-
-
- // ********** convert to Java string literal **********
-
- public static final String EMPTY_JAVA_STRING_LITERAL = "\"\""; //$NON-NLS-1$
- public static final char[] EMPTY_JAVA_STRING_LITERAL_CHAR_ARRAY = EMPTY_JAVA_STRING_LITERAL.toCharArray();
-
- public static String convertToJavaStringLiteral(String string) {
- int len = string.length();
- if (len == 0) {
- return EMPTY_JAVA_STRING_LITERAL;
- }
- StringBuilder sb = new StringBuilder(len + 5);
- convertToJavaStringLiteralOn_(string.toCharArray(), sb, len);
- return sb.toString();
- }
-
- public static char[] convertToJavaStringLiteral(char[] string) {
- int len = string.length;
- if (len == 0) {
- return EMPTY_JAVA_STRING_LITERAL_CHAR_ARRAY;
- }
- StringBuilder sb = new StringBuilder(len + 5);
- convertToJavaStringLiteralOn_(string, sb, len);
- len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- public static Iterable<String> convertToJavaStringLiterals(Iterable<String> strings) {
- return new TransformationIterable<String, String>(strings, STRING_TO_JAVA_STRING_LITERAL_TRANSFORMER);
- }
-
- public static Iterator<String> convertToJavaStringLiterals(Iterator<String> strings) {
- return new TransformationIterator<String, String>(strings, STRING_TO_JAVA_STRING_LITERAL_TRANSFORMER);
- }
-
- private static final Transformer<String, String> STRING_TO_JAVA_STRING_LITERAL_TRANSFORMER = new Transformer<String, String>() {
- public String transform(String string) {
- return StringTools.convertToJavaStringLiteral(string);
- }
- };
-
- // cannot name method simply 'convertToJavaStringLiterals' because of type-erasure...
- public static Iterable<char[]> convertToJavaCharArrayLiterals(Iterable<char[]> strings) {
- return new TransformationIterable<char[], char[]>(strings, CHAR_ARRAY_TO_JAVA_STRING_LITERAL_TRANSFORMER);
- }
-
- // cannot name method simply 'convertToJavaStringLiterals' because of type-erasure...
- public static Iterator<char[]> convertToJavaCharArrayLiterals(Iterator<char[]> strings) {
- return new TransformationIterator<char[], char[]>(strings, CHAR_ARRAY_TO_JAVA_STRING_LITERAL_TRANSFORMER);
- }
-
- private static final Transformer<char[], char[]> CHAR_ARRAY_TO_JAVA_STRING_LITERAL_TRANSFORMER = new Transformer<char[], char[]>() {
- public char[] transform(char[] string) {
- return StringTools.convertToJavaStringLiteral(string);
- }
- };
-
- public static void convertToJavaStringLiteralOn(String string, StringBuffer sb) {
- int len = string.length();
- if (len == 0) {
- sb.append(EMPTY_JAVA_STRING_LITERAL);
- } else {
- convertToJavaStringLiteralOn_(string.toCharArray(), sb, len);
- }
- }
-
- public static void convertToJavaStringLiteralOn(char[] string, StringBuffer sb) {
- int len = string.length;
- if (len == 0) {
- sb.append(EMPTY_JAVA_STRING_LITERAL);
- } else {
- convertToJavaStringLiteralOn_(string, sb, len);
- }
- }
-
- /*
- * no length checks
- */
- private static void convertToJavaStringLiteralOn_(char[] string, StringBuffer sb, int len) {
- sb.ensureCapacity(sb.length() + len + 5);
- sb.append(QUOTE);
- for (char c : string) {
- switch (c) {
- case '\b': // backspace
- sb.append("\\b"); //$NON-NLS-1$
- break;
- case '\t': // horizontal tab
- sb.append("\\t"); //$NON-NLS-1$
- break;
- case '\n': // line-feed LF
- sb.append("\\n"); //$NON-NLS-1$
- break;
- case '\f': // form-feed FF
- sb.append("\\f"); //$NON-NLS-1$
- break;
- case '\r': // carriage-return CR
- sb.append("\\r"); //$NON-NLS-1$
- break;
- case '"': // double-quote
- sb.append("\\\""); //$NON-NLS-1$
- break;
-// case '\'': // single-quote
-// sb.append("\\'"); //$NON-NLS-1$
-// break;
- case '\\': // backslash
- sb.append("\\\\"); //$NON-NLS-1$
- break;
- default:
- sb.append(c);
- break;
- }
- }
- sb.append(QUOTE);
- }
-
- public static void convertToJavaStringLiteralOn(String string, StringBuilder sb) {
- int len = string.length();
- if (len == 0) {
- sb.append(EMPTY_JAVA_STRING_LITERAL);
- } else {
- convertToJavaStringLiteralOn_(string.toCharArray(), sb, len);
- }
- }
-
- public static void convertToJavaStringLiteralOn(char[] string, StringBuilder sb) {
- int len = string.length;
- if (len == 0) {
- sb.append(EMPTY_JAVA_STRING_LITERAL);
- } else {
- convertToJavaStringLiteralOn_(string, sb, len);
- }
- }
-
- /*
- * no length checks
- */
- private static void convertToJavaStringLiteralOn_(char[] string, StringBuilder sb, int len) {
- sb.ensureCapacity(sb.length() + len + 5);
- sb.append(QUOTE);
- for (char c : string) {
- switch (c) {
- case '\b': // backspace
- sb.append("\\b"); //$NON-NLS-1$
- break;
- case '\t': // horizontal tab
- sb.append("\\t"); //$NON-NLS-1$
- break;
- case '\n': // line-feed LF
- sb.append("\\n"); //$NON-NLS-1$
- break;
- case '\f': // form-feed FF
- sb.append("\\f"); //$NON-NLS-1$
- break;
- case '\r': // carriage-return CR
- sb.append("\\r"); //$NON-NLS-1$
- break;
- case '"': // double-quote
- sb.append("\\\""); //$NON-NLS-1$
- break;
-// case '\'': // single-quote
-// sb.append("\\'"); //$NON-NLS-1$
-// break;
- case '\\': // backslash
- sb.append("\\\\"); //$NON-NLS-1$
- break;
- default:
- sb.append(c);
- break;
- }
- }
- sb.append(QUOTE);
- }
-
- public static void convertToJavaStringLiteralOn(String string, Writer writer) {
- if (string.length() == 0) {
- writeStringOn(EMPTY_JAVA_STRING_LITERAL, writer);
- } else {
- convertToJavaStringLiteralOn_(string.toCharArray(), writer);
- }
- }
-
- public static void convertToJavaStringLiteralOn(char[] string, Writer writer) {
- if (string.length == 0) {
- writeStringOn(EMPTY_JAVA_STRING_LITERAL, writer);
- } else {
- convertToJavaStringLiteralOn_(string, writer);
- }
- }
-
- /*
- * no length checks
- */
- private static void convertToJavaStringLiteralOn_(char[] string, Writer writer) {
- writeCharOn(QUOTE, writer);
- for (char c : string) {
- switch (c) {
- case '\b': // backspace
- writeStringOn("\\b", writer); //$NON-NLS-1$
- break;
- case '\t': // horizontal tab
- writeStringOn("\\t", writer); //$NON-NLS-1$
- break;
- case '\n': // line-feed LF
- writeStringOn("\\n", writer); //$NON-NLS-1$
- break;
- case '\f': // form-feed FF
- writeStringOn("\\f", writer); //$NON-NLS-1$
- break;
- case '\r': // carriage-return CR
- writeStringOn("\\r", writer); //$NON-NLS-1$
- break;
- case '"': // double-quote
- writeStringOn("\\\"", writer); //$NON-NLS-1$
- break;
-// case '\'': // single-quote
-// writeStringOn("\\'", writer); //$NON-NLS-1$
-// break;
- case '\\': // backslash
- writeStringOn("\\\\", writer); //$NON-NLS-1$
- break;
- default:
- writeCharOn(c, writer);
- break;
- }
- }
- writeCharOn(QUOTE, writer);
- }
-
-
- // ********** convenience **********
-
- public static char[] convertToCharArray(StringBuffer sb) {
- int len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- public static char[] convertToCharArray(StringBuilder sb) {
- int len = sb.length();
- char[] result = new char[len];
- sb.getChars(0, len, result, 0);
- return result;
- }
-
- private static void writeStringOn(char[] string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static void writeStringOn(char[] string, char escape, Writer writer) {
- try {
- for (char c : string) {
- if (c == escape) {
- writer.write(c);
- }
- writer.write(c);
- }
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static void writeStringOn(char[] string, int off, int len, Writer writer) {
- try {
- writer.write(string, off, len);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static void writeStringOn(String string, int off, int len, Writer writer) {
- try {
- writer.write(string, off, len);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static void writeStringOn(String string, Writer writer) {
- try {
- writer.write(string);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private static void writeCharOn(char c, Writer writer) {
- try {
- writer.write(c);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-
- // ********** constructor **********
-
- /*
- * Suppress default constructor, ensuring non-instantiability.
- */
- private StringTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBag.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBag.java
deleted file mode 100644
index e59e8a1085..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBag.java
+++ /dev/null
@@ -1,220 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * Thread-safe implementation of the {@link Bag} interface.
- */
-public class SynchronizedBag<E>
- implements Bag<E>, Serializable
-{
- /** Backing bag. */
- private final Bag<E> bag;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a synchronized bag that wraps the
- * specified bag and locks on the specified mutex.
- */
- public SynchronizedBag(Bag<E> bag, Object mutex) {
- super();
- if (bag == null) {
- throw new NullPointerException();
- }
- this.bag = bag;
- this.mutex = mutex;
- }
-
- /**
- * Construct a synchronized bag that wraps the
- * specified bag and locks on itself.
- */
- public SynchronizedBag(Bag<E> bag) {
- super();
- if (bag == null) {
- throw new NullPointerException();
- }
- this.bag = bag;
- this.mutex = this;
- }
-
- /**
- * Construct a synchronized bag that locks on the specified mutex.
- */
- public SynchronizedBag(Object mutex) {
- this(new HashBag<E>(), mutex);
- }
-
- /**
- * Construct a synchronized bag that locks on itself.
- */
- public SynchronizedBag() {
- this(new HashBag<E>());
- }
-
-
- // ********** Bag implementation **********
-
- public boolean add(E o, int count) {
- synchronized (this.mutex) {
- return this.bag.add(o, count);
- }
- }
-
- public int count(Object o) {
- synchronized (this.mutex) {
- return this.bag.count(o);
- }
- }
-
- public Iterator<Bag.Entry<E>> entries() {
- synchronized (this.mutex) {
- return this.bag.entries();
- }
- }
-
- public boolean remove(Object o, int count) {
- synchronized (this.mutex) {
- return this.bag.remove(o, count);
- }
- }
-
- public int uniqueCount() {
- synchronized (this.mutex) {
- return this.bag.uniqueCount();
- }
- }
-
- public Iterator<E> uniqueIterator() {
- synchronized (this.mutex) {
- return this.bag.uniqueIterator();
- }
- }
-
-
- // ********** Collection implementation **********
-
- public boolean add(E e) {
- synchronized (this.mutex) {
- return this.bag.add(e);
- }
- }
-
- public boolean addAll(Collection<? extends E> c) {
- synchronized (this.mutex) {
- return this.bag.addAll(c);
- }
- }
-
- public void clear() {
- synchronized (this.mutex) {
- this.bag.clear();
- }
- }
-
- public boolean contains(Object o) {
- synchronized (this.mutex) {
- return this.bag.contains(o);
- }
- }
-
- public boolean containsAll(Collection<?> c) {
- synchronized (this.mutex) {
- return this.bag.containsAll(c);
- }
- }
-
- public boolean isEmpty() {
- synchronized (this.mutex) {
- return this.bag.isEmpty();
- }
- }
-
- public Iterator<E> iterator() {
- synchronized (this.mutex) {
- return this.bag.iterator();
- }
- }
-
- public boolean remove(Object o) {
- synchronized (this.mutex) {
- return this.bag.remove(o);
- }
- }
-
- public boolean removeAll(Collection<?> c) {
- synchronized (this.mutex) {
- return this.bag.removeAll(c);
- }
- }
-
- public boolean retainAll(Collection<?> c) {
- synchronized (this.mutex) {
- return this.bag.retainAll(c);
- }
- }
-
- public int size() {
- synchronized (this.mutex) {
- return this.bag.size();
- }
- }
-
- public Object[] toArray() {
- synchronized (this.mutex) {
- return this.bag.toArray();
- }
- }
-
- public <T> T[] toArray(T[] a) {
- synchronized (this.mutex) {
- return this.bag.toArray(a);
- }
- }
-
-
- // ********** additional public protocol **********
-
- /**
- * Return the object the stack locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return this.bag.toString();
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
deleted file mode 100644
index f962b58680..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedBoolean.java
+++ /dev/null
@@ -1,469 +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.utility.internal;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to a <code>boolean</code> value.
- * It also provides protocol for suspending a thread until the
- * <code>boolean</code> value is set to <code>true</code> or <code>false</code>,
- * with optional time-outs.
- *
- * @see BooleanReference
- */
-public class SynchronizedBoolean
- implements Cloneable, Serializable
-{
- /** Backing <code>boolean</code>. */
- private boolean value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized <code>boolean</code> with the specified
- * initial value and mutex.
- */
- public SynchronizedBoolean(boolean value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized <code>boolean</code> with the
- * specified initial value.
- * The synchronized <code>boolean</code> itself will be the mutex.
- */
- public SynchronizedBoolean(boolean value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized <code>boolean</code>
- * with an initial value of <code>false</code>
- * and specified mutex.
- */
- public SynchronizedBoolean(Object mutex) {
- this(false, mutex);
- }
-
- /**
- * Create a synchronized <code>boolean</code>
- * with an initial value of <code>false</code>.
- * The synchronized <code>boolean</code> itself will be the mutex.
- */
- public SynchronizedBoolean() {
- this(false);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current <code>boolean</code> value.
- */
- public boolean getValue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current <code>boolean</code>
- * value is the specified value.
- */
- public boolean is(boolean v) {
- synchronized (this.mutex) {
- return this.value == v;
- }
- }
-
- /**
- * Return whether the current <code>boolean</code>
- * value is the specified value.
- */
- public boolean isNot(boolean v) {
- synchronized (this.mutex) {
- return this.value != v;
- }
- }
-
- /**
- * Return whether the current <code>boolean</code>
- * value is <code>true</code>.
- */
- public boolean isTrue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current <code>boolean</code>
- * value is <code>false</code>.
- */
- public boolean isFalse() {
- synchronized (this.mutex) {
- return ! this.value;
- }
- }
-
- /**
- * Set the <code>boolean</code> value.
- * If the value changes, all waiting threads are notified.
- */
- public void setValue(boolean value) {
- synchronized (this.mutex) {
- this.setValue_(value);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void setValue_(boolean v) {
- if (this.value != v) {
- this.value = v;
- this.mutex.notifyAll();
- }
- }
-
- /**
- * Set the <code>boolean</code> value to the NOT of its current value.
- * If the value changes, all waiting threads are notified.
- * Return the resulting value.
- */
- public boolean flip() {
- synchronized (this.mutex) {
- boolean v = ! this.value;
- this.setValue_(v);
- return v;
- }
- }
-
- /**
- * Set the <code>boolean</code> value to <code>true</code>.
- * If the value changes, all waiting threads are notified.
- */
- public void setNot(boolean v) {
- this.setValue( ! v);
- }
-
- /**
- * Set the <code>boolean</code> value to <code>true</code>.
- * If the value changes, all waiting threads are notified.
- */
- public void setTrue() {
- this.setValue(true);
- }
-
- /**
- * Set the <code>boolean</code> value to <code>false</code>.
- * If the value changes, all waiting threads are notified.
- */
- public void setFalse() {
- this.setValue(false);
- }
-
- /**
- * Return the object this object locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to the specified value. If the <code>boolean</code> value is already the
- * specified value, return immediately.
- */
- public void waitUntilValueIs(boolean v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilValueIs_(boolean v) throws InterruptedException {
- while (this.value != v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to the NOT of the specified value.
- * If the <code>boolean</code> value is already the NOT of the specified
- * value, return immediately.
- */
- public void waitUntilValueIsNot(boolean v) throws InterruptedException {
- this.waitUntilValueIs( ! v);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>true</code>.
- * If the <code>boolean</code> value is already <code>true</code>,
- * return immediately.
- */
- public void waitUntilTrue() throws InterruptedException {
- this.waitUntilValueIs(true);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>false</code>.
- * If the <code>boolean</code> value is already <code>false</code>,
- * return immediately.
- */
- public void waitUntilFalse() throws InterruptedException {
- this.waitUntilValueIs(false);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes to
- * <em>not</em> the specified value, then change it back to the specified
- * value and continue executing. If the <code>boolean</code> value is already
- * <em>not</em> the specified value, set the value to the specified value
- * immediately.
- */
- public void waitToSetValue(boolean v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs_( ! v);
- this.setValue_(v);
- }
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>false</code>,
- * then change it back to <code>true</code> and continue executing.
- * If the <code>boolean</code> value is already <code>false</code>,
- * set the value to <code>true</code> immediately.
- */
- public void waitToSetTrue() throws InterruptedException {
- this.waitToSetValue(true);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to <code>true</code>,
- * then change it back to <code>false</code> and continue executing.
- * If the <code>boolean</code> value is already <code>true</code>,
- * set the value to <code>false</code> immediately.
- */
- public void waitToSetFalse() throws InterruptedException {
- this.waitToSetValue(false);
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the specified value was achieved;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already the specified value,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilValueIs(boolean v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilValueIs_(boolean v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilValueIs_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value != v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value == v);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value
- * changes to the NOT of the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the NOT of the specified value was achieved;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already the NOT of the specified
- * value, return immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public void waitUntilValueIsNot(boolean v, long timeout) throws InterruptedException {
- this.waitUntilValueIs( ! v, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>true</code> or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * <code>true</code> was achieved;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already <code>true</code>,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilTrue(long timeout) throws InterruptedException {
- return this.waitUntilValueIs(true, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>false</code> or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * <code>false</code> was achieved;
- * return <code>false</code> if a time-out occurred.
- * If the <code>boolean</code> value is already <code>true</code>,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilFalse(long timeout) throws InterruptedException {
- return this.waitUntilValueIs(false, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <em>not</em> the specified value, then change it back to the specified
- * value and continue executing. If the <code>boolean</code> value does not
- * change to <code>false</code> before the time-out, simply continue
- * executing without changing the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to the specified value; return <code>false</code>
- * if a time-out occurred. If the <code>boolean</code> value is already
- * <em>not</em> the specified value, set the value to the specified value
- * immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetValue(boolean v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilValueIs_( ! v, timeout);
- if (success) {
- this.setValue_(v);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>false</code>, then change it back to <code>true</code> and
- * continue executing. If the <code>boolean</code> value does not change to
- * <code>false</code> before the time-out, simply continue executing without
- * changing the value. The time-out is specified in milliseconds. Return
- * <code>true</code> if the value was set to <code>true</code>;
- * return <code>false</code> if a time-out occurred. If the
- * <code>boolean</code> value is already <code>false</code>, set the
- * value to <code>true</code> immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetTrue(long timeout) throws InterruptedException {
- return this.waitToSetValue(true, timeout);
- }
-
- /**
- * Suspend the current thread until the <code>boolean</code> value changes
- * to <code>true</code>, then change it back to <code>false</code> and
- * continue executing. If the <code>boolean</code> value does not change to
- * <code>true</code> before the time-out, simply continue executing without
- * changing the value. The time-out is specified in milliseconds. Return
- * <code>true</code> if the value was set to <code>false</code>;
- * return <code>false</code> if a time-out occurred. If the
- * <code>boolean</code> value is already <code>true</code>, set the
- * value to <code>false</code> immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetFalse(long timeout) throws InterruptedException {
- return this.waitToSetValue(false, timeout);
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If the current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the value from another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public SynchronizedBoolean clone() {
- try {
- synchronized (this.mutex) {
- return (SynchronizedBoolean) super.clone();
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- return (o instanceof SynchronizedBoolean) &&
- (this.getValue() == ((SynchronizedBoolean) o).getValue());
- }
-
- @Override
- public int hashCode() {
- return this.getValue() ? 1 : 0;
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.getValue()) + ']';
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedInt.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedInt.java
deleted file mode 100644
index acb902ec24..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedInt.java
+++ /dev/null
@@ -1,1012 +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.utility.internal;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to an <code>int</code>.
- * It also provides protocol for suspending a thread until the
- * value is set to a specified value, with optional time-outs.
- *
- * @see IntReference
- */
-public class SynchronizedInt
- implements Comparable<SynchronizedInt>, Cloneable, Serializable
-{
- /** Backing <code>int</code>. */
- private int value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized integer with the specified initial value
- * and mutex.
- */
- public SynchronizedInt(int value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized integer with the specified initial value.
- * The synchronized integer itself will be the mutex.
- */
- public SynchronizedInt(int value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized integer with an initial value of zero
- * and the specified mutex.
- */
- public SynchronizedInt(Object mutex) {
- this(0, mutex);
- }
-
- /**
- * Create a synchronized object with an initial value of zero.
- * The synchronized integer itself will be the mutex.
- */
- public SynchronizedInt() {
- this(0);
- }
-
-
- // ********** methods **********
-
- /**
- * Return the current value.
- */
- public int getValue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current value is equal to the specified value.
- */
- public boolean equals(int v) {
- synchronized (this.mutex) {
- return this.value == v;
- }
- }
-
- /**
- * Return whether the current value is not equal to the specified value.
- */
- public boolean notEquals(int v) {
- synchronized (this.mutex) {
- return this.value != v;
- }
- }
-
- /**
- * Return whether the current value is zero.
- */
- public boolean isZero() {
- synchronized (this.mutex) {
- return this.value == 0;
- }
- }
-
- /**
- * Return whether the current value is not zero.
- */
- public boolean isNotZero() {
- synchronized (this.mutex) {
- return this.value != 0;
- }
- }
-
- /**
- * Return whether the current value is greater than the specified value.
- */
- public boolean isGreaterThan(int v) {
- synchronized (this.mutex) {
- return this.value > v;
- }
- }
-
- /**
- * Return whether the current value is greater than or equal to the
- * specified value.
- */
- public boolean isGreaterThanOrEqual(int v) {
- synchronized (this.mutex) {
- return this.value >= v;
- }
- }
-
- /**
- * Return whether the current value is less than the specified value.
- */
- public boolean isLessThan(int v) {
- synchronized (this.mutex) {
- return this.value < v;
- }
- }
-
- /**
- * Return whether the current value is less than or equal to the
- * specified value.
- */
- public boolean isLessThanOrEqual(int v) {
- synchronized (this.mutex) {
- return this.value <= v;
- }
- }
-
- /**
- * Return whether the current value is positive.
- */
- public boolean isPositive() {
- return this.isGreaterThan(0);
- }
-
- /**
- * Return whether the current value is not positive
- * (i.e. negative or zero).
- */
- public boolean isNotPositive() {
- return this.isLessThanOrEqual(0);
- }
-
- /**
- * Return whether the current value is negative.
- */
- public boolean isNegative() {
- return this.isLessThan(0);
- }
-
- /**
- * Return whether the current value is not negative
- * (i.e. zero or positive).
- */
- public boolean isNotNegative() {
- return this.isGreaterThanOrEqual(0);
- }
-
- /**
- * Set the value. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public int setValue(int value) {
- synchronized (this.mutex) {
- return this.setValue_(value);
- }
- }
-
- /**
- * Return the <em>old</em> value.
- * Pre-condition: synchronized
- */
- private int setValue_(int v) {
- int old = this.value;
- if (this.value != v) {
- this.value = v;
- this.mutex.notifyAll();
- }
- return old;
- }
-
- /**
- * Return the <em>new</em> value.
- * Pre-condition: synchronized
- */
- private int setNewValue_(int v) {
- if (this.value != v) {
- this.value = v;
- this.mutex.notifyAll();
- }
- return v;
- }
-
- /**
- * Set the value to the absolute value of the current value.
- * Return the new value.
- */
- public int abs() {
- synchronized (this.mutex) {
- return this.setNewValue_(Math.abs(this.value));
- }
- }
-
- /**
- * Set the value to the negative value of the current value.
- * Return the new value.
- */
- public int neg() {
- synchronized (this.mutex) {
- return this.setNewValue_(-this.value);
- }
- }
-
- /**
- * Set the value to zero. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public int setZero() {
- return this.setValue(0);
- }
-
- /**
- * Set the value to the current value plus the specified value.
- * Return the new value.
- */
- public int add(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(this.value + v);
- }
- }
-
- /**
- * Increment the value by one.
- * Return the new value.
- */
- public int increment() {
- synchronized (this.mutex) {
- this.value++;
- this.mutex.notifyAll();
- return this.value;
- }
- }
-
- /**
- * Set the value to the current value minus the specified value.
- * Return the new value.
- */
- public int subtract(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(this.value - v);
- }
- }
-
- /**
- * Decrement the value by one.
- * Return the new value.
- */
- public int decrement() {
- synchronized (this.mutex) {
- this.value--;
- this.mutex.notifyAll();
- return this.value;
- }
- }
-
- /**
- * Set the value to the current value times the specified value.
- * Return the new value.
- */
- public int multiply(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(this.value * v);
- }
- }
-
- /**
- * Set the value to the current value divided by the specified value.
- * Return the new value.
- */
- public int divide(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(this.value / v);
- }
- }
-
- /**
- * Set the value to the remainder of the current value divided by the
- * specified value.
- * Return the new value.
- */
- public int remainder(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(this.value % v);
- }
- }
-
- /**
- * Set the value to the minimum of the current value and the specified value.
- * Return the new value.
- */
- public int min(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(Math.min(this.value, v));
- }
- }
-
- /**
- * Set the value to the maximum of the current value and the specified value.
- * Return the new value.
- */
- public int max(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_(Math.max(this.value, v));
- }
- }
-
- /**
- * Set the value to the current value raised to the power of the'
- * specified value.
- * Return the new value.
- */
- public int pow(int v) {
- synchronized (this.mutex) {
- return this.setNewValue_((int) Math.pow(this.value, v));
- }
- }
-
- /**
- * If the current value is the specified expected value, set it to the
- * specified new value. Return the previous value.
- */
- public int compareAndSwap(int expectedValue, int newValue) {
- synchronized (this.mutex) {
- return this.compareAndSwap_(expectedValue, newValue);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private int compareAndSwap_(int expectedValue, int newValue) {
- return (this.value == expectedValue) ? this.setValue_(newValue) : this.value;
- }
-
- /**
- * Return the object the synchronized integer locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value. If the value is already the
- * specified value, return immediately.
- */
- public void waitUntilEqual(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEqual_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilEqual_(int v) throws InterruptedException {
- while (this.value != v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than the specified value. If the
- * value is already <em>not</em> the specified value,
- * return immediately.
- */
- public void waitUntilNotEqual(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilNotEqual_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilNotEqual_(int v) throws InterruptedException {
- while (this.value == v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes to zero.
- * If the value is already zero, return immediately.
- */
- public void waitUntilZero() throws InterruptedException {
- this.waitUntilEqual(0);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than zero.
- * If the value is already <em>not</em> zero,
- * return immediately.
- */
- public void waitUntilNotZero() throws InterruptedException {
- this.waitUntilNotEqual(0);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to a value greater than the specified value. If the value is already
- * greater than the specified value, return immediately.
- */
- public void waitUntilGreaterThan(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilGreaterThan_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilGreaterThan_(int v) throws InterruptedException {
- while (this.value <= v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to a value greater than or equal to the specified value. If the value is already
- * greater than or equal the specified value, return immediately.
- */
- public void waitUntilGreaterThanOrEqual(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilGreaterThanOrEqual_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilGreaterThanOrEqual_(int v) throws InterruptedException {
- while (this.value < v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to a value less than the specified value. If the value is already
- * less than the specified value, return immediately.
- */
- public void waitUntilLessThan(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilLessThan_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilLessThan_(int v) throws InterruptedException {
- while (this.value >= v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to a value less than or equal to the specified value. If the value is already
- * less than or equal the specified value, return immediately.
- */
- public void waitUntilLessThanOrEqual(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilLessThanOrEqual_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilLessThanOrEqual_(int v) throws InterruptedException {
- while (this.value > v) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value is positive.
- * If the value is already positive, return immediately.
- */
- public void waitUntilPositive() throws InterruptedException {
- this.waitUntilGreaterThan(0);
- }
-
- /**
- * Suspend the current thread until the value is not positive
- * (i.e. negative or zero).
- * If the value is already <em>not</em> positive,
- * return immediately.
- */
- public void waitUntilNotPositive() throws InterruptedException {
- this.waitUntilLessThanOrEqual(0);
- }
-
- /**
- * Suspend the current thread until the value is negative.
- * If the value is already negative, return immediately.
- */
- public void waitUntilNegative() throws InterruptedException {
- this.waitUntilLessThan(0);
- }
-
- /**
- * Suspend the current thread until the value is not negative
- * (i.e. zero or positive).
- * If the value is already <em>not</em> negative,
- * return immediately.
- */
- public void waitUntilNotNegative() throws InterruptedException {
- this.waitUntilGreaterThanOrEqual(0);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value is already <em>not</em> the specified value, set
- * the value immediately.
- * Return the previous value.
- */
- public int waitToSetValue(int v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilNotEqual_(v);
- return this.setValue_(v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than zero, then change it
- * back to zero and continue executing.
- * If the value is already <em>not</em> zero,
- * set the value to zero immediately.
- * Return the previous value.
- */
- public int waitToSetZero() throws InterruptedException {
- return this.waitToSetValue(0);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * the specified expected value, then change it
- * to the specified new value and continue executing.
- * If the value is already the specified expected value,
- * set the value to the specified new value immediately.
- * Return the previous value.
- */
- public int waitToSwap(int expectedValue, int newValue) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEqual_(expectedValue);
- return this.setValue_(newValue);
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already the specified value, return true immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilEqual(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilEqual_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilEqual_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilEqual_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value != v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value == v);
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was removed; return <code>false</code> if a
- * time-out occurred. If the value is already <em>not</em> the specified
- * value, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotEqual(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilNotEqual_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilNotEqual_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilNotEqual_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value == v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value != v);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to zero or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now zero; return <code>false</code>
- * if a time-out occurred. If the value is already zero,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilZero(long timeout) throws InterruptedException {
- return this.waitUntilEqual(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than zero or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now not zero; return <code>false</code>
- * if a time-out occurred. If the value is already <em>not</em>
- * zero, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotZero(long timeout) throws InterruptedException {
- return this.waitUntilNotEqual(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes to a value greater
- * than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already greater than the specified value, return immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilGreaterThan(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilGreaterThan_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilGreaterThan_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilGreaterThan_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value <= v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value > v);
- }
-
- /**
- * Suspend the current thread until the value changes to a value greater
- * than or equal to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already greater than or equal to the specified value,
- * return immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilGreaterThanOrEqual(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilGreaterThanOrEqual_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilGreaterThanOrEqual_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilGreaterThanOrEqual_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value < v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value >= v);
- }
-
- /**
- * Suspend the current thread until the value changes to a value less
- * than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already less than the specified value, return immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilLessThan(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilLessThan_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilLessThan_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilLessThan_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value >= v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value < v);
- }
-
- /**
- * Suspend the current thread until the value changes to a value less
- * than or equal to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already less than or equal to the specified value,
- * return immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilLessThanOrEqual(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilLessThanOrEqual_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilLessThanOrEqual_(int v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilLessThanOrEqual_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.value > v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value <= v);
- }
-
- /**
- * Suspend the current thread until the value is positive
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now positive; return <code>false</code>
- * if a time-out occurred. If the value is already positive,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilPositive(long timeout) throws InterruptedException {
- return this.waitUntilGreaterThan(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value is not positive
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now not positive; return <code>false</code>
- * if a time-out occurred. If the value is already not positive,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotPositive(long timeout) throws InterruptedException {
- return this.waitUntilLessThanOrEqual(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value is negative
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now negative; return <code>false</code>
- * if a time-out occurred. If the value is already negative,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNegative(long timeout) throws InterruptedException {
- return this.waitUntilLessThan(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value is not negative
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value is now not negative; return <code>false</code>
- * if a time-out occurred. If the value is already not negative,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotNegative(long timeout) throws InterruptedException {
- return this.waitUntilGreaterThanOrEqual(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value does not change to something other than the
- * specified value before the time-out, simply continue executing
- * without changing the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to the specified value; return <code>false</code>
- * if a time-out occurred.
- * If the value is already something other than the specified value, set
- * the value immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetValue(int v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilNotEqual_(v, timeout);
- if (success) {
- this.setValue_(v);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than zero, then change it back to zero
- * and continue executing. If the value does not change to something
- * other than zero before the time-out, simply continue
- * executing without changing the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to zero; return <code>false</code>
- * if a time-out occurred.
- * If the value is already something other than zero, set
- * the value to zero immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetZero(long timeout) throws InterruptedException {
- return this.waitToSetValue(0, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * the specified expected value, then change it
- * to the specified new value and continue executing.
- * If the value does not change to the specified expected value
- * before the time-out, simply continue executing without changing
- * the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to the specified new value; return
- * <code>false</code> if a time-out occurred.
- * If the value is already the specified expected value,
- * set the value to the specified new value immediately.
- * Return the previous value.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSwap(int expectedValue, int newValue, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEqual_(expectedValue, timeout);
- if (success) {
- this.setValue_(newValue);
- }
- return success;
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the value from another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** Comparable implementation **********
-
- public int compareTo(SynchronizedInt si) {
- int thisValue = this.getValue();
- int otherValue = si.getValue();
- return thisValue < otherValue ? -1 : (thisValue == otherValue ? 0 : 1);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public SynchronizedInt clone() {
- try {
- synchronized (this.mutex) {
- return (SynchronizedInt) super.clone();
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- return (obj instanceof SynchronizedInt) &&
- (this.getValue() == ((SynchronizedInt) obj).getValue());
- }
-
- @Override
- public int hashCode() {
- return this.getValue();
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.getValue()) + ']';
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
deleted file mode 100644
index d6554e5b3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedObject.java
+++ /dev/null
@@ -1,490 +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.utility.internal;
-
-import java.io.Serializable;
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This class provides synchronized access to an object of type <code>V</code>.
- * It also provides protocol for suspending a thread until the
- * value is set to <code>null</code> or a non-<code>null</code> value,
- * with optional time-outs.
- *
- * @parm V the type of the synchronized object's value
- * @see ObjectReference
- */
-public class SynchronizedObject<V>
- implements Cloneable, Serializable
-{
- /** Backing value. */
- private V value;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Create a synchronized object with the specified initial value
- * and mutex.
- */
- public SynchronizedObject(V value, Object mutex) {
- super();
- this.value = value;
- this.mutex = mutex;
- }
-
- /**
- * Create a synchronized object with the specified initial value.
- * The synchronized object itself will be the mutex.
- */
- public SynchronizedObject(V value) {
- super();
- this.value = value;
- this.mutex = this;
- }
-
- /**
- * Create a synchronized object with an initial value of <code>null</code>.
- * The synchronized object itself will be the mutex.
- */
- public SynchronizedObject() {
- this(null);
- }
-
-
- // ********** accessors **********
-
- /**
- * Return the current value.
- */
- public V getValue() {
- synchronized (this.mutex) {
- return this.value;
- }
- }
-
- /**
- * Return whether the current value is equal to the specified value.
- */
- public boolean valueEquals(V v) {
- synchronized (this.mutex) {
- return Tools.valuesAreEqual(this.value, v);
- }
- }
-
- /**
- * Return whether the current value is not equal to the specified value.
- */
- public boolean valueNotEqual(V v) {
- synchronized (this.mutex) {
- return Tools.valuesAreDifferent(this.value, v);
- }
- }
-
- /**
- * Return whether the current value is <code>null</code>.
- */
- public boolean isNull() {
- synchronized (this.mutex) {
- return this.value == null;
- }
- }
-
- /**
- * Return whether the current value is not <code>null</code>.
- */
- public boolean isNotNull() {
- synchronized (this.mutex) {
- return this.value != null;
- }
- }
-
- /**
- * Set the value. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public V setValue(V value) {
- synchronized (this.mutex) {
- return this.setValue_(value);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private V setValue_(V v) {
- V old = this.value;
- if (this.value != v) {
- this.value = v;
- this.mutex.notifyAll();
- }
- return old;
- }
-
- /**
- * Set the value to <code>null</code>. If the value changes, all waiting
- * threads are notified. Return the previous value.
- */
- public V setNull() {
- return this.setValue(null);
- }
-
- /**
- * If the current value is the specified expected value, set it to the
- * specified new value. Return the previous value.
- */
- public V compareAndSwap(V expectedValue, V newValue) {
- synchronized (this.mutex) {
- return this.compareAndSwap_(expectedValue, newValue);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private V compareAndSwap_(V expectedValue, V newValue) {
- return Tools.valuesAreEqual(this.value, expectedValue) ? this.setValue_(newValue) : this.value;
- }
-
- /**
- * Return the object the synchronized object locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value. If the value is already the
- * specified value, return immediately.
- */
- public void waitUntilValueIs(V v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilValueIs_(V v) throws InterruptedException {
- while (Tools.valuesAreDifferent(this.value, v)) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than the specified value. If the
- * value is already <em>not</em> the specified value,
- * return immediately.
- */
- public void waitUntilValueIsNot(V v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIsNot_(v);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilValueIsNot_(V v) throws InterruptedException {
- while (Tools.valuesAreEqual(this.value, v)) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the value changes to <code>null</code>.
- * If the value is already <code>null</code>, return immediately.
- */
- public void waitUntilNull() throws InterruptedException {
- this.waitUntilValueIs(null);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than <code>null</code>.
- * If the value is already <em>not</em> <code>null</code>,
- * return immediately.
- */
- public void waitUntilNotNull() throws InterruptedException {
- this.waitUntilValueIsNot(null);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value is already <em>not</em> the specified value, set
- * the value immediately.
- * Return the previous value.
- */
- public V waitToSetValue(V v) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIsNot_(v);
- return this.setValue_(v);
- }
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than <code>null</code>, then change it
- * back to <code>null</code> and continue executing.
- * If the value is already <em>not</em> <code>null</code>,
- * set the value to <code>null</code> immediately.
- * Return the previous value.
- */
- public V waitToSetNull() throws InterruptedException {
- return this.waitToSetValue(null);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * the specified expected value, then change it
- * to the specified new value and continue executing.
- * If the value is already the specified expected value,
- * set the value to the specified new value immediately.
- * Return the previous value.
- */
- public V waitToSwap(V expectedValue, V newValue) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilValueIs_(expectedValue);
- return this.setValue_(newValue);
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the value changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred.
- * If the value is already the specified value, return true immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilValueIs(V v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIs_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilValueIs_(V v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilValueIs_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while (Tools.valuesAreDifferent(this.value, v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value == v);
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was removed; return <code>false</code> if a
- * time-out occurred. If the value is already <em>not</em> the specified
- * value, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilValueIsNot(V v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilValueIsNot_(v, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilValueIsNot_(V v, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilValueIsNot_(v); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while (Tools.valuesAreEqual(this.value, v) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.value != v);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to <code>null</code> or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred. If the value is already <code>null</code>,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNull(long timeout) throws InterruptedException {
- return this.waitUntilValueIs(null, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes
- * to something other than <code>null</code> or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the specified value was achieved; return <code>false</code>
- * if a time-out occurred. If the value is already <em>not</em>
- * <code>null</code>, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotNull(long timeout) throws InterruptedException {
- return this.waitUntilValueIsNot(null, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * something other than the specified value, then change
- * it back to the specified value and continue executing.
- * If the value does not change to something other than the
- * specified value before the time-out, simply continue executing
- * without changing the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to the specified value; return <code>false</code>
- * if a time-out occurred.
- * If the value is already something other than the specified value, set
- * the value immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetValue(V v, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilValueIsNot_(v, timeout);
- if (success) {
- this.setValue_(v);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the value changes to something
- * other than <code>null</code>, then change it back to <code>null</code>
- * and continue executing. If the value does not change to something
- * other than <code>null</code> before the time-out, simply continue
- * executing without changing the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to <code>null</code>; return <code>false</code>
- * if a time-out occurred.
- * If the value is already something other than <code>null</code>, set
- * the value to <code>null</code> immediately and return <code>true</code>.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSetNull(long timeout) throws InterruptedException {
- return this.waitToSetValue(null, timeout);
- }
-
- /**
- * Suspend the current thread until the value changes to
- * the specified expected value, then change it
- * to the specified new value and continue executing.
- * If the value does not change to the specified expected value
- * before the time-out, simply continue executing without changing
- * the value.
- * The time-out is specified in milliseconds. Return <code>true</code>
- * if the value was set to the specified new value; return
- * <code>false</code> if a time-out occurred.
- * If the value is already the specified expected value,
- * set the value to the specified new value immediately.
- * Return the previous value.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToSwap(V expectedValue, V newValue, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilValueIs_(expectedValue, timeout);
- if (success) {
- this.setValue_(newValue);
- }
- return success;
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the value from another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public SynchronizedObject<V> clone() {
- try {
- synchronized (this.mutex) {
- @SuppressWarnings("unchecked")
- SynchronizedObject<V> clone = (SynchronizedObject<V>) super.clone();
- return clone;
- }
- } catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- @Override
- public boolean equals(Object obj) {
- return (obj instanceof SynchronizedObject<?>) &&
- Tools.valuesAreEqual(this.getValue(), ((SynchronizedObject<?>) obj).getValue());
- }
-
- @Override
- public int hashCode() {
- Object v = this.getValue();
- return (v == null) ? 0 : v.hashCode();
- }
-
- @Override
- public String toString() {
- return '[' + String.valueOf(this.getValue()) + ']';
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedQueue.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedQueue.java
deleted file mode 100644
index c35a4aa133..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedQueue.java
+++ /dev/null
@@ -1,348 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Thread-safe implementation of the {@link Queue} interface.
- * This also provides protocol for suspending a thread until the
- * queue is empty or not empty, with optional time-outs.
- */
-public class SynchronizedQueue<E>
- implements Queue<E>, Serializable
-{
- /** Backing queue. */
- private final Queue<E> queue;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a synchronized queue that wraps the
- * specified queue and locks on the specified mutex.
- */
- public SynchronizedQueue(Queue<E> queue, Object mutex) {
- super();
- if (queue == null) {
- throw new NullPointerException();
- }
- this.queue = queue;
- this.mutex = mutex;
- }
-
- /**
- * Construct a synchronized queue that wraps the
- * specified queue and locks on itself.
- */
- public SynchronizedQueue(Queue<E> queue) {
- super();
- if (queue == null) {
- throw new NullPointerException();
- }
- this.queue = queue;
- this.mutex = this;
- }
-
- /**
- * Construct an empty synchronized queue that locks on the specified mutex.
- */
- public SynchronizedQueue(Object mutex) {
- this(new SimpleQueue<E>(), mutex);
- }
-
- /**
- * Construct an empty synchronized queue that locks on itself.
- */
- public SynchronizedQueue() {
- this(new SimpleQueue<E>());
- }
-
-
- // ********** Queue implementation **********
-
- public void enqueue(E element) {
- synchronized (this.mutex) {
- this.enqueue_(element);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void enqueue_(E element) {
- this.queue.enqueue(element);
- this.mutex.notifyAll();
- }
-
- public E dequeue() {
- synchronized (this.mutex) {
- return this.dequeue_();
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private E dequeue_() {
- E element = this.queue.dequeue();
- this.mutex.notifyAll();
- return element;
- }
-
- public E peek() {
- synchronized (this.mutex) {
- return this.queue.peek();
- }
- }
-
- public boolean isEmpty() {
- synchronized (this.mutex) {
- return this.queue.isEmpty();
- }
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the queue's empty status changes
- * to the specified value.
- */
- public void waitUntilEmptyIs(boolean empty) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(empty);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilEmptyIs_(boolean empty) throws InterruptedException {
- while (this.queue.isEmpty() != empty) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the queue is empty.
- */
- public void waitUntilEmpty() throws InterruptedException {
- this.waitUntilEmptyIs(true);
- }
-
- /**
- * Suspend the current thread until the queue has something on it.
- */
- public void waitUntilNotEmpty() throws InterruptedException {
- this.waitUntilEmptyIs(false);
- }
-
- /**
- * Suspend the current thread until the queue is empty,
- * then "enqueue" the specified item to the tail of the queue
- * and continue executing.
- */
- public void waitToEnqueue(E element) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(true);
- this.enqueue_(element);
- }
- }
-
- /**
- * Suspend the current thread until the queue has something on it,
- * then "dequeue" an item from the head of the queue and return it.
- */
- public Object waitToDequeue() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(false);
- return this.dequeue_();
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the queue's empty status changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if the specified
- * empty status was achieved; return <code>false</code> if a time-out occurred.
- * If the queue's empty status is already the specified value,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilEmptyIs(boolean empty, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilEmptyIs_(empty, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilEmptyIs_(boolean empty, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilEmptyIs_(empty); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.queue.isEmpty() != empty) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.queue.isEmpty() == empty);
- }
-
- /**
- * Suspend the current thread until the queue is empty
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the queue is empty; return <code>false</code> if a time-out occurred.
- * If the queue is already empty, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilEmpty(long timeout) throws InterruptedException {
- return this.waitUntilEmptyIs(true, timeout);
- }
-
- /**
- * Suspend the current thread until the queue has something on it.
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the queue is not empty; return <code>false</code> if a time-out occurred.
- * If the queue already has something on it, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotEmpty(long timeout) throws InterruptedException {
- return this.waitUntilEmptyIs(false, timeout);
- }
-
- /**
- * Suspend the current thread until the queue is empty,
- * then "enqueue" the specified item to the tail of the queue
- * and continue executing. If the queue is not emptied out
- * before the time-out, simply continue executing without
- * "enqueueing" the item.
- * The time-out is specified in milliseconds. Return <code>true</code> if the
- * item was enqueued; return <code>false</code> if a time-out occurred.
- * If the queue is already empty, "enqueue" the specified item and
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToEnqueue(E element, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmptyIs_(true, timeout);
- if (success) {
- this.enqueue_(element);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the queue has something on it,
- * then "dequeue" an item from the head of the queue and return it.
- * If the queue is empty and nothing is "enqueued" on to it before the
- * time-out, throw a no such element exception.
- * The time-out is specified in milliseconds.
- * If the queue is not empty, "dequeue" an item and
- * return it immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public Object waitToDequeue(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmptyIs_(false, timeout);
- if (success) {
- return this.dequeue_();
- }
- throw new NoSuchElementException();
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If the current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the queue in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** additional public protocol **********
-
- /**
- * "Drain" all the current items from the queue into specified queue.
- */
- public void drainTo(Queue<E> q) {
- synchronized (this.mutex) {
- this.drainTo_(q);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void drainTo_(Queue<E> q) {
- boolean changed = false;
- while ( ! this.queue.isEmpty()) {
- q.enqueue(this.queue.dequeue());
- changed = true;
- }
- if (changed) {
- this.mutex.notifyAll();
- }
- }
-
- /**
- * Return the object the queue locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return '[' + this.queue.toString() + ']';
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
deleted file mode 100644
index dc0a4dce1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/SynchronizedStack.java
+++ /dev/null
@@ -1,325 +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.utility.internal;
-
-import java.io.Serializable;
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Thread-safe implementation of the {@link Stack} interface.
- * This also provides protocol for suspending a thread until the
- * stack is empty or not empty, with optional time-outs.
- */
-public class SynchronizedStack<E>
- implements Stack<E>, Serializable
-{
- /** Backing stack. */
- private final Stack<E> stack;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a synchronized stack that wraps the
- * specified stack and locks on the specified mutex.
- */
- public SynchronizedStack(Stack<E> stack, Object mutex) {
- super();
- if (stack == null) {
- throw new NullPointerException();
- }
- this.stack = stack;
- this.mutex = mutex;
- }
-
- /**
- * Construct a synchronized stack that wraps the
- * specified stack and locks on itself.
- */
- public SynchronizedStack(Stack<E> stack) {
- super();
- if (stack == null) {
- throw new NullPointerException();
- }
- this.stack = stack;
- this.mutex = this;
- }
-
- /**
- * Construct an empty synchronized stack that locks on the specified mutex.
- */
- public SynchronizedStack(Object mutex) {
- this(new SimpleStack<E>(), mutex);
- }
-
- /**
- * Construct an empty synchronized stack that locks on itself.
- */
- public SynchronizedStack() {
- this(new SimpleStack<E>());
- }
-
-
- // ********** Stack implementation **********
-
- public void push(E element) {
- synchronized (this.mutex) {
- this.push_(element);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void push_(E element) {
- this.stack.push(element);
- this.mutex.notifyAll();
- }
-
- public E pop() {
- synchronized (this.mutex) {
- return this.pop_();
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private E pop_() {
- E o = this.stack.pop();
- this.mutex.notifyAll();
- return o;
- }
-
- public E peek() {
- synchronized (this.mutex) {
- return this.stack.peek();
- }
- }
-
- public boolean isEmpty() {
- synchronized (this.mutex) {
- return this.stack.isEmpty();
- }
- }
-
-
- // ********** indefinite waits **********
-
- /**
- * Suspend the current thread until the stack's empty status changes
- * to the specified value.
- */
- public void waitUntilEmptyIs(boolean empty) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(empty);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private void waitUntilEmptyIs_(boolean empty) throws InterruptedException {
- while (this.stack.isEmpty() != empty) {
- this.mutex.wait();
- }
- }
-
- /**
- * Suspend the current thread until the stack is empty.
- */
- public void waitUntilEmpty() throws InterruptedException {
- this.waitUntilEmptyIs(true);
- }
-
- /**
- * Suspend the current thread until the stack has something on it.
- */
- public void waitUntilNotEmpty() throws InterruptedException {
- this.waitUntilEmptyIs(false);
- }
-
- /**
- * Suspend the current thread until the stack is empty,
- * then "push" the specified item on to the top of the stack
- * and continue executing.
- */
- public void waitToPush(E element) throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(true);
- this.push_(element);
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it,
- * then "pop" an item from the top of the stack and return it.
- */
- public Object waitToPop() throws InterruptedException {
- synchronized (this.mutex) {
- this.waitUntilEmptyIs_(false);
- return this.pop_();
- }
- }
-
-
- // ********** timed waits **********
-
- /**
- * Suspend the current thread until the stack's empty status changes
- * to the specified value or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if the specified
- * empty status was achieved; return <code>false</code> if a time-out occurred.
- * If the stack's empty status is already the specified value,
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilEmptyIs(boolean empty, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- return this.waitUntilEmptyIs_(empty, timeout);
- }
- }
-
- /**
- * Pre-condition: synchronized
- */
- private boolean waitUntilEmptyIs_(boolean empty, long timeout) throws InterruptedException {
- if (timeout == 0L) {
- this.waitUntilEmptyIs_(empty); // wait indefinitely until notified
- return true; // if it ever comes back, the condition was met
- }
-
- long stop = System.currentTimeMillis() + timeout;
- long remaining = timeout;
- while ((this.stack.isEmpty() != empty) && (remaining > 0L)) {
- this.mutex.wait(remaining);
- remaining = stop - System.currentTimeMillis();
- }
- return (this.stack.isEmpty() == empty);
- }
-
- /**
- * Suspend the current thread until the stack is empty
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the stack is empty; return <code>false</code> if a time-out occurred.
- * If the stack is already empty, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilEmpty(long timeout) throws InterruptedException {
- return this.waitUntilEmptyIs(true, timeout);
- }
-
- /**
- * Suspend the current thread until the stack has something on it.
- * or the specified time-out occurs.
- * The time-out is specified in milliseconds. Return <code>true</code> if
- * the stack is not empty; return <code>false</code> if a time-out occurred.
- * If the stack already has something on it, return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitUntilNotEmpty(long timeout) throws InterruptedException {
- return this.waitUntilEmptyIs(false, timeout);
- }
-
- /**
- * Suspend the current thread until the stack is empty,
- * then "push" the specified item on to the top of the stack
- * and continue executing. If the stack is not emptied out
- * before the time-out, simply continue executing without
- * "pushing" the item.
- * The time-out is specified in milliseconds. Return <code>true</code> if the
- * item was pushed; return <code>false</code> if a time-out occurred.
- * If the stack is already empty, "push" the specified item and
- * return <code>true</code> immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public boolean waitToPush(E element, long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmptyIs_(true, timeout);
- if (success) {
- this.push_(element);
- }
- return success;
- }
- }
-
- /**
- * Suspend the current thread until the stack has something on it,
- * then "pop" an item from the top of the stack and return it.
- * If the stack is empty and nothing is "pushed" on to it before the
- * time-out, throw an empty stack exception.
- * The time-out is specified in milliseconds.
- * If the stack is not empty, "pop" an item and
- * return it immediately.
- * If the time-out is zero, wait indefinitely.
- */
- public Object waitToPop(long timeout) throws InterruptedException {
- synchronized (this.mutex) {
- boolean success = this.waitUntilEmptyIs_(false, timeout);
- if (success) {
- return this.pop_();
- }
- throw new EmptyStackException();
- }
- }
-
-
- // ********** synchronized behavior **********
-
- /**
- * If the current thread is not interrupted, execute the specified command
- * with the mutex locked. This is useful for initializing the stack in another
- * thread.
- */
- public void execute(Command command) throws InterruptedException {
- if (Thread.interrupted()) {
- throw new InterruptedException();
- }
- synchronized (this.mutex) {
- command.execute();
- }
- }
-
-
- // ********** additional public protocol **********
-
- /**
- * Return the object the stack locks on while performing
- * its operations.
- */
- public Object getMutex() {
- return this.mutex;
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return '[' + this.stack.toString() + ']';
- }
- }
-
- private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
- synchronized (this.mutex) {
- s.defaultWriteObject();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommand.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommand.java
deleted file mode 100644
index c12038e502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommand.java
+++ /dev/null
@@ -1,63 +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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * This implementation of the Command interface allows the client to
- * specify a different Command for each thread.
- */
-public class ThreadLocalCommand implements Command {
- protected final ThreadLocal<Command> threadLocal;
- protected final Command defaultCommand;
-
- /**
- * The default command does nothing.
- */
- public ThreadLocalCommand() {
- this(Command.Null.instance());
- }
-
- public ThreadLocalCommand(Command defaultCommand) {
- super();
- this.defaultCommand = defaultCommand;
- this.threadLocal = this.buildThreadLocal();
- }
-
- protected ThreadLocal<Command> buildThreadLocal() {
- return new ThreadLocal<Command>();
- }
-
- public void execute() {
- this.get().execute();
- }
-
- protected Command get() {
- Command command = this.threadLocal.get();
- return (command != null) ? command : this.defaultCommand;
- }
-
- /**
- * Set the current thread's command to the specified value.
- */
- public void set(Command command) {
- this.threadLocal.set(command);
- }
-
- /**
- * Return the string representation of the current thread's command.
- */
- @Override
- public String toString() {
- return this.get().toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommandExecutor.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommandExecutor.java
deleted file mode 100644
index 7edfa1f862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/ThreadLocalCommandExecutor.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.utility.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-
-/**
- * This implementation of the CommandExecutor interface allows the client to
- * specify a different Command Executor for each thread.
- */
-public class ThreadLocalCommandExecutor implements CommandExecutor {
- protected final ThreadLocal<CommandExecutor> threadLocal;
- protected final CommandExecutor defaultCommandExecutor;
-
- /**
- * The default command executor simply executes the command directly.
- */
- public ThreadLocalCommandExecutor() {
- this(CommandExecutor.Default.instance());
- }
-
- public ThreadLocalCommandExecutor(CommandExecutor defaultCommandExecutor) {
- super();
- this.defaultCommandExecutor = defaultCommandExecutor;
- this.threadLocal = this.buildThreadLocal();
- }
-
- protected ThreadLocal<CommandExecutor> buildThreadLocal() {
- return new ThreadLocal<CommandExecutor>();
- }
-
- public void execute(Command command) {
- this.getThreadLocalCommandExecutor().execute(command);
- }
-
- protected CommandExecutor getThreadLocalCommandExecutor() {
- CommandExecutor ce = this.threadLocal.get();
- return (ce != null) ? ce : this.defaultCommandExecutor;
- }
-
- /**
- * Set the current thread's command executor to the specified value.
- */
- public void set(CommandExecutor commandExecutor) {
- this.threadLocal.set(commandExecutor);
- }
-
- /**
- * Return the string representation of the current thread's command
- * executor.
- */
- @Override
- public String toString() {
- return this.getThreadLocalCommandExecutor().toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Tools.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Tools.java
deleted file mode 100644
index 39378dcab5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Tools.java
+++ /dev/null
@@ -1,86 +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.utility.internal;
-
-/**
- * Various utility methods.
- */
-@SuppressWarnings("nls")
-public final class Tools {
-
- // ********** object comparison **********
-
- /**
- * Return whether the specified values are equal, with the appropriate null checks.
- */
- public static boolean valuesAreEqual(Object value1, Object value2) {
- return (value1 == null) ?
- (value2 == null) :
- ((value2 != null) && value1.equals(value2));
- }
-
- /**
- * Return whether the specified values are different, with the appropriate null checks.
- */
- public static boolean valuesAreDifferent(Object value1, Object value2) {
- return ! valuesAreEqual(value1, value2);
- }
-
-
- // ********** System properties **********
-
- /**
- * Return whether the current JVM is Sun's.
- */
- public static boolean jvmIsSun() {
- return jvmIs("Sun");
- }
-
- /**
- * Return whether the current JVM is IBM's.
- */
- public static boolean jvmIsIBM() {
- return jvmIs("IBM");
- }
-
- private static boolean jvmIs(String jvmVendorName) {
- return System.getProperty("java.vendor").startsWith(jvmVendorName);
- }
-
- /**
- * Return whether the current operating system is Microsoft Windows.
- */
- public static boolean osIsWindows() {
- return osIs("Windows");
- }
-
- /**
- * Return whether the current operating system is Linux.
- */
- public static boolean osIsLinux() {
- return osIs("Linux");
- }
-
- private static boolean osIs(String osName) {
- return System.getProperty("os.name").indexOf(osName) != -1;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private Tools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.java
deleted file mode 100644
index d73844e467..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/Transformer.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.utility.internal;
-
-import java.io.Serializable;
-
-/**
- * Used by various "pluggable" classes to transform objects.
- * Transform an object of type T1 to an object of type T2.
- */
-public interface Transformer<T1, T2> {
-
- /**
- * Return the transformed object.
- * The semantics of "transform" is determined by the
- * contract between the client and the server.
- */
- T2 transform(T1 o);
-
-
- /**
- * A "null" transformer will perform no transformation at all;
- * it will simply return the object "untransformed".
- */
- final class Null<S1, S2> implements Transformer<S1, S2>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Transformer INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R1, R2> Transformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // simply return the object, unchanged
- @SuppressWarnings("unchecked")
- public S2 transform(S1 o) {
- return (S2) o;
- }
- @Override
- public String toString() {
- return "Transformer.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /**
- * A "disabled" transformer will throw an exception if
- * {@link #transform(Object)} is called. This is useful in situations
- * where a transformer is optional and the default transformer should
- * not be used.
- */
- final class Disabled<S1, S2> implements Transformer<S1, S2>, Serializable {
- @SuppressWarnings("rawtypes")
- public static final Transformer INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R1, R2> Transformer<R1, R2> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S2 transform(S1 o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "Transformer.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java
deleted file mode 100644
index f6b3cd424e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/XMLStringEncoder.java
+++ /dev/null
@@ -1,182 +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.utility.internal;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.io.StringReader;
-
-/**
- * This encoder will replace any of a specified set of characters with an XML
- * "character reference": '/' => "&#x2f;"
- */
-public final class XMLStringEncoder {
-
- /** The set of characters to be converted into XML character references. */
- private final char[] chars;
-
- /** Cache the value of the highest character in the set above. */
- private final char maxChar;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct an encoder that converts the specified set of characters
- * into XML character references.
- */
- public XMLStringEncoder(char[] chars) {
- super();
- if (chars == null) {
- throw new NullPointerException();
- }
- // the ampersand must be included since it is the escape character
- if (ArrayTools.contains(chars, '&')) {
- this.chars = chars;
- } else {
- this.chars = ArrayTools.add(chars, '&');
- }
- this.maxChar = this.calculateMaxInvalidFileNameChar();
- }
-
- /**
- * Calculate the maximum value of the set of characters to be converted
- * into XML character references. This will be used to short-circuit the
- * search for a character in the set.
- * @see #charIsToBeEncoded(char)
- */
- private char calculateMaxInvalidFileNameChar() {
- char[] localChars = this.chars;
- char max = 0;
- for (int i = localChars.length; i-- > 0; ) {
- char c = localChars[i];
- if (max < c) {
- max = c;
- }
- }
- return max;
- }
-
-
- // ********** API **********
-
- /**
- * Return the specified string with any characters in the set
- * replaced with XML character references.
- */
- public String encode(String s) {
- int len = s.length();
- // allow for a few encoded characters
- StringBuilder sb = new StringBuilder(len + 20);
- for (int i = 0; i < len; i++) {
- this.appendCharacterTo(s.charAt(i), sb);
- }
- return sb.toString();
- }
-
- /**
- * Return the specified string with any XML character references
- * replaced by the characters themselves.
- */
- public String decode(String s) {
- StringBuilder sb = new StringBuilder(s.length());
- StringBuilder temp = new StringBuilder(); // performance tweak
- this.decodeTo(new StringReader(s), sb, temp);
- return sb.toString();
- }
-
-
- // ********** internal methods **********
-
- /**
- * Append the specified character to the string buffer,
- * converting it to an XML character reference if necessary.
- */
- private void appendCharacterTo(char c, StringBuilder sb) {
- if (this.charIsToBeEncoded(c)) {
- this.appendCharacterReferenceTo(c, sb);
- } else {
- sb.append(c);
- }
- }
-
- /**
- * Return whether the specified character is one of the characters
- * to be converted to XML character references.
- */
- private boolean charIsToBeEncoded(char c) {
- return (c <= this.maxChar) && ArrayTools.contains(this.chars, c);
- }
-
- /**
- * Append the specified character's XML character reference to the
- * specified string buffer (e.g. '/' => "&#x2f;").
- */
- private void appendCharacterReferenceTo(char c, StringBuilder sb) {
- sb.append("&#x"); //$NON-NLS-1$
- sb.append(Integer.toString(c, 16));
- sb.append(';');
- }
-
- private void decodeTo(Reader reader, StringBuilder sb, StringBuilder temp) {
- try {
- this.decodeTo_(reader, sb, temp);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private void decodeTo_(Reader reader, StringBuilder sb, StringBuilder temp) throws IOException {
- int c = reader.read();
- while (c != -1) {
- if (c == '&') {
- this.decodeCharacterReferenceTo(reader, sb, temp);
- } else {
- sb.append((char) c);
- }
- c = reader.read();
- }
- reader.close();
- }
-
- private void decodeCharacterReferenceTo(Reader reader, StringBuilder sb, StringBuilder temp) throws IOException {
- int c = reader.read();
- this.checkChar(c, '#');
- c = reader.read();
- this.checkChar(c, 'x');
-
- temp.setLength(0); // re-use temp
- c = reader.read();
- while (c != ';') {
- this.checkEndOfStream(c);
- temp.append((char) c);
- c = reader.read();
- }
- String charValue = temp.toString();
- if (charValue.length() == 0) {
- throw new IllegalStateException("missing numeric string"); //$NON-NLS-1$
- }
- sb.append((char) Integer.parseInt(charValue, 16));
- }
-
- private void checkChar(int c, int expected) {
- this.checkEndOfStream(c);
- if (c != expected) {
- throw new IllegalStateException("expected '" + (char) expected + "', but encountered '" + (char) c + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
- }
-
- private void checkEndOfStream(int c) {
- if (c == -1) {
- throw new IllegalStateException("unexpected end of string"); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/EmptyEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/EmptyEnumeration.java
deleted file mode 100644
index df8f5fd887..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/EmptyEnumeration.java
+++ /dev/null
@@ -1,62 +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.utility.internal.enumerations;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-
-/**
- * An <code>EmptyEnumeration</code> is just that.
- *
- * @param <E> the type of elements returned by the enumeration
- */
-public final class EmptyEnumeration<E>
- implements Enumeration<E>
-{
-
- // singleton
- @SuppressWarnings("rawtypes")
- private static final EmptyEnumeration INSTANCE = new EmptyEnumeration();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Enumeration<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyEnumeration() {
- super();
- }
-
- public boolean hasMoreElements() {
- return false;
- }
-
- public E nextElement() {
- throw new NoSuchElementException();
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/IteratorEnumeration.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/IteratorEnumeration.java
deleted file mode 100644
index 3113dfe36b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/enumerations/IteratorEnumeration.java
+++ /dev/null
@@ -1,57 +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.utility.internal.enumerations;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>IteratorEnumeration</code> wraps an
- * {@link Iterator} so that it can be treated like an
- * {@link Enumeration}.
- * Hopefully we don't have much need for this....
- *
- * @param <E> the type of elements returned by the enumeration
- */
-public class IteratorEnumeration<E>
- implements Enumeration<E>
-{
- private final Iterator<? extends E> iterator;
-
- /**
- * Construct an enumeration that wraps the specified iterable.
- */
- public IteratorEnumeration(Iterable<? extends E> iterable) {
- this(iterable.iterator());
- }
-
- /**
- * Construct an enumeration that wraps the specified iterator.
- */
- public IteratorEnumeration(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasMoreElements() {
- return this.iterator.hasNext();
- }
-
- public E nextElement() {
- return this.iterator.next();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayIterable.java
deleted file mode 100644
index 3916991285..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayIterable.java
+++ /dev/null
@@ -1,77 +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.utility.internal.iterables;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-/**
- * An <code>ArrayIterable</code> provides an {@link Iterable}
- * for an array of objects of type <code>E</code>.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see ArrayIterator
- * @see ArrayListIterable
- */
-public class ArrayIterable<E>
- implements Iterable<E>
-{
- final E[] array;
- final int start;
- final int length;
-
- /**
- * Construct an iterable for the specified array.
- */
- public ArrayIterable(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct an iterable for the specified array,
- * starting at the specified start index and continuing for
- * the rest of the array.
- */
- public ArrayIterable(E[] array, int start) {
- this(array, start, array.length - start);
- }
-
- /**
- * Construct an iterable for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayIterable(E[] array, int start, int length) {
- super();
- if ((start < 0) || (start > array.length)) {
- throw new IllegalArgumentException("start: " + start); //$NON-NLS-1$
- }
- if ((length < 0) || (length > array.length - start)) {
- throw new IllegalArgumentException("length: " + length); //$NON-NLS-1$
- }
- this.array = array;
- this.start = start;
- this.length = length;
- }
-
- public Iterator<E> iterator() {
- return new ArrayIterator<E>(this.array, this.start, this.length);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, Arrays.toString(this.array));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayListIterable.java
deleted file mode 100644
index 83a7ab765c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ArrayListIterable.java
+++ /dev/null
@@ -1,59 +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.utility.internal.iterables;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-
-/**
- * An <code>ArrayListIterable</code> provides a {@link ListIterable}
- * for an array of objects of type <code>E</code>.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see ArrayIterable
- * @see ArrayListIterator
- */
-public class ArrayListIterable<E>
- extends ArrayIterable<E>
- implements ListIterable<E>
-{
- /**
- * Construct a list iterable for the specified array.
- */
- public ArrayListIterable(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct a list iterable for the specified array,
- * starting at the specified start index and continuing for
- * the rest of the array.
- */
- public ArrayListIterable(E[] array, int start) {
- this(array, start, array.length - start);
- }
-
- /**
- * Construct a list iterable for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayListIterable(E[] array, int start, int length) {
- super(array, start, length);
- }
-
- @Override
- public ListIterator<E> iterator() {
- return new ArrayListIterator<E>(this.array, this.start, this.length);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java
deleted file mode 100644
index ebd9fcbfd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ChainIterable.java
+++ /dev/null
@@ -1,96 +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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-
-/**
- * A <code>ChainIterable</code> provides a pluggable {@link Iterable}
- * that loops over a chain of arbitrarily linked objects. The chain
- * should be null-terminated (i.e. a call to the {@link #nextLink(Object)}
- * method should return <code>null</code> when it is passed the last
- * link of the chain).
- * To use, supply a starting link and supply a {@link ChainIterator.Linker} or
- * subclass <code>ChainIterable</code> and override the
- * {@link #nextLink(Object)} method.
- * The starting link will be the first object returned by the iterable's iterator.
- * If the starting link is <code>null</code>, the iterable will be empty.
- * Note this iterable does not support <code>null</code> elements.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see ChainIterator
- */
-public class ChainIterable<E>
- implements Iterable<E>
-{
- private final E startLink;
- private final ChainIterator.Linker<E> linker;
-
-
- /**
- * Construct an iterable with the specified starting link
- * and a default linker that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #nextLink(Object)} method instead of building
- * a {@link ChainIterator.Linker}.
- */
- public ChainIterable(E startLink) {
- super();
- this.startLink = startLink;
- this.linker = this.buildDefaultLinker();
- }
-
- /**
- * Construct an iterator with the specified starting link
- * and linker.
- */
- public ChainIterable(E startLink, ChainIterator.Linker<E> linker) {
- super();
- this.startLink = startLink;
- this.linker = linker;
- }
-
- protected ChainIterator.Linker<E> buildDefaultLinker() {
- return new DefaultLinker();
- }
-
- public Iterator<E> iterator() {
- return new ChainIterator<E>(this.startLink, this.linker);
- }
-
- /**
- * Return the next link in the chain; null if there are no more links.
- * <p>
- * This method can be overridden by a subclass as an alternative to
- * building a {@link ChainIterator.Linker}.
- */
- protected E nextLink(@SuppressWarnings("unused") E currentLink) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.startLink);
- }
-
-
- //********** default linker **********
-
- protected class DefaultLinker implements ChainIterator.Linker<E> {
- public E nextLink(E currentLink) {
- return ChainIterable.this.nextLink(currentLink);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.java
deleted file mode 100644
index 1e2aadf9f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneIterable.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.utility.internal.iterables;
-
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-
-/**
- * Pull together remover state and behavior for subclasses.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see SnapshotCloneIterable
- * @see LiveCloneIterable
- */
-public abstract class CloneIterable<E>
- implements Iterable<E>
-{
- final CloneIterator.Remover<E> remover;
-
-
- // ********** constructors **********
-
- protected CloneIterable() {
- super();
- this.remover = this.buildDefaultRemover();
- }
-
- protected CloneIterable(CloneIterator.Remover<E> remover) {
- super();
- this.remover = remover;
- }
-
- protected CloneIterator.Remover<E> buildDefaultRemover() {
- return new DefaultRemover();
- }
-
-
- // ********** default removal **********
-
- /**
- * Remove the specified element from the original collection.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link CloneIterator.Remover}.
- */
- protected void remove(@SuppressWarnings("unused") E element) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-
- //********** default mutator **********
-
- protected class DefaultRemover implements CloneIterator.Remover<E> {
- public void remove(E element) {
- CloneIterable.this.remove(element);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneListIterable.java
deleted file mode 100644
index 90748f77c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CloneListIterable.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.utility.internal.iterables;
-
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * Pull together mutator state and behavior for subclasses.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see SnapshotCloneListIterable
- * @see LiveCloneListIterable
- */
-public abstract class CloneListIterable<E>
- implements ListIterable<E>
-{
- final CloneListIterator.Mutator<E> mutator;
-
-
- // ********** constructors **********
-
- protected CloneListIterable() {
- super();
- this.mutator = this.buildDefaultMutator();
- }
-
- protected CloneListIterable(CloneListIterator.Mutator<E> mutator) {
- super();
- this.mutator = mutator;
- }
-
- protected CloneListIterator.Mutator<E> buildDefaultMutator() {
- return new DefaultMutator();
- }
-
-
- // ********** default mutations **********
-
- /**
- * At the specified index, add the specified element to the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link CloneListIterator.Mutator}.
- */
- protected void add(@SuppressWarnings("unused") int index, @SuppressWarnings("unused") E element) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * Remove the element at the specified index from the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link CloneListIterator.Mutator}.
- */
- protected void remove(@SuppressWarnings("unused") int index) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * At the specified index, set the specified element in the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link CloneListIterator.Mutator}.
- */
- protected void set(@SuppressWarnings("unused") int index, @SuppressWarnings("unused") E element) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-
- //********** default mutator **********
-
- protected class DefaultMutator implements CloneListIterator.Mutator<E> {
- public void add(int index, E element) {
- CloneListIterable.this.add(index, element);
- }
- public void remove(int index) {
- CloneListIterable.this.remove(index);
- }
- public void set(int index, E element) {
- CloneListIterable.this.set(index, element);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeIterable.java
deleted file mode 100644
index 88cd46faef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeIterable.java
+++ /dev/null
@@ -1,98 +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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * A <code>CompositeIterable</code> wraps an {@link Iterable}
- * of {@link Iterable}s and makes them appear to be a single
- * {@link Iterable}.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see CompositeIterator
- * @see CompositeListIterable
- */
-public class CompositeIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends Iterable<? extends E>> iterables;
-
-
- /**
- * Construct an iterable with the specified collection of iterables.
- */
- public CompositeIterable(Iterable<? extends Iterable<? extends E>> iterables) {
- super();
- this.iterables = iterables;
- }
-
- /**
- * Construct an iterable with the specified object prepended
- * to the specified iterable.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterable(E object, Iterable<? extends E> iterable) {
- this(new SingleElementIterable<E>(object), iterable);
- }
-
- /**
- * Construct an iterable with the specified object appended
- * to the specified iterable.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterable(Iterable<? extends E> iterable, E object) {
- this(iterable, new SingleElementIterable<E>(object));
- }
-
- /**
- * Construct an iterable with the specified iterables.
- */
- public CompositeIterable(Iterable<? extends E>... iterables) {
- this(new ArrayIterable<Iterable<? extends E>>(iterables));
- }
-
- /**
- * combined iterators
- */
- public Iterator<E> iterator() {
- return new CompositeIterator<E>(this.iterators());
- }
-
- /**
- * iterator of iterators
- */
- protected Iterator<? extends Iterator<? extends E>> iterators() {
- return new TransformationIterator<Iterable<? extends E>, Iterator<? extends E>>(this.iterables()) {
- @Override
- protected Iterator<? extends E> transform(Iterable<? extends E> next) {
- return next.iterator();
- }
- };
- }
-
- /**
- * iterator of iterables
- */
- protected Iterator<? extends Iterable<? extends E>> iterables() {
- return this.iterables.iterator();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeListIterable.java
deleted file mode 100644
index 0d38e353ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/CompositeListIterable.java
+++ /dev/null
@@ -1,135 +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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-/**
- * A <code>CompositeListIterable</code> wraps a {@link ListIterable}
- * of {@link ListIterable}s and makes them appear to be a single
- * {@link ListIterable}.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see CompositeListIterator
- * @see CompositeIterable
- * @see ReadOnlyCompositeListIterable
- */
-public class CompositeListIterable<E>
- implements ListIterable<E>
-{
- private final ListIterable<? extends ListIterable<E>> iterables;
-
-
- /**
- * Construct a list iterable with the specified list of list iterables.
- */
- public CompositeListIterable(List<ListIterable<E>> iterables) {
- this(new ListListIterable<ListIterable<E>>(iterables));
- }
-
- /**
- * Construct a list iterable with the specified list of list iterables.
- */
- public CompositeListIterable(ListIterable<? extends ListIterable<E>> iterables) {
- super();
- this.iterables = iterables;
- }
-
- /**
- * Construct a list iterable with the specified object prepended
- * to the specified list.
- */
- public CompositeListIterable(E object, List<E> list) {
- this(object, new ListListIterable<E>(list));
- }
-
- /**
- * Construct a list iterable with the specified object prepended
- * to the specified list iterable.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterable(E object, ListIterable<E> iterable) {
- this(new SingleElementListIterable<E>(object), iterable);
- }
-
- /**
- * Construct a list iterable with the specified object appended
- * to the specified list.
- */
- public CompositeListIterable(List<E> list, E object) {
- this(new ListListIterable<E>(list), object);
- }
-
- /**
- * Construct a list iterable with the specified object appended
- * to the specified list iterable.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterable(ListIterable<E> iterable, E object) {
- this(iterable, new SingleElementListIterable<E>(object));
- }
-
- /**
- * Construct a list iterable with the specified list iterables.
- */
- public CompositeListIterable(ListIterable<E>... iterables) {
- this(new ArrayListIterable<ListIterable<E>>(iterables));
- }
-
- /**
- * Construct a list iterable with the specified lists.
- */
- public CompositeListIterable(List<E>... lists) {
- this(new TransformationListIterable<List<E>, ListIterable<E>>(new ArrayListIterable<List<E>>(lists)) {
- @Override
- protected ListIterable<E> transform(List<E> list) {
- return new ListListIterable<E>(list);
- }
- });
- }
-
- /**
- * combined list iterators
- */
- public ListIterator<E> iterator() {
- return new CompositeListIterator<E>(this.iterators());
- }
-
- /**
- * list iterator of list iterators
- */
- protected ListIterator<? extends ListIterator<E>> iterators() {
- return new TransformationListIterator<ListIterable<E>, ListIterator<E>>(this.iterables()) {
- @Override
- protected ListIterator<E> transform(ListIterable<E> next) {
- return next.iterator();
- }
- };
- }
-
- /**
- * list iterator of list iterables
- */
- protected ListIterator<? extends ListIterable<E>> iterables() {
- return this.iterables.iterator();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyIterable.java
deleted file mode 100644
index 502f399208..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyIterable.java
+++ /dev/null
@@ -1,65 +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.utility.internal.iterables;
-
-import java.io.Serializable;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-
-/**
- * An <code>EmptyIterable</code> is just that.
- * Maybe just a touch better-performing than {@link java.util.Collections#EMPTY_SET}
- * since we don't create a new {@link Iterator} every time {@link #iterator()} is called.
- * (Not sure why they do that....)
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see EmptyIterator
- * @see EmptyListIterable
- */
-public final class EmptyIterable<E>
- implements Iterable<E>, Serializable
-{
- // singleton
- @SuppressWarnings("rawtypes")
- private static final Iterable INSTANCE = new EmptyIterable();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Iterable<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyIterable() {
- super();
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyListIterable.java
deleted file mode 100644
index 3eb059c951..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/EmptyListIterable.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.utility.internal.iterables;
-
-import java.io.Serializable;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-
-/**
- * An <code>EmptyListIterable</code> is just that.
- * Maybe just a touch better-performing than {@link java.util.Collections#EMPTY_LIST}
- * since we don't create a new {@link Iterator} every time {@link #iterator()} is called.
- * (Not sure why they do that....)
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see EmptyListIterator
- * @see EmptyIterable
- */
-public final class EmptyListIterable<E>
- implements ListIterable<E>, Serializable
-{
- // singleton
- @SuppressWarnings("rawtypes")
- private static final ListIterable INSTANCE = new EmptyListIterable();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> ListIterable<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyListIterable() {
- super();
- }
-
- public ListIterator<E> iterator() {
- return EmptyListIterator.instance();
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java
deleted file mode 100644
index a184190ee6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/FilteringIterable.java
+++ /dev/null
@@ -1,95 +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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-
-/**
- * A <code>FilteringIterable</code> wraps another {@link Iterable}
- * and uses a {@link Filter} to determine which elements in the
- * nested iterable are to be returned by the iterable's iterator.
- * <p>
- * As an alternative to building a {@link Filter}, a subclass
- * of <code>FilteringIterable</code> can override the
- * {@link #accept(Object)} method.
- *
- * @param <E> the type of elements to be filtered
- *
- * @see FilteringIterator
- */
-public class FilteringIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> iterable;
- private final Filter<E> filter;
-
-
- /**
- * Construct an iterable with the specified nested
- * iterable and a default filter that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #accept(Object)} method instead of building
- * a {@link Filter}.
- */
- public FilteringIterable(Iterable<? extends E> iterable) {
- super();
- this.iterable = iterable;
- this.filter = this.buildDefaultFilter();
- }
-
- /**
- * Construct an iterable with the specified nested
- * iterable and filter.
- */
- public FilteringIterable(Iterable<? extends E> iterable, Filter<E> filter) {
- super();
- this.iterable = iterable;
- this.filter = filter;
- }
-
- protected Filter<E> buildDefaultFilter() {
- return new DefaultFilter();
- }
-
- public Iterator<E> iterator() {
- return new FilteringIterator<E>(this.iterable.iterator(), this.filter);
- }
-
- /**
- * Return whether the iterable's iterator
- * should return the specified next element from a call to the
- * {@link Iterator#next()} method.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Filter}.
- */
- protected boolean accept(@SuppressWarnings("unused") E o) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-
- //********** default filter **********
-
- protected class DefaultFilter implements Filter<E> {
- public boolean accept(E o) {
- return FilteringIterable.this.accept(o);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java
deleted file mode 100644
index 2bb584cd64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/GraphIterable.java
+++ /dev/null
@@ -1,156 +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.utility.internal.iterables;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.GraphIterator;
-
-/**
- * A <code>GraphIterable</code> is similar to a {@link TreeIterable}
- * except that it cannot be assumed that all nodes assume a strict tree
- * structure. For instance, in a tree, a node cannot be a descendent of
- * itself, but a graph may have a cyclical structure.
- *
- * A <code>GraphIterable</code> simplifies the traversal of a
- * graph of objects, where the objects' protocol(s) provides
- * a method for getting the next collection of nodes in the graph,
- * (or <em>neighbors</em>), but does not provide a method for
- * getting <em>all</em> of the nodes in the graph.
- * (e.g. a neighbor can return his neighbors, and those neighbors
- * can return their neighbors, which might also include the original
- * neighbor, but you only want to visit the original neighbor once.)
- * <p>
- * If a neighbor has already been visited (determined by using
- * {@link #equals(Object)}), that neighbor is not visited again,
- * nor are the neighbors of that object.
- * <p>
- * It is up to the user of this class to ensure a <em>complete</em> graph.
- * <p>
- * To use, supply:<ul>
- * <li> either the initial node of the graph or an {@link Iterable}
- * of the initial collection of graph nodes
- * <li> a {@link GraphIterator.MisterRogers} that tells who the neighbors are
- * of each node
- * (alternatively, subclass <code>GraphIterable</code>
- * and override the {@link #neighbors(Object)} method)
- * </ul>
- * The {@link Iterator#remove()} operation is not supported. This behavior, if
- * desired, must be implemented by the user of this class.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see GraphIterator
- */
-public class GraphIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> roots;
- private final GraphIterator.MisterRogers<E> misterRogers;
-
-
- /**
- * Construct an iterable containing the nodes of a graph with the specified root
- * and a default Mr. Rogers that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link GraphIterator.MisterRogers}.
- */
- public GraphIterable(E root) {
- this(new SingleElementIterable<E>(root));
- }
-
- /**
- * Construct an iterable containing the nodes of a graph
- * with the specified root and Mr. Rogers.
- */
- public GraphIterable(E root, GraphIterator.MisterRogers<E> misterRogers) {
- this(new SingleElementIterable<E>(root), misterRogers);
- }
-
- /**
- * Construct an iterable containing the nodes of a graph
- * with the specified collection of roots
- * and a default Mr. Rogers that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link GraphIterator.MisterRogers}.
- */
- public GraphIterable(E... roots) {
- this(Arrays.asList(roots));
- }
-
- /**
- * Construct an iterable containing the nodes of a graph
- * with the specified roots and Mr. Rogers.
- */
- public GraphIterable(E[] roots, GraphIterator.MisterRogers<E> misterRogers) {
- this(Arrays.asList(roots), misterRogers);
- }
-
- /**
- * Construct an iterable containing the nodes of a graph
- * with the specified collection of roots
- * and a default Mr. Rogers that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link GraphIterator.MisterRogers}.
- */
- public GraphIterable(Iterable<? extends E> roots) {
- super();
- this.roots = roots;
- this.misterRogers = this.buildDefaultMisterRogers();
- }
-
- /**
- * Construct an iterable containing the nodes of a graph
- * with the specified roots and Mr. Rogers.
- */
- public GraphIterable(Iterable<? extends E> roots, GraphIterator.MisterRogers<E> misterRogers) {
- super();
- this.roots = roots;
- this.misterRogers = misterRogers;
- }
-
- protected GraphIterator.MisterRogers<E> buildDefaultMisterRogers() {
- return new DefaultMisterRogers();
- }
-
- public Iterator<E> iterator() {
- return new GraphIterator<E>(this.roots, this.misterRogers);
- }
-
- /**
- * Return the immediate neighbors of the specified object.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link GraphIterator.MisterRogers}.
- */
- protected Iterator<? extends E> neighbors(@SuppressWarnings("unused") E next) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.roots);
- }
-
-
- //********** default Mr. Rogers **********
-
- protected class DefaultMisterRogers implements GraphIterator.MisterRogers<E> {
- public Iterator<? extends E> neighbors(E node) {
- return GraphIterable.this.neighbors(node);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListIterable.java
deleted file mode 100644
index adda824db4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListIterable.java
+++ /dev/null
@@ -1,27 +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.utility.internal.iterables;
-
-import java.util.ListIterator;
-
-/**
- * A <code>ListIterable</code> simply extends {@link Iterable}
- * to return a {@link ListIterator} of type <code>E</code>.
- *
- * @param <E> the type of elements returned by the iterable's iterators
- */
-public interface ListIterable<E>
- extends Iterable<E>
-{
- /**
- * Return a list iterator over a set of elements of type E.
- */
- ListIterator<E> iterator();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListListIterable.java
deleted file mode 100644
index c09fae9a58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ListListIterable.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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * A <code>ListListIterable</code> adapts a {@link List}
- * to the {@link ListIterable} interface.
- *
- * @param <E> the type of elements returned by the iterable's iterators
- */
-public class ListListIterable<E>
- implements ListIterable<E>
-{
- private final List<E> list;
-
- public ListListIterable(List<E> list) {
- super();
- this.list = list;
- }
-
- public ListIterator<E> iterator() {
- return this.list.listIterator();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneIterable.java
deleted file mode 100644
index afef8fed07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneIterable.java
+++ /dev/null
@@ -1,85 +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.utility.internal.iterables;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-
-/**
- * A <code>LiveCloneIterable</code> returns an iterator on a current copy of a
- * collection, allowing for concurrent access to the original collection. A
- * copy of the collection is created every time {@link #iterator()} is
- * called. As a result, the contents of the collection can be different with
- * each call to {@link #iterator()} (i.e. it is "live").
- * <p>
- * The original collection passed to the <code>LiveCloneIterable</code>'s
- * constructor should be thread-safe (e.g. {@link java.util.Vector});
- * otherwise you run the risk of a corrupted collection.
- * <p>
- * By default, the iterator returned by a <code>LiveCloneIterable</code> does not
- * support the {@link Iterator#remove()} operation; this is because it does not
- * have access to the original collection. But if the <code>LiveCloneIterable</code>
- * is supplied with an {@link CloneIterator.Remover} it will delegate the
- * {@link Iterator#remove()} operation to the <code>Remover</code>.
- * Alternatively, a subclass can override the iterable's {@link #remove(Object)}
- * method.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see CloneIterator
- * @see SnapshotCloneIterable
- * @see LiveCloneListIterable
- */
-public class LiveCloneIterable<E>
- extends CloneIterable<E>
-{
- private final Collection<? extends E> collection;
-
-
- // ********** constructors **********
-
- /**
- * Construct a "live" iterable for the specified collection.
- * The {@link Iterator#remove()} operation will not be supported
- * by the iterator returned by {@link #iterator()}
- * unless a subclass overrides the iterable's {@link #remove(Object)}
- * method.
- */
- public LiveCloneIterable(Collection<? extends E> collection) {
- super();
- this.collection = collection;
- }
-
- /**
- * Construct a "live" iterable for the specified collection.
- * The specified remover will be used by any generated iterators to
- * remove objects from the original collection.
- */
- public LiveCloneIterable(Collection<? extends E> collection, CloneIterator.Remover<E> remover) {
- super(remover);
- this.collection = collection;
- }
-
-
- // ********** Iterable implementation **********
-
- public Iterator<E> iterator() {
- return new CloneIterator<E>(this.collection, this.remover);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.collection);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneListIterable.java
deleted file mode 100644
index 8ce31576c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/LiveCloneListIterable.java
+++ /dev/null
@@ -1,85 +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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * A <code>LiveCloneListIterable</code> returns a list iterator on a current
- * copy of a list, allowing for concurrent access to the original list. A
- * copy of the list is created every time {@link #iterator()} is
- * called. As a result, the contents of the list can be different with
- * each call to {@link #iterator()} (i.e. it is "live").
- * <p>
- * The original list passed to the <code>LiveCloneListIterable</code>'s
- * constructor should be thread-safe (e.g. {@link java.util.Vector});
- * otherwise you run the risk of a corrupted list.
- * <p>
- * By default, the list iterator returned by a <code>LiveCloneListIterable</code>
- * does not support the modify operations; this is because it does not
- * have access to the original list. But if the <code>LiveCloneListIterable</code>
- * is supplied with an {@link CloneListIterator.Mutator} it will delegate the
- * modify operations to the <code>Mutator</code>.
- * Alternatively, a subclass can override the list iterable's mutation
- * methods.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see CloneListIterator
- * @see SnapshotCloneListIterable
- * @see LiveCloneIterable
- */
-public class LiveCloneListIterable<E>
- extends CloneListIterable<E>
-{
- private final List<? extends E> list;
-
-
- // ********** constructors **********
-
- /**
- * Construct a "live" list iterable for the specified list.
- * The {@link ListIterator} mutation operations will not be supported
- * by the list iterator returned by {@link #iterator()}
- * unless a subclass overrides the iterable's mutation
- * methods.
- */
- public LiveCloneListIterable(List<? extends E> list) {
- super();
- this.list = list;
- }
-
- /**
- * Construct a "live" list iterable for the specified list.
- * The specified mutator will be used by any generated list iterators to
- * modify the original list.
- */
- public LiveCloneListIterable(List<? extends E> list, CloneListIterator.Mutator<E> mutator) {
- super(mutator);
- this.list = list;
- }
-
-
- // ********** ListIterable implementation **********
-
- public ListIterator<E> iterator() {
- return new CloneListIterator<E>(this.list, this.mutator);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.list);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/PeekableIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/PeekableIterable.java
deleted file mode 100644
index e79efd7f09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/PeekableIterable.java
+++ /dev/null
@@ -1,56 +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.utility.internal.iterables;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.PeekableIterator;
-
-/**
- * A <code>PeekableIterable</code> wraps another {@link Iterable}
- * and returns an {@link PeekableIterator} that allows a
- * {@link PeekableIterator#peek() peek} at the next element to be
- * returned by {@link Iterator#next()}.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the peekable iterator's {@link Iterator#next()}
- * method is invoked. This is because the "next" element must be
- * pre-loaded for the {@link PeekableIterator#peek()} method.
- * This also prevents a peekable iterator from supporting the optional
- * {@link Iterator#remove()} method.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see PeekableIterator
- */
-public class PeekableIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> iterable;
-
- /**
- * Construct a peekable iterable that wraps the specified
- * iterable.
- */
- public PeekableIterable(Iterable<? extends E> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public PeekableIterator<E> iterator() {
- return new PeekableIterator<E>(this.iterable);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/QueueIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/QueueIterable.java
deleted file mode 100644
index 50819f3f9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/QueueIterable.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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Queue;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.QueueIterator;
-
-/**
- * A <code>QueueIterable</code> provides an {@link Iterable}
- * for a {@link Queue} of objects of type <code>E</code>. The queue's elements
- * are {@link Queue#dequeue() dequeue}d" as the iterable's iterator returns
- * them with calls to {@link Iterator#next()}.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see Queue
- * @see QueueIterator
- */
-public class QueueIterable<E>
- implements Iterable<E>
-{
- private final Queue<E> queue;
-
- /**
- * Construct an iterable for the specified queue.
- */
- public QueueIterable(Queue<E> queue) {
- super();
- this.queue = queue;
- }
-
- public Iterator<E> iterator() {
- return new QueueIterator<E>(this.queue);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.queue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyCompositeListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyCompositeListIterable.java
deleted file mode 100644
index a74e998dfa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyCompositeListIterable.java
+++ /dev/null
@@ -1,100 +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.utility.internal.iterables;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-/**
- * A <code>ReadOnlyCompositeListIterable</code> wraps a {@link ListIterable}
- * of {@link ListIterable}s and makes them appear to be a single
- * read-only {@link ListIterable}. A read-only composite list
- * iterable is more flexible than a normal composite list iterable when it
- * comes to the element types of the nested list iterables.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see ReadOnlyCompositeListIterator
- * @see CompositeListIterable
- */
-public class ReadOnlyCompositeListIterable<E>
- implements ListIterable<E>
-{
- private final ListIterable<? extends ListIterable<? extends E>> iterables;
-
-
- /**
- * Construct a list iterable with the specified list of list iterables.
- */
- public ReadOnlyCompositeListIterable(ListIterable<? extends ListIterable<? extends E>> iterables) {
- super();
- this.iterables = iterables;
- }
-
- /**
- * Construct a list iterable with the specified object prepended
- * to the specified list iterable.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterable(E object, ListIterable<? extends E> iterable) {
- this(new SingleElementListIterable<E>(object), iterable);
- }
-
- /**
- * Construct a list iterable with the specified object appended
- * to the specified list iterable.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterable(ListIterable<? extends E> iterable, E object) {
- this(iterable, new SingleElementListIterable<E>(object));
- }
-
- /**
- * Construct a list iterable with the specified list iterables.
- */
- public ReadOnlyCompositeListIterable(ListIterable<? extends E>... iterables) {
- this(new ArrayListIterable<ListIterable<? extends E>>(iterables));
- }
-
- /**
- * combined list iterators
- */
- public ListIterator<E> iterator() {
- return new ReadOnlyCompositeListIterator<E>(this.iterators());
- }
-
- /**
- * list iterator of list iterators
- */
- protected ListIterator<? extends ListIterator<? extends E>> iterators() {
- return new TransformationListIterator<ListIterable<? extends E>, ListIterator<? extends E>>(this.iterables()) {
- @Override
- protected ListIterator<? extends E> transform(ListIterable<? extends E> next) {
- return next.iterator();
- }
- };
- }
-
- /**
- * list iterator of list iterables
- */
- protected ListIterator<? extends ListIterable<? extends E>> iterables() {
- return this.iterables.iterator();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterables);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyIterable.java
deleted file mode 100644
index 250ace7cda..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyIterable.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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-
-/**
- * A <code>ReadOnlyIterable</code> wraps another {@link Iterable}
- * and returns a read-only {@link Iterator}.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see ReadOnlyIterator
- * @see ReadOnlyListIterable
- */
-public class ReadOnlyIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> iterable;
-
-
- /**
- * Construct an iterable the returns a read-only iterator on the elements
- * in the specified iterable.
- */
- public ReadOnlyIterable(Iterable<? extends E> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.iterable);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyListIterable.java
deleted file mode 100644
index 3065538368..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/ReadOnlyListIterable.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.utility.internal.iterables;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-
-/**
- * A <code>ReadOnlyListIterable</code> wraps another {@link ListIterable}
- * and returns a read-only {@link ListIterator}.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see ReadOnlyListIterator
- * @see ReadOnlyIterable
- */
-public class ReadOnlyListIterable<E>
- implements ListIterable<E>
-{
- private final ListIterable<? extends E> listIterable;
-
-
- /**
- * Construct a list iterable the returns a read-only list iterator on the elements
- * in the specified list iterable.
- */
- public ReadOnlyListIterable(ListIterable<? extends E> iterable) {
- super();
- this.listIterable = iterable;
- }
-
- public ListIterator<E> iterator() {
- return new ReadOnlyListIterator<E>(this.listIterable);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listIterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementIterable.java
deleted file mode 100644
index 78b504d1fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementIterable.java
+++ /dev/null
@@ -1,55 +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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-
-/**
- * A <code>SingleElementIterable</code> returns an {@link Iterator}
- * that holds a single element
- * and returns it with the first call to {@link Iterator#next()}, at
- * which point it will return <code>false</code> to any subsequent
- * call to {@link Iterator#hasNext()}.
- * <p>
- * A <code>SingleElementIterable</code> is equivalent to the
- * {@link Iterable} returned by:
- * {@link java.util.Collections#singleton(Object)}.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see SingleElementIterator
- * @see SingleElementListIterable
- */
-public class SingleElementIterable<E>
- implements Iterable<E>
-{
- private final E element;
-
- /**
- * Construct an iterable that contains only the specified element.
- */
- public SingleElementIterable(E element) {
- super();
- this.element = element;
- }
-
- public Iterator<E> iterator() {
- return new SingleElementIterator<E>(this.element);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementListIterable.java
deleted file mode 100644
index e6774eb527..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SingleElementListIterable.java
+++ /dev/null
@@ -1,58 +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.utility.internal.iterables;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-
-/**
- * A <code>SingleElementListIterable</code> returns a {@link ListIterator}
- * that holds a single element
- * and returns it with the first call to {@link ListIterator#next()}, at
- * which point it will return <code>false</code> to any subsequent
- * call to {@link ListIterator#hasNext()}. Likewise, it will return <code>false</code>
- * to a call to {@link ListIterator#hasPrevious()} until a call to {@link ListIterator#next()},
- * at which point a call to {@link ListIterator#previous()} will return the
- * single element.
- * <p>
- * A <code>SingleElementListIterable</code> is equivalent to the
- * {@link Iterable} returned by:
- * {@link java.util.Collections#singletonList(Object)}.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see SingleElementListIterator
- * @see SingleElementIterable
- */
-public class SingleElementListIterable<E>
- implements ListIterable<E>
-{
- private final E element;
-
- /**
- * Construct a list iterable that contains only the specified element.
- */
- public SingleElementListIterable(E element) {
- super();
- this.element = element;
- }
-
- public ListIterator<E> iterator() {
- return new SingleElementListIterator<E>(this.element);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneIterable.java
deleted file mode 100644
index 0da6b820af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneIterable.java
+++ /dev/null
@@ -1,101 +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.utility.internal.iterables;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-
-/**
- * A <code>SnapshotCloneIterable</code> returns an iterator on a "snapshot" of a
- * collection, allowing for concurrent access to the original collection. A
- * copy of the collection is created when the iterable is constructed.
- * As a result, the contents of the collection will be the same with
- * every call to {@link #iterator()}.
- * <p>
- * The original collection passed to the <code>SnapshotCloneIterable</code>'s
- * constructor should be thread-safe (e.g. {@link java.util.Vector});
- * otherwise you run the risk of a corrupted collection.
- * <p>
- * By default, the iterator returned by a <code>SnapshotCloneIterable</code> does not
- * support the {@link Iterator#remove()} operation; this is because it does not
- * have access to the original collection. But if the <code>SnapshotCloneIterable</code>
- * is supplied with a {@link CloneIterator.Remover} it will delegate the
- * {@link Iterator#remove()} operation to the <code>Remover</code>.
- * Alternatively, a subclass can override the iterable's {@link #remove(Object)}
- * method.
- * <p>
- * This iterable is useful for multiple passes over a collection that should not
- * be changed (e.g. by another thread) between passes.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see CloneIterator
- * @see LiveCloneIterable
- * @see SnapshotCloneListIterable
- */
-public class SnapshotCloneIterable<E>
- extends CloneIterable<E>
-{
- private final Object[] array;
-
-
- // ********** constructors **********
-
- /**
- * Construct a "snapshot" iterable for the specified collection.
- * The {@link Iterator#remove()} operation will not be supported
- * by the iterator returned by {@link #iterator()}
- * unless a subclass overrides the iterable's {@link #remove(Object)}
- * method.
- */
- public SnapshotCloneIterable(Collection<? extends E> collection) {
- super();
- this.array = collection.toArray();
- }
-
- /**
- * Construct a "snapshot" iterable for the specified collection.
- * The specified remover will be used by any generated iterators to
- * remove objects from the original collection.
- */
- public SnapshotCloneIterable(Collection<? extends E> collection, CloneIterator.Remover<E> remover) {
- super(remover);
- this.array = collection.toArray();
- }
-
-
- // ********** Iterable implementation **********
-
- public Iterator<E> iterator() {
- return new LocalCloneIterator<E>(this.remover, this.array);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, Arrays.toString(this.array));
- }
-
-
- // ********** clone iterator **********
-
- /**
- * provide access to "internal" constructor
- */
- protected static class LocalCloneIterator<E> extends CloneIterator<E> {
- protected LocalCloneIterator(Remover<E> remover, Object[] array) {
- super(remover, array);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneListIterable.java
deleted file mode 100644
index 251c05f80c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SnapshotCloneListIterable.java
+++ /dev/null
@@ -1,102 +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.utility.internal.iterables;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-
-/**
- * A <code>SnapshotCloneListIterable</code> returns a list iterator on a
- * "snapshot" of a list, allowing for concurrent access to the original list.
- * A copy of the list is created when the list iterable is constructed.
- * As a result, the contents of the list will be the same with
- * every call to {@link #iterator()}, even if the original list is modified via
- * the list iterator's mutation methods.
- * <p>
- * The original list passed to the <code>SnapshotCloneListIterable</code>'s
- * constructor should be thread-safe (e.g. {@link java.util.Vector});
- * otherwise you run the risk of a corrupted list.
- * <p>
- * By default, the list iterator returned by a <code>SnapshotCloneListIterable</code> does not
- * support the {@link ListIterator} mutation operations; this is because it does not
- * have access to the original list. But if the <code>SnapshotCloneListIterable</code>
- * is supplied with a {@link CloneListIterator.Mutator} it will delegate the
- * {@link ListIterator} mutation operations to the <code>Mutator</code>.
- * Alternatively, a subclass can override the list iterable's mutation
- * methods.
- * <p>
- * This list iterable is useful for multiple passes over a list that should not
- * be changed (e.g. by another thread) between passes.
- *
- * @param <E> the type of elements returned by the list iterable's list iterator
- *
- * @see CloneListIterator
- * @see LiveCloneListIterable
- * @see SnapshotCloneIterable
- */
-public class SnapshotCloneListIterable<E>
- extends CloneListIterable<E>
-{
- private final Object[] array;
-
-
- // ********** constructors **********
-
- /**
- * Construct a "snapshot" list iterable for the specified list.
- * The {@link ListIterator} modify operations will not be supported
- * by the list iterator returned by {@link #iterator()}
- * unless a subclass overrides the list iterable's modify
- * method.
- */
- public SnapshotCloneListIterable(List<? extends E> list) {
- super();
- this.array = list.toArray();
- }
-
- /**
- * Construct a "snapshot" list iterable for the specified list.
- * The specified mutator will be used by any generated list iterators to
- * modify the original list.
- */
- public SnapshotCloneListIterable(List<? extends E> list, CloneListIterator.Mutator<E> mutator) {
- super(mutator);
- this.array = list.toArray();
- }
-
-
- // ********** ListIterable implementation **********
-
- public ListIterator<E> iterator() {
- return new LocalCloneListIterator<E>(this.mutator, this.array);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, Arrays.toString(this.array));
- }
-
-
- // ********** clone iterator **********
-
- /**
- * provide access to "internal" constructor
- */
- protected static class LocalCloneListIterator<E> extends CloneListIterator<E> {
- protected LocalCloneListIterator(Mutator<E> mutator, Object[] array) {
- super(mutator, array);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/StackIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/StackIterable.java
deleted file mode 100644
index fe14746d97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/StackIterable.java
+++ /dev/null
@@ -1,51 +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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.StackIterator;
-
-/**
- * A <code>StackIterable</code> provides an {@link Iterable}
- * for a {@link Stack} of objects of type <code>E</code>. The stack's elements
- * are {@link Stack#pop() "popped"} as the iterable's iterator returns
- * them with calls to {@link Iterator#next()}.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see Stack
- * @see StackIterator
- */
-public class StackIterable<E>
- implements Iterable<E>
-{
- private final Stack<E> stack;
-
- /**
- * Construct an iterable for the specified stack.
- */
- public StackIterable(Stack<E> stack) {
- super();
- this.stack = stack;
- }
-
- public Iterator<E> iterator() {
- return new StackIterator<E>(this.stack);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.stack);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubIterableWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubIterableWrapper.java
deleted file mode 100644
index de91d46c31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubIterableWrapper.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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.SubIteratorWrapper;
-
-/**
- * Wrap an iterable of elements of type <code>E1</code>, converting it into an
- * iterable of elements of type <code>E2</code>. Assume the wrapped iterable
- * contains only elements of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements contained by the wrapped iterable
- * @param <E2> output: the type of elements returned by the iterable's iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterators.SubIteratorWrapper
- */
-public class SubIterableWrapper<E1, E2>
- implements Iterable<E2>
-{
- private final Iterable<E1> iterable;
-
-
- public SubIterableWrapper(Iterable<E1> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public Iterator<E2> iterator() {
- return new SubIteratorWrapper<E1, E2>(this.iterable.iterator());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubListIterableWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubListIterableWrapper.java
deleted file mode 100644
index 8803323192..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SubListIterableWrapper.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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.SubListIteratorWrapper;
-
-/**
- * Wrap a list iterable of elements of type <code>E1</code>, converting it into
- * a list iterable of elements of type <code>E2</code>. Assume the wrapped
- * iterable contains only elements of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements contained by the wrapped list iterable
- * @param <E2> output: the type of elements returned by the iterable's list iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterators.SubListIteratorWrapper
- */
-public class SubListIterableWrapper<E1, E2>
- implements ListIterable<E2>
-{
- private final ListIterable<E1> iterable;
-
-
- public SubListIterableWrapper(List<E1> list) {
- this(new ListListIterable<E1>(list));
- }
-
- public SubListIterableWrapper(ListIterable<E1> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public ListIterator<E2> iterator() {
- return new SubListIteratorWrapper<E1, E2>(this.iterable.iterator());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperIterableWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperIterableWrapper.java
deleted file mode 100644
index 5f1e063635..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperIterableWrapper.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterable of elements of any sub-type of <code>E</code>, converting it into an
- * iterable of elements of type <code>E</code>. This shouldn't be a problem since there
- * is no way to add invalid elements to the iterable.
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterators.SuperIteratorWrapper
- */
-public class SuperIterableWrapper<E>
- implements Iterable<E>
-{
- private final Iterable<E> iterable;
-
-
- @SuppressWarnings("unchecked")
- public SuperIterableWrapper(Iterable<? extends E> iterable) {
- super();
- // this should be a safe cast - the iterator will only ever
- // return E (or a sub-type) from #next()
- this.iterable = (Iterable<E>) iterable;
- }
-
- public Iterator<E> iterator() {
- return this.iterable.iterator();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperListIterableWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperListIterableWrapper.java
deleted file mode 100644
index db44b17f46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/SuperListIterableWrapper.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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.SuperListIteratorWrapper;
-
-/**
- * Wrap a list iterable of elements of any sub-type of <code>E</code>, converting it into a
- * list iterable of elements of type <code>E</code>. This shouldn't be a problem since the
- * resulting list iterable's list iterator disables the methods that would put invalid elements
- * in the list iterator's backing list (i.e. {@link #set(E)} and {@link #add(E)}).
- *
- * @param <E> the type of elements returned by the iterable's iterators
- *
- * @see org.eclipse.jpt.utility.internal.iterators.SuperListIteratorWrapper
- */
-public class SuperListIterableWrapper<E>
- implements ListIterable<E>
-{
- private final ListIterable<? extends E> iterable;
-
-
- public <T extends E> SuperListIterableWrapper(List<T> list) {
- this(new ListListIterable<T>(list));
- }
-
- public SuperListIterableWrapper(ListIterable<? extends E> iterable) {
- super();
- this.iterable = iterable;
- }
-
- public ListIterator<E> iterator() {
- return new SuperListIteratorWrapper<E>(this.iterable.iterator());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.java
deleted file mode 100644
index 7ad42b295a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationIterable.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.utility.internal.iterables;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-
-/**
- * A <code>TransformationIterable</code> wraps another {@link Iterable}
- * and transforms its elements for client consumption. To use, supply a
- * {@link Transformer} or subclass <code>TransformationIterable</code>
- * and override the {@link #transform(Object)} method.
- * Objects of type <code>E1</code> are transformed into objects of type <code>E2</code>;
- * i.e. the iterable's iterator returns objects of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements to be transformed
- * @param <E2> output: the type of elements returned by the iterable's iterator
- *
- * @see TransformationIterator
- * @see TransformationListIterable
- */
-public class TransformationIterable<E1, E2>
- implements Iterable<E2>
-{
- private final Iterable<? extends E1> iterable;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterable with the specified nested iterable
- * and a default transformer that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationIterable(Iterable<? extends E1> iterable) {
- super();
- this.iterable = iterable;
- this.transformer = this.buildDefaultTransformer();
- }
-
- /**
- * Construct an iterable with the specified nested iterable
- * and transformer.
- */
- public TransformationIterable(Iterable<? extends E1> iterable, Transformer<E1, ? extends E2> transformer) {
- super();
- this.iterable = iterable;
- this.transformer = transformer;
- }
-
- protected Transformer<E1, ? extends E2> buildDefaultTransformer() {
- return new DefaultTransformer();
- }
-
- public Iterator<E2> iterator() {
- return new TransformationIterator<E1, E2>(this.iterable.iterator(), this.transformer);
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(@SuppressWarnings("unused") E1 o) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-
- //********** default linker **********
-
- protected class DefaultTransformer implements Transformer<E1, E2> {
- public E2 transform(E1 o) {
- return TransformationIterable.this.transform(o);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationListIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationListIterable.java
deleted file mode 100644
index 0bd2714b98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TransformationListIterable.java
+++ /dev/null
@@ -1,111 +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.utility.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-
-/**
- * A <code>TransformationListIterable</code> wraps another {@link ListIterable}
- * and transforms its elements for client consumption. To use, supply a
- * {@link Transformer} or subclass <code>TransformationListIterable</code>
- * and override the {@link #transform(Object)} method.
- * Objects of type <code>E1</code> are transformed into objects of type <code>E2</code>;
- * i.e. the list iterable's list iterator returns objects of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements to be transformed
- * @param <E2> output: the type of elements returned by the iterable's iterator
- *
- * @see TransformationListIterator
- * @see TransformationIterable
- */
-public class TransformationListIterable<E1, E2>
- implements ListIterable<E2>
-{
- private final ListIterable<? extends E1> iterable;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct a list iterable with the specified nested list
- * and a default transformer that calls back to the list iterable.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationListIterable(List<E1> list) {
- this(new ListListIterable<E1>(list));
- }
-
- /**
- * Construct a list iterable with the specified nested list iterable
- * and a default transformer that calls back to the list iterable.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationListIterable(ListIterable<? extends E1> iterable) {
- super();
- this.iterable = iterable;
- this.transformer = this.buildDefaultTransformer();
- }
-
- /**
- * Construct a list iterable with the specified nested list
- * and transformer.
- */
- public TransformationListIterable(List<E1> list, Transformer<E1, ? extends E2> transformer) {
- this(new ListListIterable<E1>(list), transformer);
- }
-
- /**
- * Construct a list iterable with the specified nested list iterable
- * and transformer.
- */
- public TransformationListIterable(ListIterable<? extends E1> iterable, Transformer<E1, ? extends E2> transformer) {
- super();
- this.iterable = iterable;
- this.transformer = transformer;
- }
-
- protected Transformer<E1, ? extends E2> buildDefaultTransformer() {
- return new DefaultTransformer();
- }
-
- public ListIterator<E2> iterator() {
- return new TransformationListIterator<E1, E2>(this.iterable.iterator(), this.transformer);
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(@SuppressWarnings("unused") E1 o) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterable);
- }
-
-
- //********** default linker **********
-
- protected class DefaultTransformer implements Transformer<E1, E2> {
- public E2 transform(E1 o) {
- return TransformationListIterable.this.transform(o);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java
deleted file mode 100644
index ab227cd1d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterables/TreeIterable.java
+++ /dev/null
@@ -1,137 +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.utility.internal.iterables;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-
-/**
- * A <code>TreeIterable</code> simplifies the traversal of a
- * tree of objects, where the objects' protocol(s) provides
- * a method for getting the immediate children of the given
- * node but does not provide a method for getting all the
- * descendants (children, grandchildren, etc.) of the given node.
- * <p>
- * To use, supply:<ul>
- * <li> either the root element of the tree or, if the tree has
- * multiple roots, an {@link Iterable} of the set of roots
- * <li> a {@link TreeIterator.Midwife} that delivers the children of each child
- * (alternatively, subclass <code>TreeIterable</code>
- * and override the {@link #children(Object)} method)
- * </ul>
- *
- * @param <E> the type of elements returned by the iterable's iterator
- *
- * @see TreeIterator
- */
-public class TreeIterable<E>
- implements Iterable<E>
-{
- private final Iterable<? extends E> roots;
- private final TreeIterator.Midwife<E> midwife;
-
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified root
- * and a default midwife that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link TreeIterator.Midwife}.
- */
- public TreeIterable(E root) {
- this(new SingleElementIterable<E>(root));
- }
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified root
- * and midwife.
- */
- public TreeIterable(E root, TreeIterator.Midwife<E> midwife) {
- this(new SingleElementIterable<E>(root), midwife);
- }
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified roots
- * and a default midwife that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link TreeIterator.Midwife}.
- */
- public TreeIterable(E... roots) {
- this(Arrays.asList(roots));
- }
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified roots
- * and midwife.
- */
- public TreeIterable(E[] roots, TreeIterator.Midwife<E> midwife) {
- this(Arrays.asList(roots), midwife);
- }
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified roots
- * and a default midwife that calls back to the iterable.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link TreeIterator.Midwife}.
- */
- public TreeIterable(Iterable<? extends E> roots) {
- super();
- this.roots = roots;
- this.midwife = this.buildDefaultMidwife();
- }
-
- /**
- * Construct an iterable containing the nodes of a tree with the specified roots
- * and midwife.
- */
- public TreeIterable(Iterable<? extends E> roots, TreeIterator.Midwife<E> midwife) {
- super();
- this.roots = roots;
- this.midwife = midwife;
- }
-
- protected TreeIterator.Midwife<E> buildDefaultMidwife() {
- return new DefaultMidwife();
- }
-
- public Iterator<E> iterator() {
- return new TreeIterator<E>(this.roots, this.midwife);
- }
-
- /**
- * Return the immediate children of the specified object.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link TreeIterator.Midwife}.
- */
- protected Iterator<? extends E> children(@SuppressWarnings("unused") E next) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.roots);
- }
-
-
- //********** default midwife **********
-
- protected class DefaultMidwife implements TreeIterator.Midwife<E> {
- public Iterator<? extends E> children(E node) {
- return TreeIterable.this.children(node);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
deleted file mode 100644
index 6396a3cb78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayIterator.java
+++ /dev/null
@@ -1,88 +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.utility.internal.iterators;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>ArrayIterator</code> provides an {@link Iterator}
- * for an array of objects of type <code>E</code>.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ArrayIterable
- */
-public class ArrayIterator<E>
- implements Iterator<E>
-{
- final E[] array; // private-protected
- int cursor; // private-protected
- private final int max;
-
-
- /**
- * Construct an iterator for the specified array.
- */
- public ArrayIterator(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct an iterator for the specified array,
- * starting at the specified start index and continuing for
- * the rest of the array.
- */
- public ArrayIterator(E[] array, int start) {
- this(array, start, array.length - start);
- }
-
- /**
- * Construct an iterator for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayIterator(E[] array, int start, int length) {
- super();
- if ((start < 0) || (start > array.length)) {
- throw new IllegalArgumentException("start: " + start); //$NON-NLS-1$
- }
- if ((length < 0) || (length > array.length - start)) {
- throw new IllegalArgumentException("length: " + length); //$NON-NLS-1$
- }
- this.array = array;
- this.cursor = start;
- this.max = start + length;
- }
-
- public boolean hasNext() {
- return this.cursor != this.max;
- }
-
- public E next() {
- if (this.hasNext()) {
- return this.array[this.cursor++];
- }
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, Arrays.toString(this.array));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java
deleted file mode 100644
index e75afa5293..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ArrayListIterator.java
+++ /dev/null
@@ -1,92 +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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-/**
- * An <code>ArrayListIterator</code> provides a {@link ListIterator}
- * for an array of objects.
- * <p>
- * The name might be a bit confusing:
- * This is a {@link ListIterator} for an <code>Array</code>;
- * <em>not</em> an {@link Iterator} for a {@link java.util.ArrayList}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ArrayListIterable
- */
-public class ArrayListIterator<E>
- extends ArrayIterator<E>
- implements ListIterator<E>
-{
- private final int min;
-
-
- /**
- * Construct a list iterator for the specified array.
- */
- public ArrayListIterator(E... array) {
- this(array, 0, array.length);
- }
-
- /**
- * Construct a list iterator for the specified array,
- * starting at the specified start index and continuing for
- * the rest of the array.
- */
- public ArrayListIterator(E[] array, int start) {
- this(array, start, array.length - start);
- }
-
- /**
- * Construct a list iterator for the specified array,
- * starting at the specified start index and continuing for
- * the specified length.
- */
- public ArrayListIterator(E[] array, int start, int length) {
- super(array, start, length);
- this.min = start;
- }
-
- public int nextIndex() {
- return this.cursor;
- }
-
- public int previousIndex() {
- return this.cursor - 1;
- }
-
- public boolean hasPrevious() {
- return this.cursor != this.min;
- }
-
- public E previous() {
- if (this.hasPrevious()) {
- return this.array[--this.cursor];
- }
- throw new NoSuchElementException();
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return super.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
deleted file mode 100644
index 3454816862..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ChainIterator.java
+++ /dev/null
@@ -1,159 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ChainIterator</code> provides a pluggable {@link Iterator}
- * that loops over a chain of arbitrarily linked objects. The chain
- * should be null-terminated (i.e. a call to the {@link #nextLink(Object)}
- * method should return <code>null</code> when it is passed the last
- * link of the chain).
- * To use, supply a starting link and supply a {@link Linker} or
- * subclass <code>ChainIterator</code> and override the
- * {@link #nextLink(Object)} method.
- * The starting link will be the first object returned by the iterator.
- * If the starting link is <code>null</code>, the iterator will be empty.
- * Note this iterator does not support <code>null</code> elements.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ChainIterable
- */
-public class ChainIterator<E>
- implements Iterator<E>
-{
- private E nextLink;
- private final Linker<E> linker;
-
-
- /**
- * Construct an iterator with the specified starting link
- * and a disabled linker.
- * Use this constructor if you want to override the
- * {@link #nextLink(Object)} method instead of building
- * a {@link Linker}.
- */
- public ChainIterator(E startLink) {
- this(startLink, Linker.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified starting link
- * and linker.
- */
- public ChainIterator(E startLink, Linker<E> linker) {
- super();
- this.nextLink = startLink;
- this.linker = linker;
- }
-
- public boolean hasNext() {
- return this.nextLink != null;
- }
-
- public E next() {
- if (this.nextLink == null) {
- throw new NoSuchElementException();
- }
- E result = this.nextLink;
- this.nextLink = this.nextLink(this.nextLink);
- return result;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the next link in the chain; null if there are no more links.
- */
- protected E nextLink(E currentLink) {
- return this.linker.nextLink(currentLink);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.nextLink);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by {@link ChainIterator} to link
- * the elements in the chain.
- */
- public interface Linker<T> {
-
- /**
- * Return the next link in the chain; null if there are no more links.
- */
- T nextLink(T currentLink);
-
-
- final class Null<S> implements Linker<S> {
- @SuppressWarnings("rawtypes")
- public static final Linker INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Linker<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // simply return null, indicating the chain is ended
- public S nextLink(S currentLink) {
- return null;
- }
- @Override
- public String toString() {
- return "ChainIterator.Linker.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- final class Disabled<S> implements Linker<S> {
- @SuppressWarnings("rawtypes")
- public static final Linker INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Linker<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public S nextLink(S currentLink) {
- throw new UnsupportedOperationException(); // ChainIterator.nextLink(Object) was not implemented
- }
- @Override
- public String toString() {
- return "ChainIterator.Linker.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
deleted file mode 100644
index 16dd9f0ea9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneIterator.java
+++ /dev/null
@@ -1,191 +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.utility.internal.iterators;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CloneIterator</code> iterates over a copy of a collection,
- * allowing for concurrent access to the original collection.
- * <p>
- * The original collection passed to the <code>CloneIterator</code>'s
- * constructor should be synchronized (e.g. {@link java.util.Vector});
- * otherwise you run the risk of a corrupted collection.
- * <p>
- * By default, a <code>CloneIterator</code> does not support the
- * {@link #remove()} operation; this is because it does not have
- * access to the original collection. But if the <code>CloneIterator</code>
- * is supplied with an {@link Remover} it will delegate the
- * {@link #remove()} operation to the {@link Remover}.
- * Alternatively, a subclass can override the {@link #remove(Object)}
- * method.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.LiveCloneIterable
- * @see org.eclipse.jpt.utility.internal.iterables.SnapshotCloneIterable
- */
-public class CloneIterator<E>
- implements Iterator<E>
-{
- private final Iterator<Object> iterator;
- private E current;
- private final Remover<E> remover;
- private boolean removeAllowed;
-
-
- // ********** constructors **********
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * The {@link #remove()} method will not be supported,
- * unless a subclass overrides the {@link #remove(Object)}.
- */
- public CloneIterator(Collection<? extends E> collection) {
- this(collection, Remover.ReadOnly.<E>instance());
- }
-
- /**
- * Construct an iterator on a copy of the specified array.
- * The {@link #remove()} method will not be supported,
- * unless a subclass overrides the {@link #remove(Object)}.
- */
- public CloneIterator(E[] array) {
- this(array, Remover.ReadOnly.<E>instance());
- }
-
- /**
- * Construct an iterator on a copy of the specified collection.
- * Use the specified remover to remove objects from the
- * original collection.
- */
- public CloneIterator(Collection<? extends E> collection, Remover<E> remover) {
- this(remover, collection.toArray());
- }
-
- /**
- * Construct an iterator on a copy of the specified array.
- * Use the specified remover to remove objects from the
- * original array.
- */
- public CloneIterator(E[] array, Remover<E> remover) {
- this(remover, array.clone());
- }
-
- /**
- * Internal constructor used by subclasses.
- * Swap order of arguments to prevent collision with other constructor.
- * The passed in array will *not* be cloned.
- */
- protected CloneIterator(Remover<E> remover, Object... array) {
- super();
- this.iterator = new ArrayIterator<Object>(array);
- this.current = null;
- this.remover = remover;
- this.removeAllowed = false;
- }
-
-
- // ********** Iterator implementation **********
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public E next() {
- this.current = this.nestedNext();
- this.removeAllowed = true;
- return this.current;
- }
-
- public void remove() {
- if ( ! this.removeAllowed) {
- throw new IllegalStateException();
- }
- this.remove(this.current);
- this.removeAllowed = false;
- }
-
-
- // ********** internal methods **********
-
- /**
- * The collection passed in during construction held elements of type <code>E</code>,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (<code>Object[]</code>).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.iterator.next();
- }
-
- /**
- * Remove the specified element from the original collection.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Remover}.
- */
- protected void remove(E e) {
- this.remover.remove(e);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by {@link CloneIterator} to remove
- * elements from the original collection; since the iterator
- * does not have direct access to the original collection.
- */
- public interface Remover<T> {
-
- /**
- * Remove the specified object from the original collection.
- */
- void remove(T element);
-
-
- final class ReadOnly<S> implements Remover<S> {
- @SuppressWarnings("rawtypes")
- public static final Remover INSTANCE = new ReadOnly();
- @SuppressWarnings("unchecked")
- public static <R> Remover<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private ReadOnly() {
- super();
- }
- // remove is not supported
- public void remove(Object element) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "CloneIterator.Remover.ReadOnly"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
deleted file mode 100644
index 5493e0d5f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CloneListIterator.java
+++ /dev/null
@@ -1,291 +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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>CloneListIterator</code> iterates over a copy of a list,
- * allowing for concurrent access to the original list.
- * <p>
- * The original list passed to the <code>CloneListIterator</code>'s
- * constructor should be synchronized; otherwise you run the risk of
- * a corrupted list (e.g. {@link java.util.Vector}.
- * <p>
- * By default, a <code>CloneListIterator</code> does not support the
- * modification operations; this is because it does not have
- * access to the original list. But if the <code>CloneListIterator</code>
- * is supplied with a {@link Mutator} it will delegate the
- * modification operations to the {@link Mutator}.
- * Alternatively, a subclass can override the modification methods.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.LiveCloneListIterable
- * @see org.eclipse.jpt.utility.internal.iterables.SnapshotCloneListIterable
- */
-public class CloneListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<Object> listIterator;
- private int cursor;
- private State state;
- private final Mutator<E> mutator;
-
- private enum State {
- UNKNOWN,
- PREVIOUS,
- NEXT
- }
-
-
- // ********** constructors **********
-
- /**
- * Construct a list iterator on a copy of the specified list.
- * The modification methods will not be supported,
- * unless a subclass overrides them.
- */
- public CloneListIterator(List<? extends E> list) {
- this(list, Mutator.ReadOnly.<E>instance());
- }
-
- /**
- * Construct a list iterator on a copy of the specified array.
- * The modification methods will not be supported,
- * unless a subclass overrides them.
- */
- public CloneListIterator(E[] array) {
- this(array, Mutator.ReadOnly.<E>instance());
- }
-
- /**
- * Construct a list iterator on a copy of the specified list.
- * Use the specified list mutator to modify the original list.
- */
- public CloneListIterator(List<? extends E> list, Mutator<E> mutator) {
- this(mutator, list.toArray());
- }
-
- /**
- * Construct a list iterator on a copy of the specified array.
- * Use the specified list mutator to modify the original list.
- */
- public CloneListIterator(E[] array, Mutator<E> mutator) {
- this(mutator, array.clone());
- }
-
- /**
- * Internal constructor used by subclasses.
- * Swap order of arguments to prevent collision with other constructor.
- * The passed in array will *not* be cloned.
- */
- protected CloneListIterator(Mutator<E> mutator, Object... array) {
- super();
- // build a copy of the list and keep it in synch with original (if the mutator allows changes)
- // that way the nested list iterator will maintain some of our state
- this.listIterator = CollectionTools.list(array).listIterator();
- this.mutator = mutator;
- this.cursor = 0;
- this.state = State.UNKNOWN;
- }
-
-
- // ********** ListIterator implementation **********
-
- public boolean hasNext() {
- return this.listIterator.hasNext();
- }
-
- public E next() {
- // allow the nested iterator to throw an exception before we modify the index
- E next = this.nestedNext();
- this.cursor++;
- this.state = State.NEXT;
- return next;
- }
-
- public void remove() {
- // allow the nested iterator to throw an exception before we modify the original list
- this.listIterator.remove();
- if (this.state == State.PREVIOUS) {
- this.remove(this.cursor);
- } else {
- this.cursor--;
- this.remove(this.cursor);
- }
- }
-
- public int nextIndex() {
- return this.listIterator.nextIndex();
- }
-
- public int previousIndex() {
- return this.listIterator.previousIndex();
- }
-
- public boolean hasPrevious() {
- return this.listIterator.hasPrevious();
- }
-
- public E previous() {
- // allow the nested iterator to throw an exception before we modify the index
- E previous = this.nestedPrevious();
- this.cursor--;
- this.state = State.PREVIOUS;
- return previous;
- }
-
- public void add(E o) {
- // allow the nested iterator to throw an exception before we modify the original list
- this.listIterator.add(o);
- this.add(this.cursor, o);
- this.cursor++;
- }
-
- public void set(E o) {
- // allow the nested iterator to throw an exception before we modify the original list
- this.listIterator.set(o);
- if (this.state == State.PREVIOUS) {
- this.set(this.cursor, o);
- } else {
- this.set(this.cursor - 1, o);
- }
- }
-
-
- // ********** internal methods **********
-
- /**
- * The list passed in during construction held elements of type <code>E</code>,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (<code>Object[]</code>).
- */
- @SuppressWarnings("unchecked")
- protected E nestedNext() {
- return (E) this.listIterator.next();
- }
-
- /**
- * The list passed in during construction held elements of type <code>E</code>,
- * so this cast is not a problem. We need this cast because
- * all the elements of the original collection were copied into
- * an object array (<code>Object[]</code>).
- */
- @SuppressWarnings("unchecked")
- protected E nestedPrevious() {
- return (E) this.listIterator.previous();
- }
-
- /**
- * Add the specified element to the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Mutator}.
- */
- protected void add(int index, E o) {
- this.mutator.add(index, o);
- }
-
- /**
- * Remove the specified element from the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Mutator}.
- */
- protected void remove(int index) {
- this.mutator.remove(index);
- }
-
- /**
- * Set the specified element in the original list.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Mutator}.
- */
- protected void set(int index, E o) {
- this.mutator.set(index, o);
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- //********** member interface **********
-
- /**
- * Used by {@link CloneListIterator} to remove
- * elements from the original list; since the list iterator
- * does not have direct access to the original list.
- */
- public interface Mutator<T> {
-
- /**
- * Add the specified object to the original list.
- */
- void add(int index, T o);
-
- /**
- * Remove the specified object from the original list.
- */
- void remove(int index);
-
- /**
- * Set the specified object in the original list.
- */
- void set(int index, T o);
-
-
- final class ReadOnly<S> implements Mutator<S> {
- @SuppressWarnings("rawtypes")
- public static final Mutator INSTANCE = new ReadOnly();
- @SuppressWarnings("unchecked")
- public static <R> Mutator<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private ReadOnly() {
- super();
- }
- // add is not supported
- public void add(int index, Object o) {
- throw new UnsupportedOperationException();
- }
- // remove is not supported
- public void remove(int index) {
- throw new UnsupportedOperationException();
- }
- // set is not supported
- public void set(int index, Object o) {
- throw new UnsupportedOperationException();
- }
- @Override
- public String toString() {
- return "CloneListIterator.Mutator.ReadOnly"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
deleted file mode 100644
index f2127a2434..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeIterator.java
+++ /dev/null
@@ -1,162 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-
-/**
- * A <code>CompositeIterator</code> wraps a collection
- * of {@link Iterator}s and makes them appear to be a single
- * {@link Iterator}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.CompositeIterable
- */
-public class CompositeIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends Iterator<? extends E>> iterators;
- private Iterator<? extends E> currentIterator;
- private Iterator<? extends E> lastIteratorToReturnNext;
-
-
- // ********** constructors **********
-
- /**
- * Construct an iterator that returns all the elements held by the
- * specified iterables.
- */
- public CompositeIterator(Iterable<? extends Iterable<? extends E>> iterables) {
- this(
- new TransformationIterator<Iterable<? extends E>, Iterator<? extends E>>(iterables.iterator()) {
- @Override
- protected Iterator<? extends E> transform(Iterable<? extends E> iterable) {
- return iterable.iterator();
- }
- }
- );
- }
-
- /**
- * Construct an iterator with the specified collection of iterators.
- */
- public CompositeIterator(Iterator<? extends Iterator<? extends E>> iterators) {
- super();
- this.iterators = iterators;
- }
-
- /**
- * Construct an iterator with the specified object prepended
- * to the specified iterable.
- */
- public CompositeIterator(E object, Iterable<? extends E> iterable) {
- this(object, iterable.iterator());
- }
-
- /**
- * Construct an iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterator(E object, Iterator<? extends E> iterator) {
- this(new SingleElementIterator<E>(object), iterator);
- }
-
- /**
- * Construct an iterator with the specified object appended
- * to the specified iterable.
- */
- public CompositeIterator(Iterable<? extends E> iterable, E object) {
- this(iterable.iterator(), object);
- }
-
- /**
- * Construct an iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeIterator(Iterator<? extends E> iterator, E object) {
- this(iterator, new SingleElementIterator<E>(object));
- }
-
- /**
- * Construct an iterator with the specified iterables.
- */
- public CompositeIterator(Iterable<? extends E>... iterables) {
- this(new ArrayIterable<Iterable<? extends E>>(iterables));
- }
-
- /**
- * Construct an iterator with the specified iterators.
- */
- public CompositeIterator(Iterator<? extends E>... iterators) {
- this(new ArrayIterator<Iterator<? extends E>>(iterators));
- }
-
-
- // ********** Iterator implementation **********
-
- public boolean hasNext() {
- try {
- this.loadCurrentIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.currentIterator.hasNext();
- }
-
- public E next() {
- this.loadCurrentIterator();
- E result = this.currentIterator.next();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set 'lastIteratorToReturnNext'
- this.lastIteratorToReturnNext = this.currentIterator;
-
- return result;
- }
-
- public void remove() {
- if (this.lastIteratorToReturnNext == null) {
- // CompositeIterator#next() has never been called
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnNext.remove();
- }
-
- /**
- * Load {@link currentIterator} with the first iterator that {@link Iterator#hasNext()}
- * or the final iterator if all the elements have already been retrieved.
- */
- private void loadCurrentIterator() {
- if (this.currentIterator == null) {
- this.currentIterator = this.iterators.next();
- }
- while (( ! this.currentIterator.hasNext()) && this.iterators.hasNext()) {
- this.currentIterator = this.iterators.next();
- }
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterators);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java
deleted file mode 100644
index e1d3c7a63c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/CompositeListIterator.java
+++ /dev/null
@@ -1,269 +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.utility.internal.iterators;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * A <code>CompositeListIterator</code> wraps a list
- * of {@link ListIterator}s and makes them appear to be a single
- * {@link ListIterator}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.CompositeListIterable
- */
-public class CompositeListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends ListIterator<E>> iterators;
- private ListIterator<E> nextIterator;
- private int nextIndex;
- /**
- * true if "next" was last returned; false if "previous" was last returned;
- * this determines the effect of {@link #remove(Object)} on {@link #nextIndex}
- */
- private boolean nextReturned;
- private ListIterator<E> lastIteratorToReturnElement;
-
-
- /**
- * Construct a list iterator on the elements in the specified list of lists.
- */
- public CompositeListIterator(List<? extends List<E>> lists) {
- this(
- new TransformationListIterator<List<E>, ListIterator<E>>(lists.listIterator()) {
- @Override
- protected ListIterator<E> transform(List<E> list) {
- return list.listIterator();
- }
- }
- );
- }
-
- /**
- * Construct a list iterator on the elements in the specified list of lists.
- */
- public CompositeListIterator(ListIterable<? extends ListIterable<E>> listIterables) {
- this(
- new TransformationListIterator<ListIterable<E>, ListIterator<E>>(listIterables.iterator()) {
- @Override
- protected ListIterator<E> transform(ListIterable<E> list) {
- return list.iterator();
- }
- }
- );
- }
-
- /**
- * Construct a list iterator with the specified list of list iterators.
- */
- public CompositeListIterator(ListIterator<? extends ListIterator<E>> iterators) {
- super();
- this.iterators = iterators;
- this.nextIndex = 0;
- this.nextReturned = false;
- }
-
- /**
- * Construct a list iterator with the specified object prepended
- * to the specified list.
- */
- public CompositeListIterator(E object, List<E> list) {
- this(object, list.listIterator());
- }
-
- /**
- * Construct a list iterator with the specified object prepended
- * to the specified list.
- */
- public CompositeListIterator(E object, ListIterable<E> listIterable) {
- this(object, listIterable.iterator());
- }
-
- /**
- * Construct a list iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterator(E object, ListIterator<E> iterator) {
- this(new SingleElementListIterator<E>(object), iterator);
- }
-
- /**
- * Construct a list iterator with the specified object appended
- * to the specified list.
- */
- public CompositeListIterator(List<E> list, E object) {
- this(list.listIterator(), object);
- }
-
- /**
- * Construct a list iterator with the specified object appended
- * to the specified list.
- */
- public CompositeListIterator(ListIterable<E> listIterable, E object) {
- this(listIterable.iterator(), object);
- }
-
- /**
- * Construct a list iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public CompositeListIterator(ListIterator<E> iterator, E object) {
- this(iterator, new SingleElementListIterator<E>(object));
- }
-
- /**
- * Construct a list iterator with the specified lists.
- */
- public CompositeListIterator(List<E>... lists) {
- this(Arrays.asList(lists));
- }
-
- /**
- * Construct a list iterator with the specified lists.
- */
- public CompositeListIterator(ListIterable<E>... listIterables) {
- this(new ArrayListIterable<ListIterable<E>>(listIterables));
- }
-
- /**
- * Construct a list iterator with the specified list iterators.
- */
- public CompositeListIterator(ListIterator<E>... iterators) {
- this(new ArrayListIterator<ListIterator<E>>(iterators));
- }
-
- public void add(E o) {
- this.checkNextIterator();
- this.nextIterator.add(o);
- this.nextIndex++;
- }
-
- public boolean hasNext() {
- try {
- this.loadNextIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasNext();
- }
-
- public boolean hasPrevious() {
- try {
- this.loadPreviousIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasPrevious();
- }
-
- public E next() {
- this.loadNextIterator();
- E result = this.nextIterator.next();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set the 'lastIteratorToReturnElement'
- this.lastIteratorToReturnElement = this.nextIterator;
- this.nextIndex++;
- this.nextReturned = true;
-
- return result;
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public E previous() {
- this.loadPreviousIterator();
- E result = this.nextIterator.previous();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can set the 'lastIteratorToReturnElement'
- this.lastIteratorToReturnElement = this.nextIterator;
- this.nextIndex--;
- this.nextReturned = false;
-
- return result;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public void remove() {
- if (this.lastIteratorToReturnElement == null) {
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnElement.remove();
- if (this.nextReturned) {
- // decrement the index because the "next" element has moved forward in the list
- this.nextIndex--;
- }
- }
-
- public void set(E e) {
- if (this.lastIteratorToReturnElement == null) {
- throw new IllegalStateException();
- }
- this.lastIteratorToReturnElement.set(e);
- }
-
- /**
- * Load 'nextIterator' with the first iterator that <code>hasNext()</code>
- * or the final iterator if all the elements have already been retrieved.
- */
- private void loadNextIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasNext()) && this.iterators.hasNext()) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- /**
- * Load 'nextIterator' with the first iterator that <code>hasPrevious()</code>
- * or the first iterator if all the elements have already been retrieved.
- */
- private void loadPreviousIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasPrevious()) && this.iterators.hasPrevious()) {
- this.nextIterator = this.iterators.previous();
- }
- }
-
- /**
- * If 'nextIterator' is null, load it with the first iterator.
- */
- private void checkNextIterator() {
- if (this.nextIterator == null) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterators);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java
deleted file mode 100644
index 5fa4d4fbe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyIterator.java
+++ /dev/null
@@ -1,69 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EmptyIterator</code> is just that.
- *
- * @param <E> the type of elements (not) returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.EmptyIterable
- */
-public final class EmptyIterator<E>
- implements Iterator<E>
-{
-
- // singleton
- @SuppressWarnings("rawtypes")
- private static final EmptyIterator INSTANCE = new EmptyIterator();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> Iterator<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyIterator() {
- super();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public E next() {
- throw new NoSuchElementException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java
deleted file mode 100644
index 5cd142ddfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EmptyListIterator.java
+++ /dev/null
@@ -1,93 +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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EmptyListIterator</code> is just that.
- *
- * @param <E> the type of elements (not) returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.EmptyListIterable
- */
-public final class EmptyListIterator<E>
- implements ListIterator<E>
-{
-
- // singleton
- @SuppressWarnings("rawtypes")
- private static final EmptyListIterator INSTANCE = new EmptyListIterator();
-
- /**
- * Return the singleton.
- */
- @SuppressWarnings("unchecked")
- public static <T> ListIterator<T> instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EmptyListIterator() {
- super();
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public boolean hasNext() {
- return false;
- }
-
- public boolean hasPrevious() {
- return false;
- }
-
- public E next() {
- throw new NoSuchElementException();
- }
-
- public int nextIndex() {
- return 0;
- }
-
- public E previous() {
- throw new NoSuchElementException();
- }
-
- public int previousIndex() {
- return -1;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java
deleted file mode 100644
index d39ebfe81c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/EnumerationIterator.java
+++ /dev/null
@@ -1,52 +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.utility.internal.iterators;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * An <code>EnumerationIterator</code> wraps an
- * {@link Enumeration} so that it can be treated like an
- * {@link Iterator}.
- *
- * @param <E> the type of elements returned by the iterator
- */
-public class EnumerationIterator<E>
- implements Iterator<E>
-{
- private final Enumeration<? extends E> enumeration;
-
- /**
- * Construct an iterator that wraps the specified enumeration.
- */
- public EnumerationIterator(Enumeration<? extends E> enumeration) {
- this.enumeration = enumeration;
- }
-
- public boolean hasNext() {
- return this.enumeration.hasMoreElements();
- }
-
- public E next() {
- return this.enumeration.nextElement();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.enumeration);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
deleted file mode 100644
index 642b4a32df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/FilteringIterator.java
+++ /dev/null
@@ -1,148 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>FilteringIterator</code> wraps another {@link Iterator}
- * and uses a {@link Filter} to determine which elements in the
- * nested iterator are to be returned by calls to {@link #next()}.
- * <p>
- * As an alternative to building a {@link Filter</code>, a subclass
- * of <code>FilteringIterator</code> can override the
- * {@link #accept(Object)} method.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the filtered iterator's {@link #next()}
- * method is invoked. This is because the "next" element must be
- * checked for whether it is to be accepted before the filtered iterator
- * can determine whether it has a "next" element (i.e. that the
- * {@link #hasNext()} method should return <code>true</code>).
- * This also prevents a filtered iterator from supporting the optional
- * <code>remove()</code> method.
- *
- * @param <E> the type of elements to be filtered
- *
- * @see org.eclipse.jpt.utility.internal.iterables.FilteringIterable
- */
-public class FilteringIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
- private final Filter<E> filter;
- private E next;
- private boolean done;
-
-
- /**
- * Construct an iterator with the specified
- * iterable and a disabled filter.
- * Use this constructor if you want to override the
- * {@link #accept(Object)} method instead of building
- * a {@link Filter}.
- */
- public FilteringIterator(Iterable<? extends E> iterable) {
- this(iterable.iterator());
- }
-
- /**
- * Construct an iterator with the specified nested
- * iterator and a disabled filter.
- * Use this constructor if you want to override the
- * {@link #accept(Object)} method instead of building
- * a {@link Filter}.
- */
- public FilteringIterator(Iterator<? extends E> iterator) {
- this(iterator, Filter.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator with the specified
- * iterable and filter.
- */
- public FilteringIterator(Iterable<? extends E> iterable, Filter<E> filter) {
- this(iterable.iterator(), filter);
- }
-
- /**
- * Construct an iterator with the specified nested
- * iterator and filter.
- */
- public FilteringIterator(Iterator<? extends E> iterator, Filter<E> filter) {
- super();
- this.iterator = iterator;
- this.filter = filter;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E result = this.next;
- this.loadNext();
- return result;
- }
-
- /**
- * Because we need to pre-load the next element
- * to be returned, we cannot support the <code>remove()</code>
- * method.
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load next with the next valid entry from the nested
- * iterator. If there are none, next is set to <code>END</code>.
- */
- private void loadNext() {
- this.done = true;
- while (this.iterator.hasNext() && (this.done)) {
- E temp = this.iterator.next();
- if (this.accept(temp)) {
- // assume that if the object was accepted it is of type E
- this.next = temp;
- this.done = false;
- } else {
- this.next = null;
- this.done = true;
- }
- }
- }
-
- /**
- * Return whether the {@link FilteringIterator}
- * should return the specified next element from a call to the
- * {@link #next()} method.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Filter}.
- */
- protected boolean accept(E o) {
- return this.filter.accept(o);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.java
deleted file mode 100644
index 516573e521..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/GraphIterator.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.utility.internal.iterators;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>GraphIterator</code> is similar to a {@link TreeIterator}
- * except that it cannot be assumed that all nodes assume a strict tree
- * structure. For instance, in a tree, a node cannot be a descendent of
- * itself, but a graph may have a cyclical structure.
- *
- * A <code>GraphIterator</code> simplifies the traversal of a
- * graph of objects, where the objects' protocol(s) provides
- * a method for getting the next collection of nodes in the graph,
- * (or <em>neighbors</em>), but does not provide a method for
- * getting <em>all</em> of the nodes in the graph.
- * (e.g. a neighbor can return his neighbors, and those neighbors
- * can return their neighbors, which might also include the original
- * neighbor, but you only want to visit the original neighbor once.)
- * <p>
- * If a neighbor has already been visited (determined by using
- * {@link #equals(Object)}), that neighbor is not visited again,
- * nor are the neighbors of that object.
- * <p>
- * It is up to the user of this class to ensure a <em>complete</em> graph.
- * <p>
- * To use, supply:<ul>
- * <li> either the initial node of the graph or an {@link Iterator}
- * over an initial collection of graph nodes
- * <li> a {@link MisterRogers] that tells who the neighbors are
- * of each node
- * (alternatively, subclass <code>GraphIterator</code>
- * and override the {@link #neighbors(Object)} method)
- * </ul>
- * {@link #remove()} is not supported. This behavior, if
- * desired, must be implemented by the user of this class.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.GraphIterable
- */
-public class GraphIterator<E>
- implements Iterator<E>
-{
- // use a LinkedList since we will be pulling off the front and adding to the end
- private final LinkedList<Iterator<? extends E>> iterators = new LinkedList<Iterator<? extends E>>();
- private final HashSet<E> visitedNeighbors = new HashSet<E>();
- private final MisterRogers<E> misterRogers;
-
- private Iterator<? extends E> currentIterator;
-
- private E nextNeighbor;
- private boolean done;
-
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified collection of roots
- * and a disabled Mr. Rogers.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link MisterRogers}.
- */
- public GraphIterator(E... roots) {
- this(new ArrayIterator<E>(roots));
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified collection of roots
- * and a disabled Mr. Rogers.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link MisterRogers}.
- */
- public GraphIterator(Iterable<? extends E> roots) {
- this(roots.iterator());
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified collection of roots
- * and a disabled Mr. Rogers.
- * Use this constructor if you want to override the
- * {@link #neighbors(Object)} method instead of building
- * a {@link MisterRogers}.
- */
- public GraphIterator(Iterator<? extends E> roots) {
- this(roots, MisterRogers.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified root
- * and a disabled Mr. Rogers.
- * Use this constructor if you want to override the
- * <code>neighbors(Object)</code> method instead of building
- * a <code>MisterRogers</code>.
- */
- public GraphIterator(E root) {
- this(root, MisterRogers.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified root and Mr. Rogers.
- */
- public GraphIterator(E root, MisterRogers<E> misterRogers) {
- this(new SingleElementIterator<E>(root), misterRogers);
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified collection of roots and Mr. Rogers.
- */
- public GraphIterator(E[] roots, MisterRogers<E> misterRogers) {
- this(new ArrayIterator<E>(roots), misterRogers);
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified roots and Mr. Rogers.
- */
- public GraphIterator(Iterable<? extends E> roots, MisterRogers<E> misterRogers) {
- this(roots.iterator(), misterRogers);
- }
-
- /**
- * Construct an iterator that returns the nodes of a graph
- * with the specified roots and Mr. Rogers.
- */
- public GraphIterator(Iterator<? extends E> roots, MisterRogers<E> misterRogers) {
- super();
- this.currentIterator = roots;
- this.misterRogers = misterRogers;
- this.loadNextNeighbor();
- }
-
- /**
- * Load next neighbor with the next entry from the current iterator.
- * If the current iterator has none, load the next iterator.
- * If there are no more, the {@link done} flag is set.
- */
- private void loadNextNeighbor() {
- if (this.currentIterator == EmptyIterator.instance()) {
- this.done = true;
- }
- else if (this.currentIterator.hasNext()) {
- E nextPossibleNeighbor = this.currentIterator.next();
- if (this.visitedNeighbors.contains(nextPossibleNeighbor)) {
- this.loadNextNeighbor(); // recurse
- } else {
- this.nextNeighbor = nextPossibleNeighbor;
- this.visitedNeighbors.add(nextPossibleNeighbor);
- this.iterators.add(this.neighbors(nextPossibleNeighbor));
- }
- }
- else {
- for (Iterator<? extends Iterator<? extends E>> stream = this.iterators.iterator(); ! this.currentIterator.hasNext() && stream.hasNext(); ) {
- this.currentIterator = stream.next();
- stream.remove();
- }
- if ( ! this.currentIterator.hasNext()) {
- this.currentIterator = EmptyIterator.instance();
- }
- this.loadNextNeighbor(); // recurse
- }
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E next = this.nextNeighbor;
- this.loadNextNeighbor();
- return next;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Return the immediate neighbors of the specified object.
- */
- protected Iterator<? extends E> neighbors(E next) {
- return this.misterRogers.neighbors(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.currentIterator);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by {@link GraphIterator} to retrieve
- * the immediate neighbors of a node in the graph.
- * "These are the people in your neighborhood..."
- */
- public interface MisterRogers<T> {
-
- /**
- * Return the immediate neighbors of the specified object.
- */
- Iterator<? extends T> neighbors(T next);
-
-
- final class Null<S> implements MisterRogers<S> {
- @SuppressWarnings("rawtypes")
- public static final MisterRogers INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> MisterRogers<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // return no neighbors
- public Iterator<S> neighbors(S next) {
- return EmptyIterator.instance();
- }
- @Override
- public String toString() {
- return "GraphIterator.MisterRogers.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /** The Mr. Rogers used when the {@link GraphIterator#neighbors(Object)} method is overridden. */
- final class Disabled<S> implements MisterRogers<S> {
- @SuppressWarnings("rawtypes")
- public static final MisterRogers INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> MisterRogers<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public Iterator<S> neighbors(S next) {
- throw new UnsupportedOperationException(); // GraphIterator.neighbors(Object) was not implemented
- }
- @Override
- public String toString() {
- return "GraphIterator.MisterRogers.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.java
deleted file mode 100644
index 04a134b445..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/PeekableIterator.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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>PeekableIterator</code> wraps another {@link Iterator}
- * and allows a {@link #peek()} at the next element to be
- * returned by {@link #next()}.
- * <p>
- * One, possibly undesirable, side-effect of using this iterator is that
- * the nested iterator's <code>next()</code> method will be invoked
- * <em>before</em> the peekable iterator's {@link #next()}
- * method is invoked. This is because the "next" element must be
- * pre-loaded for the {@link #peek()} method.
- * This also prevents a peekable iterator from supporting the optional
- * {@link #remove()} method.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.PeekableIterable
- */
-public class PeekableIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
- private E next;
- private boolean done;
-
-
- /**
- * Construct a peekable iterator that wraps the specified
- * iterable.
- */
- public PeekableIterator(Iterable<? extends E> iterable) {
- this(iterable.iterator());
- }
-
- /**
- * Construct a peekable iterator that wraps the specified nested
- * iterator.
- */
- public PeekableIterator(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- this.done = false;
- this.loadNext();
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E result = this.next;
- this.loadNext();
- return result;
- }
-
- /**
- * Return the element that will be returned by the next call to the
- * {@link #next()} method, without advancing past it.
- */
- public E peek() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- return this.next;
- }
-
- /**
- * Because we need to pre-load the next element
- * to be returned, we cannot support the {@link #remove()}
- * method.
- */
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load next with the next entry from the nested
- * iterator. If there are none, {@link #next} is set to <code>null</code>
- * and {@link #done} is set to <code>true</code>.
- */
- private void loadNext() {
- if (this.iterator.hasNext()) {
- this.next = this.iterator.next();
- } else {
- this.next = null;
- this.done = true;
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/QueueIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/QueueIterator.java
deleted file mode 100644
index 80d6b6a6ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/QueueIterator.java
+++ /dev/null
@@ -1,59 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Queue;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>QueueIterator</code> provides an {@link Iterator}
- * for a {@link Queue} of objects of type <code>E</code>. The queue's elements
- * are {@link Queue#dequeue() dequeue}d" as the iterator returns them with
- * calls to {@link #next()}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see Queue
- * @see org.eclipse.jpt.utility.internal.iterables.QueueIterable
- */
-public class QueueIterator<E>
- implements Iterator<E>
-{
- private final Queue<E> queue;
-
-
- /**
- * Construct an iterator for the specified queue.
- */
- public QueueIterator(Queue<E> queue) {
- super();
- this.queue = queue;
- }
-
- public boolean hasNext() {
- return ! this.queue.isEmpty();
- }
-
- public E next() {
- return this.queue.dequeue();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.queue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.java
deleted file mode 100644
index 2ad79fd297..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyCompositeListIterator.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.utility.internal.iterators;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * A <code>ReadOnlyCompositeListIterator</code> wraps a list
- * of {@link ListIterator}s and makes them appear to be a single
- * read-only {@link ListIterator}. A read-only composite list
- * iterator is more flexible than a normal composite list iterator when it
- * comes to the element types of the nested iterators.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ReadOnlyCompositeListIterable
- */
-public class ReadOnlyCompositeListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends ListIterator<? extends E>> iterators;
- private ListIterator<? extends E> nextIterator;
- private int nextIndex;
-
-
- /**
- * Construct a read-only list iterator with the specified list of lists.
- */
- public ReadOnlyCompositeListIterator(List<? extends List<? extends E>> lists) {
- this(
- new TransformationListIterator<List<? extends E>, ListIterator<? extends E>>(lists.listIterator()) {
- @Override
- protected ListIterator<? extends E> transform(List<? extends E> list) {
- return list.listIterator();
- }
- }
- );
- }
-
- /**
- * Construct a read-only list iterator with the specified list of lists.
- */
- public ReadOnlyCompositeListIterator(ListIterable<? extends ListIterable<? extends E>> listIterables) {
- this(
- new TransformationListIterator<ListIterable<? extends E>, ListIterator<? extends E>>(listIterables.iterator()) {
- @Override
- protected ListIterator<? extends E> transform(ListIterable<? extends E> listIterable) {
- return listIterable.iterator();
- }
- }
- );
- }
-
- /**
- * Construct a read-only list iterator with the specified list of
- * list iterators.
- */
- public ReadOnlyCompositeListIterator(ListIterator<? extends ListIterator<? extends E>> iterators) {
- super();
- this.iterators = iterators;
- this.nextIndex = 0;
- }
-
- /**
- * Construct a read-only list iterator with the specified object prepended
- * to the specified list.
- */
- public ReadOnlyCompositeListIterator(E object, List<? extends E> list) {
- this(object, list.listIterator());
- }
-
- /**
- * Construct a read-only list iterator with the specified object prepended
- * to the specified list.
- */
- public ReadOnlyCompositeListIterator(E object, ListIterable<? extends E> listIterable) {
- this(object, listIterable.iterator());
- }
-
- /**
- * Construct a read-only list iterator with the specified object prepended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterator(E object, ListIterator<? extends E> iterator) {
- this(new SingleElementListIterator<E>(object), iterator);
- }
-
- /**
- * Construct a read-only list iterator with the specified object appended
- * to the specified list.
- */
- public ReadOnlyCompositeListIterator(List<? extends E> list, E object) {
- this(list.listIterator(), object);
- }
-
- /**
- * Construct a read-only list iterator with the specified object appended
- * to the specified list.
- */
- public ReadOnlyCompositeListIterator(ListIterable<? extends E> listIterable, E object) {
- this(listIterable.iterator(), object);
- }
-
- /**
- * Construct a read-only list iterator with the specified object appended
- * to the specified iterator.
- */
- @SuppressWarnings("unchecked")
- public ReadOnlyCompositeListIterator(ListIterator<? extends E> iterator, E object) {
- this(iterator, new SingleElementListIterator<E>(object));
- }
-
- /**
- * Construct a read-only list iterator with the specified lists.
- */
- public ReadOnlyCompositeListIterator(List<? extends E>... lists) {
- this(Arrays.asList(lists));
- }
-
- /**
- * Construct a read-only list iterator with the specified lists.
- */
- public ReadOnlyCompositeListIterator(ListIterable<? extends E>... listIterables) {
- this(new ArrayListIterable<ListIterable<? extends E>>(listIterables));
- }
-
- /**
- * Construct a read-only list iterator with the specified list iterators.
- */
- public ReadOnlyCompositeListIterator(ListIterator<? extends E>... iterators) {
- this(new ArrayListIterator<ListIterator<? extends E>>(iterators));
- }
-
- public boolean hasNext() {
- try {
- this.loadNextIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasNext();
- }
-
- public boolean hasPrevious() {
- try {
- this.loadPreviousIterator();
- } catch (NoSuchElementException ex) {
- // this occurs if there are no iterators at all
- return false;
- }
- return this.nextIterator.hasPrevious();
- }
-
- public E next() {
- this.loadNextIterator();
- E result = this.nextIterator.next();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can increment 'nextIndex'
- this.nextIndex++;
-
- return result;
- }
-
- public int nextIndex() {
- return this.nextIndex;
- }
-
- public E previous() {
- this.loadPreviousIterator();
- E result = this.nextIterator.previous();
-
- // the statement above will throw a NoSuchElementException
- // if the current iterator is at the end of the line;
- // so if we get here, we can decrement 'nextIndex'
- this.nextIndex--;
-
- return result;
- }
-
- public int previousIndex() {
- return this.nextIndex - 1;
- }
-
- public void add(E o) {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- // the list iterator is read-only
- throw new UnsupportedOperationException();
- }
-
- /**
- * Load {@link #nextIterator} with the first iterator that {@link #hasNext()}
- * or the final iterator if all the elements have already been retrieved.
- */
- private void loadNextIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasNext()) && this.iterators.hasNext()) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- /**
- * Load {@link #nextIterator} with the first iterator that {@link #hasPrevious()}
- * or the first iterator if all the elements have already been retrieved.
- */
- private void loadPreviousIterator() {
- this.checkNextIterator();
- while (( ! this.nextIterator.hasPrevious()) && this.iterators.hasPrevious()) {
- this.nextIterator = this.iterators.previous();
- }
- }
-
- /**
- * If {@link #nextIterator} is null, load it with the first iterator.
- */
- private void checkNextIterator() {
- if (this.nextIterator == null) {
- this.nextIterator = this.iterators.next();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterators);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
deleted file mode 100644
index edbef6274f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyIterator.java
+++ /dev/null
@@ -1,65 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ReadOnlyIterator</code> wraps another {@link Iterator}
- * and removes support for {@link #remove()}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ReadOnlyIterable
- */
-public class ReadOnlyIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
-
- /**
- * Construct an iterator on the specified collection that
- * disallows removes.
- */
- public ReadOnlyIterator(Iterable<? extends E> c) {
- this(c.iterator());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and disallow removes.
- */
- public ReadOnlyIterator(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.iterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.iterator.next();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java
deleted file mode 100644
index 86884fc8ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ReadOnlyListIterator.java
+++ /dev/null
@@ -1,108 +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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * A <code>ReadOnlyListIterator</code> wraps another
- * {@link ListIterator} and removes support for:<ul>
- * <li>{@link #remove()}
- * <li>{@link #set(Object)}
- * <li>{@link #add(Object)}
- * </ul>
- *
- * @param <E> the type of elements returned by the list iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.ReadOnlyListIterable
- */
-public class ReadOnlyListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends E> listIterator;
-
-
- /**
- * Construct a list iterator on the specified list that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(List<? extends E> list) {
- this(list.listIterator());
- }
-
- /**
- * Construct a list iterator on the specified list that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(ListIterable<? extends E> listIterable) {
- this(listIterable.iterator());
- }
-
- /**
- * Construct a list iterator on the specified list iterator that
- * disallows removes, sets, and adds.
- */
- public ReadOnlyListIterator(ListIterator<? extends E> listIterator) {
- super();
- this.listIterator = listIterator;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.listIterator.hasNext();
- }
-
- public E next() {
- // delegate to the nested iterator
- return this.listIterator.next();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.listIterator.hasPrevious();
- }
-
- public E previous() {
- // delegate to the nested iterator
- return this.listIterator.previous();
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.listIterator.nextIndex();
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.listIterator.previousIndex();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public void set(E o) {
- throw new UnsupportedOperationException();
- }
-
- public void add(E o) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java
deleted file mode 100644
index f3d597e122..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/ResultSetIterator.java
+++ /dev/null
@@ -1,162 +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.utility.internal.iterators;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>ResultSetIterator</code> wraps an SQL {@link ResultSet}
- * and transforms its rows for client consumption. Subclasses can override
- * {@link #buildNext(ResultSet)} to build the expected object from
- * the current row of the result set.
- * <p>
- * To use, supply:<ul>
- * <li> a {@link ResultSet}
- * <li> an {@link Adapter} that converts a row in the {@link ResultSet}
- * into the desired object
- * (alternatively, subclass <code>ResultSetIterator</code>
- * and override the {@link #buildNext(ResultSet)} method)
- * </ul>
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see java.sql.ResultSet
- */
-public class ResultSetIterator<E>
- implements Iterator<E>
-{
- private final ResultSet resultSet;
- private final Adapter<E> adapter;
- private E next;
- private boolean done;
-
-
- /**
- * Construct an iterator on the specified result set that returns
- * the objects produced by the specified adapter.
- */
- public ResultSetIterator(ResultSet resultSet, Adapter<E> adapter) {
- super();
- this.resultSet = resultSet;
- this.adapter = adapter;
- this.done = false;
- this.next = this.buildNext();
- }
-
- /**
- * Construct an iterator on the specified result set that returns
- * the first object in each row of the result set.
- */
- public ResultSetIterator(ResultSet resultSet) {
- this(resultSet, Adapter.Default.<E>instance());
- }
-
- /**
- * Build the next object for the iterator to return.
- * Close the result set when we reach the end.
- */
- private E buildNext() {
- try {
- if (this.resultSet.next()) {
- return this.buildNext(this.resultSet);
- }
- this.resultSet.close();
- this.done = true;
- return null;
- } catch (SQLException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * By default, return the first object in the current row
- * of the result set. Any {@link SQLException}s will
- * be caught and wrapped in a {@link RuntimeException}.
- */
- protected E buildNext(ResultSet rs) throws SQLException {
- return this.adapter.buildNext(rs);
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- E temp = this.next;
- this.next = this.buildNext();
- return temp;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.resultSet);
- }
-
-
- // ********** interface **********
-
- /**
- * Used by {@link ResultSetIterator} to convert a
- * {@link ResultSet}'s current row into the next object
- * to be returned by the {@link Iterator}.
- */
- public interface Adapter<T> {
-
- /**
- * Return an object corresponding to the result set's
- * "current" row. Any {@link SQLException}s will
- * be caught and wrapped in a {@link RuntimeException}.
- * @see java.sql.ResultSet
- */
- T buildNext(ResultSet rs) throws SQLException;
-
-
- final class Default<S> implements Adapter<S> {
- @SuppressWarnings("rawtypes")
- public static final Adapter INSTANCE = new Default();
- @SuppressWarnings("unchecked")
- public static <R> Adapter<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- // return the first object in the current row of the result set
- @SuppressWarnings("unchecked")
- public S buildNext(ResultSet rs) throws SQLException {
- // result set columns are indexed starting with 1
- return (S) rs.getObject(1);
- }
- @Override
- public String toString() {
- return "ResultSetIterator.Adapter.Default"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java
deleted file mode 100644
index 25e89cfb3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementIterator.java
+++ /dev/null
@@ -1,67 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>SingleElementIterator</code> holds a single element
- * and returns it with the first call to {@link next()}, at
- * which point it will return <code>false</code> to any subsequent
- * call to {@link #hasNext()}.
- * <p>
- * A <code>SingleElementIterator</code> is equivalent to the
- * {@link Iterator} returned by:
- * {@link java.util.Collections#singleton(element)}<code>.iterator()</code>
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SingleElementIterable
- */
-public class SingleElementIterator<E>
- implements Iterator<E>
-{
- private final E element;
- private boolean done;
-
-
- /**
- * Construct an iterator that returns only the specified element.
- */
- public SingleElementIterator(E element) {
- super();
- this.element = element;
- this.done = false;
- }
-
- public boolean hasNext() {
- return ! this.done;
- }
-
- public E next() {
- if (this.done) {
- throw new NoSuchElementException();
- }
- this.done = true;
- return this.element;
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java
deleted file mode 100644
index c4076651f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SingleElementListIterator.java
+++ /dev/null
@@ -1,98 +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.utility.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>SingleElementListIterator</code> holds a single element
- * and returns it with the first call to {@link next()}, at
- * which point it will return <code>false</code> to any subsequent
- * call to {@link #hasNext()}. Likewise, it will return <code>false</code>
- * to a call to {@link #hasPrevious()} until a call to {@link #next()},
- * at which point a call to {@link #previous()} will return the
- * single element.
- * <p>
- * A <code>SingleElementListIterator</code> is equivalent to the
- * {@link Iterator} returned by:
- * {@link java.util.Collections#singletonList(element)}<code>.listIterator()</code>
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SingleElementListIterable
- */
-public class SingleElementListIterator<E>
- implements ListIterator<E>
-{
- private final E element;
- private boolean hasNext;
-
-
- /**
- * Construct a list iterator that returns only the specified element.
- */
- public SingleElementListIterator(E element) {
- super();
- this.element = element;
- this.hasNext = true;
- }
-
- public boolean hasNext() {
- return this.hasNext;
- }
-
- public E next() {
- if (this.hasNext) {
- this.hasNext = false;
- return this.element;
- }
- throw new NoSuchElementException();
- }
-
- public int nextIndex() {
- return this.hasNext ? 0 : 1;
- }
-
- public boolean hasPrevious() {
- return ! this.hasNext;
- }
-
- public E previous() {
- if (this.hasNext) {
- throw new NoSuchElementException();
- }
- this.hasNext = true;
- return this.element;
- }
-
- public int previousIndex() {
- return this.hasNext ? -1 : 0;
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.element);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/StackIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/StackIterator.java
deleted file mode 100644
index e743fa73f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/StackIterator.java
+++ /dev/null
@@ -1,59 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>StackIterator</code> provides an {@link Iterator}
- * for a {@link Stack} of objects of type <code>E</code>. The stack's elements
- * are {@link Stack#pop() pop}ped" as the iterator returns them with
- * calls to {@link #next()}.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see Stack
- * @see org.eclipse.jpt.utility.internal.iterables.StackIterable
- */
-public class StackIterator<E>
- implements Iterator<E>
-{
- private final Stack<E> stack;
-
-
- /**
- * Construct an iterator for the specified stack.
- */
- public StackIterator(Stack<E> stack) {
- super();
- this.stack = stack;
- }
-
- public boolean hasNext() {
- return ! this.stack.isEmpty();
- }
-
- public E next() {
- return this.stack.pop();
- }
-
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.stack);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubIteratorWrapper.java
deleted file mode 100644
index eefcfccbb4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubIteratorWrapper.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.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterator on elements of type <code>E1</code>, converting it into an
- * iterator on elements of type <code>E2</code>. Assume the wrapped iterator
- * returns only elements of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements returned by the wrapped iterator
- * @param <E2> output: the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SubIterableWrapper
- */
-public class SubIteratorWrapper<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<E1> iterator;
-
-
- public SubIteratorWrapper(Iterable<E1> iterable) {
- this(iterable.iterator());
- }
-
- public SubIteratorWrapper(Iterator<E1> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public E2 next() {
- return (E2) this.iterator.next();
- }
-
- public void remove() {
- this.iterator.remove();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubListIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubListIteratorWrapper.java
deleted file mode 100644
index c9e5db72ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SubListIteratorWrapper.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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * Wrap a list iterator on elements of type <code>E1</code>, converting it into
- * a list iterator on elements of type <code>E2</code>. Assume the wrapped
- * list iterator returns only elements of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements returned by the wrapped list iterator
- * @param <E2> output: the type of elements returned by the list iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SubListIterableWrapper
- */
-public class SubListIteratorWrapper<E1, E2>
- implements ListIterator<E2>
-{
- private final ListIterator<E1> listIterator;
-
-
- public SubListIteratorWrapper(List<E1> list) {
- this(list.listIterator());
- }
-
- public SubListIteratorWrapper(ListIterable<E1> listIterable) {
- this(listIterable.iterator());
- }
-
- public SubListIteratorWrapper(ListIterator<E1> iterator) {
- super();
- this.listIterator = iterator;
- }
-
- public boolean hasNext() {
- return this.listIterator.hasNext();
- }
-
- @SuppressWarnings("unchecked")
- public E2 next() {
- return (E2) this.listIterator.next();
- }
-
- public int nextIndex() {
- return this.listIterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- return this.listIterator.hasPrevious();
- }
-
- @SuppressWarnings("unchecked")
- public E2 previous() {
- return (E2) this.listIterator.previous();
- }
-
- public int previousIndex() {
- return this.listIterator.previousIndex();
- }
-
- public void remove() {
- this.listIterator.remove();
- }
-
- public void set(E2 e) {
- throw new UnsupportedOperationException();
- }
-
- public void add(E2 e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperIteratorWrapper.java
deleted file mode 100644
index 52fd5f632e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperIteratorWrapper.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.utility.internal.iterators;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterator on elements of any sub-type of <code>E</code>, converting it into an
- * iterator on elements of type <code>E</code>. This shouldn't be a problem since there
- * is no way to add invalid elements to the iterator's backing collection.
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SuperIterableWrapper
- */
-public class SuperIteratorWrapper<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
-
-
- public SuperIteratorWrapper(Iterable<? extends E> iterable) {
- this(iterable.iterator());
- }
-
- public SuperIteratorWrapper(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public E next() {
- return this.iterator.next();
- }
-
- public void remove() {
- this.iterator.remove();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperListIteratorWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperListIteratorWrapper.java
deleted file mode 100644
index c3817ac076..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SuperListIteratorWrapper.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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * Wrap a list iterator on elements of any sub-type of <code>E</code>, converting it into a
- * list iterator on elements of type <code>E</code>. This shouldn't be a problem since the
- * resulting list iterator disables the methods that would put invalid elements
- * in the iterator's backing list (i.e. {@link #set(E)} and {@link #add(E)}).
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.SuperListIterableWrapper
- */
-public class SuperListIteratorWrapper<E>
- implements ListIterator<E>
-{
- private final ListIterator<? extends E> listIterator;
-
-
- public SuperListIteratorWrapper(List<? extends E> list) {
- this(list.listIterator());
- }
-
- public SuperListIteratorWrapper(ListIterable<? extends E> listIterable) {
- this(listIterable.iterator());
- }
-
- public SuperListIteratorWrapper(ListIterator<? extends E> listIterator) {
- super();
- this.listIterator = listIterator;
- }
-
- public boolean hasNext() {
- return this.listIterator.hasNext();
- }
-
- public E next() {
- return this.listIterator.next();
- }
-
- public int nextIndex() {
- return this.listIterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- return this.listIterator.hasPrevious();
- }
-
- public E previous() {
- return this.listIterator.previous();
- }
-
- public int previousIndex() {
- return this.listIterator.previousIndex();
- }
-
- public void remove() {
- this.listIterator.remove();
- }
-
- public void set(E e) {
- throw new UnsupportedOperationException();
- }
-
- public void add(E e) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedIterator.java
deleted file mode 100644
index 2fd5ae21ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedIterator.java
+++ /dev/null
@@ -1,76 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * Wrap an iterator and synchronize all its methods so it can be safely shared
- * among multiple threads.
- *
- * @param <E> the type of elements returned by the iterator
- */
-public class SynchronizedIterator<E>
- implements Iterator<E>
-{
- private final Iterator<? extends E> iterator;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
-
- public SynchronizedIterator(Iterable<? extends E> iterable) {
- this(iterable.iterator());
- }
-
- public SynchronizedIterator(Iterable<? extends E> iterable, Object mutex) {
- this(iterable.iterator(), mutex);
- }
-
- public SynchronizedIterator(Iterator<? extends E> iterator) {
- super();
- this.iterator = iterator;
- this.mutex = this;
- }
-
- public SynchronizedIterator(Iterator<? extends E> iterator, Object mutex) {
- super();
- this.iterator = iterator;
- this.mutex = mutex;
- }
-
- public synchronized boolean hasNext() {
- synchronized (this.mutex) {
- return this.iterator.hasNext();
- }
- }
-
- public synchronized E next() {
- synchronized (this.mutex) {
- return this.iterator.next();
- }
- }
-
- public synchronized void remove() {
- synchronized (this.mutex) {
- this.iterator.remove();
- }
- }
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return StringTools.buildToStringFor(this, this.iterator);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedListIterator.java
deleted file mode 100644
index d3ffc94c9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/SynchronizedListIterator.java
+++ /dev/null
@@ -1,122 +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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * Wrap a list iterator and synchronize all its methods so it can be safely shared
- * among multiple threads.
- *
- * @param <E> the type of elements returned by the iterator
- */
-public class SynchronizedListIterator<E>
- implements ListIterator<E>
-{
- private final ListIterator<E> listIterator;
-
- /** Object to synchronize on. */
- private final Object mutex;
-
-
- public SynchronizedListIterator(List<E> list) {
- this(list.listIterator());
- }
-
- public SynchronizedListIterator(List<E> list, Object mutex) {
- this(list.listIterator(), mutex);
- }
-
- public SynchronizedListIterator(ListIterable<E> listIterable) {
- this(listIterable.iterator());
- }
-
- public SynchronizedListIterator(ListIterable<E> listIterable, Object mutex) {
- this(listIterable.iterator(), mutex);
- }
-
- public SynchronizedListIterator(ListIterator<E> listIterator) {
- super();
- this.listIterator = listIterator;
- this.mutex = this;
- }
-
- public SynchronizedListIterator(ListIterator<E> listIterator, Object mutex) {
- super();
- this.listIterator = listIterator;
- this.mutex = mutex;
- }
-
- public synchronized boolean hasNext() {
- synchronized (this.mutex) {
- return this.listIterator.hasNext();
- }
- }
-
- public synchronized E next() {
- synchronized (this.mutex) {
- return this.listIterator.next();
- }
- }
-
- public synchronized int nextIndex() {
- synchronized (this.mutex) {
- return this.listIterator.nextIndex();
- }
- }
-
- public synchronized boolean hasPrevious() {
- synchronized (this.mutex) {
- return this.listIterator.hasPrevious();
- }
- }
-
- public synchronized E previous() {
- synchronized (this.mutex) {
- return this.listIterator.previous();
- }
- }
-
- public synchronized int previousIndex() {
- synchronized (this.mutex) {
- return this.listIterator.previousIndex();
- }
- }
-
- public synchronized void remove() {
- synchronized (this.mutex) {
- this.listIterator.remove();
- }
- }
-
- public synchronized void add(E e) {
- synchronized (this.mutex) {
- this.listIterator.add(e);
- }
- }
-
- public synchronized void set(E e) {
- synchronized (this.mutex) {
- this.listIterator.set(e);
- }
- }
-
- @Override
- public String toString() {
- synchronized (this.mutex) {
- return StringTools.buildToStringFor(this, this.listIterator);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
deleted file mode 100644
index 8185d9844b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationIterator.java
+++ /dev/null
@@ -1,103 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-
-
-/**
- * A <code>TransformationIterator</code> wraps another {@link Iterator}
- * and transforms its results for client consumption. To use, supply a
- * {@link Transformer} or subclass <code>TransformationIterator</code>
- * and override the {@link #transform(Object)} method.
- * Objects of type <code>E1</code> are transformed into objects of type <code>E2</code>;
- * i.e. the iterator returns objects of type <code>E2</code>.
- *
- * @param <E1> input: the type of elements to be transformed
- * @param <E2> output: the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.TransformationIterable
- */
-public class TransformationIterator<E1, E2>
- implements Iterator<E2>
-{
- private final Iterator<? extends E1> iterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified iterable
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationIterator(Iterable<? extends E1> iterable) {
- this(iterable.iterator());
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationIterator(Iterator<? extends E1> iterator) {
- this(iterator, Transformer.Disabled.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified iterable and transformer.
- */
- public TransformationIterator(Iterable<? extends E1> iterable, Transformer<E1, ? extends E2> transformer) {
- this(iterable.iterator(), transformer);
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationIterator(Iterator<? extends E1> iterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.iterator = iterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.iterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.iterator.next());
- }
-
- public void remove() {
- // delegate to the nested iterator
- this.iterator.remove();
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(E1 next) {
- return this.transformer.transform(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.iterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java
deleted file mode 100644
index 358cf6a3c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TransformationListIterator.java
+++ /dev/null
@@ -1,152 +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.utility.internal.iterators;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-
-/**
- * A <code>TransformationListIterator</code> wraps another {@link ListIterator}
- * and transforms its results for client consumption. To use, supply a
- * {@link Transformer} or subclass <code>TransformationIterator</code>
- * and override the {@link #transform(Object)} method.
- * <p>
- * The methods {@link #set(Object)} and {@link #add(Object)}
- * are left unsupported in this class.
- *
- * @param <E1> input: the type of elements to be transformed
- * @param <E2> output: the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.TransformationListIterable
- */
-public class TransformationListIterator<E1, E2>
- implements ListIterator<E2>
-{
- private final ListIterator<? extends E1> listIterator;
- private final Transformer<E1, ? extends E2> transformer;
-
-
- /**
- * Construct an iterator with the specified list
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationListIterator(List<? extends E1> list) {
- this(list.listIterator());
- }
-
- /**
- * Construct an iterator with the specified nested listed iterator
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationListIterator(ListIterator<? extends E1> listIterator) {
- this(listIterator, Transformer.Disabled.<E1, E2>instance());
- }
-
- /**
- * Construct an iterator with the specified list
- * and a disabled transformer.
- * Use this constructor if you want to override the
- * {@link #transform(Object)} method instead of building
- * a {@link Transformer}.
- */
- public TransformationListIterator(ListIterable<? extends E1> listIterable) {
- this(listIterable.iterator());
- }
-
- /**
- * Construct an iterator with the specified list and transformer.
- */
- public TransformationListIterator(List<? extends E1> list, Transformer<E1, ? extends E2> transformer) {
- this(list.listIterator(), transformer);
- }
-
- /**
- * Construct an iterator with the specified list and transformer.
- */
- public TransformationListIterator(ListIterable<? extends E1> listIterable, Transformer<E1, ? extends E2> transformer) {
- this(listIterable.iterator(), transformer);
- }
-
- /**
- * Construct an iterator with the specified nested iterator
- * and transformer.
- */
- public TransformationListIterator(ListIterator<? extends E1> listIterator, Transformer<E1, ? extends E2> transformer) {
- super();
- this.listIterator = listIterator;
- this.transformer = transformer;
- }
-
- public boolean hasNext() {
- // delegate to the nested iterator
- return this.listIterator.hasNext();
- }
-
- public E2 next() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.listIterator.next());
- }
-
- public int nextIndex() {
- // delegate to the nested iterator
- return this.listIterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- // delegate to the nested iterator
- return this.listIterator.hasPrevious();
- }
-
- public E2 previous() {
- // transform the object returned by the nested iterator before returning it
- return this.transform(this.listIterator.previous());
- }
-
- public int previousIndex() {
- // delegate to the nested iterator
- return this.listIterator.previousIndex();
- }
-
- public void add(E2 o) {
- throw new UnsupportedOperationException();
- }
-
- public void set(E2 o) {
- throw new UnsupportedOperationException();
- }
-
- public void remove() {
- // delegate to the nested iterator
- this.listIterator.remove();
- }
-
- /**
- * Transform the specified object and return the result.
- */
- protected E2 transform(E1 next) {
- return this.transformer.transform(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listIterator);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java
deleted file mode 100644
index 5994906372..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/iterators/TreeIterator.java
+++ /dev/null
@@ -1,254 +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.utility.internal.iterators;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * A <code>TreeIterator</code> simplifies the traversal of a
- * tree of objects, where the objects' protocol(s) provides
- * a method for getting the immediate children of the given
- * node but does not provide a method for getting all the
- * descendants (children, grandchildren, etc.) of the given node.
- * <p>
- * To use, supply:<ul>
- * <li> either the root element of the tree or, if the tree has
- * multiple roots, an {@link Iterator} over the set of roots
- * <li> a {@link Midwife} that delivers the children
- * of each child
- * (alternatively, subclass <code>TreeIterator</code>
- * and override the {@link #children(Object)} method)
- * </ul>
- *
- * @param <E> the type of elements returned by the iterator
- *
- * @see org.eclipse.jpt.utility.internal.iterables.TreeIterable
- */
-public class TreeIterator<E>
- implements Iterator<E>
-{
- private final LinkedList<Iterator<? extends E>> iterators;
- private final Midwife<E> midwife;
- private Iterator<? extends E> currentIterator;
-
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified collection of roots
- * and a disabled midwife.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link Midwife}.
- */
- public TreeIterator(E... roots) {
- this(new ArrayIterator<E>(roots));
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified collection of roots
- * and a disabled midwife.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link Midwife}.
- */
- public TreeIterator(Iterable<? extends E> roots) {
- this(roots.iterator());
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified collection of roots
- * and a disabled midwife.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link Midwife}.
- */
- public TreeIterator(Iterator<? extends E> roots) {
- this(roots, Midwife.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified root and a disabled midwife.
- * Use this constructor if you want to override the
- * {@link #children(Object)} method instead of building
- * a {@link Midwife}.
- */
- public TreeIterator(E root) {
- this(root, Midwife.Disabled.<E>instance());
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified root and midwife.
- */
- public TreeIterator(E root, Midwife<E> midwife) {
- this(new SingleElementIterator<E>(root), midwife);
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified roots and midwife.
- */
- public TreeIterator(E[] roots, Midwife<E> midwife) {
- this(new ArrayIterator<E>(roots), midwife);
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified roots and midwife.
- */
- public TreeIterator(Iterable<? extends E> roots, Midwife<E> midwife) {
- this(roots.iterator(), midwife);
- }
-
- /**
- * Construct an iterator that returns the nodes of a tree
- * with the specified roots and midwife.
- */
- public TreeIterator(Iterator<? extends E> roots, Midwife<E> midwife) {
- super();
- this.currentIterator = roots;
- // use a LinkedList since we will be pulling off the front and adding to the end
- this.iterators = new LinkedList<Iterator<? extends E>>();
- this.midwife = midwife;
- }
-
- public boolean hasNext() {
- if (this.currentIterator.hasNext()) {
- return true;
- }
- for (Iterator<? extends E> iterator : this.iterators) {
- if (iterator.hasNext()) {
- return true;
- }
- }
- return false;
- }
-
- public E next() {
- if (this.currentIterator.hasNext()) {
- return this.nextInternal();
- }
- for (Iterator<Iterator<? extends E>> stream = this.iterators.iterator(); stream.hasNext(); ) {
- this.currentIterator = stream.next();
- if (this.currentIterator.hasNext()) {
- break;
- }
- stream.remove();
- }
- return this.nextInternal();
- }
-
- /**
- * Fetch the children of the next node before returning it.
- */
- private E nextInternal() {
- E next = this.currentIterator.next();
- this.iterators.add(this.children(next));
- return next;
- }
-
- public void remove() {
- this.currentIterator.remove();
- }
-
- /**
- * Return the immediate children of the specified object.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Midwife}.
- */
- protected Iterator<? extends E> children(E next) {
- return this.midwife.children(next);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.currentIterator);
- }
-
-
- //********** inner classes **********
-
- /**
- * Used by {@link TreeIterator} to retrieve
- * the immediate children of a node in the tree.
- */
- public interface Midwife<T> {
-
- /**
- * Return the immediate children of the specified object.
- */
- Iterator<? extends T> children(T o);
-
-
- final class Null<S> implements Midwife<S> {
- @SuppressWarnings("rawtypes")
- public static final Midwife INSTANCE = new Null();
- @SuppressWarnings("unchecked")
- public static <R> Midwife<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- // return no neighbors
- public Iterator<S> children(S next) {
- return EmptyIterator.instance();
- }
- @Override
- public String toString() {
- return "TreeIterator.Midwife.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- /**
- * The midwife used when the {@link TreeIterator#children(Object)}
- * method is overridden.
- */
- final class Disabled<S> implements Midwife<S> {
- @SuppressWarnings("rawtypes")
- public static final Midwife INSTANCE = new Disabled();
- @SuppressWarnings("unchecked")
- public static <R> Midwife<R> instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Disabled() {
- super();
- }
- // throw an exception
- public Iterator<S> children(S next) {
- throw new UnsupportedOperationException(); // TreeIterator.children(Object) was not implemented
- }
- @Override
- public String toString() {
- return "TreeIterator.Midwife.Disabled"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
deleted file mode 100644
index 6cd31fc447..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/AbstractModel.java
+++ /dev/null
@@ -1,687 +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.utility.internal.model;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Reasonable implementation of the {@link Model} protocol
- * with numerous convenience methods.
- *
- * @see ChangeSupport
- */
-public abstract class AbstractModel
- implements Model
-{
- /**
- * Delegate state/property/collection/list/tree change support to this
- * helper object. The change support object is "lazily-initialized";
- * so it may be null. The method {@link #getChangeSupport()} will initialize this
- * field if it is null.
- *
- * NB: We instantiate this when we fire events, even when we do not have
- * any listeners (which is be implied if this is null).
- * This allows the change support to have behavior tied to events even when
- * we have no listeners.
- * @see CallbackChangeSupport#aspectChanged(String)
- */
- protected ChangeSupport changeSupport;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Default constructor.
- */
- protected AbstractModel() {
- super();
- }
-
- /**
- * This accessor will build the change support when required.
- * This only helps reduce the footprint of a model that neither has any
- * listeners added to it nor ever changes (fires any events).
- */
- protected synchronized ChangeSupport getChangeSupport() {
- if (this.changeSupport == null) {
- this.changeSupport = this.buildChangeSupport();
- }
- return this.changeSupport;
- }
-
- /**
- * Allow subclasses to tweak the change support used.
- */
- protected ChangeSupport buildChangeSupport() {
- return new ChangeSupport(this);
- }
-
-
- // ********** change support **********
-
- public void addChangeListener(ChangeListener listener) {
- this.getChangeSupport().addChangeListener(listener);
- }
-
- public void removeChangeListener(ChangeListener listener) {
- this.getChangeSupport().removeChangeListener(listener);
- }
-
- /**
- * Return whether the model has any change listeners.
- */
- public boolean hasAnyChangeListeners() {
- return (this.changeSupport != null) && this.changeSupport.hasAnyChangeListeners();
- }
-
- /**
- * Return whether the model has no change listeners.
- */
- public boolean hasNoChangeListeners() {
- return ! this.hasAnyChangeListeners();
- }
-
-
- // ********** state change support **********
-
- public void addStateChangeListener(StateChangeListener listener) {
- this.getChangeSupport().addStateChangeListener(listener);
- }
-
- public void removeStateChangeListener(StateChangeListener listener) {
- this.getChangeSupport().removeStateChangeListener(listener);
- }
-
- /**
- * Return whether the model has any state change listeners.
- */
- public boolean hasAnyStateChangeListeners() {
- return (this.changeSupport != null) && this.changeSupport.hasAnyStateChangeListeners();
- }
-
- /**
- * Return whether the model has no state change listeners.
- */
- public boolean hasNoStateChangeListeners() {
- return ! this.hasAnyStateChangeListeners();
- }
-
- protected final void fireStateChanged(StateChangeEvent event) {
- this.getChangeSupport().fireStateChanged(event);
- }
-
- protected final void fireStateChanged() {
- this.getChangeSupport().fireStateChanged();
- }
-
-
- // ********** property change support **********
-
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.getChangeSupport().addPropertyChangeListener(propertyName, listener);
- }
-
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.getChangeSupport().removePropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Return whether the model has any property change listeners that will
- * be notified when the specified property has changed.
- */
- public boolean hasAnyPropertyChangeListeners(String propertyName) {
- return (this.changeSupport != null) && this.changeSupport.hasAnyPropertyChangeListeners(propertyName);
- }
-
- /**
- * Return whether the model has no property change listeners that will
- * be notified when the specified property has changed.
- */
- public boolean hasNoPropertyChangeListeners(String propertyName) {
- return ! this.hasAnyPropertyChangeListeners(propertyName);
- }
-
- protected final void firePropertyChanged(PropertyChangeEvent event) {
- this.getChangeSupport().firePropertyChanged(event);
- }
-
- protected final void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
- this.getChangeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- protected final void firePropertyChanged(String propertyName, int oldValue, int newValue) {
- this.getChangeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- protected final void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
- this.getChangeSupport().firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- /**
- * implied <code>null</code> "old" value
- */
- protected final void firePropertyChanged(String propertyName, Object newValue) {
- this.firePropertyChanged(propertyName, null, newValue);
- }
-
-
- // ********** collection change support **********
-
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.getChangeSupport().addCollectionChangeListener(collectionName, listener);
- }
-
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.getChangeSupport().removeCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Return whether the model has any collection change listeners that will
- * be notified when the specified collection has changed.
- */
- public boolean hasAnyCollectionChangeListeners(String collectionName) {
- return (this.changeSupport != null) && this.changeSupport.hasAnyCollectionChangeListeners(collectionName);
- }
-
- /**
- * Return whether the model has no collection change listeners that will
- * be notified when the specified collection has changed.
- */
- public boolean hasNoCollectionChangeListeners(String collectionName) {
- return ! this.hasAnyCollectionChangeListeners(collectionName);
- }
-
- protected final void fireItemsAdded(CollectionAddEvent event) {
- this.getChangeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemsAdded(String collectionName, Collection<?> addedItems) {
- this.getChangeSupport().fireItemsAdded(collectionName, addedItems);
- }
-
- protected final void fireItemAdded(String collectionName, Object addedItem) {
- this.getChangeSupport().fireItemAdded(collectionName, addedItem);
- }
-
- protected final void fireItemsRemoved(CollectionRemoveEvent event) {
- this.getChangeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
- this.getChangeSupport().fireItemsRemoved(collectionName, removedItems);
- }
-
- protected final void fireItemRemoved(String collectionName, Object removedItem) {
- this.getChangeSupport().fireItemRemoved(collectionName, removedItem);
- }
-
- protected final void fireCollectionCleared(CollectionClearEvent event) {
- this.getChangeSupport().fireCollectionCleared(event);
- }
-
- protected final void fireCollectionCleared(String collectionName) {
- this.getChangeSupport().fireCollectionCleared(collectionName);
- }
-
- protected final void fireCollectionChanged(CollectionChangeEvent event) {
- this.getChangeSupport().fireCollectionChanged(event);
- }
-
- protected final void fireCollectionChanged(String collectionName, Collection<?> collection) {
- this.getChangeSupport().fireCollectionChanged(collectionName, collection);
- }
-
- protected <E> boolean addItemToCollection(E item, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().addItemToCollection(item, collection, collectionName);
- }
-
- protected <E> boolean addItemsToCollection(E[] items, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().addItemsToCollection(items, collection, collectionName);
- }
-
- protected <E> boolean addItemsToCollection(Collection<? extends E> items, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().addItemsToCollection(items, collection, collectionName);
- }
-
- protected <E> boolean addItemsToCollection(Iterable<? extends E> items, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().addItemsToCollection(items, collection, collectionName);
- }
-
- protected <E> boolean addItemsToCollection(Iterator<? extends E> items, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().addItemsToCollection(items, collection, collectionName);
- }
-
- protected boolean removeItemFromCollection(Object item, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().removeItemFromCollection(item, collection, collectionName);
- }
-
- protected boolean removeItemsFromCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().removeItemsFromCollection(items, collection, collectionName);
- }
-
- protected boolean removeItemsFromCollection(Collection<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().removeItemsFromCollection(items, collection, collectionName);
- }
-
- protected boolean removeItemsFromCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().removeItemsFromCollection(items, collection, collectionName);
- }
-
- protected boolean removeItemsFromCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().removeItemsFromCollection(items, collection, collectionName);
- }
-
- protected boolean retainItemsInCollection(Object[] items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().retainItemsInCollection(items, collection, collectionName);
- }
-
- protected boolean retainItemsInCollection(Collection<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().retainItemsInCollection(items, collection, collectionName);
- }
-
- protected boolean retainItemsInCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().retainItemsInCollection(items, collection, collectionName);
- }
-
- protected boolean retainItemsInCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- return this.getChangeSupport().retainItemsInCollection(items, collection, collectionName);
- }
-
- protected boolean clearCollection(Collection<?> collection, String collectionName) {
- return this.getChangeSupport().clearCollection(collection, collectionName);
- }
-
- protected <E> boolean synchronizeCollection(Collection<E> newCollection, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().synchronizeCollection(newCollection, collection, collectionName);
- }
-
- protected <E> boolean synchronizeCollection(Iterator<E> newCollection, Collection<E> collection, String collectionName) {
- return this.getChangeSupport().synchronizeCollection(newCollection, collection, collectionName);
- }
-
-
- // ********** list change support **********
-
- public void addListChangeListener(String listName, ListChangeListener listener) {
- this.getChangeSupport().addListChangeListener(listName, listener);
- }
-
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- this.getChangeSupport().removeListChangeListener(listName, listener);
- }
-
- /**
- * Return whether the model has any list change listeners that will
- * be notified when the specified list has changed.
- */
- public boolean hasAnyListChangeListeners(String listName) {
- return (this.changeSupport != null) && this.changeSupport.hasAnyListChangeListeners(listName);
- }
-
- /**
- * Return whether the model has no list change listeners that will
- * be notified when the specified list has changed.
- */
- public boolean hasNoListChangeListeners(String listName) {
- return ! this.hasAnyListChangeListeners(listName);
- }
-
- protected final void fireItemsAdded(ListAddEvent event) {
- this.getChangeSupport().fireItemsAdded(event);
- }
-
- protected final void fireItemsAdded(String listName, int index, List<?> addedItems) {
- this.getChangeSupport().fireItemsAdded(listName, index, addedItems);
- }
-
- protected final void fireItemAdded(String listName, int index, Object addedItem) {
- this.getChangeSupport().fireItemAdded(listName, index, addedItem);
- }
-
- protected final void fireItemsRemoved(ListRemoveEvent event) {
- this.getChangeSupport().fireItemsRemoved(event);
- }
-
- protected final void fireItemsRemoved(String listName, int index, List<?> removedItems) {
- this.getChangeSupport().fireItemsRemoved(listName, index, removedItems);
- }
-
- protected final void fireItemRemoved(String listName, int index, Object removedItem) {
- this.getChangeSupport().fireItemRemoved(listName, index, removedItem);
- }
-
- protected final void fireItemsReplaced(ListReplaceEvent event) {
- this.getChangeSupport().fireItemsReplaced(event);
- }
-
- protected final <E> void fireItemsReplaced(String listName, int index, List<? extends E> newItems, List<E> replacedItems) {
- this.getChangeSupport().fireItemsReplaced(listName, index, newItems, replacedItems);
- }
-
- protected final void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
- this.getChangeSupport().fireItemReplaced(listName, index, newItem, replacedItem);
- }
-
- protected final void fireItemsMoved(ListMoveEvent event) {
- this.getChangeSupport().fireItemsMoved(event);
- }
-
- protected final <E> void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
- this.getChangeSupport().fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- protected final void fireItemMoved(String listName, int targetIndex, int sourceIndex) {
- this.getChangeSupport().fireItemMoved(listName, targetIndex, sourceIndex);
- }
-
- protected final void fireListCleared(ListClearEvent event) {
- this.getChangeSupport().fireListCleared(event);
- }
-
- protected final void fireListCleared(String listName) {
- this.getChangeSupport().fireListCleared(listName);
- }
-
- protected final void fireListChanged(ListChangeEvent event) {
- this.getChangeSupport().fireListChanged(event);
- }
-
- protected final void fireListChanged(String listName, List<?> list) {
- this.getChangeSupport().fireListChanged(listName, list);
- }
-
- protected <E> void addItemToList(int index, E item, List<E> list, String listName) {
- this.getChangeSupport().addItemToList(index, item, list, listName);
- }
-
- protected <E> boolean addItemToList(E item, List<E> list, String listName) {
- return this.getChangeSupport().addItemToList(item, list, listName);
- }
-
- protected <E> boolean addItemsToList(int index, E[] items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(index, items, list, listName);
- }
-
- protected <E> boolean addItemsToList(int index, Collection<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(index, items, list, listName);
- }
-
- protected <E> boolean addItemsToList(int index, Iterable<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(index, items, list, listName);
- }
-
- protected <E> boolean addItemsToList(int index, Iterator<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(index, items, list, listName);
- }
-
- protected <E> boolean addItemsToList(E[] items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(items, list, listName);
- }
-
- protected <E> boolean addItemsToList(Collection<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(items, list, listName);
- }
-
- protected <E> boolean addItemsToList(Iterable<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(items, list, listName);
- }
-
- protected <E> boolean addItemsToList(Iterator<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().addItemsToList(items, list, listName);
- }
-
- protected <E> E removeItemFromList(int index, List<E> list, String listName) {
- return this.getChangeSupport().removeItemFromList(index, list, listName);
- }
-
- protected boolean removeItemFromList(Object item, List<?> list, String listName) {
- return this.getChangeSupport().removeItemFromList(item, list, listName);
- }
-
- protected <E> List<E> removeItemsFromList(int index, List<E> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(index, list, listName);
- }
-
- protected <E> List<E> removeItemsFromList(int index, int length, List<E> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(index, length, list, listName);
- }
-
- protected boolean removeItemsFromList(Object[] items, List<?> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(items, list, listName);
- }
-
- protected boolean removeItemsFromList(Collection<?> items, List<?> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(items, list, listName);
- }
-
- protected boolean removeItemsFromList(Iterable<?> items, List<?> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(items, list, listName);
- }
-
- protected boolean removeItemsFromList(Iterator<?> items, List<?> list, String listName) {
- return this.getChangeSupport().removeItemsFromList(items, list, listName);
- }
-
- protected boolean retainItemsInList(Object[] items, List<?> list, String listName) {
- return this.getChangeSupport().retainItemsInList(items, list, listName);
- }
-
- protected boolean retainItemsInList(Collection<?> items, List<?> list, String listName) {
- return this.getChangeSupport().retainItemsInList(items, list, listName);
- }
-
- protected boolean retainItemsInList(Iterable<?> items, List<?> list, String listName) {
- return this.getChangeSupport().retainItemsInList(items, list, listName);
- }
-
- protected boolean retainItemsInList(Iterator<?> items, List<?> list, String listName) {
- return this.getChangeSupport().retainItemsInList(items, list, listName);
- }
-
- protected <E> E setItemInList(int index, E item, List<E> list, String listName) {
- return this.getChangeSupport().setItemInList(index, item, list, listName);
- }
-
- protected <E> int replaceItemInList(E oldItem, E newItem, List<E> list, String listName) {
- return this.getChangeSupport().replaceItemInList(oldItem, newItem, list, listName);
- }
-
- protected <E> List<E> setItemsInList(int index, E[] items, List<E> list, String listName) {
- return this.getChangeSupport().setItemsInList(index, items, list, listName);
- }
-
- protected <E> List<E> setItemsInList(int index, List<? extends E> items, List<E> list, String listName) {
- return this.getChangeSupport().setItemsInList(index, items, list, listName);
- }
-
- protected <E> void moveItemsInList(int targetIndex, int sourceIndex, int length, List<E> list, String listName) {
- this.getChangeSupport().moveItemsInList(targetIndex, sourceIndex, length, list, listName);
- }
-
- protected <E> void moveItemInList(int targetIndex, int sourceIndex, List<E> list, String listName) {
- this.getChangeSupport().moveItemInList(targetIndex, sourceIndex, list, listName);
- }
-
- protected boolean clearList(List<?> list, String listName) {
- return this.getChangeSupport().clearList(list, listName);
- }
-
- protected <E> boolean synchronizeList(List<E> newList, List<E> list, String listName) {
- return this.getChangeSupport().synchronizeList(newList, list, listName);
- }
-
- protected <E> boolean synchronizeList(Iterator<E> newList, List<E> list, String listName) {
- return this.getChangeSupport().synchronizeList(newList, list, listName);
- }
-
-
- // ********** tree change support **********
-
- public void addTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.getChangeSupport().addTreeChangeListener(treeName, listener);
- }
-
- public void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.getChangeSupport().removeTreeChangeListener(treeName, listener);
- }
-
- /**
- * Return whether the model has any tree change listeners that will
- * be notified when the specified tree has changed.
- */
- public boolean hasAnyTreeChangeListeners(String treeName) {
- return (this.changeSupport != null) && this.changeSupport.hasAnyTreeChangeListeners(treeName);
- }
-
- /**
- * Return whether the model has no tree change listeners that will
- * be notified when the specified tree has changed.
- */
- public boolean hasNoTreeChangeListeners(String treeName) {
- return ! this.hasAnyTreeChangeListeners(treeName);
- }
-
- protected final void fireNodeAdded(TreeAddEvent event) {
- this.getChangeSupport().fireNodeAdded(event);
- }
-
- protected final void fireNodeAdded(String treeName, List<?> path) {
- this.getChangeSupport().fireNodeAdded(treeName, path);
- }
-
- protected final void fireNodeRemoved(TreeRemoveEvent event) {
- this.getChangeSupport().fireNodeRemoved(event);
- }
-
- protected final void fireNodeRemoved(String treeName, List<?> path) {
- this.getChangeSupport().fireNodeRemoved(treeName, path);
- }
-
- protected final void fireTreeCleared(TreeClearEvent event) {
- this.getChangeSupport().fireTreeCleared(event);
- }
-
- protected final void fireTreeCleared(String treeName) {
- this.getChangeSupport().fireTreeCleared(treeName);
- }
-
- protected final void fireTreeChanged(TreeChangeEvent event) {
- this.getChangeSupport().fireTreeChanged(event);
- }
-
- protected final void fireTreeChanged(String treeName, Collection<?> nodes) {
- this.getChangeSupport().fireTreeChanged(treeName, nodes);
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the specified values are equal, with the appropriate <code>null</code> checks.
- * Convenience method for checking whether an attribute value has changed.
- * <p>
- * <em>Do not</em> use this to determine whether to fire a change notification,
- * {@link ChangeSupport} already does that.
- */
- protected final boolean valuesAreEqual(Object value1, Object value2) {
- return this.getChangeSupport().valuesAreEqual(value1, value2);
- }
- protected final boolean attributeValueHasNotChanged(Object oldValue, Object newValue) {
- return this.valuesAreEqual(oldValue, newValue);
- }
-
-
- /**
- * Return whether the specified values are different, with the appropriate <code>null</code> checks.
- * Convenience method for checking whether an attribute value has changed.
- * <p>
- * <em>Do not</em> use this to determine whether to fire a change notification,
- * {@link ChangeSupport} already does that.
- * <p>
- * For example, after firing the change notification, you can use this method
- * to decide if some other, related, piece of state needs to be synchronized
- * with the state that just changed.
- */
- protected final boolean valuesAreDifferent(Object value1, Object value2) {
- return this.getChangeSupport().valuesAreDifferent(value1, value2);
- }
- protected final boolean attributeValueHasChanged(Object oldValue, Object newValue) {
- return this.valuesAreDifferent(oldValue, newValue);
- }
-
-
- // ********** Object overrides **********
-
- /**
- * Although cloning models is usually not a Good Idea,
- * we should at least support it properly.
- */
- @Override
- protected AbstractModel clone() throws CloneNotSupportedException {
- AbstractModel clone = (AbstractModel) super.clone();
- // clear out change support - models do not share listeners
- clone.changeSupport = null;
- return clone;
- }
-
- /**
- * e.g. <code>"ClassName[00F3EE42](add'l info)"</code>
- */
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append('(');
- int len = sb.length();
- this.toString(sb);
- if (sb.length() == len) {
- sb.deleteCharAt(len - 1);
- } else {
- sb.append(')');
- }
- return sb.toString();
- }
-
- /**
- * This method is public so one model can call a nested model's
- * <code>#toString(StringBuilder)</code>.
- */
- public void toString(@SuppressWarnings("unused") StringBuilder sb) {
- // subclasses should override this to do something a bit more helpful
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java
deleted file mode 100644
index b3d9b4d081..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/CallbackChangeSupport.java
+++ /dev/null
@@ -1,338 +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.utility.internal.model;
-
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * This change support class will notify listeners whenever one of the source's
- * aspects has changed. Only the aspect name is passed to the listener; no
- * event is generated. This allows the listeners to delegate to the change
- * support object verification that an aspect as actually changed. This is
- * useful for simple things like setting dirty flags, blanket validation, and
- * blanket sychronization; i.e. things that might be interested in the <em>name</em>
- * of the aspect that changed but not so much <em>how</em> the aspect changed.
- */
-public class CallbackChangeSupport
- extends ChangeSupport
-{
- protected final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
- private static final long serialVersionUID = 1L;
-
-
- public CallbackChangeSupport(Model source, Listener listener) {
- this(source);
- this.addListener(listener);
- }
-
- public CallbackChangeSupport(Model source) {
- super(source);
- }
-
- protected void aspectChanged(String aspectName) {
- for (Listener listener : this.listenerList.getListeners()) {
- listener.aspectChanged(aspectName);
- }
- }
-
- public void addListener(Listener listener) {
- this.listenerList.add(listener);
- }
-
- public void removeListener(Listener listener) {
- this.listenerList.remove(listener);
- }
-
-
- // ********** listener interface **********
-
- /**
- * Listener that will be notified of any aspect changes.
- */
- public interface Listener extends EventListener {
-
- /**
- * The specified aspect changed.
- */
- void aspectChanged(String aspectName);
-
- }
-
-
- // ********** state change support **********
-
- @Override
- public void fireStateChanged(StateChangeEvent event) {
- super.fireStateChanged(event);
- this.aspectChanged(null);
- }
-
- @Override
- public void fireStateChanged() {
- super.fireStateChanged();
- this.aspectChanged(null);
- }
-
-
- // ********** property change support **********
-
- @Override
- protected void firePropertyChanged_(PropertyChangeEvent event) {
- super.firePropertyChanged_(event);
- this.aspectChanged(event.getPropertyName());
- }
-
- @Override
- protected void firePropertyChanged_(String propertyName, Object oldValue, Object newValue) {
- super.firePropertyChanged_(propertyName, oldValue, newValue);
- this.aspectChanged(propertyName);
- }
-
- @Override
- protected void firePropertyChanged_(String propertyName, int oldValue, int newValue) {
- super.firePropertyChanged_(propertyName, oldValue, newValue);
- this.aspectChanged(propertyName);
- }
-
- @Override
- protected void firePropertyChanged_(String propertyName, boolean oldValue, boolean newValue) {
- super.firePropertyChanged_(propertyName, oldValue, newValue);
- this.aspectChanged(propertyName);
- }
-
-
- // ********** collection change support **********
-
- @Override
- protected void fireItemsAdded_(CollectionAddEvent event) {
- super.fireItemsAdded_(event);
- this.aspectChanged(event.getCollectionName());
- }
-
- @Override
- protected void fireItemsAdded_(String collectionName, Collection<?> addedItems) {
- super.fireItemsAdded_(collectionName, addedItems);
- this.aspectChanged(collectionName);
- }
-
- @Override
- public void fireItemAdded(String collectionName, Object addedItem) {
- super.fireItemAdded(collectionName, addedItem);
- this.aspectChanged(collectionName);
- }
-
- @Override
- protected void fireItemsRemoved_(CollectionRemoveEvent event) {
- super.fireItemsRemoved_(event);
- this.aspectChanged(event.getCollectionName());
- }
-
- @Override
- protected void fireItemsRemoved_(String collectionName, Collection<?> removedItems) {
- super.fireItemsRemoved_(collectionName, removedItems);
- this.aspectChanged(collectionName);
- }
-
- @Override
- public void fireItemRemoved(String collectionName, Object removedItem) {
- super.fireItemRemoved(collectionName, removedItem);
- this.aspectChanged(collectionName);
- }
-
- @Override
- public void fireCollectionCleared(CollectionClearEvent event) {
- super.fireCollectionCleared(event);
- this.aspectChanged(event.getCollectionName());
- }
-
- @Override
- public void fireCollectionCleared(String collectionName) {
- super.fireCollectionCleared(collectionName);
- this.aspectChanged(collectionName);
- }
-
- @Override
- public void fireCollectionChanged(CollectionChangeEvent event) {
- super.fireCollectionChanged(event);
- this.aspectChanged(event.getCollectionName());
- }
-
- @Override
- public void fireCollectionChanged(String collectionName, Collection<?> collection) {
- super.fireCollectionChanged(collectionName, collection);
- this.aspectChanged(collectionName);
- }
-
-
- // ********** list change support **********
-
- @Override
- protected void fireItemsAdded_(ListAddEvent event) {
- super.fireItemsAdded_(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- protected void fireItemsAdded_(String listName, int index, List<?> addedItems) {
- super.fireItemsAdded_(listName, index, addedItems);
- this.aspectChanged(listName);
- }
-
- @Override
- public void fireItemAdded(String listName, int index, Object addedItem) {
- super.fireItemAdded(listName, index, addedItem);
- this.aspectChanged(listName);
- }
-
- @Override
- protected void fireItemsRemoved_(ListRemoveEvent event) {
- super.fireItemsRemoved_(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- protected void fireItemsRemoved_(String listName, int index, List<?> removedItems) {
- super.fireItemsRemoved_(listName, index, removedItems);
- this.aspectChanged(listName);
- }
-
- @Override
- public void fireItemRemoved(String listName, int index, Object removedItem) {
- super.fireItemRemoved(listName, index, removedItem);
- this.aspectChanged(listName);
- }
-
- @Override
- protected void fireItemsReplaced_(ListReplaceEvent event) {
- super.fireItemsReplaced_(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- protected void fireItemsReplaced_(String listName, int index, List<?> newItems, List<?> replacedItems) {
- super.fireItemsReplaced_(listName, index, newItems, replacedItems);
- this.aspectChanged(listName);
- }
-
- @Override
- protected void fireItemReplaced_(String listName, int index, Object newItem, Object replacedItem) {
- super.fireItemReplaced_(listName, index, newItem, replacedItem);
- this.aspectChanged(listName);
- }
-
- @Override
- protected void fireItemsMoved_(ListMoveEvent event) {
- super.fireItemsMoved_(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- protected void fireItemsMoved_(String listName, int targetIndex, int sourceIndex, int length) {
- super.fireItemsMoved_(listName, targetIndex, sourceIndex, length);
- this.aspectChanged(listName);
- }
-
- @Override
- public void fireListCleared(ListClearEvent event) {
- super.fireListCleared(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- public void fireListCleared(String listName) {
- super.fireListCleared(listName);
- this.aspectChanged(listName);
- }
-
- @Override
- public void fireListChanged(ListChangeEvent event) {
- super.fireListChanged(event);
- this.aspectChanged(event.getListName());
- }
-
- @Override
- public void fireListChanged(String listName, List<?> list) {
- super.fireListChanged(listName, list);
- this.aspectChanged(listName);
- }
-
-
- // ********** tree change support **********
-
- @Override
- public void fireNodeAdded(TreeAddEvent event) {
- super.fireNodeAdded(event);
- this.aspectChanged(event.getTreeName());
- }
-
- @Override
- public void fireNodeAdded(String treeName, List<?> path) {
- super.fireNodeAdded(treeName, path);
- this.aspectChanged(treeName);
- }
-
- @Override
- public void fireNodeRemoved(TreeRemoveEvent event) {
- super.fireNodeRemoved(event);
- this.aspectChanged(event.getTreeName());
- }
-
- @Override
- public void fireNodeRemoved(String treeName, List<?> path) {
- super.fireNodeRemoved(treeName, path);
- this.aspectChanged(treeName);
- }
-
- @Override
- public void fireTreeCleared(TreeClearEvent event) {
- super.fireTreeCleared(event);
- this.aspectChanged(event.getTreeName());
- }
-
- @Override
- public void fireTreeCleared(String treeName) {
- super.fireTreeCleared(treeName);
- this.aspectChanged(treeName);
- }
-
- @Override
- public void fireTreeChanged(TreeChangeEvent event) {
- super.fireTreeChanged(event);
- this.aspectChanged(event.getTreeName());
- }
-
- @Override
- public void fireTreeChanged(String treeName, Collection<?> nodes) {
- super.fireTreeChanged(treeName, nodes);
- this.aspectChanged(treeName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
deleted file mode 100644
index 6acfac1993..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/ChangeSupport.java
+++ /dev/null
@@ -1,2746 +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.utility.internal.model;
-
-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.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Support object that can be used by implementors of the {@link Model} interface.
- * It provides for state, property, collection, list, and tree change notifications to
- * listeners.
- * <p>
- * <strong>NB1:</strong> There is lots of copy-n-paste code in this class. Nearly all of this duplication
- * is an effort to prevent the unnecessary creation of new objects (typically event
- * objects). Since many events are fired when there are no listeners, we postpone
- * the creation of event objects until we know we have interested listeners.
- * Most methods have the "non-duplicated" version of the method body commented
- * out at the top of the current method body.
- * The hope was that this class would prove to be fairly static and the duplicated
- * code would not prove onerous; but that has not proven to be
- * the case, as we have added support for "state" changes, "dirty" notification,
- * and custom "notifiers", with more to come, I'm sure.... ~bjv
- * <p>
- * <strong>NB2:</strong> This class will check to see if, during the firing of events, a listener
- * on the original, cloned, list of listeners has been removed from the master
- * list of listeners <em>before</em> it is notified. If the listener has been removed
- * "concurrently" it will <em>not</em> be notified.
- * <p>
- * <strong>NB3:</strong> Any listener that is added during the firing of events will <em>not</em> be
- * also notified. This is a bit inconsistent with NB2, but seems reasonable
- * since any added listener should already be in synch with the model.
- * <p>
- * <strong>NB4:</strong> This class is serializable, but it will only write out listeners that
- * are also serializable while silently leaving behind listeners that are not.
- *
- * @see Model
- * @see AbstractModel
- */
-public class ChangeSupport
- implements Serializable
-{
- /** The object to be provided as the "source" for any generated events. */
- protected final Model source;
-
- /** Associate aspect names to class-specific listener lists. */
- private AspectListenerListPair<?>[] aspectListenerListPairs = EMPTY_ASPECT_LISTENER_LIST_PAIR_ARRAY;
- private static final AspectListenerListPair<?>[] EMPTY_ASPECT_LISTENER_LIST_PAIR_ARRAY = new AspectListenerListPair[0];
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- /**
- * Construct support for the specified source of change events.
- * The source cannot be null.
- */
- public ChangeSupport(Model source) {
- super();
- if (source == null) {
- throw new NullPointerException();
- }
- this.source = source;
- }
-
-
- // ********** internal implementation **********
-
- /**
- * Add a listener that listens to all the events of the specified type and
- * carrying the specified aspect name.
- * Neither the aspect name nor the listener can be null.
- */
- protected synchronized <L extends EventListener> void addListener(Class<L> listenerClass, String aspectName, L listener) {
- ListenerList<L> aspectListenerList = this.getListenerList(listenerClass, aspectName);
- if (aspectListenerList == null) {
- this.aspectListenerListPairs = ArrayTools.add(this.aspectListenerListPairs, new SimpleAspectListenerListPair<L>(listenerClass, aspectName, listener));
- } else {
- aspectListenerList.add(listener);
- }
- }
-
- /**
- * Add a listener that listens to all the events of the specified type.
- * The listener cannot be null.
- */
- protected synchronized <L extends EventListener> void addListener(Class<L> listenerClass, L listener) {
- ListenerList<L> listenerList = this.getListenerList(listenerClass);
- if (listenerList == null) {
- this.aspectListenerListPairs = ArrayTools.add(this.aspectListenerListPairs, new NullAspectListenerListPair<L>(listenerClass, listener));
- } else {
- listenerList.add(listener);
- }
- }
-
- /**
- * Remove a listener that has been registered for all the
- * events of the specified type and carrying the specified aspect name.
- * Neither the aspect name nor the listener can be null.
- */
- protected synchronized <L extends EventListener> void removeListener(Class<L> listenerClass, String aspectName, L listener) {
- ListenerList<L> aspectListenerList = this.getListenerList(listenerClass, aspectName);
- if (aspectListenerList == null) {
- throw new IllegalArgumentException("unregistered listener: " + listener); //$NON-NLS-1$
- }
- aspectListenerList.remove(listener); // leave the pair, even if the listener list is empty?
- }
-
- /**
- * Remove a listener that has been registered for all the events of the specified type.
- * The listener cannot be null.
- */
- protected synchronized <L extends EventListener> void removeListener(Class<L> listenerClass, L listener) {
- ListenerList<L> listenerList = this.getListenerList(listenerClass);
- if (listenerList == null) {
- throw new IllegalArgumentException("unregistered listener: " + listener); //$NON-NLS-1$
- }
- listenerList.remove(listener); // leave the pair, even if the listener list is empty?
- }
-
- /**
- * Return the listener list for the specified listener class and aspect name.
- * Return null if the listener list is not present.
- * The aspect name cannot be null.
- */
- protected <L extends EventListener> ListenerList<L> getListenerList(Class<L> listenerClass, String aspectName) {
- // put in a null check to simplify calling code
- if (aspectName == null) {
- throw new NullPointerException();
- }
- return this.getListenerList_(listenerClass, aspectName);
- }
-
- /**
- * Return the listener list for the specified listener class.
- * Return null if the listener list is not present.
- */
- protected <L extends EventListener> ListenerList<L> getListenerList(Class<L> listenerClass) {
- return this.getListenerList_(listenerClass, null);
- }
-
- /**
- * Return the listener list for the specified listener class and aspect name.
- * Return null if the listener list is not present.
- */
- protected synchronized <L extends EventListener> ListenerList<L> getListenerList_(Class<L> listenerClass, String aspectName) {
- for (AspectListenerListPair<?> pair : this.aspectListenerListPairs) {
- if (pair.matches(listenerClass, aspectName)) {
- @SuppressWarnings("unchecked") ListenerList<L> aspectListenerList = (ListenerList<L>) pair.listenerList;
- return aspectListenerList;
- }
- }
- return null;
- }
-
- /**
- * Return whether there are any listeners for the specified listener class
- * and aspect name.
- */
- protected <L extends EventListener> boolean hasAnyListeners(Class<L> listenerClass, String aspectName) {
- ListenerList<L> aspectListenerList = this.getListenerList(listenerClass, aspectName);
- if ((aspectListenerList != null) && ! aspectListenerList.isEmpty()) {
- return true;
- }
- return this.hasAnyChangeListeners(); // check for any general purpose listeners
- }
-
- /**
- * Return whether there are no listeners for the specified listener class
- * and aspect name.
- */
- protected <L extends EventListener> boolean hasNoListeners(Class<L> listenerClass, String aspectName) {
- return ! this.hasAnyListeners(listenerClass, aspectName);
- }
-
- /**
- * Return whether there are any listeners for the specified listener class.
- */
- protected <L extends EventListener> boolean hasAnyListeners(Class<L> listenerClass) {
- ListenerList<L> aspectListenerList = this.getListenerList(listenerClass);
- if ((aspectListenerList != null) && ! aspectListenerList.isEmpty()) {
- return true;
- }
- // check for any general purpose listeners (unless that's what we're already doing)
- return (listenerClass == this.getChangeListenerClass()) ? false : this.hasAnyChangeListeners();
- }
-
- /**
- * Return whether there are no listeners for the specified listener class.
- */
- protected <L extends EventListener> boolean hasNoListeners(Class<L> listenerClass) {
- return ! this.hasAnyListeners(listenerClass);
- }
-
-
- // ********** general purpose change support **********
-
- /**
- * Subclasses that add other types of listeners should override this method
- * to return the extension to ChangeListener that also extends whatever new
- * listener types are supported.
- */
- @SuppressWarnings("unchecked")
- protected <L extends ChangeListener> Class<L> getChangeListenerClass() {
- // not sure why I need to cast here...
- return (Class<L>) CHANGE_LISTENER_CLASS;
- }
-
- protected static final Class<ChangeListener> CHANGE_LISTENER_CLASS = ChangeListener.class;
-
- /**
- * Add a general purpose listener that listens to all events,
- * regardless of the aspect name associated with that event.
- * The listener cannot be null.
- */
- public void addChangeListener(ChangeListener listener) {
- this.addListener(this.getChangeListenerClass(), listener);
- }
-
- /**
- * Remove a general purpose listener.
- * The listener cannot be null.
- */
- public void removeChangeListener(ChangeListener listener) {
- this.removeListener(this.getChangeListenerClass(), listener);
- }
-
- /**
- * Return whether there are any general purpose listeners that will be
- * notified of any changes.
- */
- public boolean hasAnyChangeListeners() {
- return this.hasAnyListeners(this.getChangeListenerClass());
- }
-
- private ListenerList<ChangeListener> getChangeListenerList() {
- return this.getListenerList(CHANGE_LISTENER_CLASS);
- }
-
- private Iterable<ChangeListener> getChangeListeners() {
- ListenerList<ChangeListener> listenerList = this.getChangeListenerList();
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasChangeListener(ChangeListener listener) {
- return CollectionTools.contains(this.getChangeListeners(), listener);
- }
-
-
- // ********** state change support **********
-
- protected static final Class<StateChangeListener> STATE_CHANGE_LISTENER_CLASS = StateChangeListener.class;
-
- /**
- * Add a state change listener.
- */
- public void addStateChangeListener(StateChangeListener listener) {
- this.addListener(STATE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Remove a state change listener.
- */
- public void removeStateChangeListener(StateChangeListener listener) {
- this.removeListener(STATE_CHANGE_LISTENER_CLASS, listener);
- }
-
- /**
- * Return whether there are any state change listeners.
- */
- public boolean hasAnyStateChangeListeners() {
- return this.hasAnyListeners(STATE_CHANGE_LISTENER_CLASS);
- }
-
- private ListenerList<StateChangeListener> getStateChangeListenerList() {
- return this.getListenerList(STATE_CHANGE_LISTENER_CLASS);
- }
-
- private Iterable<StateChangeListener> getStateChangeListeners() {
- ListenerList<StateChangeListener> listenerList = this.getStateChangeListenerList();
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasStateChangeListener(StateChangeListener listener) {
- return CollectionTools.contains(this.getStateChangeListeners(), listener);
- }
-
- /**
- * Fire the specified state change event to any registered listeners.
- */
- public void fireStateChanged(StateChangeEvent event) {
- Iterable<StateChangeListener> listeners = this.getStateChangeListeners();
- if (listeners != null) {
- for (StateChangeListener listener : listeners) {
- if (this.hasStateChangeListener(listener)) { // verify listener is still listening
- listener.stateChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.stateChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a generic state change event to any registered state change
- * listeners.
- */
- public void fireStateChanged() {
-// this.fireStateChanged(new StateChangeEvent(this.source));
- StateChangeEvent event = null;
- Iterable<StateChangeListener> listeners = this.getStateChangeListeners();
- if (listeners != null) {
- for (StateChangeListener listener : listeners) {
- if (this.hasStateChangeListener(listener)) { // verify listener is still listening
- if (event == null) {
- event = new StateChangeEvent(this.source);
- }
- listener.stateChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new StateChangeEvent(this.source);
- }
- changeListener.stateChanged(event);
- }
- }
- }
- }
-
-
- // ********** property change support **********
-
- protected static final Class<PropertyChangeListener> PROPERTY_CHANGE_LISTENER_CLASS = PropertyChangeListener.class;
-
- /**
- * Add a property change listener for the specified property. The listener
- * will be notified only for changes to the specified property.
- */
- public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.addListener(PROPERTY_CHANGE_LISTENER_CLASS, propertyName, listener);
- }
-
- /**
- * Remove a property change listener that was registered for a specific property.
- */
- public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- this.removeListener(PROPERTY_CHANGE_LISTENER_CLASS, propertyName, listener);
- }
-
- /**
- * Return whether there are any property change listeners that will
- * be notified when the specified property has changed.
- */
- public boolean hasAnyPropertyChangeListeners(String propertyName) {
- return this.hasAnyListeners(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- }
-
- private ListenerList<PropertyChangeListener> getPropertyChangeListenerList(String propertyName) {
- return this.getListenerList(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- }
-
- private Iterable<PropertyChangeListener> getPropertyChangeListeners(String propertyName) {
- ListenerList<PropertyChangeListener> listenerList = this.getPropertyChangeListenerList(propertyName);
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- return CollectionTools.contains(this.getPropertyChangeListeners(propertyName), listener);
- }
-
- /**
- * Fire the specified property change event to any registered listeners.
- * No event is fired if the given event's old and new values are the same;
- * this includes when both values are null. Use a state change event
- * for general purpose notification of changes.
- */
- public void firePropertyChanged(PropertyChangeEvent event) {
- if (this.valuesAreDifferent(event.getOldValue(), event.getNewValue())) {
- this.firePropertyChanged_(event);
- }
- }
-
- /**
- * pre-condition: the specified event's old and new values are different
- */
- protected void firePropertyChanged_(PropertyChangeEvent event) {
- String propertyName = event.getPropertyName();
- Iterable<PropertyChangeListener> listeners = this.getPropertyChangeListeners(propertyName);
- if (listeners != null) {
- for (PropertyChangeListener listener : listeners) {
- if (this.hasPropertyChangeListener(propertyName, listener)) { // verify listener is still listening
- listener.propertyChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.propertyChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a bound property update to any registered property change listeners.
- * No event is fired if the given old and new values are the same;
- * this includes when both values are null. Use a state change event
- * for general purpose notification of changes.
- */
- public void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
-// this.firePropertyChanged(new PropertyChangeEvent(this.source, propertyName, oldValue, newValue));
- if (this.valuesAreDifferent(oldValue, newValue)) {
- this.firePropertyChanged_(propertyName, oldValue, newValue);
- }
- }
-
- /**
- * pre-condition: the specified old and new values are different
- */
- protected void firePropertyChanged_(String propertyName, Object oldValue, Object newValue) {
- PropertyChangeEvent event = null;
- Iterable<PropertyChangeListener> listeners = this.getPropertyChangeListeners(propertyName);
- if (listeners != null) {
- for (PropertyChangeListener listener : listeners) {
- if (this.hasPropertyChangeListener(propertyName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, oldValue, newValue);
- }
- listener.propertyChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, oldValue, newValue);
- }
- changeListener.propertyChanged(event);
- }
- }
- }
- }
-
- /**
- * Report an int bound property update to any registered listeners.
- * No event is fired if old and new are equal.
- * <p>
- * This is merely a convenience wrapper around the more general
- * firePropertyChange method that takes Object values.
- */
- public void firePropertyChanged(String propertyName, int oldValue, int newValue) {
-// this.firePropertyChanged(propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue));
- if (oldValue != newValue) {
- this.firePropertyChanged_(propertyName, oldValue, newValue);
- }
- }
-
- /**
- * pre-condition: the specified old and new values are different
- */
- protected void firePropertyChanged_(String propertyName, int oldValue, int newValue) {
- PropertyChangeEvent event = null;
- Iterable<PropertyChangeListener> listeners = this.getPropertyChangeListeners(propertyName);
- if (listeners != null) {
- for (PropertyChangeListener listener : listeners) {
- if (this.hasPropertyChangeListener(propertyName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue));
- }
- listener.propertyChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue));
- }
- changeListener.propertyChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a boolean bound property update to any registered listeners.
- * No event is fired if old and new are equal.
- * <p>
- * This is merely a convenience wrapper around the more general
- * firePropertyChange method that takes Object values.
- */
- public void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
-// this.firePropertyChanged(propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- if (oldValue != newValue) {
- this.firePropertyChanged_(propertyName, oldValue, newValue);
- }
- }
-
- /**
- * pre-condition: the specified old and new values are different
- */
- protected void firePropertyChanged_(String propertyName, boolean oldValue, boolean newValue) {
- PropertyChangeEvent event = null;
- Iterable<PropertyChangeListener> listeners = this.getPropertyChangeListeners(propertyName);
- if (listeners != null) {
- for (PropertyChangeListener listener : listeners) {
- if (this.hasPropertyChangeListener(propertyName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- listener.propertyChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new PropertyChangeEvent(this.source, propertyName, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- changeListener.propertyChanged(event);
- }
- }
- }
- }
-
-
- // ********** collection change support **********
-
- protected static final Class<CollectionChangeListener> COLLECTION_CHANGE_LISTENER_CLASS = CollectionChangeListener.class;
-
- /**
- * Add a collection change listener for the specified collection. The listener
- * will be notified only for changes to the specified collection.
- */
- public void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.addListener(COLLECTION_CHANGE_LISTENER_CLASS, collectionName, listener);
- }
-
- /**
- * Remove a collection change listener that was registered for a specific collection.
- */
- public void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- this.removeListener(COLLECTION_CHANGE_LISTENER_CLASS, collectionName, listener);
- }
-
- /**
- * Return whether there are any collection change listeners that will
- * be notified when the specified collection has changed.
- */
- public boolean hasAnyCollectionChangeListeners(String collectionName) {
- return this.hasAnyListeners(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- }
-
- private ListenerList<CollectionChangeListener> getCollectionChangeListenerList(String collectionName) {
- return this.getListenerList(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- }
-
- private Iterable<CollectionChangeListener> getCollectionChangeListeners(String collectionName) {
- ListenerList<CollectionChangeListener> listenerList = this.getCollectionChangeListenerList(collectionName);
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- return CollectionTools.contains(this.getCollectionChangeListeners(collectionName), listener);
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(CollectionAddEvent event) {
- if (event.getItemsSize() != 0) {
- this.fireItemsAdded_(event);
- }
- }
-
- /**
- * pre-condition: items were added
- */
- protected void fireItemsAdded_(CollectionAddEvent event) {
- String collectionName = event.getCollectionName();
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsAdded(String collectionName, Collection<?> addedItems) {
-// this.fireItemsAdded(new CollectionAddEvent(this.source, collectionName, addedItems));
- if ( ! addedItems.isEmpty()) {
- this.fireItemsAdded_(collectionName, addedItems);
- }
- }
-
- /**
- * pre-condition: items were added
- */
- protected void fireItemsAdded_(String collectionName, Collection<?> addedItems) {
- CollectionAddEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionAddEvent(this.source, collectionName, addedItems);
- }
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionAddEvent(this.source, collectionName, addedItems);
- }
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemAdded(String collectionName, Object addedItem) {
-// this.fireItemsAdded(collectionName, Collections.singleton(addedItem));
-
- CollectionAddEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionAddEvent(this.source, collectionName, addedItem);
- }
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionAddEvent(this.source, collectionName, addedItem);
- }
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(CollectionRemoveEvent event) {
- if (event.getItemsSize() != 0) {
- this.fireItemsRemoved_(event);
- }
- }
-
- /**
- * pre-condition: items were removed
- */
- protected void fireItemsRemoved_(CollectionRemoveEvent event) {
- String collectionName = event.getCollectionName();
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
-// this.fireItemsRemoved(new CollectionRemoveEvent(this.source, collectionName, removedItems));
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved_(collectionName, removedItems);
- }
- }
-
- /**
- * pre-condition: items were removed
- */
- protected void fireItemsRemoved_(String collectionName, Collection<?> removedItems) {
- CollectionRemoveEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionRemoveEvent(this.source, collectionName, removedItems);
- }
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionRemoveEvent(this.source, collectionName, removedItems);
- }
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireItemRemoved(String collectionName, Object removedItem) {
-// this.fireItemsRemoved(collectionName, Collections.singleton(removedItem));
-
- CollectionRemoveEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionRemoveEvent(this.source, collectionName, removedItem);
- }
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionRemoveEvent(this.source, collectionName, removedItem);
- }
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(CollectionClearEvent event) {
- String collectionName = event.getCollectionName();
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- listener.collectionCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.collectionCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionCleared(String collectionName) {
-// this.fireCollectionCleared(new CollectionClearEvent(this.source, collectionName));
-
- CollectionClearEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionClearEvent(this.source, collectionName);
- }
- listener.collectionCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionClearEvent(this.source, collectionName);
- }
- changeListener.collectionCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(CollectionChangeEvent event) {
- String collectionName = event.getCollectionName();
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- listener.collectionChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.collectionChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a bound collection update to any registered listeners.
- */
- public void fireCollectionChanged(String collectionName, Collection<?> collection) {
-// this.fireCollectionChanged(new CollectionChangeEvent(this.source, collectionName, collection));
-
- CollectionChangeEvent event = null;
- Iterable<CollectionChangeListener> listeners = this.getCollectionChangeListeners(collectionName);
- if (listeners != null) {
- for (CollectionChangeListener listener : listeners) {
- if (this.hasCollectionChangeListener(collectionName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionChangeEvent(this.source, collectionName, collection);
- }
- listener.collectionChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new CollectionChangeEvent(this.source, collectionName, collection);
- }
- changeListener.collectionChanged(event);
- }
- }
- }
- }
-
- /**
- * Add the specified item to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#add(Object)
- */
- public <E> boolean addItemToCollection(E item, Collection<E> collection, String collectionName) {
- if (collection.add(item)) {
- this.fireItemAdded(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToCollection(E[] items, Collection<E> collection, String collectionName) {
- return (items.length != 0)
- && this.addItemsToCollection_(new ArrayIterator<E>(items), collection, collectionName);
- }
-
- /**
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToCollection(Collection<? extends E> items, Collection<E> collection, String collectionName) {
- return ( ! items.isEmpty())
- && this.addItemsToCollection_(items.iterator(), collection, collectionName);
- }
-
- /**
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToCollection(Iterable<? extends E> items, Collection<E> collection, String collectionName) {
- return this.addItemsToCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Add the specified items to the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether collection changed.
- * @see java.util.Collection#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToCollection(Iterator<? extends E> items, Collection<E> collection, String collectionName) {
- return items.hasNext()
- && this.addItemsToCollection_(items, collection, collectionName);
- }
-
- /**
- * no empty check
- */
- protected <E> boolean addItemsToCollection_(Iterator<? extends E> items, Collection<E> collection, String collectionName) {
- Collection<E> addedItems = null;
- while (items.hasNext()) {
- E item = items.next();
- if (collection.add(item)) {
- if (addedItems == null) {
- addedItems = new ArrayList<E>();
- }
- addedItems.add(item);
- }
- }
- if (addedItems != null) {
- this.fireItemsAdded(collectionName, addedItems);
- return true;
- }
- return false;
- }
-
- /**
- * Remove the specified item from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#remove(Object)
- */
- public boolean removeItemFromCollection(Object item, Collection<?> collection, String collectionName) {
- if (collection.remove(item)) {
- this.fireItemRemoved(collectionName, item);
- return true;
- }
- return false;
- }
-
- /**
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromCollection(Object[] items, Collection<?> collection, String collectionName) {
- return (items.length != 0)
- && ( ! collection.isEmpty())
- && this.removeItemsFromCollection_(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromCollection(Collection<?> items, Collection<?> collection, String collectionName) {
- return ( ! items.isEmpty())
- && ( ! collection.isEmpty())
- && this.removeItemsFromCollection_(items.iterator(), collection, collectionName);
- }
-
- /**
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.removeItemsFromCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Remove the specified items from the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- return items.hasNext()
- && ( ! collection.isEmpty())
- && this.removeItemsFromCollection_(items, collection, collectionName);
- }
-
- /**
- * no empty checks
- */
- protected boolean removeItemsFromCollection_(Iterator<?> items, Collection<?> collection, String collectionName) {
- HashBag<?> removedItems = CollectionTools.collection(items);
- removedItems.retainAll(collection);
- boolean changed = collection.removeAll(removedItems);
-
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved(collectionName, removedItems);
- }
- return changed;
- }
-
- /**
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- public boolean retainItemsInCollection(Object[] items, Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- if (items.length == 0) {
- return this.clearCollection_(collection, collectionName);
- }
- return this.retainItemsInCollection_(new ArrayIterator<Object>(items), collection, collectionName);
- }
-
- /**
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- public boolean retainItemsInCollection(Collection<?> items, Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- if (items.isEmpty()) {
- return this.clearCollection_(collection, collectionName);
- }
- return this.retainItemsInCollection_(items.iterator(), collection, collectionName);
- }
-
- /**
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- public boolean retainItemsInCollection(Iterable<?> items, Collection<?> collection, String collectionName) {
- return this.retainItemsInCollection(items.iterator(), collection, collectionName);
- }
-
- /**
- * Retain the specified items in the specified bound collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#retainAll(java.util.Collection)
- */
- public boolean retainItemsInCollection(Iterator<?> items, Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- if ( ! items.hasNext()) {
- return this.clearCollection_(collection, collectionName);
- }
- return this.retainItemsInCollection_(items, collection, collectionName);
- }
-
- /**
- * no empty checks
- */
- protected boolean retainItemsInCollection_(Iterator<?> items, Collection<?> collection, String collectionName) {
- HashBag<?> retainedItems = CollectionTools.collection(items);
- HashBag<?> removedItems = CollectionTools.collection(collection);
- removedItems.removeAll(retainedItems);
- boolean changed = collection.retainAll(retainedItems);
-
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved(collectionName, removedItems);
- }
- return changed;
- }
-
- /**
- * Clear the entire collection
- * and fire the appropriate event if necessary.
- * Return whether the collection changed.
- * @see java.util.Collection#clear()
- */
- public boolean clearCollection(Collection<?> collection, String collectionName) {
- if (collection.isEmpty()) {
- return false;
- }
- return this.clearCollection_(collection, collectionName);
- }
-
- /**
- * no empty check
- */
- protected boolean clearCollection_(Collection<?> collection, String collectionName) {
- collection.clear();
- this.fireCollectionCleared(collectionName);
- return true;
- }
-
- /**
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- public <E> boolean synchronizeCollection(Collection<E> newCollection, Collection<E> collection, String collectionName) {
- if (newCollection.isEmpty()) {
- return this.clearCollection(collection, collectionName);
- }
-
- if (collection.isEmpty()) {
- return this.addItemsToCollection_(newCollection.iterator(), collection, collectionName);
- }
-
- return this.synchronizeCollection_(newCollection, collection, collectionName);
- }
-
- /**
- * Synchronize the collection with the specified new collection,
- * making a minimum number of removes and adds.
- * Return whether the collection changed.
- */
- public <E> boolean synchronizeCollection(Iterator<E> newCollection, Collection<E> collection, String collectionName) {
- if ( ! newCollection.hasNext()) {
- return this.clearCollection(collection, collectionName);
- }
-
- if (collection.isEmpty()) {
- return this.addItemsToCollection_(newCollection, collection, collectionName);
- }
-
- return this.synchronizeCollection_(CollectionTools.collection(newCollection), collection, collectionName);
- }
-
- /**
- * no empty checks
- */
- protected <E> boolean synchronizeCollection_(Collection<E> newCollection, Collection<E> collection, String collectionName) {
- boolean changed = false;
- Collection<E> removeItems = new HashBag<E>(collection);
- removeItems.removeAll(newCollection);
- changed |= this.removeItemsFromCollection(removeItems, collection, collectionName);
-
- Collection<E> addItems = new HashBag<E>(newCollection);
- addItems.removeAll(collection);
- changed |= this.addItemsToCollection(addItems, collection, collectionName);
-
- return changed;
- }
-
-
- // ********** list change support **********
-
- protected static final Class<ListChangeListener> LIST_CHANGE_LISTENER_CLASS = ListChangeListener.class;
-
- /**
- * Add a list change listener for the specified list. The listener
- * will be notified only for changes to the specified list.
- */
- public void addListChangeListener(String listName, ListChangeListener listener) {
- this.addListener(LIST_CHANGE_LISTENER_CLASS, listName, listener);
- }
-
- /**
- * Remove a list change listener that was registered for a specific list.
- */
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- this.removeListener(LIST_CHANGE_LISTENER_CLASS, listName, listener);
- }
-
- /**
- * Return whether there are any list change listeners that will
- * be notified when the specified list has changed.
- */
- public boolean hasAnyListChangeListeners(String listName) {
- return this.hasAnyListeners(LIST_CHANGE_LISTENER_CLASS, listName);
- }
-
- private ListenerList<ListChangeListener> getListChangeListenerList(String listName) {
- return this.getListenerList(LIST_CHANGE_LISTENER_CLASS, listName);
- }
-
- private Iterable<ListChangeListener> getListChangeListeners(String listName) {
- ListenerList<ListChangeListener> listenerList = this.getListChangeListenerList(listName);
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasListChangeListener(String listName, ListChangeListener listener) {
- return CollectionTools.contains(this.getListChangeListeners(listName), listener);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(ListAddEvent event) {
- if (event.getItemsSize() != 0) {
- this.fireItemsAdded_(event);
- }
- }
-
- /**
- * pre-condition: items were added
- */
- protected void fireItemsAdded_(ListAddEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsAdded(String listName, int index, List<?> addedItems) {
-// this.fireItemsAdded(new ListAddEvent(this.source, listName, index, addedItems));
- if ( ! addedItems.isEmpty()) {
- this.fireItemsAdded_(listName, index, addedItems);
- }
- }
-
- /**
- * pre-condition: items were added
- */
- protected void fireItemsAdded_(String listName, int index, List<?> addedItems) {
- ListAddEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListAddEvent(this.source, listName, index, addedItems);
- }
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListAddEvent(this.source, listName, index, addedItems);
- }
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemAdded(String listName, int index, Object addedItem) {
-// this.fireItemsAdded(listName, index, Collections.singletonList(addedItem));
-
- ListAddEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListAddEvent(this.source, listName, index, addedItem);
- }
- listener.itemsAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListAddEvent(this.source, listName, index, addedItem);
- }
- changeListener.itemsAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(ListRemoveEvent event) {
- if (event.getItemsSize() != 0) {
- this.fireItemsRemoved_(event);
- }
- }
-
- /**
- * pre-condition: items were removed
- */
- protected void fireItemsRemoved_(ListRemoveEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsRemoved(String listName, int index, List<?> removedItems) {
-// this.fireItemsRemoved(new ListRemoveEvent(this.source, listName, index, removedItems));
- if ( ! removedItems.isEmpty()) {
- this.fireItemsRemoved_(listName, index, removedItems);
- }
- }
-
- /**
- * pre-condition: items were removed
- */
- protected void fireItemsRemoved_(String listName, int index, List<?> removedItems) {
- ListRemoveEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListRemoveEvent(this.source, listName, index, removedItems);
- }
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListRemoveEvent(this.source, listName, index, removedItems);
- }
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemRemoved(String listName, int index, Object removedItem) {
-// this.fireItemsRemoved(listName, index, Collections.singletonList(removedItem));
-
- ListRemoveEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListRemoveEvent(this.source, listName, index, removedItem);
- }
- listener.itemsRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListRemoveEvent(this.source, listName, index, removedItem);
- }
- changeListener.itemsRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(ListReplaceEvent event) {
- if ((event.getItemsSize() != 0) && this.elementsAreDifferent(event.getNewItems(), event.getOldItems())) {
- this.fireItemsReplaced_(event);
- }
- }
-
- /**
- * pre-condition: items were replaced
- */
- protected void fireItemsReplaced_(ListReplaceEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.itemsReplaced(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsReplaced(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsReplaced(String listName, int index, List<?> newItems, List<?> oldItems) {
-// this.fireItemsReplaced(new ListReplaceEvent(this.source, listName, index, newItems, oldItems));
- if (( ! newItems.isEmpty()) && this.elementsAreDifferent(newItems, oldItems)) {
- this.fireItemsReplaced_(listName, index, newItems, oldItems);
- }
- }
-
- /**
- * pre-condition: items were replaced
- */
- protected void fireItemsReplaced_(String listName, int index, List<?> newItems, List<?> oldItems) {
- ListReplaceEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListReplaceEvent(this.source, listName, index, newItems, oldItems);
- }
- listener.itemsReplaced(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListReplaceEvent(this.source, listName, index, newItems, oldItems);
- }
- changeListener.itemsReplaced(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemReplaced(String listName, int index, Object newItem, Object oldItem) {
-// this.fireItemsReplaced(listName, index, Collections.singletonList(newItem), Collections.singletonList(oldItem));
- if (this.valuesAreDifferent(newItem, oldItem)) {
- this.fireItemReplaced_(listName, index, newItem, oldItem);
- }
- }
-
- /**
- * pre-condition: items were replaced
- */
- protected void fireItemReplaced_(String listName, int index, Object newItem, Object oldItem) {
- ListReplaceEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListReplaceEvent(this.source, listName, index, newItem, oldItem);
- }
- listener.itemsReplaced(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListReplaceEvent(this.source, listName, index, newItem, oldItem);
- }
- changeListener.itemsReplaced(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(ListMoveEvent event) {
- if (event.getTargetIndex() != event.getSourceIndex()) {
- this.fireItemsMoved_(event);
- }
- // it's unlikely but possible the list is unchanged by the move... (e.g. any moves within ["foo", "foo", "foo"]...)
- }
-
- /**
- * pre-condition: items were moved
- */
- protected void fireItemsMoved_(ListMoveEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.itemsMoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.itemsMoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
-// this.fireItemsMoved(new ListMoveEvent(this.source, listName, targetIndex, sourceIndex, length));
- if (targetIndex != sourceIndex) {
- this.fireItemsMoved_(listName, targetIndex, sourceIndex, length);
- }
- // it's unlikely but possible the list is unchanged by the move... (e.g. any moves within ["foo", "foo", "foo"]...)
- }
-
- /**
- * pre-condition: items were moved
- */
- protected void fireItemsMoved_(String listName, int targetIndex, int sourceIndex, int length) {
- ListMoveEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListMoveEvent(this.source, listName, targetIndex, sourceIndex, length);
- }
- listener.itemsMoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListMoveEvent(this.source, listName, targetIndex, sourceIndex, length);
- }
- changeListener.itemsMoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireItemMoved(String listName, int targetIndex, int sourceIndex) {
- this.fireItemsMoved(listName, targetIndex, sourceIndex, 1);
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListCleared(ListClearEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.listCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.listCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListCleared(String listName) {
-// this.fireListCleared(new ListClearEvent(this.source, listName));
-
- ListClearEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListClearEvent(this.source, listName);
- }
- listener.listCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListClearEvent(this.source, listName);
- }
- changeListener.listCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(ListChangeEvent event) {
- String listName = event.getListName();
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- listener.listChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.listChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a bound list update to any registered listeners.
- */
- public void fireListChanged(String listName, List<?> list) {
-// this.fireListChanged(new ListChangeEvent(this.source, listName));
-
- ListChangeEvent event = null;
- Iterable<ListChangeListener> listeners = this.getListChangeListeners(listName);
- if (listeners != null) {
- for (ListChangeListener listener : listeners) {
- if (this.hasListChangeListener(listName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new ListChangeEvent(this.source, listName, list);
- }
- listener.listChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new ListChangeEvent(this.source, listName, list);
- }
- changeListener.listChanged(event);
- }
- }
- }
- }
-
- /**
- * Add the specified item to the specified bound list at the specified index
- * and fire the appropriate event.
- * @see java.util.List#add(int, Object)
- */
- public <E> void addItemToList(int index, E item, List<E> list, String listName) {
- list.add(index, item);
- this.fireItemAdded(listName, index, item);
- }
-
- /**
- * Add the specified item to the end of the specified bound list
- * and fire the appropriate event.
- * Return whether the list changed (i.e. 'true').
- * @see java.util.List#add(Object)
- */
- public <E> boolean addItemToList(E item, List<E> list, String listName) {
- if (list.add(item)) {
- this.fireItemAdded(listName, list.size() - 1, item);
- return true;
- }
- return false; // List#add(Object) should always return 'true', so we should never get here...
- }
-
- /**
- * Add the specified items to the specified bound list at the specified index
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- public <E> boolean addItemsToList(int index, E[] items, List<E> list, String listName) {
- return (items.length != 0)
- && this.addItemsToList_(index, Arrays.asList(items), list, listName);
- }
-
- /**
- * Add the specified items to the specified bound list at the specified index
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- public <E> boolean addItemsToList(int index, Collection<? extends E> items, List<E> list, String listName) {
- return ( ! items.isEmpty())
- && this.addItemsToList_(index, this.convertToList(items), list, listName);
- }
-
- /**
- * no empty check
- */
- protected <E> boolean addItemsToList_(int index, List<? extends E> items, List<E> list, String listName) {
- if (list.addAll(index, items)) {
- this.fireItemsAdded(listName, index, items);
- return true;
- }
- return false; // 'items' should not be empty, so we should never get here...
- }
-
- /**
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- public <E> boolean addItemsToList(int index, Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(index, items.iterator(), list, listName);
- }
-
- /**
- * Add the specified items to the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- public <E> boolean addItemsToList(int index, Iterator<? extends E> items, List<E> list, String listName) {
- if ( ! items.hasNext()) {
- return false;
- }
-
- ArrayList<E> addedItems = CollectionTools.list(items);
- if (list.addAll(index, addedItems)) {
- this.fireItemsAdded(listName, index, addedItems);
- return true;
- }
- return false; // 'items' should not be empty, so we should never get here...
- }
-
- /**
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToList(E[] items, List<E> list, String listName) {
- return (items.length != 0)
- && this.addItemsToList_(Arrays.asList(items), list, listName);
- }
-
- /**
- * Add the specified items to the end of the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(int, java.util.Collection)
- */
- public <E> boolean addItemsToList(Collection<? extends E> items, List<E> list, String listName) {
- return ( ! items.isEmpty())
- && this.addItemsToList_(this.convertToList(items), list, listName);
- }
-
- protected <E> List<? extends E> convertToList(Collection<? extends E> collection) {
- return (collection instanceof List<?>) ? (List<? extends E>) collection : new ArrayList<E>(collection);
- }
-
- /**
- * no empty check
- */
- protected <E> boolean addItemsToList_(List<? extends E> items, List<E> list, String listName) {
- int index = list.size();
- if (list.addAll(items)) {
- this.fireItemsAdded(listName, index, items);
- return true;
- }
- return false; // 'items' should not be empty, so we should never get here...
- }
-
- /**
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToList(Iterable<? extends E> items, List<E> list, String listName) {
- return this.addItemsToList(items.iterator(), list, listName);
- }
-
- /**
- * Add the specified items to the end of to the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#addAll(java.util.Collection)
- */
- public <E> boolean addItemsToList(Iterator<? extends E> items, List<E> list, String listName) {
- if ( ! items.hasNext()) {
- return false;
- }
- return this.addItemsToList_(items, list, listName);
- }
-
- /**
- * no empty check
- */
- protected <E> boolean addItemsToList_(Iterator<? extends E> items, List<E> list, String listName) {
- ArrayList<E> addedItems = CollectionTools.list(items);
- int index = list.size();
- if (list.addAll(addedItems)) {
- this.fireItemsAdded(listName, index, addedItems);
- return true;
- }
- return false; // 'items' should not be empty, so we should never get here...
- }
-
- /**
- * Remove the specified item from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed item.
- * @see java.util.List#remove(int)
- */
- public <E> E removeItemFromList(int index, List<E> list, String listName) {
- E item = list.remove(index);
- this.fireItemRemoved(listName, index, item);
- return item;
- }
-
- /**
- * Remove the specified item from the specified bound list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#remove(Object)
- */
- public boolean removeItemFromList(Object item, List<?> list, String listName) {
- int index = list.indexOf(item);
- if (index == -1) {
- return false;
- }
- list.remove(index);
- this.fireItemRemoved(listName, index, item);
- return true;
- }
-
- /**
- * Remove the items from the specified index on
- * from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#remove(int)
- */
- public <E> List<E> removeItemsFromList(int index, List<E> list, String listName) {
- return this.removeItemsFromList(index, list.size() - index, list, listName);
- }
-
- /**
- * Remove the specified items from the specified bound list
- * and fire the appropriate event if necessary.
- * Return the removed items.
- * @see java.util.List#remove(int)
- */
- public <E> List<E> removeItemsFromList(int index, int length, List<E> list, String listName) {
- if (length == 0) {
- return Collections.emptyList();
- }
- return this.removeItemsFromList_(index, length, list, listName);
- }
-
- /**
- * no empty check
- */
- protected <E> List<E> removeItemsFromList_(int index, int length, List<E> list, String listName) {
- List<E> subList = list.subList(index, index + length);
- List<E> removedItems = new ArrayList<E>(subList);
- subList.clear();
- this.fireItemsRemoved(listName, index, removedItems);
- return removedItems;
- }
-
- /**
- * Remove the specified items from the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromList(Object[] items, List<?> list, String listName) {
- return (items.length != 0)
- && ( ! list.isEmpty())
- && this.removeItemsFromList_(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Remove the specified items from the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromList(Collection<?> items, List<?> list, String listName) {
- return ( ! items.isEmpty())
- && ( ! list.isEmpty())
- && this.removeItemsFromList_(items.iterator(), list, listName);
- }
-
- /**
- * Remove the specified items from the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromList(Iterable<?> items, List<?> list, String listName) {
- return this.removeItemsFromList(items.iterator(), list, listName);
- }
-
- /**
- * Remove the specified items from the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#removeAll(java.util.Collection)
- */
- public boolean removeItemsFromList(Iterator<?> items, List<?> list, String listName) {
- return (items.hasNext())
- && ( ! list.isEmpty())
- && this.removeItemsFromList_(items, list, listName);
- }
-
- /**
- * no empty checks
- */
- protected boolean removeItemsFromList_(Iterator<?> items, List<?> list, String listName) {
- boolean changed = false;
- while (items.hasNext()) {
- changed |= this.removeItemFromList(items.next(), list, listName);
- }
- return changed;
- }
-
- /**
- * Retain the specified items in the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- public boolean retainItemsInList(Object[] items, List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- if (items.length == 0) {
- return this.clearList_(list, listName);
- }
- return this.retainItemsInList_(new ArrayIterator<Object>(items), list, listName);
- }
-
- /**
- * Retain the specified items in the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- public boolean retainItemsInList(Collection<?> items, List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- if (items.isEmpty()) {
- return this.clearList_(list, listName);
- }
- return this.retainItemsInList_(items.iterator(), list, listName);
- }
-
- /**
- * Retain the specified items in the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- public boolean retainItemsInList(Iterable<?> items, List<?> list, String listName) {
- return this.retainItemsInList(items.iterator(), list, listName);
- }
-
- /**
- * Retain the specified items in the specified bound list
- * and fire the appropriate event(s) if necessary.
- * Return whether the list changed.
- * @see java.util.List#retainAll(java.util.Collection)
- */
- public boolean retainItemsInList(Iterator<?> items, List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- if ( ! items.hasNext()) {
- return this.clearList_(list, listName);
- }
- return this.retainItemsInList_(items, list, listName);
- }
-
- /**
- * no empty checks
- */
- protected boolean retainItemsInList_(Iterator<?> items, List<?> list, String listName) {
- HashBag<?> retainedItems = CollectionTools.collection(items);
- HashBag<?> removedItems = CollectionTools.collection(list);
- removedItems.removeAll(retainedItems);
- return this.removeItemsFromList(removedItems, list, listName);
- }
-
- /**
- * Set the specified item in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced item.
- * @see java.util.List#set(int, Object)
- */
- public <E> E setItemInList(int index, E item, List<E> list, String listName) {
- E oldItem = list.set(index, item);
- this.fireItemReplaced(listName, index, item, oldItem);
- return oldItem;
- }
-
- /**
- * Replace the first occurrence of the specified item
- * in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the index of the replaced item.
- * Return -1 if the item was not found in the list.
- * @see java.util.List#set(int, Object)
- */
- public <E> int replaceItemInList(E oldItem, E newItem, List<E> list, String listName) {
- if (list.isEmpty()) {
- return -1;
- }
-
- int index = list.indexOf(oldItem);
- if ((index != -1) && this.valuesAreDifferent(oldItem, newItem)) {
- list.set(index, newItem);
- this.fireItemReplaced_(listName, index, newItem, oldItem);
- }
- return index;
- }
-
- /**
- * Set the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced items.
- * @see java.util.List#set(int, Object)
- */
- public <E> List<E> setItemsInList(int index, E[] items, List<E> list, String listName) {
- if (items.length == 0) {
- return Collections.emptyList();
- }
- return this.setItemsInList_(index, Arrays.asList(items), list, listName);
- }
-
- /**
- * Set the specified items in the specified bound list
- * and fire the appropriate event if necessary.
- * Return the replaced items.
- * @see java.util.List#set(int, Object)
- */
- public <E> List<E> setItemsInList(int index, List<? extends E> items, List<E> list, String listName) {
- if (items.isEmpty()) {
- return Collections.emptyList();
- }
- return this.setItemsInList_(index, items, list, listName);
- }
-
- /**
- * no empty check
- */
- protected <E> List<E> setItemsInList_(int index, List<? extends E> items, List<E> list, String listName) {
- List<E> subList = list.subList(index, index + items.size());
- List<E> oldItems = new ArrayList<E>(subList);
- for (int i = 0; i < items.size(); i++) {
- E newItem = items.get(i);
- E oldItem = subList.set(i, newItem);
- this.fireItemReplaced(listName, index + i, newItem, oldItem);
- }
- return oldItems;
- }
-
- /**
- * Move items in the specified list from the specified source index to the
- * specified target index for the specified length.
- * Return whether the list changed.
- */
- public <E> boolean moveItemsInList(int targetIndex, int sourceIndex, int length, List<E> list, String listName) {
- if ((targetIndex == sourceIndex) || (length == 0)) {
- return false;
- }
- // it's unlikely but possible the list is unchanged by the move... (e.g. any moves within ["foo", "foo", "foo"]...)
- CollectionTools.move(list, targetIndex, sourceIndex, length);
- this.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- return true;
- }
-
- /**
- * Move an item in the specified list from the specified source index to the
- * specified target index.
- * Return whether the list changed.
- */
- public <E> boolean moveItemInList(int targetIndex, int sourceIndex, List<E> list, String listName) {
- if (targetIndex == sourceIndex) {
- return false;
- }
- // it's unlikely but possible the list is unchanged by the move... (e.g. any moves within ["foo", "foo", "foo"]...)
- CollectionTools.move(list, targetIndex, sourceIndex);
- this.fireItemMoved(listName, targetIndex, sourceIndex);
- return true;
- }
-
- /**
- * Clear the entire list
- * and fire the appropriate event if necessary.
- * Return whether the list changed.
- * @see java.util.List#clear()
- */
- public boolean clearList(List<?> list, String listName) {
- if (list.isEmpty()) {
- return false;
- }
- return this.clearList_(list, listName);
- }
-
- /**
- * no empty check
- */
- protected boolean clearList_(List<?> list, String listName) {
- list.clear();
- this.fireListCleared(listName);
- return true;
- }
-
- /**
- * Synchronize the list with the specified new list,
- * making a minimum number of sets, removes, and/or adds.
- * Return whether the list changed.
- */
- public <E> boolean synchronizeList(List<E> newList, List<E> list, String listName) {
- if (newList.isEmpty()) {
- return this.clearList(list, listName);
- }
- if (list.isEmpty()) {
- return this.addItemsToList_(newList, list, listName);
- }
- return this.synchronizeList_(newList, list, listName);
- }
-
- /**
- * Synchronize the list with the specified new list,
- * making a minimum number of sets, removes, and/or adds.
- * Return whether the list changed.
- */
- public <E> boolean synchronizeList(Iterator<E> newList, List<E> list, String listName) {
- if ( ! newList.hasNext()) {
- return this.clearList(list, listName);
- }
- if (list.isEmpty()) {
- return this.addItemsToList_(newList, list, listName);
- }
- return this.synchronizeList_(CollectionTools.list(newList), list, listName);
- }
-
- /**
- * no empty checks
- */
- protected <E> boolean synchronizeList_(List<E> newList, List<E> oldList, String listName) {
- int newSize = newList.size();
- int oldSize = oldList.size();
-
- boolean changed = false;
- int min = Math.min(newSize, oldSize);
- for (int i = 0; i < min; i++) {
- E newItem = newList.get(i);
- E oldItem = oldList.set(i, newItem);
- if (this.valuesAreDifferent(newItem, oldItem)) {
- changed = true;
- this.fireItemReplaced_(listName, i, newItem, oldItem);
- }
- }
-
- if (newSize == oldSize) {
- return changed;
- }
-
- if (newSize < oldSize) {
- this.removeItemsFromList_(newSize, oldSize - newSize, oldList, listName);
- return true;
- }
-
- // newSize > oldSize
- this.addItemsToList_(newList.subList(oldSize, newSize), oldList, listName);
- return true;
- }
-
-
- // ********** tree change support **********
-
- protected static final Class<TreeChangeListener> TREE_CHANGE_LISTENER_CLASS = TreeChangeListener.class;
-
- /**
- * Add a tree change listener for the specified tree. The listener
- * will be notified only for changes to the specified tree.
- */
- public void addTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.addListener(TREE_CHANGE_LISTENER_CLASS, treeName, listener);
- }
-
- /**
- * Remove a tree change listener that was registered for a specific tree.
- */
- public void removeTreeChangeListener(String treeName, TreeChangeListener listener) {
- this.removeListener(TREE_CHANGE_LISTENER_CLASS, treeName, listener);
- }
-
- /**
- * Return whether there are any tree change listeners that will
- * be notified when the specified tree has changed.
- */
- public boolean hasAnyTreeChangeListeners(String treeName) {
- return this.hasAnyListeners(TREE_CHANGE_LISTENER_CLASS, treeName);
- }
-
- private ListenerList<TreeChangeListener> getTreeChangeListenerList(String treeName) {
- return this.getListenerList(TREE_CHANGE_LISTENER_CLASS, treeName);
- }
-
- private Iterable<TreeChangeListener> getTreeChangeListeners(String treeName) {
- ListenerList<TreeChangeListener> listenerList = this.getTreeChangeListenerList(treeName);
- return (listenerList == null) ? null : listenerList.getListeners();
- }
-
- private boolean hasTreeChangeListener(String treeName, TreeChangeListener listener) {
- return CollectionTools.contains(this.getTreeChangeListeners(treeName), listener);
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(TreeAddEvent event) {
- String treeName = event.getTreeName();
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- listener.nodeAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.nodeAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeAdded(String treeName, List<?> path) {
-// this.fireNodeAdded(new TreeAddEvent(this.source, treeName, path));
- TreeAddEvent event = null;
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeAddEvent(this.source, treeName, path);
- }
- listener.nodeAdded(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeAddEvent(this.source, treeName, path);
- }
- changeListener.nodeAdded(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(TreeRemoveEvent event) {
- String treeName = event.getTreeName();
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- listener.nodeRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.nodeRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireNodeRemoved(String treeName, List<?> path) {
-// this.fireNodeRemoved(new TreeRemoveEvent(this.source, treeName, path));
-
- TreeRemoveEvent event = null;
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeRemoveEvent(this.source, treeName, path);
- }
- listener.nodeRemoved(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeRemoveEvent(this.source, treeName, path);
- }
- changeListener.nodeRemoved(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(TreeClearEvent event) {
- String treeName = event.getTreeName();
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- listener.treeCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.treeCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeCleared(String treeName) {
-// this.fireTreeCleared(new TreeClearEvent(this.source, treeName));
-
- TreeClearEvent event = null;
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeClearEvent(this.source, treeName);
- }
- listener.treeCleared(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeClearEvent(this.source, treeName);
- }
- changeListener.treeCleared(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(TreeChangeEvent event) {
- String treeName = event.getTreeName();
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- listener.treeChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- changeListener.treeChanged(event);
- }
- }
- }
- }
-
- /**
- * Report a bound tree update to any registered listeners.
- */
- public void fireTreeChanged(String treeName, Collection<?> nodes) {
-// this.fireTreeChanged(new TreeChangeEvent(this.source, treeName, nodes));
-
- TreeChangeEvent event = null;
- Iterable<TreeChangeListener> listeners = this.getTreeChangeListeners(treeName);
- if (listeners != null) {
- for (TreeChangeListener listener : listeners) {
- if (this.hasTreeChangeListener(treeName, listener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeChangeEvent(this.source, treeName, nodes);
- }
- listener.treeChanged(event);
- }
- }
- }
-
- Iterable<ChangeListener> changeListeners = this.getChangeListeners();
- if (changeListeners != null) {
- for (ChangeListener changeListener : changeListeners) {
- if (this.hasChangeListener(changeListener)) { // verify listener is still listening
- if (event == null) {
- event = new TreeChangeEvent(this.source, treeName, nodes);
- }
- changeListener.treeChanged(event);
- }
- }
- }
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the specified values are equal, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- */
- public boolean valuesAreEqual(Object value1, Object value2) {
- return Tools.valuesAreEqual(value1, value2);
- }
-
- /**
- * Return whether the specified values are different, with the appropriate null checks.
- * Convenience method for checking whether an attribute value has changed.
- */
- public boolean valuesAreDifferent(Object value1, Object value2) {
- return Tools.valuesAreDifferent(value1, value2);
- }
-
- /**
- * Return whether the specified iterables return the same elements
- * in the same order.
- */
- public boolean elementsAreEqual(Iterable<?> iterable1, Iterable<?> iterable2) {
- return CollectionTools.elementsAreEqual(iterable1, iterable2);
- }
-
- /**
- * Return whether the specified iterables do not return the same elements
- * in the same order.
- */
- public boolean elementsAreDifferent(Iterable<?> iterable1, Iterable<?> iterable2) {
- return CollectionTools.elementsAreDifferent(iterable1, iterable2);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.source);
- }
-
-
- // ********** member classes **********
-
- /**
- * Pair an aspect name with its associated listeners.
- */
- static abstract class AspectListenerListPair<L extends EventListener>
- implements Serializable
- {
- final ListenerList<L> listenerList;
-
- private static final long serialVersionUID = 1L;
-
- AspectListenerListPair(Class<L> listenerClass, L listener) {
- super();
- this.listenerList = new ListenerList<L>(listenerClass, listener);
- }
-
- boolean matches(Class<? extends EventListener> listenerClass, @SuppressWarnings("unused") String aspectName) {
- return this.listenerList.getListenerType() == listenerClass;
- }
-
- boolean matches(Class<? extends EventListener> listenerClass) {
- return this.matches(listenerClass, null);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getAspectName());
- }
-
- abstract String getAspectName();
-
- }
-
- /**
- * Pair an aspect name with its associated listeners.
- */
- static class SimpleAspectListenerListPair<L extends EventListener>
- extends AspectListenerListPair<L>
- {
- final String aspectName;
-
- private static final long serialVersionUID = 1L;
-
- SimpleAspectListenerListPair(Class<L> listenerClass, String aspectName, L listener) {
- super(listenerClass, listener);
- if (aspectName == null) {
- throw new NullPointerException();
- }
- this.aspectName = aspectName;
- }
-
- @Override
- boolean matches(Class<? extends EventListener> listenerClass, @SuppressWarnings("hiding") String aspectName) {
- return this.aspectName.equals(aspectName)
- && super.matches(listenerClass, aspectName);
- }
-
- @Override
- String getAspectName() {
- return this.aspectName;
- }
-
- }
-
- /**
- * Pair a null aspect name with its associated listeners.
- */
- static class NullAspectListenerListPair<L extends EventListener>
- extends AspectListenerListPair<L>
- {
- private static final long serialVersionUID = 1L;
-
- NullAspectListenerListPair(Class<L> listenerClass, L listener) {
- super(listenerClass, listener);
- }
-
- @Override
- boolean matches(Class<? extends EventListener> listenerClass, String aspectName) {
- return (aspectName == null)
- && super.matches(listenerClass, null);
- }
-
- @Override
- String getAspectName() {
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java
deleted file mode 100644
index 0e588325df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/SingleAspectChangeSupport.java
+++ /dev/null
@@ -1,380 +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.utility.internal.model;
-
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.List;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * This change support class changes the behavior of the standard
- * change support in several ways:<ul>
- * <li>All events fired by the source must specify the single aspect.
- * <li>Listeners are required to be either "general purpose" listeners or
- * listeners of the single aspect.
- * </ul>
- */
-public class SingleAspectChangeSupport
- extends ChangeSupport
-{
- protected final Class<? extends EventListener> validListenerClass;
- protected final String validAspectName;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- public SingleAspectChangeSupport(Model source, Class<? extends EventListener> validListenerClass, String validAspectName) {
- super(source);
- if ( ! validListenerClass.isAssignableFrom(this.getChangeListenerClass())) {
- throw new IllegalArgumentException("The change support's change listener class (" + this.getChangeListenerClass().getName() + //$NON-NLS-1$
- ") does not extend the valid listener class: " + validListenerClass.getName()); //$NON-NLS-1$
- }
- this.validListenerClass = validListenerClass;
- this.validAspectName = validAspectName;
- }
-
-
- // ********** internal implementation **********
-
- private UnsupportedOperationException buildUnsupportedOperationException() {
- return new UnsupportedOperationException(
- "This Model supports only changes for the listener type \"" + this.validListenerClass.getName() //$NON-NLS-1$
- + "\" and the aspect \"" + this.validAspectName + '"' //$NON-NLS-1$
- );
- }
-
- /**
- * The listener can be either an instance of the valid listener class or
- * the "general-purpose" change listener class (which should extend the
- * the valid listener class).
- */
- private void check(Class<? extends EventListener> listenerClass) {
- if ((listenerClass != this.getChangeListenerClass()) && (listenerClass != this.validListenerClass)) {
- throw new IllegalArgumentException(
- "This Model supports only changes for the listener type \"" + this.validListenerClass.getName() //$NON-NLS-1$
- + "\" : \"" + listenerClass.getName() + '"' //$NON-NLS-1$
- );
- }
- }
-
- private void check(Class<? extends EventListener> listenerClass, String aspectName) {
- this.check(listenerClass);
- if ( ! aspectName.equals(this.validAspectName)) {
- throw new IllegalArgumentException(
- "This Model supports only changes for the aspect \"" + this.validAspectName //$NON-NLS-1$
- + "\" : \"" + aspectName + '"' //$NON-NLS-1$
- );
- }
- }
-
- @Override
- protected synchronized <L extends EventListener> void addListener(Class<L> listenerClass, String aspectName, L listener) {
- this.check(listenerClass, aspectName);
- super.addListener(listenerClass, aspectName, listener);
- }
-
- @Override
- protected synchronized <L extends EventListener> void addListener(Class<L> listenerClass, L listener) {
- this.check(listenerClass);
- super.addListener(listenerClass, listener);
- }
-
- @Override
- protected synchronized <L extends EventListener> void removeListener(Class<L> listenerClass, String aspectName, L listener) {
- this.check(listenerClass, aspectName);
- super.removeListener(listenerClass, aspectName, listener);
- }
-
- @Override
- protected synchronized <L extends EventListener> void removeListener(Class<L> listenerClass, L listener) {
- this.check(listenerClass);
- super.removeListener(listenerClass, listener);
- }
-
- @Override
- protected <L extends EventListener> boolean hasAnyListeners(Class<L> listenerClass, String aspectName) {
- this.check(listenerClass, aspectName);
- return super.hasAnyListeners(listenerClass, aspectName);
- }
-
- @Override
- protected <L extends EventListener> boolean hasAnyListeners(Class<L> listenerClass) {
- this.check(listenerClass);
- return super.hasAnyListeners(listenerClass);
- }
-
-
- // ********** state change support **********
-
- @Override
- public void fireStateChanged(StateChangeEvent event) {
- throw this.buildUnsupportedOperationException();
- }
-
- @Override
- public void fireStateChanged() {
- throw this.buildUnsupportedOperationException();
- }
-
-
- // ********** property change support **********
-
- @Override
- public void firePropertyChanged(PropertyChangeEvent event) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, event.getPropertyName());
- super.firePropertyChanged(event);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, Object oldValue, Object newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, int oldValue, int newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
- @Override
- public void firePropertyChanged(String propertyName, boolean oldValue, boolean newValue) {
- this.check(PROPERTY_CHANGE_LISTENER_CLASS, propertyName);
- super.firePropertyChanged(propertyName, oldValue, newValue);
- }
-
-
- // ********** collection change support **********
-
- @Override
- public void fireItemsAdded(CollectionAddEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.getCollectionName());
- super.fireItemsAdded(event);
- }
-
- @Override
- public void fireItemsAdded(String collectionName, Collection<?> addedItems) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemsAdded(collectionName, addedItems);
- }
-
- @Override
- public void fireItemAdded(String collectionName, Object addedItem) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemAdded(collectionName, addedItem);
- }
-
- @Override
- public void fireItemsRemoved(CollectionRemoveEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.getCollectionName());
- super.fireItemsRemoved(event);
- }
-
- @Override
- public void fireItemsRemoved(String collectionName, Collection<?> removedItems) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemsRemoved(collectionName, removedItems);
- }
-
- @Override
- public void fireItemRemoved(String collectionName, Object removedItem) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireItemRemoved(collectionName, removedItem);
- }
-
- @Override
- public void fireCollectionCleared(CollectionClearEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.getCollectionName());
- super.fireCollectionCleared(event);
- }
-
- @Override
- public void fireCollectionCleared(String collectionName) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireCollectionCleared(collectionName);
- }
-
- @Override
- public void fireCollectionChanged(CollectionChangeEvent event) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, event.getCollectionName());
- super.fireCollectionChanged(event);
- }
-
- @Override
- public void fireCollectionChanged(String collectionName, Collection<?> collection) {
- this.check(COLLECTION_CHANGE_LISTENER_CLASS, collectionName);
- super.fireCollectionChanged(collectionName, collection);
- }
-
-
- // ********** list change support **********
-
- @Override
- public void fireItemsAdded(ListAddEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireItemsAdded(event);
- }
-
- @Override
- public void fireItemsAdded(String listName, int index, List<?> addedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsAdded(listName, index, addedItems);
- }
-
- @Override
- public void fireItemAdded(String listName, int index, Object addedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemAdded(listName, index, addedItem);
- }
-
- @Override
- public void fireItemsRemoved(ListRemoveEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireItemsRemoved(event);
- }
-
- @Override
- public void fireItemsRemoved(String listName, int index, List<?> removedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsRemoved(listName, index, removedItems);
- }
-
- @Override
- public void fireItemRemoved(String listName, int index, Object removedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemRemoved(listName, index, removedItem);
- }
-
- @Override
- public void fireItemsReplaced(ListReplaceEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireItemsReplaced(event);
- }
-
- @Override
- public void fireItemsReplaced(String listName, int index, List<?> newItems, List<?> replacedItems) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsReplaced(listName, index, newItems, replacedItems);
- }
-
- @Override
- public void fireItemReplaced(String listName, int index, Object newItem, Object replacedItem) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemReplaced(listName, index, newItem, replacedItem);
- }
-
- @Override
- public void fireItemsMoved(ListMoveEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireItemsMoved(event);
- }
-
- @Override
- public void fireItemsMoved(String listName, int targetIndex, int sourceIndex, int length) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireItemsMoved(listName, targetIndex, sourceIndex, length);
- }
-
- @Override
- public void fireListCleared(ListClearEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireListCleared(event);
- }
-
- @Override
- public void fireListCleared(String listName) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireListCleared(listName);
- }
-
- @Override
- public void fireListChanged(ListChangeEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- super.fireListChanged(event);
- }
-
- @Override
- public void fireListChanged(String listName, List<?> list) {
- this.check(LIST_CHANGE_LISTENER_CLASS, listName);
- super.fireListChanged(listName, list);
- }
-
-
- // ********** tree change support **********
-
- @Override
- public void fireNodeAdded(TreeAddEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireNodeAdded(event);
- }
-
- @Override
- public void fireNodeAdded(String treeName, List<?> path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeAdded(treeName, path);
- }
-
- @Override
- public void fireNodeRemoved(TreeRemoveEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireNodeRemoved(event);
- }
-
- @Override
- public void fireNodeRemoved(String treeName, List<?> path) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireNodeRemoved(treeName, path);
- }
-
- @Override
- public void fireTreeCleared(TreeClearEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireTreeCleared(event);
- }
-
- @Override
- public void fireTreeCleared(String treeName) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeCleared(treeName);
- }
-
- @Override
- public void fireTreeChanged(TreeChangeEvent event) {
- this.check(TREE_CHANGE_LISTENER_CLASS, event.getTreeName());
- super.fireTreeChanged(event);
- }
-
- @Override
- public void fireTreeChanged(String treeName, Collection<?> nodes) {
- this.check(TREE_CHANGE_LISTENER_CLASS, treeName);
- super.fireTreeChanged(treeName, nodes);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTChangeListenerWrapper.java
deleted file mode 100644
index 43fe3e9e0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTChangeListenerWrapper.java
+++ /dev/null
@@ -1,454 +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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-
-/**
- * Wrap another change listener and forward events to it on the AWT
- * event queue, 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 final class AWTChangeListenerWrapper
- implements ChangeListener
-{
- private final ChangeListener listener;
-
-
- public AWTChangeListenerWrapper(ChangeListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void stateChanged(StateChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.stateChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildStateChangedRunnable(event));
- }
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.propertyChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildPropertyChangedRunnable(event));
- }
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionChangedRunnable(event));
- }
- }
-
- public void itemsAdded(ListAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListMoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildListClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildListChangedRunnable(event));
- }
- }
-
- public void nodeAdded(TreeAddEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.nodeAdded_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildStateChangedRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.stateChanged_(event);
- }
- };
- }
-
- private Runnable buildPropertyChangedRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.propertyChanged_(event);
- }
- };
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsAddedRunnable(final ListAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListMoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListReplaceEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListClearedRunnable(final ListClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildNodeAddedRunnable(final TreeAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void stateChanged_(StateChangeEvent event) {
- this.listener.stateChanged(event);
- }
-
- void propertyChanged_(PropertyChangeEvent event) {
- this.listener.propertyChanged(event);
- }
-
- 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);
- }
-
- 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);
- }
-
- 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 "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java
deleted file mode 100644
index f87f54d10d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTCollectionChangeListenerWrapper.java
+++ /dev/null
@@ -1,161 +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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-
-/**
- * Wrap another collection change listener and forward events to it on the AWT
- * event queue, 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 final class AWTCollectionChangeListenerWrapper
- implements CollectionChangeListener
-{
- private final CollectionChangeListener listener;
-
- public AWTCollectionChangeListenerWrapper(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.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionClearedRunnable(event));
- }
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.collectionChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildCollectionChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final CollectionAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final CollectionRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionClearedRunnable(final CollectionClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionCleared_(event);
- }
- @Override
- public String toString() {
- return "collection cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildCollectionChangedRunnable(final CollectionChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTCollectionChangeListenerWrapper.this.collectionChanged_(event);
- }
- @Override
- public String toString() {
- return "collection changed"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- 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 "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java
deleted file mode 100644
index b0d6fe4bae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTListChangeListenerWrapper.java
+++ /dev/null
@@ -1,211 +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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-
-/**
- * Wrap another list change listener and forward events to it on the AWT
- * event queue, 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 final class AWTListChangeListenerWrapper
- implements ListChangeListener
-{
- private final ListChangeListener listener;
-
- public AWTListChangeListenerWrapper(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.executeOnEventQueue(this.buildItemsAddedRunnable(event));
- }
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsRemovedRunnable(event));
- }
- }
-
- public void itemsMoved(ListMoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsMoved_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsMovedRunnable(event));
- }
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.itemsReplaced_(event);
- } else {
- this.executeOnEventQueue(this.buildItemsReplacedRunnable(event));
- }
- }
-
- public void listCleared(ListClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildListClearedRunnable(event));
- }
- }
-
- public void listChanged(ListChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.listChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildListChangedRunnable(event));
- }
- }
-
- private Runnable buildItemsAddedRunnable(final ListAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsAdded_(event);
- }
- @Override
- public String toString() {
- return "items added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsRemovedRunnable(final ListRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsRemoved_(event);
- }
- @Override
- public String toString() {
- return "items removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsMovedRunnable(final ListMoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsMoved_(event);
- }
- @Override
- public String toString() {
- return "items moved"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildItemsReplacedRunnable(final ListReplaceEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.itemsReplaced_(event);
- }
- @Override
- public String toString() {
- return "items replaced"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListClearedRunnable(final ListClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listCleared_(event);
- }
- @Override
- public String toString() {
- return "list cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildListChangedRunnable(final ListChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTListChangeListenerWrapper.this.listChanged_(event);
- }
- @Override
- public String toString() {
- return "list changed"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- 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 "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java
deleted file mode 100644
index f2a252a7b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTPropertyChangeListenerWrapper.java
+++ /dev/null
@@ -1,83 +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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * Wrap another property change listener and forward events to it on the AWT
- * event queue, 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 final class AWTPropertyChangeListenerWrapper
- implements PropertyChangeListener
-{
- private final PropertyChangeListener listener;
-
-
- public AWTPropertyChangeListenerWrapper(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.executeOnEventQueue(this.buildPropertyChangedRunnable(event));
- }
- }
-
- private Runnable buildPropertyChangedRunnable(final PropertyChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTPropertyChangeListenerWrapper.this.propertyChanged_(event);
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void propertyChanged_(PropertyChangeEvent event) {
- this.listener.propertyChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.java
deleted file mode 100644
index 11ef2369c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTStateChangeListenerWrapper.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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-/**
- * Wrap another state change listener and forward events to it on the AWT
- * event queue, 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 final class AWTStateChangeListenerWrapper
- implements StateChangeListener
-{
- private final StateChangeListener listener;
-
- public AWTStateChangeListenerWrapper(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.executeOnEventQueue(this.buildStateChangedRunnable(event));
- }
- }
-
- private Runnable buildStateChangedRunnable(final StateChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTStateChangeListenerWrapper.this.stateChanged_(event);
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- void stateChanged_(StateChangeEvent event) {
- this.listener.stateChanged(event);
- }
-
- @Override
- public String toString() {
- return "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java
deleted file mode 100644
index 55e3a51852..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/listener/awt/AWTTreeChangeListenerWrapper.java
+++ /dev/null
@@ -1,161 +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.utility.internal.model.listener.awt;
-
-import java.awt.EventQueue;
-
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Wrap another tree change listener and forward events to it on the AWT
- * event queue, 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 final class AWTTreeChangeListenerWrapper
- implements TreeChangeListener
-{
- private final TreeChangeListener listener;
-
- public AWTTreeChangeListenerWrapper(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.executeOnEventQueue(this.buildNodeAddedRunnable(event));
- }
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.nodeRemoved_(event);
- } else {
- this.executeOnEventQueue(this.buildNodeRemovedRunnable(event));
- }
- }
-
- public void treeCleared(TreeClearEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeCleared_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeClearedRunnable(event));
- }
- }
-
- public void treeChanged(TreeChangeEvent event) {
- if (this.isExecutingOnUIThread()) {
- this.treeChanged_(event);
- } else {
- this.executeOnEventQueue(this.buildTreeChangedRunnable(event));
- }
- }
-
- private Runnable buildNodeAddedRunnable(final TreeAddEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeAdded_(event);
- }
- @Override
- public String toString() {
- return "node added"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildNodeRemovedRunnable(final TreeRemoveEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.nodeRemoved_(event);
- }
- @Override
- public String toString() {
- return "node removed"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeClearedRunnable(final TreeClearEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeCleared_(event);
- }
- @Override
- public String toString() {
- return "tree cleared"; //$NON-NLS-1$
- }
- };
- }
-
- private Runnable buildTreeChangedRunnable(final TreeChangeEvent event) {
- return new Runnable() {
- public void run() {
- AWTTreeChangeListenerWrapper.this.treeChanged_(event);
- }
- @Override
- public String toString() {
- return "tree changed"; //$NON-NLS-1$
- }
- };
- }
-
- private boolean isExecutingOnUIThread() {
- return EventQueue.isDispatchThread();
- }
-
- /**
- * {@link EventQueue#invokeLater(Runnable)} seems to work OK;
- * but using {@link EventQueue#invokeAndWait(Runnable)} can sometimes make
- * things more predictable when debugging, at the risk of deadlocks.
- */
- private void executeOnEventQueue(Runnable r) {
- EventQueue.invokeLater(r);
-// try {
-// EventQueue.invokeAndWait(r);
-// } catch (InterruptedException ex) {
-// throw new RuntimeException(ex);
-// } catch (java.lang.reflect.InvocationTargetException ex) {
-// throw new RuntimeException(ex);
-// }
- }
-
- 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 "AWT(" + this.listener.toString() + ')'; //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractCollectionValueModel.java
deleted file mode 100644
index 7737eedfd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractCollectionValueModel.java
+++ /dev/null
@@ -1,124 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * This abstract class provides the infrastructure for "lazily" adding listeners
- * to an underlying model as necessary. Subclasses will need to engage and
- * disegage the underlying model and fire the appropriate collection change
- * events. Subclasses must implement the appropriate {@link CollectionValueModel}.
- * <p>
- * Subclasses must implement the following methods:<ul>
- * <li>{@link #engageModel()}<p>
- * implement this method to add the appropriate listener to the underlying model
- * <li>{@link #disengageModel()}<p>
- * implement this method to remove the appropriate listener from the underlying model
- * </ul>
- */
-public abstract class AbstractCollectionValueModel
- extends AbstractModel
-{
-
- // ********** constructor/initialization **********
-
- protected AbstractCollectionValueModel() {
- super();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, CollectionValueModel.VALUES);
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public synchronized void addChangeListener(ChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public synchronized void addCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- if (collectionName.equals(CollectionValueModel.VALUES) && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addCollectionChangeListener(collectionName, listener);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public synchronized void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public synchronized void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener) {
- super.removeCollectionChangeListener(collectionName, listener);
- if (collectionName.equals(CollectionValueModel.VALUES) && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the model has no collection value listeners.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return whether the model has any collection value listeners.
- */
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(CollectionValueModel.VALUES);
- }
-
-
- // ********** behavior **********
-
- /**
- * Engage the underlying model.
- */
- protected abstract void engageModel();
-
- /**
- * Stop listening to the underlying model.
- */
- protected abstract void disengageModel();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractListValueModel.java
deleted file mode 100644
index c9ee2562ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractListValueModel.java
+++ /dev/null
@@ -1,124 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This abstract class provides the infrastructure for "lazily" adding listeners
- * to an underlying model as necessary. Subclasses will need to engage and
- * disegage the underlying model and fire the appropriate list change
- * events. Subclasses must implement the appropriate {@link ListValueModel}.
- * <p>
- * Subclasses must implement the following methods:<ul>
- * <li>{@link #engageModel()}<p>
- * implement this method to add the appropriate listener to the underlying model
- * <li>{@link #disengageModel()}<p>
- * implement this method to remove the appropriate listener from the underlying model
- * </ul>
- */
-public abstract class AbstractListValueModel
- extends AbstractModel
-{
-
- // ********** constructor/initialization **********
-
- protected AbstractListValueModel() {
- super();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, ListValueModel.LIST_VALUES);
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addListChangeListener(String listName, ListChangeListener listener) {
- if (listName.equals(ListValueModel.LIST_VALUES) && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addListChangeListener(listName, listener);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public void removeListChangeListener(String listName, ListChangeListener listener) {
- super.removeListChangeListener(listName, listener);
- if (listName.equals(ListValueModel.LIST_VALUES) && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the model has no collection value listeners.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return whether the model has any collection value listeners.
- */
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(ListValueModel.LIST_VALUES);
- }
-
-
- // ********** behavior **********
-
- /**
- * Engage the underlying model.
- */
- protected abstract void engageModel();
-
- /**
- * Stop listening to the underlying model.
- */
- protected abstract void disengageModel();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModel.java
deleted file mode 100644
index d85efef68a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModel.java
+++ /dev/null
@@ -1,124 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure for "lazily" adding listeners
- * to an underlying model as necessary. Subclasses will need to engage and
- * disegage the underlying model and fire the appropriate property change
- * events. Subclasses must implement the appropriate {@link PropertyValueModel}.
- * <p>
- * Subclasses must implement the following methods:<ul>
- * <li>{@link #engageModel()}<p>
- * implement this method to add the appropriate listener to the underlying model
- * <li>{@link #disengageModel()}<p>
- * implement this method to remove the appropriate listener from the underlying model
- * </ul>
- */
-public abstract class AbstractPropertyValueModel
- extends AbstractModel
-{
-
- // ********** constructor/initialization **********
-
- protected AbstractPropertyValueModel() {
- super();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, PropertyValueModel.VALUE);
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public synchronized void addChangeListener(ChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public synchronized void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- if (propertyName.equals(PropertyValueModel.VALUE) && this.hasNoListeners()) {
- this.engageModel();
- }
- super.addPropertyChangeListener(propertyName, listener);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
- super.removePropertyChangeListener(propertyName, listener);
- if (propertyName.equals(PropertyValueModel.VALUE) && this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the model has no property value listeners.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * Return whether the model has any property value listeners.
- */
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE);
- }
-
-
- // ********** behavior **********
-
- /**
- * Engage the underlying model.
- */
- protected abstract void engageModel();
-
- /**
- * Stop listening to the underlying model.
- */
- protected abstract void disengageModel();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModelAdapter.java
deleted file mode 100644
index 641456d90d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,117 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must implement:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current model
- * <li>{@link #engageModel_()}<p>
- * to start listening to the adapted model
- * <li>{@link #disengageModel_()}<p>
- * to stop listening to the adapted model
- * </ul>
- * Subclasses can call {@link #propertyChanged()} whenever the calculated
- * value of the property changes (as determined by the subclass).
- */
-public abstract class AbstractPropertyValueModelAdapter<V>
- extends AbstractPropertyValueModel
- implements PropertyValueModel<V>
-{
- /**
- * Cache the current value so we can pass an "old value" when
- * we fire a property change event.
- * We need this because the value may be calculated and we may
- * not able to derive the "old value" from any fired events.
- */
- protected V value;
-
-
- // ********** constructor/initialization **********
-
- protected AbstractPropertyValueModelAdapter() {
- super();
- // our value is null when we are not listening to the model
- this.value = null;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the cached value.
- */
- public V getValue() {
- return this.value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model and build the value.
- */
- @Override
- protected void engageModel() {
- this.engageModel_();
- // synch our value *after* we start listening to the model,
- // since the model's value might change when a listener is added
- this.value = this.buildValue();
- }
-
- /**
- * Start listening to the model.
- */
- protected abstract void engageModel_();
-
- /**
- * Build and return the current value, as derived from the
- * current state of the underlying model.
- */
- protected abstract V buildValue();
-
- /**
- * Stop listening to the model and clear the value.
- */
- @Override
- protected void disengageModel() {
- this.disengageModel_();
- // clear out our value when we are not listening to the model
- this.value = null;
- }
-
- /**
- * Stop listening to the model.
- */
- protected abstract void disengageModel_();
-
- /**
- * The underlying model changed in some fashion.
- * Recalculate the value and notify any listeners.
- */
- protected void propertyChanged() {
- Object old = this.value;
- this.firePropertyChanged(VALUE, old, this.value = this.buildValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java
deleted file mode 100644
index 906c2e147c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AbstractTreeNodeValueModel.java
+++ /dev/null
@@ -1,194 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-
-/**
- * Subclasses need only implement the following methods:
- *
- * #value()
- * return the user-determined "value" of the node,
- * i.e. the object "wrapped" by the node
- *
- * #setValue(Object)
- * set the user-determined "value" of the node,
- * i.e. the object "wrapped" by the node;
- * typically only overridden for nodes with "primitive" values
- *
- * #parent()
- * return the parent of the node, which should be another
- * TreeNodeValueModel
- *
- * #childrenModel()
- * return a ListValueModel for the node's children
- *
- * #engageValue() and #disengageValue()
- * override these methods to listen to the node's value if
- * it can change in a way that should be reflected in the tree
- */
-public abstract class AbstractTreeNodeValueModel<T>
- extends AbstractModel
- implements TreeNodeValueModel<T>
-{
-
-
- // ********** constructors **********
-
- /**
- * Default constructor.
- */
- protected AbstractTreeNodeValueModel() {
- super();
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- // this model fires *both* "value property change" and "state change" events...
-// return new SingleAspectChangeSupport(this, PropertyChangeListener.class, PropertyValueModel.VALUE);
- return super.buildChangeSupport();
- }
-
-
- // ********** extend AbstractModel implementation **********
-
- /**
- * Clients should be adding both "state change" and "value property change"
- * listeners.
- */
- @Override
- public void addStateChangeListener(StateChangeListener listener) {
- if (this.hasNoStateChangeListeners()) {
- this.engageValue();
- }
- super.addStateChangeListener(listener);
- }
-
- /**
- * Begin listening to the node's value's state. If the state of the node changes
- * in a way that should be reflected in the tree, fire a "state change" event.
- */
- protected abstract void engageValue();
-
- /**
- * @see #addStateChangeListener(StateChangeListener)
- */
- @Override
- public void removeStateChangeListener(StateChangeListener listener) {
- super.removeStateChangeListener(listener);
- if (this.hasNoStateChangeListeners()) {
- this.disengageValue();
- }
- }
-
- /**
- * Stop listening to the node's value.
- * @see #engageValue()
- */
- protected abstract void disengageValue();
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** TreeNodeValueModel implementation **********
-
- @SuppressWarnings("unchecked")
- public TreeNodeValueModel<T>[] path() {
- List<TreeNodeValueModel<T>> path = CollectionTools.reverseList(this.backPath());
- return path.toArray(new TreeNodeValueModel[path.size()]);
- }
-
- /**
- * Return an iterator that climbs up the node's path,
- * starting with, and including, the node
- * and up to, and including, the root node.
- */
- protected Iterator<TreeNodeValueModel<T>> backPath() {
- return new ChainIterator<TreeNodeValueModel<T>>(this) {
- @Override
- protected TreeNodeValueModel<T> nextLink(TreeNodeValueModel<T> currentLink) {
- return currentLink.parent();
- }
- };
- }
-
- public TreeNodeValueModel<T> child(int index) {
- return this.childrenModel().get(index);
- }
-
- public int childrenSize() {
- return this.childrenModel().size();
- }
-
- public int indexOfChild(TreeNodeValueModel<T> child) {
- ListValueModel<TreeNodeValueModel<T>> children = this.childrenModel();
- int size = children.size();
- for (int i = 0; i < size; i++) {
- if (children.get(i) == child) {
- return i;
- }
- }
- return -1;
- }
-
- public boolean isLeaf() {
- return this.childrenModel().size() == 0;
- }
-
-
- // ********** standard methods **********
-
- /**
- * We implement #equals(Object) so that TreePaths containing these nodes
- * will resolve properly when the nodes contain the same values. This is
- * necessary because nodes are dropped and rebuilt willy-nilly when dealing
- * with a sorted list of children; and this allows us to save and restore
- * a tree's expanded paths. The nodes in the expanded paths that are
- * saved before any modification (e.g. renaming a node) will be different
- * from the nodes in the tree's paths after the modification, if the modification
- * results in a possible change in the node sort order. ~bjv
- */
- @Override
- public boolean equals(Object o) {
- if (o == null) {
- return false;
- }
- if (o.getClass() != this.getClass()) {
- return false;
- }
- @SuppressWarnings("unchecked")
- AbstractTreeNodeValueModel<T> other = (AbstractTreeNodeValueModel<T>) o;
- return this.getValue().equals(other.getValue());
- }
-
- @Override
- public int hashCode() {
- return this.getValue().hashCode();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java
deleted file mode 100644
index 9010b08bc8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectAdapter.java
+++ /dev/null
@@ -1,266 +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.utility.internal.model.value;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract extension of {@link AbstractModel} provides a base for adding
- * change listeners (property change, collection change, list change, tree change)
- * to a subject and converting the subject's change notifications into a single
- * set of change notifications for a common aspect (e.g. <code>VALUE</code>).
- * <p>
- * The adapter will only listen to the subject (and subject holder) when the
- * adapter itself actually has listeners. This will allow the adapter to be
- * garbage collected when appropriate
- */
-public abstract class AspectAdapter<S>
- extends AbstractModel
-{
- /**
- * The subject that holds the aspect and fires
- * change notification when the aspect changes.
- * We need to hold on to this directly so we can
- * disengage it when it changes.
- */
- protected S subject;
-
- /**
- * A value model that holds the subject
- * that holds the aspect and provides change notification.
- * This is useful when there are a number of aspect adapters
- * that have the same subject and that subject can change.
- * All the aspect adapters should share the same subject holder.
- * For now, this is can only be set upon construction and is
- * immutable.
- */
- protected final PropertyValueModel<? extends S> subjectHolder;
-
- /** A listener that keeps us in synch with the subject holder. */
- protected final PropertyChangeListener subjectChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an aspect adapter for the specified subject.
- */
- protected AspectAdapter(S subject) {
- this(new StaticPropertyValueModel<S>(subject));
- }
-
- /**
- * Construct an aspect adapter for the specified subject holder.
- * The subject holder cannot be null.
- */
- protected AspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super();
- if (subjectHolder == null) {
- throw new NullPointerException();
- }
- this.subjectHolder = subjectHolder;
- this.subjectChangeListener = this.buildSubjectChangeListener();
- // the subject is null when we are not listening to it
- // this will typically result in our value being null
- this.subject = null;
- }
-
-
- // ********** initialization **********
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new LocalChangeSupport(this, this.getListenerClass(), this.getListenerAspectName());
- }
-
- /**
- * The subject holder's value has changed, keep our subject in synch.
- */
- protected PropertyChangeListener buildSubjectChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- AspectAdapter.this.subjectChanged();
- }
- @Override
- public String toString() {
- return "subject change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * The subject has changed. Notify listeners that the value has changed.
- */
- protected synchronized void subjectChanged() {
- Object oldValue = this.getValue();
- boolean hasListeners = this.hasListeners();
- if (hasListeners) {
- this.disengageSubject();
- }
- this.subject = this.subjectHolder.getValue();
- if (hasListeners) {
- this.engageSubject();
- this.fireAspectChanged(oldValue, this.getValue());
- }
- }
-
- /**
- * Return the aspect's current value.
- */
- protected abstract Object getValue();
-
- /**
- * Return the class of listener that is interested in the aspect adapter's
- * changes.
- */
- protected abstract Class<? extends EventListener> getListenerClass();
-
- /**
- * Return the name of the aspect adapter's aspect (e.g. VALUE).
- * This is the name of the aspect adapter's single aspect, not the
- * name of the subject's aspect the aspect adapter is adapting.
- */
- protected abstract String getListenerAspectName();
-
- /**
- * Return whether there are any listeners for the aspect.
- */
- protected abstract boolean hasListeners();
-
- /**
- * Return whether there are no listeners for the aspect.
- */
- protected boolean hasNoListeners() {
- return ! this.hasListeners();
- }
-
- /**
- * The aspect has changed, notify listeners appropriately.
- */
- protected abstract void fireAspectChanged(Object oldValue, Object newValue);
-
- protected void engageSubject() {
- // check for nothing to listen to
- if (this.subject != null) {
- this.engageSubject_();
- }
- }
-
- /**
- * The subject is not null - add our listener.
- */
- protected abstract void engageSubject_();
-
- protected void disengageSubject() {
- // check for nothing to listen to
- if (this.subject != null) {
- this.disengageSubject_();
- }
- }
-
- /**
- * The subject is not null - remove our listener.
- */
- protected abstract void disengageSubject_();
-
- protected void engageSubjectHolder() {
- this.subjectHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- // synch our subject *after* we start listening to the subject holder,
- // since its value might change when a listener is added
- this.subject = this.subjectHolder.getValue();
- }
-
- protected void disengageSubjectHolder() {
- this.subjectHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.subjectChangeListener);
- // clear out the subject when we are not listening to its holder
- this.subject = null;
- }
-
- protected void engageModels() {
- this.engageSubjectHolder();
- this.engageSubject();
- }
-
- protected void disengageModels() {
- this.disengageSubject();
- this.disengageSubjectHolder();
- }
-
-
- // ********** local change support **********
-
- /**
- * Extend change support to start listening to the aspect adapter's
- * models (the subject holder and the subject itself) when the first
- * relevant listener is added.
- * Conversely, stop listening to the aspect adapter's models when the
- * last relevant listener is removed.
- * A relevant listener is a listener of the relevant type and aspect or a
- * general-purpose listener.
- */
- protected class LocalChangeSupport extends SingleAspectChangeSupport {
- private static final long serialVersionUID = 1L;
-
- public LocalChangeSupport(AspectAdapter<S> source, Class<? extends EventListener> validListenerClass, String validAspectName) {
- super(source, validListenerClass, validAspectName);
- }
-
- protected boolean hasNoListeners() {
- return this.hasNoListeners(this.validListenerClass, this.validAspectName);
- }
-
-
- // ********** overrides **********
-
- @Override
- protected synchronized <T extends EventListener> void addListener(Class<T> listenerClass, T listener) {
- if (this.hasNoListeners()) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(listenerClass, listener);
- }
-
- @Override
- protected synchronized <T extends EventListener> void addListener(Class<T> listenerClass, String aspectName, T listener) {
- if (this.hasNoListeners()) {
- AspectAdapter.this.engageModels();
- }
- super.addListener(listenerClass, aspectName, listener);
- }
-
- @Override
- protected synchronized <T extends EventListener> void removeListener(Class<T> listenerClass, T listener) {
- super.removeListener(listenerClass, listener);
- if (this.hasNoListeners()) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- @Override
- protected synchronized <T extends EventListener> void removeListener(Class<T> listenerClass, String aspectName, T listener) {
- super.removeListener(listenerClass, aspectName, listener);
- if (this.hasNoListeners()) {
- AspectAdapter.this.disengageModels();
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectCollectionValueModelAdapter.java
deleted file mode 100644
index 5976a55adc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectCollectionValueModelAdapter.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.utility.internal.model.value;
-
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This {@link AspectAdapter} provides basic collection change support.
- * This converts an "aspect" (as defined by subclasses) into
- * a single {@link #VALUES} collection.
- * <p>
- * The typical subclass will override the following methods:<ul>
- * <li>{@link #engageSubject_()}<p>
- * implement this method to add the appropriate listener to the subject
- * <li>{@link #disengageSubject_()}<p>
- * implement this method to remove the appropriate listener from the subject
- * <li>{@link #getIterable()}<p>
- * at the very minimum, override this method to return an iterable containing the
- * subject's collection aspect; it does not need to be overridden if either
- * {@link #iterator_()} or {@link #iterator()} is overridden and its behavior changed
- * <li>{@link #size_()}<p>
- * override this method to improve performance; it does not need to be overridden if
- * {@link #size()} is overridden and its behavior changed
- * <li>{@link #iterator_()}<p>
- * override this method to return an iterator on the
- * subject's collection aspect if it is not possible to implement {@link #getIterable()};
- * it does not need to be overridden if
- * {@link #iterator()} is overridden and its behavior changed
- * <li>{@link #iterator()}<p>
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- * <li>{@link #size()}<p>
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- * </ul>
- * To notify listeners, subclasses can call {@link #collectionChanged()}
- * whenever the aspect has changed.
- */
-public abstract class AspectCollectionValueModelAdapter<S, E>
- extends AspectAdapter<S>
- implements CollectionValueModel<E>
-{
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model adapter for an aspect of the
- * specified subject.
- */
- protected AspectCollectionValueModelAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- /**
- * Return the elements of the subject's collection aspect.
- */
- public Iterator<E> iterator() {
- return (this.subject == null) ? EmptyIterator.<E>instance() : this.iterator_();
- }
-
- /**
- * Return the elements of the subject's collection aspect.
- * At this point we can be sure the subject is not null.
- * @see #iterator()
- */
- protected Iterator<E> iterator_() {
- return this.getIterable().iterator();
- }
-
- /**
- * Return the elements of the subject's collection aspect.
- * At this point we can be sure the subject is not null.
- * @see #iterator_()
- */
- protected Iterable<E> getIterable() {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * Return the size of the subject's collection aspect.
- */
- public int size() {
- return (this.subject == null) ? 0 : this.size_();
- }
-
- /**
- * Return the size of the subject's collection aspect.
- * At this point we can be sure the subject is not null.
- * @see #size()
- */
- protected int size_() {
- return CollectionTools.size(this.iterator());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.buildValueCollection();
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- @SuppressWarnings("unchecked") Collection<E> newCollection = (Collection<E>) newValue;
- this.fireCollectionChanged(VALUES, newCollection);
- }
-
- protected void collectionChanged() {
- this.fireCollectionChanged(VALUES, this.buildValueCollection());
- }
-
- protected Collection<E> buildValueCollection() {
- return CollectionTools.collection(this.iterator());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.buildValueCollection());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectListValueModelAdapter.java
deleted file mode 100644
index 2748cea6dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectListValueModelAdapter.java
+++ /dev/null
@@ -1,197 +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.utility.internal.model.value;
-
-import java.util.EventListener;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This {@link AspectAdapter} provides basic list change support.
- * This converts an "aspect" (as defined by subclasses) into
- * a single {@link #LIST_VALUES} list.
- * <p>
- * The typical subclass will override the following methods:<ul>
- * <li>{@link #engageSubject_()}<p>
- * implement this method to add the appropriate listener to the subject
- * <li>{@link #disengageSubject_()}<p>
- * implement this method to remove the appropriate listener from the subject
- * <li>{@link #getListIterable()}<p>
- * at the very minimum, override this method to return a list iterable containing the
- * subject's list aspect; it does not need to be overridden if either
- * {@link #listIterator_()} or {@link #listIterator()} is overridden and its behavior changed
- * <li>{@link #get(int)}<p>
- * override this method to improve performance
- * <li>{@link #size_()}<p>
- * override this method to improve performance; it does not need to be overridden if
- * {@link #size()} is overridden and its behavior changed
- * <li>{@link #toArray_()}<p>
- * override this method to improve performance; it does not need to be overridden if
- * {@link #toArray()} is overridden and its behavior changed
- * <li>{@link #listIterator_()}<p>
- * override this method to return a list iterator on the subject's list
- * aspect if it is not possible to implement {@link #getListIterable()};
- * it does not need to be overridden if
- * {@link #listIterator()} is overridden and its behavior changed
- * <li>{@link #listIterator()}<p>
- * override this method only if returning an empty list iterator when the
- * subject is null is unacceptable
- * <li>{@link #size()}<p>
- * override this method only if returning a zero when the
- * subject is null is unacceptable
- * <li>{@link #toArray()}<p>
- * override this method only if returning an empty array when the
- * subject is null is unacceptable
- * </ul>
- * To notify listeners, subclasses can call {@link #listChanged()}
- * whenever the aspect has changed.
- */
-public abstract class AspectListValueModelAdapter<S, E>
- extends AspectAdapter<S>
- implements ListValueModel<E>
-{
- private static final Object[] EMPTY_ARRAY = new Object[0];
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model adapter for an aspect of the
- * specified subject.
- */
- protected AspectListValueModelAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- }
-
-
- // ********** ListValueModel implementation **********
-
- /**
- * Return the elements of the subject's list aspect.
- */
- public ListIterator<E> iterator() {
- return this.listIterator();
- }
-
- /**
- * Return the elements of the subject's list aspect.
- */
- public ListIterator<E> listIterator() {
- return (this.subject == null) ? EmptyListIterator.<E>instance() : this.listIterator_();
- }
-
- /**
- * Return the elements of the subject's list aspect.
- * At this point we can be sure the subject is not null.
- * @see #listIterator()
- */
- protected ListIterator<E> listIterator_() {
- return this.getListIterable().iterator();
- }
-
- /**
- * Return the elements of the subject's list aspect.
- * At this point we can be sure the subject is not null.
- * @see #listIterator_()
- */
- protected ListIterable<E> getListIterable() {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * Return the element at the specified index of the subject's list aspect.
- */
- public E get(int index) {
- return CollectionTools.get(this.listIterator(), index);
- }
-
- /**
- * Return the size of the subject's list aspect.
- */
- public int size() {
- return this.subject == null ? 0 : this.size_();
- }
-
- /**
- * Return the size of the subject's list aspect.
- * At this point we can be sure the subject is not null.
- * @see #size()
- */
- protected int size_() {
- return CollectionTools.size(this.listIterator());
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- */
- public Object[] toArray() {
- return this.subject == null ? EMPTY_ARRAY : this.toArray_();
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- * At this point we can be sure the subject is not null.
- * @see #toArray()
- */
- protected Object[] toArray_() {
- return ArrayTools.array(this.listIterator(), this.size());
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected List<E> getValue() {
- return this.buildValueList();
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return ListChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return LIST_VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- @SuppressWarnings("unchecked") List<E> newList = (List<E>) newValue;
- this.fireListChanged(LIST_VALUES, newList);
- }
-
- protected void listChanged() {
- this.fireListChanged(LIST_VALUES, this.buildValueList());
- }
-
- protected List<E> buildValueList() {
- return CollectionTools.list(this.iterator());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.buildValueList());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java
deleted file mode 100644
index f0c053a2ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,178 +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.utility.internal.model.value;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This {@link AspectAdapter} provides basic property change support.
- * This converts an "aspect" (as defined by subclasses) into
- * a single {@link #VALUE} property.
- * <p>
- * The typical subclass will override the following methods:<ul>
- * <li>{@link #engageSubject_()}<p>
- * implement this method to add the appropriate listener to the subject
- * <li>{@link #disengageSubject_()}<p>
- * implement this method to remove the appropriate listener from the subject
- * <li>{@link #buildValue_()}<p>
- * at the very minimum, override this method to return the value of the
- * subject's aspect (or "virtual" aspect); it does not need to be
- * overridden if {@link #buildValue()} is overridden and its behavior changed
- * <li>{@link #setValue_(Object)}<p>
- * override this method if the client code needs to <em>set</em> the value of
- * the subject's aspect; oftentimes, though, the client code (e.g. UI)
- * will need only to <em>get</em> the value; it does not need to be
- * overridden if {@link #setValue(Object)} is overridden and its behavior changed
- * <li>{@link #buildValue()}<p>
- * override this method only if returning a <code>null</code> value when
- * the subject is <code>null</code> is unacceptable
- * <li>{@link #setValue(Object)}<p>
- * override this method only if something must be done when the subject
- * is <code>null</code> (e.g. throw an exception)
- * </ul>
- * To notify listeners, subclasses can call {@link #propertyChanged()}
- * whenever the aspect has changed.
- */
-public abstract class AspectPropertyValueModelAdapter<S, V>
- extends AspectAdapter<S>
- implements WritablePropertyValueModel<V>
-{
- /**
- * Cache the current value of the aspect so we
- * can pass an "old value" when we fire a property change event.
- * We need this because the value may be calculated and may
- * not be in the property change event fired by the subject,
- * especially when dealing with multiple aspects.
- */
- protected V value;
-
-
- // ********** constructors **********
-
- /**
- * Construct a property value model adapter for an aspect of the
- * specified subject.
- */
- protected AspectPropertyValueModelAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- // our value is null when we are not listening to the subject
- this.value = null;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Return the value of the subject's aspect.
- */
- @Override
- public final V getValue() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- /**
- * Set the value of the subject's aspect.
- */
- public void setValue(V value) {
- if (this.subject != null) {
- this.setValue_(value);
- }
- }
-
- /**
- * Set the value of the subject's aspect.
- * At this point we can be sure the subject is not null.
- * @see #setValue(Object)
- */
- protected void setValue_(@SuppressWarnings("unused") V value) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
- @Override
- protected void engageSubject() {
- super.engageSubject();
- // synch our value *after* we start listening to the subject,
- // since its value might change when a listener is added
- this.value = this.buildValue();
- }
-
- @Override
- protected void disengageSubject() {
- super.disengageSubject();
- // clear out our value when we are not listening to the subject
- this.value = null;
- }
-
-
- // ********** behavior **********
-
- /**
- * Return the aspect's value.
- * At this point the subject may be null.
- */
- protected V buildValue() {
- return (this.subject == null) ? null : this.buildValue_();
- }
-
- /**
- * Return the value of the subject's aspect.
- * At this point we can be sure the subject is not null.
- * @see #buildValue()
- */
- protected V buildValue_() {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * This method can be called by subclasses whenever the subject's aspect
- * has changed; listeners will be notified appropriately.
- */
- protected void propertyChanged() {
- V old = this.value;
- this.value = this.buildValue();
- this.fireAspectChanged(old, this.value);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectTreeValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectTreeValueModelAdapter.java
deleted file mode 100644
index 6e5aa1f01c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/AspectTreeValueModelAdapter.java
+++ /dev/null
@@ -1,119 +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.utility.internal.model.value;
-
-import java.util.Collection;
-import java.util.EventListener;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * This {@link AspectAdapter} provides basic tree change support.
- * This converts an "aspect" (as defined by subclasses) into
- * a single {@link #NODES} tree.
- * <p>
- * The typical subclass will override the following methods:<ul>
- * <li>{@link #engageSubject_()}<p>
- * implement this method to add the appropriate listener to the subject
- * <li>{@link #disengageSubject_()}<p>
- * implement this method to remove the appropriate listener from the subject
- * <li>{@link #nodes_()}<p>
- * at the very minimum, override this method to return an iterator
- * on the subject's tree aspect; it does not need to be overridden if
- * {@link #nodes()} is overridden and its behavior changed
- * <li>{@link #nodes()}<p>
- * override this method only if returning an empty iterator when the
- * subject is null is unacceptable
- * </ul>
- * To notify listeners, subclasses can call {@link #treeChanged()}
- * whenever the aspect has changed.
- */
-public abstract class AspectTreeValueModelAdapter<S, E>
- extends AspectAdapter<S>
- implements TreeValueModel<E>
-{
-
- // ********** constructors **********
-
- /**
- * Construct a tree value model adapter for an aspect of the
- * specified subject.
- */
- protected AspectTreeValueModelAdapter(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- }
-
-
- // ********** TreeValueModel implementation **********
-
- /**
- * Return the nodes of the subject's tree aspect.
- */
- public Iterator<E> nodes() {
- return (this.subject == null) ? EmptyIterator.<E>instance() : this.nodes_();
- }
-
- /**
- * Return the nodes of the subject's tree aspect.
- * At this point we can be sure the subject is not null.
- * @see #nodes()
- */
- protected Iterator<E> nodes_() {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.buildValueCollection();
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return TreeChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return NODES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyTreeChangeListeners(NODES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- @SuppressWarnings("unchecked") Collection<E> newNodes = (Collection<E>) newValue;
- this.fireTreeChanged(NODES, newNodes);
- }
-
- protected void treeChanged() {
- this.fireTreeChanged(NODES, this.buildValueCollection());
- }
-
- protected Collection<E> buildValueCollection() {
- return CollectionTools.collection(this.nodes());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.buildValueCollection());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
deleted file mode 100644
index 6477fa4623..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/BufferedWritablePropertyValueModel.java
+++ /dev/null
@@ -1,392 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>BufferedWritablePropertyValueModel</code> is used to hold a temporary copy of the value
- * in another property value model (the "wrapped" value holder). The application
- * can modify this temporary copy, ad nauseam; but the temporary copy is only
- * passed through to the "wrapped" value holder when the trigger "accepts" the
- * buffered value. Alternatively, the application can "reset" the buffered value
- * to the original, "wrapped" value.
- * <p>
- * The trigger is another {@link PropertyValueModel} that holds a {@link Boolean}
- * and the application changes the trigger's value to true on "accept", false on "reset".
- * Typically, in a dialog:<ul>
- * <li>pressing the "OK" button will trigger an "accept" and close the dialog
- * <li>pressing the "Cancel" button will simply close the dialog,
- * dropping the "buffered" values into the bit bucket
- * <li>pressing the "Apply" button will trigger an "accept" and leave the dialog open
- * <li>pressing the "Restore" button will trigger a "reset" and leave the dialog open
- * </ul>
- * <p>
- * A number of buffered property value models can wrap another set of
- * property aspect adapters that adapt the various aspects of a single
- * domain model. All the bufferd property value models can be hooked to the
- * same trigger, and that trigger is controlled by the application, typically
- * via the OK button in a dialog.
- *
- * @see PropertyAspectAdapter
- */
-public class BufferedWritablePropertyValueModel<T>
- extends PropertyValueModelWrapper<T>
- implements WritablePropertyValueModel<T>
-{
-
- /**
- * We cache the value here until it is accepted and passed
- * through to the wrapped value holder.
- */
- protected T bufferedValue;
-
- /**
- * This is set to true when we are "accepting" the buffered value
- * and passing it through to the wrapped value holder. This allows
- * us to ignore the property change event fired by the wrapped
- * value holder.
- * (We can't stop listening to the wrapped value holder, because
- * if we are the only listener that could "deactivate" the wrapped
- * value holder.)
- */
- protected boolean accepting;
-
- /**
- * 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;
-
- /**
- * This flag indicates whether our buffered value has been assigned
- * a value and is possibly out of synch with the wrapped value.
- */
- protected boolean buffering;
-
-
- // ********** constructors **********
-
- /**
- * Construct a buffered property value model with the specified wrapped
- * property value model and trigger holder.
- */
- public BufferedWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, PropertyValueModel<Boolean> triggerHolder) {
- super(valueHolder);
- if (triggerHolder == null) {
- throw new NullPointerException();
- }
- this.triggerHolder = triggerHolder;
- this.bufferedValue = null;
- this.buffering = false;
- this.accepting = false;
- this.triggerChangeListener = this.buildTriggerChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildTriggerChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- BufferedWritablePropertyValueModel.this.triggerChanged(event);
- }
- @Override
- public String toString() {
- return "trigger change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * If we are currently "buffering" a value, return that;
- * otherwise, return the wrapped value.
- */
- public T getValue() {
- return this.buffering ? this.bufferedValue : this.valueHolder.getValue();
- }
-
- /**
- * Assign the new value to our "buffered" value.
- * It will be pushed to the wrapped value holder
- * when the trigger is "accepted".
- */
- public void setValue(T value) {
- if (this.buffering) {
- if (this.valuesAreEqual(value, this.valueHolder.getValue())) {
- // the buffered value is being set back to the original value
- this.reset();
- } else {
- // the buffered value is being changed
- Object old = this.bufferedValue;
- this.bufferedValue = value;
- this.firePropertyChanged(VALUE, old, value);
- }
- } else {
- if (this.valuesAreEqual(value, this.valueHolder.getValue())) {
- // the buffered value is being set to the same value as the original value - ignore
- } else {
- // the buffered value is being set for the first time
- Object old = this.valueHolder.getValue();
- this.bufferedValue = value;
- this.buffering = true;
- this.firePropertyChanged(VALUE, old, value);
- }
- }
- }
-
-
- // ********** PropertyValueModelWrapper extensions **********
-
- /**
- * extend to engage the trigger holder also
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.triggerHolder.addPropertyChangeListener(VALUE, this.triggerChangeListener);
- }
-
- /**
- * extend to disengage the trigger holder also
- */
- @Override
- protected void disengageModel() {
- this.triggerHolder.removePropertyChangeListener(VALUE, this.triggerChangeListener);
- super.disengageModel();
- }
-
-
- // ********** behavior **********
-
- /**
- * If we are currently "accepting" the value (i.e passing it on to the
- * "wrapped" model), ignore change notifications, since we caused
- * them and our own listeners are already aware of the change.
- */
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- if ( ! this.accepting) {
- this.valueChanged_(event);
- }
- }
-
- /**
- * If we have a "buffered" value, check whether the "wrapped" value has
- * changed to be the same as the "buffered" value. If it has, stop "buffering";
- * if not, do nothing.
- * If we do not yet have a "buffered" value, simply propagate the
- * change notification with the buffered model as the source.
- */
- protected void valueChanged_(PropertyChangeEvent event) {
- if (this.buffering) {
- if (this.valuesAreEqual(event.getNewValue(), this.bufferedValue)) {
- // the buffered value is being set back to the original value
- this.reset();
- } else {
- this.handleChangeConflict(event);
- }
- } else {
- this.firePropertyChanged(event.clone(this));
- }
- }
-
- /**
- * By default, if we have a "buffered" value and the "wrapped" value changes,
- * we simply ignore the new "wrapped" value and simply overlay it with the
- * "buffered" value if it is "accepted". ("Last One In Wins" concurrency model)
- * Subclasses can override this method to change that behavior with a
- * different concurrency model. For example, you could drop the "buffered" value
- * and replace it with the new "wrapped" value, or you could throw an
- * exception.
- */
- protected void handleChangeConflict(@SuppressWarnings("unused") PropertyChangeEvent event) {
- // the default is to do nothing
- }
-
- /**
- * The trigger changed:<ul>
- * <li>If it is now true, "accept" the buffered value and push
- * it to the wrapped value holder.
- * <li>If it is now false, "reset" the buffered value to its original value.
- * </ul>
- */
- protected void triggerChanged(PropertyChangeEvent event) {
- // if nothing has been "buffered", we don't need to do anything:
- // nothing needs to be passed through; nothing needs to be reset;
- if (this.buffering) {
- if (((Boolean) event.getNewValue()).booleanValue()) {
- this.accept();
- } else {
- this.reset();
- }
- }
- }
-
- protected void accept() {
- // set the accepting flag so we ignore any events
- // fired by the wrapped value holder
- this.accepting = true;
- try {
- this.getValueHolder().setValue(this.bufferedValue);
- } finally {
- this.bufferedValue = null;
- this.buffering = false;
- // clear the flag once the "accept" is complete
- this.accepting = false;
- }
- }
-
- protected void reset() {
- // notify our listeners that our value has been reset
- Object old = this.bufferedValue;
- this.bufferedValue = null;
- this.buffering = false;
- this.firePropertyChanged(VALUE, old, this.valueHolder.getValue());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Return whether the buffered model is currently "buffering"
- * a value.
- */
- public boolean isBuffering() {
- return this.buffering;
- }
-
- /**
- * Our constructor accepts only a {@link WritablePropertyValueModel}{@code<T>}.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> getValueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
-
- // ********** inner class **********
-
- /**
- * <code>Trigger</code> is a special property value model that only maintains its
- * value (of <code>true</code> or <code>false</code>) during the change notification caused by
- * {@link #setValue(T)}. In other words, a <code>Trigger</code>
- * only has a valid value when it is being set.
- */
- public static class Trigger extends SimplePropertyValueModel<Boolean> {
-
-
- // ********** constructor **********
-
- /**
- * Construct a trigger with a null value.
- */
- public Trigger() {
- super();
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * Extend so that this method can only be invoked during
- * change notification triggered by {@link #setValue(Object)}.
- */
- @Override
- public Boolean getValue() {
- if (this.value == null) {
- throw new IllegalStateException("The method Trigger.getValue() may only be called during change notification."); //$NON-NLS-1$
- }
- return this.value;
- }
-
- /**
- * Extend to reset the value to <code>null</code> once all the
- * listeners have been notified.
- */
- @Override
- public void setValue(Boolean value) {
- super.setValue(value);
- this.value = null;
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Set the trigger's value:<ul>
- * <li><code>true</code> indicates "accept"
- * <li><code>false</code> indicates "reset"
- * </ul>
- */
- public void setValue(boolean value) {
- this.setValue(Boolean.valueOf(value));
- }
-
- /**
- * Return the trigger's value:<ul>
- * <li><code>true</code> indicates "accept"
- * <li><code>false</code> indicates "reset"
- * </ul>
- * This method can only be invoked during change notification.
- */
- public boolean booleanValue() {
- return this.getValue().booleanValue();
- }
-
- /**
- * Accept the trigger (i.e. set its value to <code>true</code>).
- */
- public void accept() {
- this.setValue(true);
- }
-
- /**
- * Return whether the trigger has been accepted
- * (i.e. its value was changed to <code>true</code>).
- * This method can only be invoked during change notification.
- */
- public boolean isAccepted() {
- return this.booleanValue();
- }
-
- /**
- * Reset the trigger (i.e. set its value to <code>false</code>).
- */
- public void reset() {
- this.setValue(false);
- }
-
- /**
- * Return whether the trigger has been reset
- * (i.e. its value was changed to <code>false</code>).
- * This method can only be invoked during change notification.
- */
- public boolean isReset() {
- return ! this.booleanValue();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationPropertyValueModel.java
deleted file mode 100644
index db5930da6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationPropertyValueModel.java
+++ /dev/null
@@ -1,112 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>CachingTransformationPropertyValueModel</code> wraps another
- * {@link PropertyValueModel} and uses a {@link Transformer}
- * to transform the wrapped value before it is returned by {@link #getValue()}.
- * The transformed value is calculated and cached during initialization and every
- * time the wrapped value changes. This can be useful when the old value
- * passed in to {@link #valueChanged(org.eclipse.jpt.utility.model.event.PropertyChangeEvent)}
- * can no longer be "transformed" because its state is no longer valid.
- * This caching can also improve time performance in some situations.
- * <p>
- * As an alternative to building a {@link Transformer},
- * a subclass of <code>CachingTransformationPropertyValueModel</code> can
- * either override {@link #transform_(Object)} or,
- * if something other than null should be returned when the wrapped value
- * is null, override {@link #transform(Object)}.
- */
-public class CachingTransformationPropertyValueModel<T1, T2>
- extends TransformationPropertyValueModel<T1, T2>
-{
- /**
- * Cache the transformed value so that during property change event notification
- * we do not have to transform the old value. The old value could no longer be valid in
- * the model; as a result, transforming it would not be valid.
- */
- protected T2 cachedValue;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and the default transformer.
- * Use this constructor if you want to override
- * {@link #transform_(Object)} or {@link #transform(Object)}
- * instead of building a {@link Transformer}.
- */
- public CachingTransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder) {
- super(valueHolder);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and transformer.
- */
- public CachingTransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder, Transformer<T1, T2> transformer) {
- super(valueHolder, transformer);
- }
-
-
- // ********** behavior **********
-
- /**
- * We have listeners, transform the nested value and cache the result.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.cachedValue = this.transform(this.valueHolder.getValue());
- }
-
- /**
- * We have no more listeners, clear the cached value.
- */
- @Override
- protected void disengageModel() {
- this.cachedValue = null;
- super.disengageModel();
- }
-
- /**
- * No need to transform the nested value, simply return the cached value,
- * which is already transformed.
- */
- @Override
- public T2 getValue() {
- return this.cachedValue;
- }
-
- /**
- * Transform the specified new value, caching it before returning it.
- * A bit of a side-effect, but it seems reasonable.
- */
- @Override
- protected T2 transformNew(T1 value) {
- this.cachedValue = super.transformNew(value);
- return this.cachedValue;
- }
-
- /**
- * No need to transform the old value, simply return the cached value,
- * which is already transformed.
- */
- @Override
- protected T2 transformOld(T1 value) {
- return this.cachedValue;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationWritablePropertyValueModel.java
deleted file mode 100644
index f9c7f11318..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CachingTransformationWritablePropertyValueModel.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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>CachingTransformationWritablePropertyValueModel<code> augments the
- * behavior of a {@link TransformationWritablePropertyValueModel} by caching
- * the transformed value.
- * The transformed value is calculated and cached during initialization and every
- * time the wrapped value changes. This can be useful when the old value
- * passed in to {@link #valueChanged(org.eclipse.jpt.utility.model.event.PropertyChangeEvent)}
- * can no longer be "transformed" because its state is no longer valid.
- * This caching can also improve time performance in some situations.
- */
-public class CachingTransformationWritablePropertyValueModel<T1, T2>
- extends TransformationWritablePropertyValueModel<T1, T2>
-{
- /**
- * Cache the transformed value so that during property change event notification
- * we do not have to transform the old value. The old value could no longer be valid in
- * the model; as a result, transforming it would not be valid.
- */
- protected T2 cachedValue;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and the default bidi transformer.
- * Use this constructor if you want to override
- * {@link #transform_(Object)} and {@link reverseTransform_(Object)}
- * (or {@link #transform(Object)} and {@link #reverseTransform(Object)})
- * methods instead of building a {@link BidiTransformer}.
- */
- public CachingTransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder) {
- super(valueHolder);
- }
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and bidi transformer.
- */
- public CachingTransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder, BidiTransformer<T1, T2> transformer) {
- super(valueHolder, transformer);
- }
-
-
- // ********** behavior **********
-
- /**
- * We have listeners, transform the nested value and cache the result.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.cachedValue = this.transform(this.valueHolder.getValue());
- }
-
- /**
- * We have no more listeners, clear the cached value.
- */
- @Override
- protected void disengageModel() {
- this.cachedValue = null;
- super.disengageModel();
- }
-
- /**
- * No need to transform the nested value, simply return the cached value,
- * which is already transformed.
- */
- @Override
- public T2 getValue() {
- return this.cachedValue;
- }
-
- /**
- * Transform the specified new value, caching it before returning it.
- * A bit of a side-effect, but it seems reasonable.
- */
- @Override
- protected T2 transformNew(T1 value) {
- this.cachedValue = super.transformNew(value);
- return this.cachedValue;
- }
-
- /**
- * No need to transform the old value, simply return the cached value,
- * which is already transformed.
- */
- @Override
- protected T2 transformOld(T1 value) {
- return this.cachedValue;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ChangePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ChangePropertyValueModelAdapter.java
deleted file mode 100644
index d86d6da5b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ChangePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,99 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.SimpleChangeListener;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must override:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current model
- * </ul>
- * Subclasses might want to override the following methods
- * to improve performance (by not recalculating the value, if possible):<ul>
- * <li>{@link #modelChanged(ChangeEvent event)}
- * <li>{@link #buildChangeListener()}
- * </ul>
- */
-public abstract class ChangePropertyValueModelAdapter<T>
- extends AbstractPropertyValueModelAdapter<T>
-{
- /** The wrapped model. */
- protected final Model model;
-
- /** A listener that allows us to synch with changes to the wrapped collection holder. */
- protected final ChangeListener changeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped model.
- */
- protected ChangePropertyValueModelAdapter(Model model) {
- super();
- this.model = model;
- this.changeListener = this.buildChangeListener();
- }
-
- protected ChangeListener buildChangeListener() {
- return new SimpleChangeListener() {
- @Override
- protected void modelChanged(ChangeEvent event) {
- ChangePropertyValueModelAdapter.this.modelChanged(event);
- }
- @Override
- public String toString() {
- return "change listener command"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model.
- */
- @Override
- protected void engageModel_() {
- this.model.addChangeListener(this.changeListener);
- }
-
- /**
- * Stop listening to the model.
- */
- @Override
- protected void disengageModel_() {
- this.model.removeChangeListener(this.changeListener);
- }
-
-
- // ********** change support **********
-
- /**
- * The wrapped model has changed;
- * propagate the change notification appropriately.
- */
- protected void modelChanged(@SuppressWarnings("unused") ChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
deleted file mode 100644
index bdcf4b41ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionAspectAdapter.java
+++ /dev/null
@@ -1,158 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of {@link AspectCollectionValueModelAdapter} provides
- * basic collection change support.
- * This converts a set of one or more collections into
- * a single {@link #VALUES} collection.
- * <p>
- * The typical subclass will override the following methods (see the descriptions
- * in {@link AspectCollectionValueModelAdapter}):<ul>
- * <li>{@link #getIterable()}
- * <li>{@link #size_()}
- * <li>{@link #iterator_()}
- * <li>{@link #iterator()}
- * <li>{@link #size()}
- * </ul>
- */
-public abstract class CollectionAspectAdapter<S extends Model, E>
- extends AspectCollectionValueModelAdapter<S, E>
-{
- /**
- * The name of the subject's collections that we use for the value.
- */
- protected final String[] collectionNames;
- protected static final String[] EMPTY_COLLECTION_NAMES = new String[0];
-
- /** A listener that listens to the subject's collection aspects. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection aspect adapter for the specified subject
- * and collection.
- */
- protected CollectionAspectAdapter(String collectionName, S subject) {
- this(new String[] {collectionName}, subject);
- }
-
- /**
- * Construct a collection aspect adapter for the specified subject
- * and collections.
- */
- protected CollectionAspectAdapter(String[] collectionNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), collectionNames);
- }
-
- /**
- * Construct a collection aspect adapter for the specified subject holder
- * and collections.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... collectionNames) {
- super(subjectHolder);
- this.collectionNames = collectionNames;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
- /**
- * Construct a collection aspect adapter for the specified subject holder
- * and collections.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> collectionNames) {
- this(subjectHolder, collectionNames.toArray(new String[collectionNames.size()]));
- }
-
- /**
- * Construct a collection aspect adapter for an "unchanging" collection in
- * the specified subject. This is useful for a collection aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new collection.
- */
- protected CollectionAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_COLLECTION_NAMES);
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- // transform the subject's collection change events into VALUES collection change events
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- CollectionAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- CollectionAspectAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- CollectionAspectAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionAspectAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener: " + Arrays.asList(CollectionAspectAdapter.this.collectionNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected void engageSubject_() {
- for (String collectionName : this.collectionNames) {
- ((Model) this.subject).addCollectionChangeListener(collectionName, this.collectionChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String collectionName : this.collectionNames) {
- ((Model) this.subject).removeCollectionChangeListener(collectionName, this.collectionChangeListener);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(CollectionAddEvent event) {
- this.fireItemsAdded(event.clone(this, VALUES));
- }
-
- protected void itemsRemoved(CollectionRemoveEvent event) {
- this.fireItemsRemoved(event.clone(this, VALUES));
- }
-
- protected void collectionCleared(CollectionClearEvent event) {
- this.fireCollectionCleared(event.clone(this, VALUES));
- }
-
- protected void collectionChanged(CollectionChangeEvent event) {
- this.fireCollectionChanged(event.clone(this, VALUES));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java
deleted file mode 100644
index 2a0d236a83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,215 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a {@link CollectionValueModel} behave like
- * a read-only {@link ListValueModel}, sorta.
- * <p>
- * To maintain a reasonably consistent appearance to client code, we
- * keep an internal list somewhat in synch with the wrapped collection.
- * <p>
- * <strong>NB:</strong> Since we only listen to the wrapped collection when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * collection while we are listening to it, results to various methods
- * (e.g. {@link #size()}, {@link #get(int)}) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, clients will also be listeners.
- */
-public class CollectionListValueModelAdapter<E>
- extends AbstractListValueModel
- implements ListValueModel<E>
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<? extends E> collectionHolder;
-
- /** A listener that forwards any events fired by the collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
- /**
- * Our internal list, which holds the same elements as
- * the wrapped collection, but keeps them in order.
- */
- // we declare this an ArrayList so we can use #clone() and #ensureCapacity(int)
- protected final ArrayList<E> list;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified collection value model.
- */
- public CollectionListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- super();
- if (collectionHolder == null) {
- throw new NullPointerException();
- }
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- this.list = new ArrayList<E>(collectionHolder.size());
- // postpone building the list and listening to the underlying collection
- // until we have listeners ourselves...
- }
-
-
- // ********** initialization **********
-
- /**
- * The wrapped collection has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- CollectionListValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- CollectionListValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- CollectionListValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionListValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.list);
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
- public int size() {
- return this.list.size();
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageModel() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- // synch our list *after* we start listening to the collection holder,
- // since its value might change when a listener is added
- this.buildList();
- }
-
- @Override
- protected void disengageModel() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- // clear out the list when we are not listening to the collection holder
- this.list.clear();
- }
-
- protected void buildList() {
- // if the new collection is empty, do nothing
- int size = this.collectionHolder.size();
- if (size != 0) {
- this.buildList(size);
- }
- }
-
- protected void buildList(int size) {
- this.list.ensureCapacity(size);
- for (E each : this.collectionHolder) {
- this.list.add(each);
- }
- }
-
- protected void itemsAdded(CollectionAddEvent event) {
- this.addItemsToList(this.indexToAddItems(), this.getItems(event), this.list, LIST_VALUES);
- }
-
- protected int indexToAddItems() {
- return this.list.size();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- protected void itemsRemoved(CollectionRemoveEvent event) {
- this.removeItemsFromList(this.getItems(event), this.list, LIST_VALUES);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- protected void collectionCleared(@SuppressWarnings("unused") CollectionClearEvent event) {
- this.clearList(this.list, LIST_VALUES);
- }
-
- /**
- * synchronize our internal list with the wrapped collection
- * and fire the appropriate events
- */
- protected void collectionChanged(@SuppressWarnings("unused") CollectionChangeEvent event) {
- int size = this.collectionHolder.size();
- if (size == 0) {
- if (this.list.isEmpty()) {
- // no change
- } else {
- this.clearList(this.list, LIST_VALUES);
- }
- } else {
- if (this.list.isEmpty()) {
- this.buildList(size);
- this.fireItemsAdded(LIST_VALUES, 0, this.list);
- } else {
- this.list.clear();
- this.buildList(size);
- this.fireListChanged(LIST_VALUES, this.list);
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.list);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java
deleted file mode 100644
index d63ed69a57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionPropertyValueModelAdapter.java
+++ /dev/null
@@ -1,139 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a collection value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must override:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current collection value
- * </ul>
- * Subclasses might want to override the following methods
- * to improve performance (by not recalculating the value, if possible):<ul>
- * <li>{@link #itemsAdded(CollectionAddEvent event)}
- * <li>{@link #itemsRemoved(CollectionRemoveEvent event)}
- * <li>{@link #collectionCleared(CollectionClearEvent event)}
- * <li>{@link #collectionChanged(CollectionChangeEvent event)}
- * </ul>
- */
-public abstract class CollectionPropertyValueModelAdapter<V>
- extends AbstractPropertyValueModelAdapter<V>
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<?> collectionModel;
-
- /** A listener that allows us to synch with changes to the wrapped collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * collection value model.
- */
- protected CollectionPropertyValueModelAdapter(CollectionValueModel<?> collectionModel) {
- super();
- this.collectionModel = collectionModel;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- CollectionPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionPropertyValueModelAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the collection holder.
- */
- @Override
- protected void engageModel_() {
- this.collectionModel.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- /**
- * Stop listening to the collection holder.
- */
- @Override
- protected void disengageModel_() {
- this.collectionModel.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(@SuppressWarnings("unused") CollectionAddEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were removed from the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected void itemsRemoved(@SuppressWarnings("unused") CollectionRemoveEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped collection holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void collectionCleared(@SuppressWarnings("unused") CollectionClearEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The value of the wrapped collection holder has changed;
- * propagate the change notification appropriately.
- */
- protected void collectionChanged(@SuppressWarnings("unused") CollectionChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java
deleted file mode 100644
index 58d43231c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CollectionValueModelWrapper.java
+++ /dev/null
@@ -1,132 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another collection value model, "lazily" listen to it, and propagate
- * its change notifications. Subclasses must implement the appropriate
- * {@link CollectionValueModel}.
- */
-public abstract class CollectionValueModelWrapper<E>
- extends AbstractCollectionValueModel
-{
- /** The wrapped collection value model. */
- protected final CollectionValueModel<? extends E> collectionHolder;
-
- /** A listener that allows us to synch with changes to the wrapped collection holder. */
- protected final CollectionChangeListener collectionChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model.
- */
- protected CollectionValueModelWrapper(CollectionValueModel<? extends E> collectionHolder) {
- super();
- this.collectionHolder = collectionHolder;
- this.collectionChangeListener = this.buildCollectionChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildCollectionChangeListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- CollectionValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- CollectionValueModelWrapper.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- CollectionValueModelWrapper.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CollectionValueModelWrapper.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "collection change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** AbstractCollectionValueModel implementation **********
-
- /**
- * Start listening to the collection holder.
- */
- @Override
- protected void engageModel() {
- this.collectionHolder.addCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
- /**
- * Stop listening to the collection holder.
- */
- @Override
- protected void disengageModel() {
- this.collectionHolder.removeCollectionChangeListener(CollectionValueModel.VALUES, this.collectionChangeListener);
- }
-
-
- // ********** helper methods **********
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(CollectionRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(CollectionAddEvent event);
-
- /**
- * Items were removed from the wrapped collection holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(CollectionRemoveEvent event);
-
- /**
- * The wrapped collection holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void collectionCleared(CollectionClearEvent event);
-
- /**
- * The value of the wrapped collection holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void collectionChanged(CollectionChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeBooleanPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeBooleanPropertyValueModel.java
deleted file mode 100644
index 1bf5d25a46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeBooleanPropertyValueModel.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.utility.internal.model.value;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>CompositeBooleanPropertyValueModel</code> adapts a
- * {@link CollectionValueModel} holding boolean {@link PropertyValueModel}s
- * to a single boolean {@link PropertyValueModel}. The composite value is
- * determined by the {@link CompositeBooleanPropertyValueModel.Adapter} provided
- * at construction. Typically the composite will be either an AND or an OR of
- * all the boolean values.
- * <p>
- * If there are <em>no</em> boolean {@link PropertyValueModel}s, the composite
- * will return its default value; which, by default, is <code>null</code>.
- * <p>
- * <strong>NB:</strong> None of the wrapped boolean models can return a
- * <code>null</code> value or this class will throw an exception. The assumption
- * is that all the wrapped boolean models are configured with "default" values
- * that determine the model's value (TRUE or FALSE) when <code>null</code>.
- */
-public class CompositeBooleanPropertyValueModel
- extends CompositePropertyValueModel<Boolean>
-{
- /**
- * Calculation of the model's value is delegated to this adapter.
- */
- protected final Adapter adapter;
-
- /**
- * The default setting for the composite boolean property value model;
- * for when the underlying collection model is empty.
- * The default [default value] is <code>null</code>.
- */
- private final Boolean defaultValue;
-
-
- // ********** AND factory methods **********
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static CompositeBooleanPropertyValueModel and(PropertyValueModel<Boolean>... array) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, array);
- }
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static CompositeBooleanPropertyValueModel and(Boolean defaultValue, PropertyValueModel<Boolean>... array) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, defaultValue, array);
- }
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel and(Collection<E> collection) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, collection);
- }
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel and(Boolean defaultValue, Collection<E> collection) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, defaultValue, collection);
- }
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static CompositeBooleanPropertyValueModel and(CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, collectionModel);
- }
-
- /**
- * Construct a boolean property value model that is a composite AND of the
- * specified boolean property value models; i.e. the model's value is true
- * if all the contained models are true, otherwise its value is false.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static CompositeBooleanPropertyValueModel and(Boolean defaultValue, CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- return new CompositeBooleanPropertyValueModel(AND_ADAPTER, defaultValue, collectionModel);
- }
-
-
- // ********** OR factory methods **********
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static CompositeBooleanPropertyValueModel or(PropertyValueModel<Boolean>... array) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, array);
- }
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static CompositeBooleanPropertyValueModel or(Boolean defaultValue, PropertyValueModel<Boolean>... array) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, defaultValue, array);
- }
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel or(Collection<E> collection) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, collection);
- }
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel or(Boolean defaultValue, Collection<E> collection) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, defaultValue, collection);
- }
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public static CompositeBooleanPropertyValueModel or(CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, collectionModel);
- }
-
- /**
- * Construct a boolean property value model that is a composite OR of the
- * specified boolean property value models; i.e. the model's value is false
- * if all the contained models are false, otherwise its value is true.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public static CompositeBooleanPropertyValueModel or(Boolean defaultValue, CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- return new CompositeBooleanPropertyValueModel(OR_ADAPTER, defaultValue, collectionModel);
- }
-
-
- // ********** constructors **********
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public CompositeBooleanPropertyValueModel(Adapter adapter, PropertyValueModel<Boolean>... array) {
- this(adapter, null, array);
- }
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public CompositeBooleanPropertyValueModel(Adapter adapter, Boolean defaultValue, PropertyValueModel<Boolean>... array) {
- super(array);
- this.adapter = adapter;
- this.defaultValue = defaultValue;
- }
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel(Adapter adapter, Collection<E> collection) {
- this(adapter, null, collection);
- }
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public <E extends PropertyValueModel<Boolean>> CompositeBooleanPropertyValueModel(Adapter adapter, Boolean defaultValue, Collection<E> collection) {
- super(collection);
- this.adapter = adapter;
- this.defaultValue = defaultValue;
- }
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * The model's default value, when it contains no nested models, is
- * <code>null</code>.
- */
- public CompositeBooleanPropertyValueModel(Adapter adapter, CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- this(adapter, null, collectionModel);
- }
-
- /**
- * Construct a boolean property value model that is a composite of the specified
- * boolean property value models, as defined by the specified adapter.
- * When the model contains no nested models, its value will be the
- * specified default.
- */
- public CompositeBooleanPropertyValueModel(Adapter adapter, Boolean defaultValue, CollectionValueModel<? extends PropertyValueModel<Boolean>> collectionModel) {
- super(collectionModel);
- this.adapter = adapter;
- this.defaultValue = defaultValue;
- }
-
-
- // ********** implementation **********
-
- /**
- * Return true if all the contained booleans are true; otherwise return
- * false.
- */
- @Override
- protected Boolean buildValue() {
- return (this.collectionModel.size() == 0) ? this.defaultValue : this.buildValue_();
- }
-
- protected Boolean buildValue_() {
- return this.adapter.buildValue(this.getBooleans());
- }
-
- protected Iterable<Boolean> getBooleans() {
- return new TransformationIterable<PropertyValueModel<Boolean>, Boolean>(this.getCollectionModel()) {
- @Override
- protected Boolean transform(PropertyValueModel<Boolean> booleanModel) {
- return booleanModel.getValue();
- }
- };
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<? extends PropertyValueModel<Boolean>> getCollectionModel() {
- return (CollectionValueModel<? extends PropertyValueModel<Boolean>>) super.getCollectionModel();
- }
-
-
- // ********** adapter **********
-
- /**
- * This adapter allows the {@link CompositeBooleanPropertyValueModel} to be
- * pluggable.
- */
- public interface Adapter {
- /**
- * Return the composite boolean value of the specified collection
- * of boolean models.
- */
- Boolean buildValue(Iterable<Boolean> booleans);
- }
-
- /**
- * Return true if all the booleans are true; otherwise return false.
- */
- public static final Adapter AND_ADAPTER = new Adapter() {
- public Boolean buildValue(Iterable<Boolean> booleans) {
- for (Boolean b : booleans) {
- if ( ! b.booleanValue()) {
- return Boolean.FALSE;
- }
- }
- return Boolean.TRUE;
- }
- @Override
- public String toString() {
- return "AND_ADAPTER"; //$NON-NLS-1$
- }
- };
-
- /**
- * Return false if all the booleans are false; otherwise return true.
- */
- public static final Adapter OR_ADAPTER = new Adapter() {
- public Boolean buildValue(Iterable<Boolean> booleans) {
- for (Boolean b : booleans) {
- if (b.booleanValue()) {
- return Boolean.TRUE;
- }
- }
- return Boolean.FALSE;
- }
- @Override
- public String toString() {
- return "OR_ADAPTER"; //$NON-NLS-1$
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
deleted file mode 100644
index 66881df0b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeCollectionValueModel.java
+++ /dev/null
@@ -1,448 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.NullList;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>CompositeCollectionValueModel</code> wraps another
- * {@link CollectionValueModel} and uses a {@link Transformer}
- * to convert each item in the wrapped collection to yet another
- * {@link CollectionValueModel}. This composite collection contains
- * the combined items from all these component collections.
- * <p>
- * <strong>NB:</strong> The wrapped collection must be an "identity set" that does not
- * contain the same item twice or this class will throw an exception.
- * <p>
- * Terminology:<ul>
- * <li><em>sources</em> - the items in the wrapped collection value model; these
- * are converted into component CVMs by the transformer
- * <li><em>component CVMs</em> - the component collection value models that are combined
- * by this composite collection value model
- * <li><em>items</em> - the items held by the component CVMs
- * </ul>
- */
-public class CompositeCollectionValueModel<E1, E2>
- extends CollectionValueModelWrapper<E1>
- implements CollectionValueModel<E2>
-{
- /**
- * This is the (optional) user-supplied object that transforms
- * the items in the wrapped collection to collection value models.
- */
- private final Transformer<E1, CollectionValueModel<E2>> transformer;
-
- /**
- * Cache of the component collection value models that
- * were generated by the transformer; keyed by the item
- * in the wrapped collection that was passed to the transformer.
- */
- private final IdentityHashMap<E1, CollectionValueModel<E2>> componentCVMs =
- new IdentityHashMap<E1, CollectionValueModel<E2>>();
-
- /**
- * Cache of the collections corresponding to the component
- * collection value models above; keyed by the component
- * collection value models.
- * Use {@link ArrayList}s so we can use {@link ArrayList}-specific methods
- * (e.g. {@link ArrayList#clone()} and {@link ArrayList#ensureCapacity(int)}).
- */
- private final IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>> collections =
- new IdentityHashMap<CollectionValueModel<E2>, ArrayList<E2>>();
-
- /** Listener that listens to all the component collection value models. */
- private final CollectionChangeListener componentCVMListener;
-
- /** Cache the size of the composite collection. */
- private int size;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model. Use this constructor if<ul>
- * <li> the wrapped collection value model already contains other
- * collection value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeCollectionValueModel(CollectionValueModel<? extends E1> collectionHolder) {
- this(collectionHolder, Transformer.Null.<E1, CollectionValueModel<E2>>instance());
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and transformer.
- */
- public CompositeCollectionValueModel(CollectionValueModel<? extends E1> collectionHolder, Transformer<E1, CollectionValueModel<E2>> transformer) {
- super(collectionHolder);
- this.transformer = transformer;
- this.componentCVMListener = this.buildComponentListener();
- this.size = 0;
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model. Use this constructor if<ul>
- * <li> the wrapped collection value model already contains other
- * collection value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeCollectionValueModel(ListValueModel<? extends E1> listHolder) {
- this(new ListCollectionValueModelAdapter<E1>(listHolder));
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and transformer.
- */
- public CompositeCollectionValueModel(ListValueModel<? extends E1> listHolder, Transformer<E1, CollectionValueModel<E2>> transformer) {
- this(new ListCollectionValueModelAdapter<E1>(listHolder), transformer);
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection. Use this constructor if<ul>
- * <li> the wrapped collection value model already contains other
- * collection value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeCollectionValueModel(Collection<? extends E1> collection) {
- this(new StaticCollectionValueModel<E1>(collection));
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection and transformer.
- */
- public CompositeCollectionValueModel(Collection<? extends E1> collection, Transformer<E1, CollectionValueModel<E2>> transformer) {
- this(new StaticCollectionValueModel<E1>(collection), transformer);
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection. Use this constructor if<ul>
- * <li> the wrapped collection value model already contains other
- * collection value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeCollectionValueModel(E1... collection) {
- this(new StaticCollectionValueModel<E1>(collection));
- }
-
- /**
- * Construct a collection value model with the specified, unchanging, wrapped
- * collection and transformer.
- */
- public CompositeCollectionValueModel(E1[] collection, Transformer<E1, CollectionValueModel<E2>> transformer) {
- this(new StaticCollectionValueModel<E1>(collection), transformer);
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildComponentListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- CompositeCollectionValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- CompositeCollectionValueModel.this.componentItemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- CompositeCollectionValueModel.this.componentCollectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- CompositeCollectionValueModel.this.componentCollectionChanged(event);
- }
- @Override
- public String toString() {
- return "component listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E2> iterator() {
- return new CompositeIterator<E2>(this.buildCollectionsIterators());
- }
-
- protected Iterator<Iterator<E2>> buildCollectionsIterators() {
- return new TransformationIterator<ArrayList<E2>, Iterator<E2>>(this.collections.values().iterator()) {
- @Override
- protected Iterator<E2> transform(ArrayList<E2> next) {
- return next.iterator();
- }
- };
- }
-
- public int size() {
- return this.size;
- }
-
-
- // ********** CollectionValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the wrapped collection,
- // since its value might change when a listener is added
- this.addAllComponentSources();
- }
-
- /**
- * Transform all the sources to collection value models
- * and add their items to our cache, with no event notification.
- */
- protected void addAllComponentSources() {
- for (E1 source : this.collectionHolder) {
- this.addComponentSource(source, NullList.<E2>instance());
- }
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // stop listening to the components...
- for (CollectionValueModel<E2> componentCVM : this.componentCVMs.values()) {
- componentCVM.removeCollectionChangeListener(VALUES, this.componentCVMListener);
- }
- // ...and clear the cache
- this.componentCVMs.clear();
- this.collections.clear();
- this.size = 0;
- }
-
- /**
- * Some component sources were added;
- * add their corresponding items to our cache.
- */
- @Override
- protected void itemsAdded(CollectionAddEvent event) {
- ArrayList<E2> addedItems = new ArrayList<E2>();
- for (E1 item : this.getItems(event)) {
- this.addComponentSource(item, addedItems);
- }
- this.fireItemsAdded(VALUES, addedItems);
- }
-
- /**
- * Transform the specified source to a collection value model
- * and add its items to our cache and the "collecting parameter".
- */
- protected void addComponentSource(E1 source, List<E2> addedItems) {
- CollectionValueModel<E2> componentCVM = this.transform(source);
- if (this.componentCVMs.put(source, componentCVM) != null) {
- throw new IllegalStateException("duplicate component: " + source); //$NON-NLS-1$
- }
- componentCVM.addCollectionChangeListener(VALUES, this.componentCVMListener);
- ArrayList<E2> componentCollection = new ArrayList<E2>(componentCVM.size());
- if (this.collections.put(componentCVM, componentCollection) != null) {
- throw new IllegalStateException("duplicate collection: " + source); //$NON-NLS-1$
- }
- this.addComponentItems(componentCVM, componentCollection);
- addedItems.addAll(componentCollection);
- }
-
- /**
- * Add the items in the specified component CVM to the specified component
- * collection.
- */
- protected void addComponentItems(CollectionValueModel<E2> componentCVM, ArrayList<E2> componentCollection) {
- int itemsSize = componentCVM.size();
- this.size += itemsSize;
- componentCollection.ensureCapacity(componentCollection.size() + itemsSize);
- CollectionTools.addAll(componentCollection, componentCVM);
- }
-
- /**
- * Some component sources were removed;
- * remove their corresponding items from our cache.
- */
- @Override
- protected void itemsRemoved(CollectionRemoveEvent event) {
- ArrayList<E2> removedItems = new ArrayList<E2>();
- for (E1 item : this.getItems(event)) {
- this.removeComponentSource(item, removedItems);
- }
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- /**
- * Remove the items corresponding to the specified source
- * from our cache.
- */
- protected void removeComponentSource(E1 source, List<E2> removedItems) {
- CollectionValueModel<E2> componentCVM = this.componentCVMs.remove(source);
- if (componentCVM == null) {
- throw new IllegalStateException("missing component: " + source); //$NON-NLS-1$
- }
- componentCVM.removeCollectionChangeListener(VALUES, this.componentCVMListener);
- ArrayList<E2> componentCollection = this.collections.remove(componentCVM);
- if (componentCollection == null) {
- throw new IllegalStateException("missing collection: " + source); //$NON-NLS-1$
- }
- removedItems.addAll(componentCollection);
- this.removeComponentItems(componentCollection);
- }
-
- /**
- * Update our size and collection cache.
- */
- protected void removeComponentItems(ArrayList<E2> componentCollection) {
- this.size -= componentCollection.size();
- componentCollection.clear();
- }
-
- /**
- * The component sources cleared;
- * clear our cache.
- */
- @Override
- protected void collectionCleared(CollectionClearEvent event) {
- this.removeAllComponentSources();
- this.fireCollectionCleared(VALUES);
- }
-
- protected void removeAllComponentSources() {
- // copy the keys so we don't eat our own tail
- ArrayList<E1> copy = new ArrayList<E1>(this.componentCVMs.keySet());
- for (E1 source : copy) {
- this.removeComponentSource(source, NullList.<E2>instance());
- }
- }
-
- /**
- * The component sources changed;
- * rebuild our cache.
- */
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.removeAllComponentSources();
- this.addAllComponentSources();
- this.fireCollectionChanged(VALUES, CollectionTools.collection(this.iterator()));
- }
-
-
- // ********** internal methods **********
-
- /**
- * Transform the specified object into a collection value model.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Transformer}.
- */
- protected CollectionValueModel<E2> transform(E1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * One of the component collections had items added;
- * synchronize our caches.
- */
- protected void componentItemsAdded(CollectionAddEvent event) {
- int itemsSize = event.getItemsSize();
- this.size += itemsSize;
-
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- componentCollection.ensureCapacity(componentCollection.size() + itemsSize);
-
- this.addItemsToCollection(this.getComponentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections had items removed;
- * synchronize our caches.
- */
- protected void componentItemsRemoved(CollectionRemoveEvent event) {
- this.size -= event.getItemsSize();
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- this.removeItemsFromCollection(this.getComponentItems(event), componentCollection, VALUES);
- }
-
- /**
- * One of the component collections was cleared;
- * synchronize our caches by clearing out the appropriate
- * collection.
- */
- protected void componentCollectionCleared(CollectionClearEvent event) {
- ArrayList<E2> componentCollection = this.collections.get(this.componentCVM(event));
- ArrayList<E2> removedItems = new ArrayList<E2>(componentCollection);
- this.removeComponentItems(componentCollection);
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- /**
- * One of the component collections changed;
- * synchronize our caches by clearing out the appropriate
- * collection and then rebuilding it.
- */
- protected void componentCollectionChanged(CollectionChangeEvent event) {
- CollectionValueModel<E2> componentCVM = this.componentCVM(event);
- ArrayList<E2> componentCollection = this.collections.get(componentCVM);
- this.removeComponentItems(componentCollection);
- this.addComponentItems(componentCVM, componentCollection);
- this.fireCollectionChanged(VALUES, CollectionTools.collection(this.iterator()));
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E2> getComponentItems(CollectionAddEvent event) {
- return (Iterable<E2>) event.getItems();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E2> getComponentItems(CollectionRemoveEvent event) {
- return (Iterable<E2>) event.getItems();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<E2> componentCVM(CollectionEvent event) {
- return (CollectionValueModel<E2>) event.getSource();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java
deleted file mode 100644
index b454a0141d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositeListValueModel.java
+++ /dev/null
@@ -1,683 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationListIterator;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>CompositeListValueModel</code> wraps another
- * {@link ListValueModel} and uses a {@link Transformer}
- * to convert each item in the wrapped list to yet another
- * {@link ListValueModel}. This composite list contains
- * the combined items from all these component lists.
- * <p>
- * Terminology:<ul>
- * <li><em>sources</em> - the items in the wrapped list value model; these
- * are converted into component LVMs by the transformer
- * <li><em>component LVMs</em> - the component list value models that are combined
- * by this composite list value model
- * <li><em>items</em> - the items held by the component LVMs
- * </ul>
- */
-public class CompositeListValueModel<E1, E2>
- extends ListValueModelWrapper<E1>
- implements ListValueModel<E2>
-{
- /**
- * This is the (optional) user-supplied object that transforms
- * the items in the wrapped list to list value models.
- */
- private final Transformer<E1, ListValueModel<E2>> transformer;
-
- /**
- * Cache of the sources, component LVMs, lists.
- */
- private final ArrayList<Info> infoList = new ArrayList<Info>();
- protected class Info {
- // the object passed to the transformer
- final E1 source;
- // the list value model generated by the transformer
- final ListValueModel<E2> componentLVM;
- // cache of the items held by the component LVM
- final ArrayList<E2> items;
- // the component LVM's beginning index within the composite LVM
- int begin;
- protected Info(E1 source, ListValueModel<E2> componentLVM, ArrayList<E2> items, int begin) {
- super();
- this.source = source;
- this.componentLVM = componentLVM;
- this.items = items;
- this.begin = begin;
- }
- }
-
- /** Listener that listens to all the component list value models. */
- private final ListChangeListener componentLVMListener;
-
- /** Cache the size of the composite list. */
- private int size;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model. Use this constructor if<ul>
- * <li> the wrapped list value model already contains other
- * list value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeListValueModel(ListValueModel<? extends E1> listHolder) {
- this(listHolder, Transformer.Null.<E1, ListValueModel<E2>>instance());
- }
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model and transformer.
- */
- public CompositeListValueModel(ListValueModel<? extends E1> listHolder, Transformer<E1, ListValueModel<E2>> transformer) {
- super(listHolder);
- this.transformer = transformer;
- this.componentLVMListener = this.buildComponentLVMListener();
- this.size = 0;
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list. Use this constructor if<ul>
- * <li> the wrapped list value model already contains other
- * list value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeListValueModel(List<? extends E1> list) {
- this(new StaticListValueModel<E1>(list));
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list and transformer.
- */
- public CompositeListValueModel(List<? extends E1> list, Transformer<E1, ListValueModel<E2>> transformer) {
- this(new StaticListValueModel<E1>(list), transformer);
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list. Use this constructor if<ul>
- * <li> the wrapped list value model already contains other
- * list value models, or
- * <li> you want to override {@link #transform(E1)}
- * instead of building a {@link Transformer}
- * </ul>
- */
- public CompositeListValueModel(E1... list) {
- this(new StaticListValueModel<E1>(list));
- }
-
- /**
- * Construct a list value model with the specified, unchanging, wrapped
- * list and transformer.
- */
- public CompositeListValueModel(E1[] list, Transformer<E1, ListValueModel<E2>> transformer) {
- this(new StaticListValueModel<E1>(list), transformer);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildComponentLVMListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- CompositeListValueModel.this.componentItemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- CompositeListValueModel.this.componentItemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- CompositeListValueModel.this.componentItemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- CompositeListValueModel.this.componentItemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- CompositeListValueModel.this.componentListCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- CompositeListValueModel.this.componentListChanged(event);
- }
- @Override
- public String toString() {
- return "component LVM listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public E2 get(int index) {
- if ((index < 0) || (index >= this.size)) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + this.size); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // move backwards through the info list
- for (int i = this.infoList.size(); i-- > 0; ) {
- Info info = this.infoList.get(i);
- if (index >= info.begin) {
- return info.items.get(index - info.begin);
- }
- }
- throw new IllegalStateException(); // something is wack
- }
-
- public Iterator<E2> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E2> listIterator() {
- return new ReadOnlyCompositeListIterator<E2>(this.buildListsIterators());
- }
-
- protected ListIterator<ListIterator<E2>> buildListsIterators() {
- return new TransformationListIterator<Info, ListIterator<E2>>(this.infoList.listIterator()) {
- @Override
- protected ListIterator<E2> transform(Info info) {
- return info.items.listIterator();
- }
- };
- }
-
- public int size() {
- return this.size;
- }
-
- public Object[] toArray() {
- return ArrayTools.array(this.listIterator(), this.size);
- }
-
-
- // ********** ListValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the wrapped list,
- // since its value might change when a listener is added
- this.addComponentSources(0, this.listHolder, this.listHolder.size(), false); // false = do not fire event
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // stop listening to the component LVMs...
- for (Info info : this.infoList) {
- info.componentLVM.removeListChangeListener(LIST_VALUES, this.componentLVMListener);
- }
- // ...and clear the cache
- this.infoList.clear();
- this.size = 0;
- }
-
- /**
- * Some component sources were added; update our cache.
- */
- @Override
- protected void itemsAdded(ListAddEvent event) {
- this.addComponentSources(event.getIndex(), this.getItems(event), event.getItemsSize(), true); // true = fire event
- }
-
- /**
- * Add infos corresponding to the specified sources to our cache.
- * Fire the appropriate event if requested.
- */
- protected void addComponentSources(int addedSourcesIndex, Iterable<? extends E1> addedSources, int addedSourcesSize, boolean fireEvent) {
- ArrayList<Info> newInfoList = new ArrayList<Info>(addedSourcesSize);
- // the 'items' are either tacked on to the end or
- // at the 'begin' index of the first 'info' that is being pushed back
- int newItemsIndex = (addedSourcesIndex == this.infoList.size()) ? this.size : this.infoList.get(addedSourcesIndex).begin;
-
- int begin = newItemsIndex;
- for (E1 source : addedSources) {
- ListValueModel<E2> componentLVM = this.transform(source);
- componentLVM.addListChangeListener(LIST_VALUES, this.componentLVMListener);
- ArrayList<E2> items = new ArrayList<E2>(componentLVM.size());
- CollectionTools.addAll(items, componentLVM.listIterator());
- newInfoList.add(new Info(source, componentLVM, items, begin));
- begin += items.size();
- }
- this.infoList.addAll(addedSourcesIndex, newInfoList);
- int newItemsSize = begin - newItemsIndex;
- this.size += newItemsSize;
-
- // bump the 'begin' index for all the infos that were pushed back by the insert
- int movedInfosIndex = addedSourcesIndex + addedSourcesSize;
- for (int i = movedInfosIndex; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += newItemsSize;
- }
-
- if (fireEvent) {
- ArrayList<E2> newItems = new ArrayList<E2>(newItemsSize);
- for (int i = addedSourcesIndex; i < movedInfosIndex; i++) {
- newItems.addAll(this.infoList.get(i).items);
- }
- this.fireItemsAdded(LIST_VALUES, newItemsIndex, newItems);
- }
- }
-
- /**
- * Some component sources were removed; update our cache.
- */
- @Override
- protected void itemsRemoved(ListRemoveEvent event) {
- this.removeComponentSources(event.getIndex(), event.getItemsSize(), true); // true = fire event
- }
-
- /**
- * Remove the infos corresponding to the specified sources from our cache.
- */
- protected void removeComponentSources(int removedSourcesIndex, int removedSourcesSize, boolean fireEvent) {
- int removedItemsIndex = this.infoList.get(removedSourcesIndex).begin;
- int movedSourcesIndex = removedSourcesIndex + removedSourcesSize;
- int movedItemsIndex = (movedSourcesIndex == this.infoList.size()) ? this.size : this.infoList.get(movedSourcesIndex).begin;
- int removedItemsSize = movedItemsIndex - removedItemsIndex;
- this.size -= removedItemsSize;
-
- List<Info> subList = this.infoList.subList(removedSourcesIndex, removedSourcesIndex + removedSourcesSize);
- ArrayList<Info> removedInfoList = new ArrayList<Info>(subList); // make a copy
- subList.clear();
-
- // decrement the 'begin' index for all the infos that were moved forward by the deletes
- for (int i = removedSourcesIndex; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
-
- for (Info removedInfo : removedInfoList) {
- removedInfo.componentLVM.removeListChangeListener(LIST_VALUES, this.componentLVMListener);
- }
-
- if (fireEvent) {
- ArrayList<E2> removedItems = new ArrayList<E2>(removedItemsSize);
- for (Info removedInfo : removedInfoList) {
- removedItems.addAll(removedInfo.items);
- }
- this.fireItemsRemoved(LIST_VALUES, removedItemsIndex, removedItems);
- }
- }
-
- /**
- * Some component sources were replaced; update our cache.
- */
- @Override
- protected void itemsReplaced(ListReplaceEvent event) {
- this.replaceComponentSources(event.getIndex(), this.getNewItems(event), event.getItemsSize(), true); // true = fire event
- }
-
- /**
- * Replaced component sources will not (typically) map to a set of replaced
- * items, so we remove and add the corresponding lists of items, resulting in
- * two events.
- */
- protected void replaceComponentSources(int replacedSourcesIndex, Iterable<? extends E1> newSources, int replacedSourcesSize, boolean fireEvent) {
- this.removeComponentSources(replacedSourcesIndex, replacedSourcesSize, fireEvent);
- this.addComponentSources(replacedSourcesIndex, newSources, replacedSourcesSize, fireEvent);
- }
-
- /**
- * Some component sources were moved; update our cache.
- */
- @Override
- protected void itemsMoved(ListMoveEvent event) {
- this.moveComponentSources(event.getTargetIndex(), event.getSourceIndex(), event.getLength(), true); // true = fire event
- }
-
- protected void moveComponentSources(int targetSourcesIndex, int sourceSourcesIndex, int movedSourcesLength, boolean fireEvent) {
- int sourceItemsIndex = this.infoList.get(sourceSourcesIndex).begin;
-
- int nextSourceSourceIndex = sourceSourcesIndex + movedSourcesLength;
- int nextSourceItemIndex = (nextSourceSourceIndex == this.infoList.size()) ? this.size : this.infoList.get(nextSourceSourceIndex).begin;
- int moveItemsLength = nextSourceItemIndex - sourceItemsIndex;
-
- int targetItemsIndex = -1;
- if (sourceSourcesIndex > targetSourcesIndex) {
- // move from high to low index
- targetItemsIndex = this.infoList.get(targetSourcesIndex).begin;
- } else {
- // move from low to high index (higher items move down during move)
- int nextTargetSourceIndex = targetSourcesIndex + movedSourcesLength;
- targetItemsIndex = (nextTargetSourceIndex == this.infoList.size()) ? this.size : this.infoList.get(nextTargetSourceIndex).begin;
- targetItemsIndex = targetItemsIndex - moveItemsLength;
- }
-
- CollectionTools.move(this.infoList, targetSourcesIndex, sourceSourcesIndex, movedSourcesLength);
-
- // update the 'begin' indexes of all the affected 'infos'
- int min = Math.min(targetSourcesIndex, sourceSourcesIndex);
- int max = Math.max(targetSourcesIndex, sourceSourcesIndex) + movedSourcesLength;
- int begin = Math.min(targetItemsIndex, sourceItemsIndex);
- for (int i = min; i < max; i++) {
- Info info = this.infoList.get(i);
- info.begin = begin;
- begin += info.componentLVM.size();
- }
-
- if (fireEvent) {
- this.fireItemsMoved(LIST_VALUES, targetItemsIndex, sourceItemsIndex, moveItemsLength);
- }
- }
-
- /**
- * The component sources were cleared; clear our cache.
- */
- @Override
- protected void listCleared(ListClearEvent event) {
- this.clearComponentSources();
- }
-
- protected void clearComponentSources() {
- this.removeComponentSources(0, this.infoList.size(), false); // false = do not fire event
- this.fireListCleared(LIST_VALUES);
- }
-
- /**
- * The component sources changed; rebuild our cache.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- int newSize = this.listHolder.size();
- if (newSize == 0) {
- this.clearComponentSources();
- return;
- }
-
- int oldSize = this.infoList.size();
- if (oldSize == 0) {
- this.addComponentSources(0, this.listHolder, newSize, true); // true = fire event
- return;
- }
-
- int min = Math.min(newSize, oldSize);
- // handle replaced sources individually so we don't fire events for unchanged sources
- for (int i = 0; i < min; i++) {
- E1 newSource = this.listHolder.get(i);
- E1 oldSource = this.infoList.get(i).source;
- if (this.valuesAreDifferent(newSource, oldSource)) {
- this.replaceComponentSources(i, new SingleElementIterable<E1>(newSource), 1, true); // true = fire event
- }
- }
-
- if (newSize == oldSize) {
- return;
- }
-
- if (newSize < oldSize) {
- this.removeComponentSources(min, oldSize - newSize, true); // true = fire event
- return;
- }
-
- // newSize > oldSize
- this.addComponentSources(min, this.buildSubListHolder(min), newSize - oldSize, true); // true = fire event
- }
-
- protected Iterable<? extends E1> buildSubListHolder(int fromIndex) {
- int listHolderSize = this.listHolder.size();
- return CollectionTools.list(this.listHolder, listHolderSize).subList(fromIndex, listHolderSize);
- }
-
- protected Iterable<? extends E1> buildSubListHolder(int fromIndex, int toIndex) {
- int listHolderSize = this.listHolder.size();
- return ((fromIndex == 0) && (toIndex == listHolderSize)) ?
- this.listHolder :
- CollectionTools.list(this.listHolder, listHolderSize).subList(fromIndex, toIndex);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-
- // ********** internal methods **********
-
- /**
- * Transform the specified object into a list value model.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Transformer}.
- */
- protected ListValueModel<E2> transform(E1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * Return the index of the specified component LVM.
- */
- protected int indexOf(ListValueModel<E2> componentLVM) {
- for (int i = 0; i < this.infoList.size(); i++) {
- if (this.infoList.get(i).componentLVM == componentLVM) {
- return i;
- }
- }
- throw new IllegalArgumentException("invalid component LVM: " + componentLVM); //$NON-NLS-1$
- }
-
- /**
- * Return the index of the specified event's component LVM.
- */
- protected int indexFor(ListEvent event) {
- return this.indexOf(this.getComponentLVM(event));
- }
-
- /**
- * Items were added to one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsAdded(ListAddEvent event) {
- int componentLVMIndex = this.indexFor(event);
- this.addComponentItems(componentLVMIndex, this.infoList.get(componentLVMIndex), event.getIndex(), this.getComponentItems(event), event.getItemsSize());
- }
-
- protected void addComponentItems(int componentLVMIndex, Info info, int addedItemsIndex, Iterable<E2> addedItems, int addedItemsSize) {
- // update the affected 'begin' indices
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += addedItemsSize;
- }
- this.size += addedItemsSize;
-
- // synchronize the cached list
- CollectionTools.addAll(info.items, addedItemsIndex, addedItems, addedItemsSize);
-
- // translate the event
- this.fireItemsAdded(LIST_VALUES, info.begin + addedItemsIndex, info.items.subList(addedItemsIndex, addedItemsIndex + addedItemsSize));
- }
-
- /**
- * Items were removed from one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsRemoved(ListRemoveEvent event) {
- // update the affected 'begin' indices
- int componentLVMIndex = this.indexFor(event);
- int removedItemsSize = event.getItemsSize();
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
- this.size -= removedItemsSize;
-
- // synchronize the cached list
- Info info = this.infoList.get(componentLVMIndex);
- int itemIndex = event.getIndex();
- info.items.subList(itemIndex, itemIndex + event.getItemsSize()).clear();
-
- // translate the event
- this.fireItemsRemoved(event.clone(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were replaced in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsReplaced(ListReplaceEvent event) {
- // no changes to the 'begin' indices or size
-
- // synchronize the cached list
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- int i = event.getIndex();
- for (E2 item : this.getComponentItems(event)) {
- info.items.set(i++, item);
- }
-
- // translate the event
- this.fireItemsReplaced(event.clone(this, LIST_VALUES, info.begin));
- }
-
- /**
- * Items were moved in one of the component lists;
- * synchronize our cache.
- */
- protected void componentItemsMoved(ListMoveEvent event) {
- // no changes to the 'begin' indices or size
-
- // synchronize the cached list
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
- CollectionTools.move(info.items, event.getTargetIndex(), event.getSourceIndex(), event.getLength());
-
- // translate the event
- this.fireItemsMoved(event.clone(this, LIST_VALUES, info.begin));
- }
-
- /**
- * One of the component lists was cleared;
- * synchronize our cache.
- */
- protected void componentListCleared(ListClearEvent event) {
- int componentLVMIndex = this.indexFor(event);
- this.clearComponentList(componentLVMIndex, this.infoList.get(componentLVMIndex));
- }
-
- protected void clearComponentList(int componentLVMIndex, Info info) {
- // update the affected 'begin' indices
- int removedItemsSize = info.items.size();
- if (removedItemsSize == 0) {
- return;
- }
-
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin -= removedItemsSize;
- }
- this.size -= removedItemsSize;
-
- // synchronize the cached list
- ArrayList<E2> items = new ArrayList<E2>(info.items); // make a copy
- info.items.clear();
-
- // translate the event
- this.fireItemsRemoved(LIST_VALUES, info.begin, items);
- }
-
- /**
- * One of the component lists changed;
- * synchronize our cache by synchronizing the appropriate
- * list and firing the appropriate events.
- */
- protected void componentListChanged(ListChangeEvent event) {
- int componentLVMIndex = this.indexFor(event);
- Info info = this.infoList.get(componentLVMIndex);
-
- int newItemsSize = info.componentLVM.size();
- if (newItemsSize == 0) {
- this.clearComponentList(componentLVMIndex, info);
- return;
- }
-
- int oldItemsSize = info.items.size();
- if (oldItemsSize == 0) {
- this.addComponentItems(componentLVMIndex, info, 0, info.componentLVM, newItemsSize);
- return;
- }
-
- int min = Math.min(newItemsSize, oldItemsSize);
- // handle replaced items individually so we don't fire events for unchanged items
- for (int i = 0; i < min; i++) {
- E2 newItem = info.componentLVM.get(i);
- E2 oldItem = info.items.set(i, newItem);
- this.fireItemReplaced(LIST_VALUES, info.begin + i, newItem, oldItem);
- }
-
- int delta = newItemsSize - oldItemsSize;
- if (delta == 0) { // newItemsSize == oldItemsSize
- return;
- }
-
- for (int i = componentLVMIndex + 1; i < this.infoList.size(); i++) {
- this.infoList.get(i).begin += delta;
- }
- this.size += delta;
-
- if (delta < 0) { // newItemsSize < oldItemsSize
- List<E2> subList = info.items.subList(newItemsSize, oldItemsSize);
- ArrayList<E2> removedItems = new ArrayList<E2>(subList); // make a copy
- subList.clear();
- this.fireItemsRemoved(LIST_VALUES, info.begin + newItemsSize, removedItems);
- return;
- }
-
- // newItemsSize > oldItemsSize
- ArrayList<E2> addedItems = new ArrayList<E2>(delta);
- for (int i = oldItemsSize; i < newItemsSize; i++) {
- addedItems.add(info.componentLVM.get(i));
- }
- info.items.addAll(addedItems);
- this.fireItemsAdded(LIST_VALUES, info.begin + oldItemsSize, addedItems);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E2> getComponentItems(ListAddEvent event) {
- return (Iterable<E2>) event.getItems();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E2> getComponentItems(ListReplaceEvent event) {
- return (Iterable<E2>) event.getNewItems();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected ListValueModel<E2> getComponentLVM(ListEvent event) {
- return (ListValueModel<E2>) event.getSource();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositePropertyValueModel.java
deleted file mode 100644
index 149500cc1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/CompositePropertyValueModel.java
+++ /dev/null
@@ -1,198 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.IdentityHashBag;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>CompositePropertyValueModel</code> adapts a
- * {@link CollectionValueModel} holding other {@link PropertyValueModel}s
- * to a single {@link PropertyValueModel}.
- * <p>
- * Subclasses must implement:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * component values
- * </ul>
- * <strong>NB:</strong> The wrapped collection must not contain any duplicates
- * or this class will throw an exception.
- */
-public abstract class CompositePropertyValueModel<V>
- extends CollectionPropertyValueModelAdapter<V>
-{
- /**
- * Cache the component property value models so we can stop listening to
- * them when they are removed from the collection value model.
- */
- protected final IdentityHashBag<PropertyValueModel<?>> componentPVMs =
- new IdentityHashBag<PropertyValueModel<?>>();
-
- /**
- * Listen to every property value model in the collection value model.
- * If one changes, we need to re-calculate our value.
- */
- protected final PropertyChangeListener propertyChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a property value model that is a composite of the specified
- * property value models.
- */
- public CompositePropertyValueModel(PropertyValueModel<?>... collection) {
- this(Arrays.asList(collection));
- }
-
- /**
- * Construct a property value model that is a composite of the specified
- * property value models.
- */
- public <E extends PropertyValueModel<?>> CompositePropertyValueModel(Collection<E> collection) {
- this(new StaticCollectionValueModel<E>(collection));
- }
-
- /**
- * Construct a property value model that is a composite of the specified
- * property value models.
- */
- public CompositePropertyValueModel(CollectionValueModel<? extends PropertyValueModel<?>> collectionModel) {
- super(collectionModel);
- this.propertyChangeListener = this.buildPropertyChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- CompositePropertyValueModel.this.propertyChanged(event);
- }
- @Override
- public String toString() {
- return "property change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Subclasses can override this method if the event can be used to improve
- * the performance of building a new value (e.g. some property changes may
- * not necessitate the re-calculation of the value).
- */
- protected void propertyChanged(@SuppressWarnings("unused") PropertyChangeEvent event) {
- this.propertyChanged();
- }
-
-
- // ********** CollectionPropertyValueModelAdapter overrides **********
-
- @Override
- protected void engageModel_() {
- super.engageModel_();
- this.addComponentPVMs(this.getCollectionModel());
- }
-
- protected <E extends PropertyValueModel<?>> void addComponentPVMs(Iterable<E> pvms) {
- for (PropertyValueModel<?> each : pvms) {
- this.componentPVMs.add(each);
- each.addPropertyChangeListener(VALUE, this.propertyChangeListener);
- }
- }
-
- @Override
- protected void disengageModel_() {
- this.removeComponentPVMs(this.getCollectionModel());
- super.disengageModel_();
- }
-
- protected <E extends PropertyValueModel<?>> void removeComponentPVMs(Iterable<E> pvms) {
- for (PropertyValueModel<?> each : pvms) {
- each.removePropertyChangeListener(VALUE, this.propertyChangeListener);
- this.componentPVMs.remove(each);
- }
- }
-
- @Override
- protected void itemsAdded(CollectionAddEvent event) {
- this.addComponentPVMs(this.getItems(event));
- super.itemsAdded(event);
- }
-
- @Override
- protected void itemsRemoved(CollectionRemoveEvent event) {
- this.removeComponentPVMs(this.getItems(event));
- super.itemsRemoved(event);
- }
-
- @Override
- protected void collectionCleared(CollectionClearEvent event) {
- this.removeAllComponentPVMs();
- super.collectionCleared(event);
- }
-
- protected void removeAllComponentPVMs() {
- // copy the list so we don't eat our own tail
- ArrayList<PropertyValueModel<?>> copy = new ArrayList<PropertyValueModel<?>>(this.componentPVMs);
- this.removeComponentPVMs(copy);
- }
-
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.removeAllComponentPVMs();
- this.addComponentPVMs(this.getCollectionModel());
- super.collectionChanged(event);
- }
-
-
- // ********** convenience methods **********
-
- /**
- * Our constructor accepts only a {@link CollectionValueModel}{@code<? extends }{@link PropertyValueModel}{@code<?>>}.
- */
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected CollectionValueModel<? extends PropertyValueModel<?>> getCollectionModel() {
- return (CollectionValueModel<? extends PropertyValueModel<?>>) this.collectionModel;
- }
-
- /**
- * Our constructor accepts only a {@link CollectionValueModel}{@code<? extends }{@link PropertyValueModel}{@code<?>>}.
- */
- @SuppressWarnings("unchecked")
- protected Iterable<? extends PropertyValueModel<?>> getItems(CollectionAddEvent event) {
- return (Iterable<? extends PropertyValueModel<?>>) event.getItems();
- }
-
- /**
- * Our constructor accepts only a {@link CollectionValueModel}{@code<? extends }{@link PropertyValueModel}{@code<?>>}.
- */
- @SuppressWarnings("unchecked")
- protected Iterable<? extends PropertyValueModel<?>> getItems(CollectionRemoveEvent event) {
- return (Iterable<? extends PropertyValueModel<?>>) event.getItems();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java
deleted file mode 100644
index 27081444d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ExtendedListValueModelWrapper.java
+++ /dev/null
@@ -1,211 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyCompositeListIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This wrapper extends a {@link ListValueModel} (or {@link CollectionValueModel})
- * with fixed collections of items on either end.
- * <p>
- * <strong>NB:</strong> Be careful using or wrapping this list value model, since the
- * "extended" items may be unexpected by the client code or wrapper.
- */
-public class ExtendedListValueModelWrapper<E>
- extends ListValueModelWrapper<E>
- implements ListValueModel<E>
-{
- /** the items "prepended" to the wrapped list */
- protected List<E> prefix;
-
- /** the items "appended" to the wrapped list */
- protected List<E> suffix;
-
-
- // ********** lots o' constructors **********
-
- /**
- * Extend the specified list with a prefix and suffix.
- */
- public ExtendedListValueModelWrapper(List<? extends E> prefix, ListValueModel<? extends E> listHolder, List<? extends E> suffix) {
- super(listHolder);
- this.prefix = new ArrayList<E>(prefix);
- this.suffix = new ArrayList<E>(suffix);
- }
-
- /**
- * Extend the specified list with a prefix and suffix.
- */
- public ExtendedListValueModelWrapper(E prefix, ListValueModel<? extends E> listHolder, E suffix) {
- super(listHolder);
- this.prefix = Collections.singletonList(prefix);
- this.suffix = Collections.singletonList(suffix);
- }
-
- /**
- * Extend the specified list with a prefix.
- */
- public ExtendedListValueModelWrapper(List<? extends E> prefix, ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = new ArrayList<E>(prefix);
- this.suffix = Collections.emptyList();
- }
-
- /**
- * Extend the specified list with a prefix.
- */
- public ExtendedListValueModelWrapper(E prefix, ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = Collections.singletonList(prefix);
- this.suffix = Collections.emptyList();
- }
-
- /**
- * Extend the specified list with a suffix.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder, List<? extends E> suffix) {
- super(listHolder);
- this.prefix = Collections.emptyList();
- this.suffix = new ArrayList<E>(suffix);
- }
-
- /**
- * Extend the specified list with a suffix.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder, E suffix) {
- super(listHolder);
- this.prefix = Collections.emptyList();
- this.suffix = Collections.singletonList(suffix);
- }
-
- /**
- * Extend the specified list with a prefix containing a single null item.
- */
- public ExtendedListValueModelWrapper(ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.prefix = Collections.singletonList(null);
- this.suffix = Collections.emptyList();
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.listIterator_());
- }
-
- @SuppressWarnings("unchecked")
- protected ListIterator<E> listIterator_() {
- return new ReadOnlyCompositeListIterator<E>(
- this.prefix.listIterator(),
- this.listHolder.listIterator(),
- this.suffix.listIterator()
- );
- }
-
- public E get(int index) {
- int prefixSize = this.prefix.size();
- if (index < prefixSize) {
- return this.prefix.get(index);
- } else if (index >= prefixSize + this.listHolder.size()) {
- return this.suffix.get(index - (prefixSize + this.listHolder.size()));
- } else {
- return this.listHolder.get(index - prefixSize);
- }
- }
-
- public int size() {
- return this.prefix.size() + this.listHolder.size() + this.suffix.size();
- }
-
- public Object[] toArray() {
- ArrayList<E> list = new ArrayList<E>(this.size());
- list.addAll(this.prefix);
- CollectionTools.addAll(list, this.listHolder.iterator());
- list.addAll(this.suffix);
- return list.toArray();
- }
-
-
- // ********** ListValueModelWrapper implementation/overrides **********
-
- @Override
- protected void itemsAdded(ListAddEvent event) {
- this.fireItemsAdded(event.clone(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsRemoved(ListRemoveEvent event) {
- this.fireItemsRemoved(event.clone(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsReplaced(ListReplaceEvent event) {
- this.fireItemsReplaced(event.clone(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void itemsMoved(ListMoveEvent event) {
- this.fireItemsMoved(event.clone(this, LIST_VALUES, this.prefix.size()));
- }
-
- @Override
- protected void listCleared(ListClearEvent event) {
- this.fireListChanged(LIST_VALUES, this.buildList()); // not "cleared"
- }
-
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(LIST_VALUES, this.buildList());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-
- // ********** miscellaneous **********
-
- public void setPrefix(List<E> prefix) {
- this.prefix = prefix;
- this.fireListChanged(LIST_VALUES, this.buildList());
- }
-
- public void setSuffix(List<E> suffix) {
- this.suffix = suffix;
- this.fireListChanged(LIST_VALUES, this.buildList());
- }
-
- private List<E> buildList() {
- return CollectionTools.list(this.listIterator_());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java
deleted file mode 100644
index b7a2884a11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringCollectionValueModel.java
+++ /dev/null
@@ -1,179 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>FilteringCollectionValueModel</code> wraps another
- * {@link CollectionValueModel} and uses a {@link Filter}
- * to determine which items in the collection are returned by calls
- * to {@link #iterator()}.
- * <p>
- * The filter can be changed at any time; allowing the same
- * adapter to be used with different filter criteria (e.g. when the user
- * wants to view a list of <code>.java</code> files).
- * <p>
- * <strong>NB:</strong> If the objects in the "filtered" collection can change in such a way
- * that they should be removed from the "filtered" collection, you will
- * need to wrap the original collection in an {@link ItemAspectListValueModelAdapter}.
- * For example, if the filter only "accepts" items whose names begin
- * with "X" and the names of the items can change, you will need to
- * wrap the original list of unfiltered items with an
- * {@link ItemPropertyListValueModelAdapter} that listens for changes to each
- * item's name and fires the appropriate event whenever an item's name
- * changes. The event will cause this wrapper to re-filter the changed
- * item and add or remove it from the "filtered" collection as appropriate.
- */
-public class FilteringCollectionValueModel<E>
- extends CollectionValueModelWrapper<E>
- implements CollectionValueModel<E>
-{
- /** This filters the items in the nested collection. */
- private Filter<E> filter;
-
- /** Cache the items that were accepted by the filter */
- private final Collection<E> filteredItems = new ArrayList<E>();
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and a filter that simply accepts every object.
- */
- public FilteringCollectionValueModel(CollectionValueModel<? extends E> collectionHolder) {
- this(collectionHolder, Filter.Null.<E>instance());
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and filter.
- */
- public FilteringCollectionValueModel(CollectionValueModel<? extends E> collectionHolder, Filter<E> filter) {
- super(collectionHolder);
- this.filter = filter;
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and a filter that simply accepts every object.
- */
- public FilteringCollectionValueModel(ListValueModel<E> listHolder) {
- this(new ListCollectionValueModelAdapter<E>(listHolder));
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and filter.
- */
- public FilteringCollectionValueModel(ListValueModel<E> listHolder, Filter<E> filter) {
- this(new ListCollectionValueModelAdapter<E>(listHolder), filter);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.filteredItems);
- }
-
- public int size() {
- return this.filteredItems.size();
- }
-
-
- // ********** CollectionValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the nested collection,
- // since its value might change when a listener is added
- CollectionTools.addAll(this.filteredItems, this.filter(this.collectionHolder));
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the cache when we are not listening to the nested collection
- this.filteredItems.clear();
- }
-
- @Override
- protected void itemsAdded(CollectionAddEvent event) {
- // filter the values before propagating the change event
- this.addItemsToCollection(this.filter(this.getItems(event)), this.filteredItems, VALUES);
- }
-
- @Override
- protected void itemsRemoved(CollectionRemoveEvent event) {
- // do *not* filter the values, because they may no longer be
- // "accepted" and that might be why they were removed in the first place;
- // anyway, any extraneous items are harmless
- this.removeItemsFromCollection(event.getItems(), this.filteredItems, VALUES);
- }
-
- @Override
- protected void collectionCleared(CollectionClearEvent event) {
- this.clearCollection(this.filteredItems, VALUES);
- }
-
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.rebuildFilteredItems();
- }
-
-
- // ********** miscellaneous **********
-
- /**
- * Change the filter and rebuild the collection.
- */
- public void setFilter(Filter<E> filter) {
- this.filter = filter;
- this.rebuildFilteredItems();
- }
-
- /**
- * Return an iterable that filters the specified iterable.
- */
- protected Iterable<E> filter(Iterable<? extends E> items) {
- return new FilteringIterable<E>(items, this.filter);
- }
-
- /**
- * Synchronize our cache with the wrapped collection.
- */
- protected void rebuildFilteredItems() {
- this.filteredItems.clear();
- CollectionTools.addAll(this.filteredItems, this.filter(this.collectionHolder));
- this.fireCollectionChanged(VALUES, this.filteredItems);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.filteredItems);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java
deleted file mode 100644
index 5e201d0e2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringPropertyValueModel.java
+++ /dev/null
@@ -1,142 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>FilteringPropertyValueModel</code> wraps another
- * {@link PropertyValueModel} and uses a {@link Filter}
- * to determine when the wrapped value is to be returned by calls
- * to {@link #getValue()}.
- * <p>
- * As an alternative to building a {@link Filter}, a subclass
- * can override {@link #accept(T)}.
- * <p>
- * One, possibly undesirable, side-effect of using this value model is that
- * it must return *something* as the value. The default behavior is
- * to return <code>null</code> whenever the wrapped value is not "accepted",
- * which can be configured and/or overridden ({@link #getDefaultValue()}).
- */
-public class FilteringPropertyValueModel<T>
- extends PropertyValueModelWrapper<T>
- implements PropertyValueModel<T>
-{
- protected final Filter<T> filter;
- protected final T defaultValue;
-
-
- // ********** constructors **********
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override {@link #accept(T)}
- * instead of building a {@link Filter}.
- * The default value will be <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder) {
- this(valueHolder, Filter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model, specified default value, and a disabled filter.
- * Use this constructor if you want to override {@link #accept(T)}
- * instead of building a {@link Filter}
- * <em>and</em> you need to specify
- * a default value other than <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, T defaultValue) {
- this(valueHolder, Filter.Disabled.<T>instance(), defaultValue);
- }
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model and filter.
- * The default value will be <code>null</code>.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, Filter<T> filter) {
- this(valueHolder, filter, null);
- }
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model, filter, and default value.
- */
- public FilteringPropertyValueModel(PropertyValueModel<? extends T> valueHolder, Filter<T> filter, T defaultValue) {
- super(valueHolder);
- this.filter = filter;
- this.defaultValue = defaultValue;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T getValue() {
- return this.filterValue(this.valueHolder.getValue());
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- // filter the values before propagating the change event
- @SuppressWarnings("unchecked")
- T eventOldValue = (T) event.getOldValue();
- Object oldValue = this.filterValue(eventOldValue);
- @SuppressWarnings("unchecked")
- T eventNewValue = (T) event.getNewValue();
- Object newValue = this.filterValue(eventNewValue);
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
-
- // ********** queries **********
-
- /**
- * If the specified value is "accepted" simply return it,
- * otherwise return the default value.
- */
- protected T filterValue(T value) {
- return this.accept(value) ? value : this.getDefaultValue();
- }
-
- /**
- * Return whether the filtering property value model should
- * return the specified value from a call to
- * {@link #getValue()}; the value came
- * from the nested property value model
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link Filter}.
- */
- protected boolean accept(T value) {
- return this.filter.accept(value);
- }
-
- /**
- * Return the object that should be returned if
- * the nested value was rejected by the filter.
- * The default is <code>null</code>.
- */
- protected T getDefaultValue() {
- return this.defaultValue;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java
deleted file mode 100644
index 455c86f8a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/FilteringWritablePropertyValueModel.java
+++ /dev/null
@@ -1,123 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>FilteringWritablePropertyValueModel</code> wraps another
- * {@link WritablePropertyValueModel} and uses a {@link BidiFilter}
- * to determine when the wrapped value is to be returned by calls
- * to {@link FilteringPropertyValueModel#getValue() getValue()} and modified by calls to
- * {@link #setValue(T)}.
- * <p>
- * As an alternative to building a {@link BidiFilter}, a subclass
- * can override {@link FilteringPropertyValueModel#accept(T) accept(T)} and {@link #reverseAccept(T)}.
- * <p>
- * One, possibly undesirable, side-effect of using this value model is that
- * it must return *something* as the value. The default behavior is
- * to return <code>null</code> whenever the wrapped value is not "accepted",
- * which can be configured and/or overridden ({@link FilteringPropertyValueModel#getDefaultValue() getDefaultValue()}).
- * <p>
- * Similarly, if an incoming value is not "reverse accepted", <em>nothing</em>
- * will passed through to the wrapped value holder, not even <code>null</code>.
- */
-public class FilteringWritablePropertyValueModel<T>
- extends FilteringPropertyValueModel<T>
- implements WritablePropertyValueModel<T>
-{
-
-
- // ********** constructors **********
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model and a disabled filter.
- * Use this constructor if you want to override
- * {@link #accept(T)} and {@link #reverseAccept(T)}
- * instead of building a {@link BidiFilter}.
- * The default value will be <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder) {
- this(valueHolder, BidiFilter.Disabled.<T>instance(), null);
- }
-
- /**
- * Construct a filtering property value model with the specified nested
- * property value model, specified default value, and a disabled filter.
- * Use this constructor if you want to override
- * {@link #accept(T)} and {@link #reverseAccept(T)}
- * instead of building a {@link BidiFilter}.
- * <em>and</em> you need to specify
- * a default value other than <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, T defaultValue) {
- this(valueHolder, BidiFilter.Disabled.<T>instance(), defaultValue);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and filter.
- * The default value will be <code>null</code>.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, BidiFilter<T> filter) {
- this(valueHolder, filter, null);
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model, filter, and default value.
- */
- public FilteringWritablePropertyValueModel(WritablePropertyValueModel<T> valueHolder, BidiFilter<T> filter, T defaultValue) {
- super(valueHolder, filter, defaultValue);
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T value) {
- if (this.reverseAccept(value)) {
- this.getValueHolder().setValue(value);
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether the filtering writable property value model
- * should pass through the specified value to the nested
- * writable property value model in a call to
- * {@link #setValue(T)}.
- * <p>
- * This method can be overridden by a subclass as an
- * alternative to building a {@link BidiFilter}.
- */
- protected boolean reverseAccept(T value) {
- return this.getFilter().reverseAccept(value);
- }
-
- /**
- * Our constructor accepts only a {@link WritablePropertyValueModel}{@code<T>}.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T> getValueHolder() {
- return (WritablePropertyValueModel<T>) this.valueHolder;
- }
-
- /**
- * Our constructors accept only a bidirectional filter.
- */
- protected BidiFilter<T> getFilter() {
- return (BidiFilter<T>) this.filter;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java
deleted file mode 100644
index ffa6da9dab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemAspectListValueModelAdapter.java
+++ /dev/null
@@ -1,274 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventObject;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.IntReference;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Abstract list value model that provides behavior for wrapping a {@link ListValueModel}
- * (or {@link CollectionValueModel}) and listening for changes to aspects of the
- * <em>items</em> held by the list (or collection). Changes to the actual list
- * (or collection) are also monitored.
- *
- * This is useful if you have a collection of items that can be modified by adding
- * or removing items or the items themselves might change in a fashion that
- * might change the list or collection's external appearance.
- *
- * Subclasses need to override two methods:<ul>
- * <li>{@link #engageItem_(Model)}<p>
- * begin listening to the appropriate aspect of the specified item and call
- * {@link #itemAspectChanged(EventObject)} whenever the aspect changes
- * <li>{@link #disengageItem_(Model)}<p>
- * stop listening to the appropriate aspect of the specified item
- * </ul>
- */
-public abstract class ItemAspectListValueModelAdapter<E>
- extends ListValueModelWrapper<E>
- implements ListValueModel<E>
-{
-
- /**
- * Maintain a counter for each of the items in the
- * wrapped list holder we are listening to.
- */
- protected final IdentityHashMap<E, IntReference> counters;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder is required.
- */
- protected ItemAspectListValueModelAdapter(ListValueModel<? extends E> listHolder) {
- super(listHolder);
- this.counters = new IdentityHashMap<E, IntReference>();
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- protected ItemAspectListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.listHolder.listIterator());
- }
-
- public E get(int index) {
- return this.listHolder.get(index);
- }
-
- public int size() {
- return this.listHolder.size();
- }
-
- public Object[] toArray() {
- return this.listHolder.toArray();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder and the items in the list.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.engageAllItems();
- }
-
- protected void engageAllItems() {
- this.engageItems(this.listHolder);
- }
-
- protected void engageItems(Iterable<? extends E> items) {
- for (E item : items) {
- this.engageItem(item);
- }
- }
-
- protected void engageItem(E item) {
- // listen to each item only once
- IntReference counter = this.counters.get(item);
- if (counter == null) {
- counter = new IntReference();
- this.counters.put(item, counter);
- this.engageItem_((Model) item);
- }
- counter.increment();
- }
-
- /**
- * Start listening to the specified item.
- */
- protected abstract void engageItem_(Model item);
-
- /**
- * Stop listening to the list holder and the items in the list.
- */
- @Override
- protected void disengageModel() {
- this.disengageAllItems();
- super.disengageModel();
- }
-
- protected void disengageAllItems() {
- this.disengageItems(this.listHolder);
- }
-
- protected void disengageItems(Iterable<? extends E> items) {
- for (E item : items) {
- this.disengageItem(item);
- }
- }
-
- protected void disengageItem(E item) {
- // stop listening to each item only once
- IntReference counter = this.counters.get(item);
- if (counter == null) {
- // something is wrong if this happens... ~bjv
- throw new IllegalStateException("missing counter: " + item); //$NON-NLS-1$
- }
- if (counter.decrement() == 0) {
- this.counters.remove(item);
- this.disengageItem_((Model) item);
- }
- }
-
- /**
- * Stop listening to the specified item.
- */
- protected abstract void disengageItem_(Model item);
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder.
- * Forward the event and begin listening to the added items.
- */
- @Override
- protected void itemsAdded(ListAddEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsAdded(event.clone(this, LIST_VALUES));
- this.engageItems(this.getItems(event));
- }
-
- /**
- * Items were removed from the wrapped list holder.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void itemsRemoved(ListRemoveEvent event) {
- this.disengageItems(this.getItems(event));
- // re-fire event with the wrapper as the source
- this.fireItemsRemoved(event.clone(this, LIST_VALUES));
- }
-
- /**
- * Items were replaced in the wrapped list holder.
- * Stop listening to the removed items, forward the event,
- * and begin listening to the added items.
- */
- @Override
- protected void itemsReplaced(ListReplaceEvent event) {
- this.disengageItems(this.getOldItems(event));
- // re-fire event with the wrapper as the source
- this.fireItemsReplaced(event.clone(this, LIST_VALUES));
- this.engageItems(this.getNewItems(event));
- }
-
- /**
- * Items were moved in the wrapped list holder.
- * No need to change any listeners; just forward the event.
- */
- @Override
- protected void itemsMoved(ListMoveEvent event) {
- // re-fire event with the wrapper as the source
- this.fireItemsMoved(event.clone(this, LIST_VALUES));
- }
-
- /**
- * The wrapped list holder was cleared.
- * Stop listening to the removed items and forward the event.
- */
- @Override
- protected void listCleared(ListClearEvent event) {
- // we should only need to disengage each item once...
- // make a copy to prevent a ConcurrentModificationException
- Collection<E> keys = new ArrayList<E>(this.counters.keySet());
- this.disengageItems(keys);
- this.counters.clear();
- // re-fire event with the wrapper as the source
- this.fireListCleared(LIST_VALUES);
- }
-
- /**
- * The wrapped list holder has changed in some dramatic fashion.
- * Reconfigure our listeners and forward the event.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- // we should only need to disengage each item once...
- // make a copy to prevent a ConcurrentModificationException
- Collection<E> keys = new ArrayList<E>(this.counters.keySet());
- this.disengageItems(keys);
- this.counters.clear();
- // re-fire event with the wrapper as the source
- this.fireListChanged(event.clone(this));
- this.engageAllItems();
- }
-
-
- // ********** item change support **********
-
- /**
- * The specified item has a bound property that has changed.
- * Notify listeners of the change. The listeners will have to determine
- * whether the item aspect change is significant.
- */
- protected void itemAspectChanged(@SuppressWarnings("unused") EventObject event) {
- this.fireListChanged(LIST_VALUES, CollectionTools.list(this.listHolder, this.listHolder.size()));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemChangeListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemChangeListValueModelAdapter.java
deleted file mode 100644
index 6eda968786..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemChangeListValueModelAdapter.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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.SimpleChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to all of the changes
- * of each item in the wrapped list model.
- */
-public class ItemChangeListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
- /** Listener that listens to all the items in the list. */
- protected final ChangeListener itemChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified items.
- */
- public ItemChangeListValueModelAdapter(ListValueModel<E> listHolder) {
- super(listHolder);
- this.itemChangeListener = this.buildItemChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected ChangeListener buildItemChangeListener() {
- return new SimpleChangeListener() {
- @Override
- protected void modelChanged(ChangeEvent event) {
- ItemChangeListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- item.addChangeListener(this.itemChangeListener);
- }
-
- @Override
- protected void disengageItem_(Model item) {
- item.removeChangeListener(this.itemChangeListener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java
deleted file mode 100644
index f58bf96a84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemCollectionListValueModelAdapter.java
+++ /dev/null
@@ -1,101 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to one or more collection
- * aspects of each item in the wrapped list model.
- */
-public class ItemCollectionListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' collections that we listen to. */
- protected final String[] collectionNames;
-
- /** Listener that listens to all the items in the list. */
- protected final CollectionChangeListener itemCollectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item Collections.
- */
- public ItemCollectionListValueModelAdapter(ListValueModel<E> listHolder, String... collectionNames) {
- super(listHolder);
- this.collectionNames = collectionNames;
- this.itemCollectionListener = this.buildItemCollectionListener();
- }
-
- /**
- * Construct an adapter for the specified item Collections.
- */
- public ItemCollectionListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... collectionNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), collectionNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a Collection aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected CollectionChangeListener buildItemCollectionListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ItemCollectionListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item collection listener: " + Arrays.asList(ItemCollectionListValueModelAdapter.this.collectionNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- for (String collectionName : this.collectionNames) {
- item.addCollectionChangeListener(collectionName, this.itemCollectionListener);
- }
- }
-
- @Override
- protected void disengageItem_(Model item) {
- for (String collectionName : this.collectionNames) {
- item.removeCollectionChangeListener(collectionName, this.itemCollectionListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java
deleted file mode 100644
index d58a6078ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemListListValueModelAdapter.java
+++ /dev/null
@@ -1,109 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to one or more list
- * aspects of each item in the wrapped list model.
- */
-public class ItemListListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the subject's lists that we listen to. */
- protected final String[] listNames;
-
- /** Listener that listens to all the items in the list. */
- protected final ListChangeListener itemListListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item List aspects.
- */
- public ItemListListValueModelAdapter(ListValueModel<E> listHolder, String... listNames) {
- super(listHolder);
- this.listNames = listNames;
- this.itemListListener = this.buildItemListListener();
- }
-
- /**
- * Construct an adapter for the specified item List aspects.
- */
- public ItemListListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... listNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), listNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that the List aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected ListChangeListener buildItemListListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void listCleared(ListClearEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void listChanged(ListChangeEvent event) {
- ItemListListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item list listener: " + Arrays.asList(ItemListListValueModelAdapter.this.listNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- for (String listName : this.listNames) {
- item.addListChangeListener(listName, this.itemListListener);
- }
- }
-
- @Override
- protected void disengageItem_(Model item) {
- for (String listName : this.listNames) {
- item.removeListChangeListener(listName, this.itemListListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
deleted file mode 100644
index e4bd9932cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemPropertyListValueModelAdapter.java
+++ /dev/null
@@ -1,84 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to one or more
- * properties of each item in the wrapped list model.
- */
-public class ItemPropertyListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' properties that we listen to. */
- protected final String[] propertyNames;
-
- /** Listener that listens to all the items in the list. */
- protected final PropertyChangeListener itemPropertyListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item properties.
- */
- public ItemPropertyListValueModelAdapter(ListValueModel<E> listHolder, String... propertyNames) {
- super(listHolder);
- this.propertyNames = propertyNames;
- this.itemPropertyListener = this.buildItemPropertyListener();
- }
-
- /**
- * Construct an adapter for the specified item properties.
- */
- public ItemPropertyListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... propertyNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), propertyNames);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildItemPropertyListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ItemPropertyListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item property listener: " + Arrays.asList(ItemPropertyListValueModelAdapter.this.propertyNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- for (String propertyName : this.propertyNames) {
- item.addPropertyChangeListener(propertyName, this.itemPropertyListener);
- }
- }
-
- @Override
- protected void disengageItem_(Model item) {
- for (String propertyName : this.propertyNames) {
- item.removePropertyChangeListener(propertyName, this.itemPropertyListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
deleted file mode 100644
index ccf3021b2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemStateListValueModelAdapter.java
+++ /dev/null
@@ -1,74 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to the
- * "state" of each item in the wrapped list model.
- */
-public class ItemStateListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
- /** Listener that listens to all the items in the list. */
- protected final StateChangeListener itemStateListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the item state.
- */
- public ItemStateListValueModelAdapter(ListValueModel<E> listHolder) {
- super(listHolder);
- this.itemStateListener = this.buildItemStateListener();
- }
-
- /**
- * Construct an adapter for the item state.
- */
- public ItemStateListValueModelAdapter(CollectionValueModel<E> collectionHolder) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** initialization **********
-
- protected StateChangeListener buildItemStateListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ItemStateListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item state listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- item.addStateChangeListener(this.itemStateListener);
- }
-
- @Override
- protected void disengageItem_(Model item) {
- item.removeStateChangeListener(this.itemStateListener);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java
deleted file mode 100644
index 3b55b5ec95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ItemTreeListValueModelAdapter.java
+++ /dev/null
@@ -1,101 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Extend {@link ItemAspectListValueModelAdapter} to listen to one or more tree
- * aspects of each item in the wrapped list model.
- */
-public class ItemTreeListValueModelAdapter<E>
- extends ItemAspectListValueModelAdapter<E>
-{
-
- /** The names of the items' tree that we listen to. */
- protected final String[] treeNames;
-
- /** Listener that listens to all the items in the list. */
- protected final TreeChangeListener itemTreeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified item trees.
- */
- public ItemTreeListValueModelAdapter(ListValueModel<E> listHolder, String... treeNames) {
- super(listHolder);
- this.treeNames = treeNames;
- this.itemTreeListener = this.buildItemTreeListener();
- }
-
- /**
- * Construct an adapter for the specified item trees.
- */
- public ItemTreeListValueModelAdapter(CollectionValueModel<E> collectionHolder, String... treeNames) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), treeNames);
- }
-
-
- // ********** initialization **********
-
- /**
- * All we really care about is the fact that a tree aspect has
- * changed. Do the same thing no matter which event occurs.
- */
- protected TreeChangeListener buildItemTreeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeAddEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void nodeRemoved(TreeRemoveEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void treeCleared(TreeClearEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- ItemTreeListValueModelAdapter.this.itemAspectChanged(event);
- }
- @Override
- public String toString() {
- return "item tree listener: " + Arrays.asList(ItemTreeListValueModelAdapter.this.treeNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageItem_(Model item) {
- for (String treeName : this.treeNames) {
- item.addTreeChangeListener(treeName, this.itemTreeListener);
- }
- }
-
- @Override
- protected void disengageItem_(Model item) {
- for (String treeName : this.treeNames) {
- item.removeTreeChangeListener(treeName, this.itemTreeListener);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java
deleted file mode 100644
index df8dfa0965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListAspectAdapter.java
+++ /dev/null
@@ -1,176 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of {@link AspectListValueModelAdapter} provides
- * basic list change support.
- * This converts a set of one or more lists into
- * a single {@link #LIST_VALUES} list.
- * <p>
- * The typical subclass will override the following methods (see the descriptions
- * in {@link AspectListValueModelAdapter}):<ul>
- * <li>{@link #listIterator_()}
- * <li>{@link #get(int)}
- * <li>{@link #size_()}
- * <li>{@link #toArray_()}
- * <li>{@link #listIterator()}
- * <li>{@link #size()}
- * <li>{@link #toArray()}
- * </ul>
- */
-public abstract class ListAspectAdapter<S extends Model, E>
- extends AspectListValueModelAdapter<S, E>
-{
- /**
- * The name of the subject's lists that we use for the value.
- */
- protected final String[] listNames;
- protected static final String[] EMPTY_LIST_NAMES = new String[0];
-
- /** A listener that listens to the subject's list aspects. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list aspect adapter for the specified subject
- * and list.
- */
- protected ListAspectAdapter(String listName, S subject) {
- this(new String[] {listName}, subject);
- }
-
- /**
- * Construct a list aspect adapter for the specified subject
- * and lists.
- */
- protected ListAspectAdapter(String[] listNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), listNames);
- }
-
- /**
- * Construct a list aspect adapter for the specified subject holder
- * and lists.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... listNames) {
- super(subjectHolder);
- this.listNames = listNames;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- /**
- * Construct a list aspect adapter for the specified subject holder
- * and lists.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> listNames) {
- this(subjectHolder, listNames.toArray(new String[listNames.size()]));
- }
-
- /**
- * Construct a list aspect adapter for an "unchanging" list in
- * the specified subject. This is useful for a list aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new list.
- */
- protected ListAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_LIST_NAMES);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- // transform the subject's list change events into VALUE list change events
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListAspectAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListAspectAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListAspectAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListAspectAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ListAspectAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListAspectAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener: " + Arrays.asList(ListAspectAdapter.this.listNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected void engageSubject_() {
- for (String listName : this.listNames) {
- ((Model) this.subject).addListChangeListener(listName, this.listChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String listName : this.listNames) {
- ((Model) this.subject).removeListChangeListener(listName, this.listChangeListener);
- }
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(ListAddEvent event) {
- this.fireItemsAdded(event.clone(this, LIST_VALUES));
- }
-
- protected void itemsRemoved(ListRemoveEvent event) {
- this.fireItemsRemoved(event.clone(this, LIST_VALUES));
- }
-
- protected void itemsReplaced(ListReplaceEvent event) {
- this.fireItemsReplaced(event.clone(this, LIST_VALUES));
- }
-
- protected void itemsMoved(ListMoveEvent event) {
- this.fireItemsMoved(event.clone(this, LIST_VALUES));
- }
-
- protected void listCleared(ListClearEvent event) {
- this.fireListCleared(event.clone(this, LIST_VALUES));
- }
-
- protected void listChanged(ListChangeEvent event) {
- this.fireListChanged(event.clone(this, LIST_VALUES));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
deleted file mode 100644
index 1450f14809..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCollectionValueModelAdapter.java
+++ /dev/null
@@ -1,233 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to make a {@link ListValueModel} behave like
- * a read-only {@link CollectionValueModel}, sorta.
- * <p>
- * We keep an internal collection somewhat in synch with the wrapped list.
- * <p>
- * <strong>NB:</strong> Since we only listen to the wrapped list when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * list while we are listening to it, results to various methods
- * (e.g. {@link #size()}, {@link iterator()}) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- */
-public class ListCollectionValueModelAdapter<E>
- extends AbstractCollectionValueModel
- implements CollectionValueModel<E>
-{
- /** The wrapped list value model. */
- protected final ListValueModel<? extends E> listHolder;
-
- /** A listener that forwards any events fired by the list holder. */
- protected final ListChangeListener listChangeListener;
-
- /**
- * Our internal collection, which holds the same elements as
- * the wrapped list.
- */
- // we declare this an ArrayList so we can use #clone() and #ensureCapacity(int)
- protected final ArrayList<E> collection;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified list value model.
- */
- public ListCollectionValueModelAdapter(ListValueModel<? extends E> listHolder) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- this.collection = new ArrayList<E>();
- // postpone building the collection and listening to the underlying list
- // until we have listeners ourselves...
- }
-
-
- // ********** initialization **********
-
- /**
- * The wrapped list has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListCollectionValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListCollectionValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListCollectionValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListCollectionValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ListCollectionValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListCollectionValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- // try to prevent backdoor modification of the list
- return new ReadOnlyIterator<E>(this.collection);
- }
-
- public int size() {
- return this.collection.size();
- }
-
-
- // ********** AbstractCollectionValueModel implementation **********
-
- @Override
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- // synch our collection *after* we start listening to the list holder,
- // since its value might change when a listener is added
- this.buildCollection();
- }
-
- @Override
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- // clear out the collection when we are not listening to the list holder
- this.collection.clear();
- }
-
-
- // ********** behavior **********
-
- protected void itemsAdded(ListAddEvent event) {
- this.addItemsToCollection(this.getItems(event), this.collection, VALUES);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(ListAddEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- protected void itemsRemoved(ListRemoveEvent event) {
- this.removeItemsFromCollection(this.getItems(event), this.collection, VALUES);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getItems(ListRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- protected void itemsReplaced(ListReplaceEvent event) {
- this.removeItemsFromCollection(this.getOldItems(event), this.collection, VALUES);
- this.addItemsToCollection(this.getNewItems(event), this.collection, VALUES);
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getOldItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getOldItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
- protected void itemsMoved(@SuppressWarnings("unused") ListMoveEvent event) {
- // do nothing? moving items in a list has no net effect on a collection...
- }
-
- protected void listCleared(@SuppressWarnings("unused") ListClearEvent event) {
- // put in empty check so we don't fire events unnecessarily
- if ( ! this.collection.isEmpty()) {
- this.collection.clear();
- this.fireCollectionCleared(VALUES);
- }
- }
-
- /**
- * synchronize our internal collection with the wrapped list
- * and fire the appropriate events
- */
- protected void listChanged(@SuppressWarnings("unused") ListChangeEvent event) {
- if (this.listHolder.size() == 0) {
- if (this.collection.isEmpty()) {
- // no change
- } else {
- this.clearCollection(this.collection, VALUES);
- }
- } else {
- if (this.collection.isEmpty()) {
- this.buildCollection();
- this.fireItemsAdded(VALUES, this.collection);
- } else {
- this.collection.clear();
- this.buildCollection();
- this.fireCollectionChanged(VALUES, this.collection);
- }
- }
- }
-
- protected void buildCollection() {
- // if the new list is empty, do nothing
- int size = this.listHolder.size();
- if (size != 0) {
- this.buildCollection(size);
- }
- }
-
- protected void buildCollection(int size) {
- this.collection.ensureCapacity(size);
- for (E each : this.listHolder) {
- this.collection.add(each);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collection);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java
deleted file mode 100644
index 9d32bbcb11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListCurator.java
+++ /dev/null
@@ -1,226 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.EventListener;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of {@link AspectAdapter} provides list change support
- * by adapting a subject's state change events to a minimum set
- * of list change events.
- */
-public abstract class ListCurator<S extends Model, E>
- extends AspectAdapter<S>
- implements ListValueModel<E>
-{
- /** How the list looked before the last state change */
- private final ArrayList<E> record;
-
- /** A listener that listens for the subject's state to change */
- private final StateChangeListener stateChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a curator for the specified subject.
- */
- protected ListCurator(S subject) {
- this(new StaticPropertyValueModel<S>(subject));
- }
-
- /**
- * Construct a curator for the specified subject holder.
- * The subject holder cannot be null.
- */
- protected ListCurator(PropertyValueModel<? extends S> subjectHolder) {
- super(subjectHolder);
- this.record = new ArrayList<E>();
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * The subject's state has changed, do inventory and report to listeners.
- */
- protected StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ListCurator.this.submitInventoryReport();
- }
- @Override
- public String toString() {
- return "state change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public ListIterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.record);
- }
-
- /**
- * Return the item at the specified index of the subject's list aspect.
- */
- public E get(int index) {
- return this.record.get(index);
- }
-
- /**
- * Return the size of the subject's list aspect.
- */
- public int size() {
- return this.record.size();
- }
-
- /**
- * Return an array manifestation of the subject's list aspect.
- */
- public Object[] toArray() {
- return this.record.toArray();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected ListIterator<E> getValue() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return ListChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return LIST_VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyListChangeListeners(LIST_VALUES);
- }
-
- /**
- * The aspect has changed, notify listeners appropriately.
- */
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- this.fireListChanged(LIST_VALUES, this.record);
- }
-
- /**
- * The subject is not null - add our listener.
- */
- @Override
- protected void engageSubject_() {
- ((Model) this.subject).addStateChangeListener(this.stateChangeListener);
- // synch our list *after* we start listening to the subject,
- // since its value might change when a listener is added
- CollectionTools.addAll(this.record, this.iteratorForRecord());
- }
-
- /**
- * The subject is not null - remove our listener.
- */
- @Override
- protected void disengageSubject_() {
- ((Model) this.subject).removeStateChangeListener(this.stateChangeListener);
- // clear out the list when we are not listening to the subject
- this.record.clear();
- }
-
-
- // ********** ListCurator protocol **********
-
- /**
- * This is intended to be different from {@link ListValueModel#iterator()}.
- * It is intended to be used only when the subject changes or the
- * subject's "state" changes (as signified by a state change event).
- */
- protected abstract Iterator<E> iteratorForRecord();
-
-
- // ********** behavior **********
-
- void submitInventoryReport() {
- List<E> newRecord = CollectionTools.list(this.iteratorForRecord());
- int recordIndex = 0;
-
- // add items from the new record
- for (E newItem : newRecord) {
- this.inventoryNewItem(recordIndex, newItem);
- recordIndex++;
- }
-
- // clean out items that are no longer in the new record
- for (recordIndex = 0; recordIndex < this.record.size(); ) {
- E item = this.record.get(recordIndex);
-
- if (newRecord.contains(item)) {
- recordIndex++;
- } else {
- this.removeItemFromInventory(recordIndex, item);
- }
- }
- }
-
- private void inventoryNewItem(int recordIndex, E newItem) {
- List<E> rec = new ArrayList<E>(this.record);
-
- if ((recordIndex < rec.size()) && rec.get(recordIndex).equals(newItem)) {
- return;
- }
- if (rec.contains(newItem)) {
- this.removeItemFromInventory(recordIndex, rec.get(recordIndex));
- this.inventoryNewItem(recordIndex, newItem);
- } else {
- this.addItemToInventory(recordIndex, newItem);
- }
- }
-
- private void addItemToInventory(int index, E item) {
- this.addItemToList(index, item, this.record, LIST_VALUES);
- }
-
- private void removeItemFromInventory(int index, @SuppressWarnings("unused") E item) {
- this.removeItemFromList(index, this.record, LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.record);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.java
deleted file mode 100644
index b468f9a277..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListPropertyValueModelAdapter.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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a list value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must override:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current list value
- * </ul>
- * Subclasses might want to override the following methods
- * to improve performance (by not recalculating the value, if possible):<ul>
- * <li>{@link #itemsAdded(ListAddEvent event)}
- * <li>{@link #itemsRemoved(ListRemoveEvent event)}
- * <li>{@link #itemsReplaced(ListReplaceEvent event)}
- * <li>{@link #itemsMoved(ListMoveEvent event)}
- * <li>{@link #listCleared(ListClearEvent event)}
- * <li>{@link #listChanged(ListChangeEvent event)}
- * </ul>
- */
-public abstract class ListPropertyValueModelAdapter<T>
- extends AbstractPropertyValueModelAdapter<T>
-{
- /** The wrapped list value model. */
- protected final ListValueModel<?> listHolder;
-
- /** A listener that allows us to synch with changes to the wrapped list holder. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * list value model.
- */
- protected ListPropertyValueModelAdapter(ListValueModel<?> listHolder) {
- super();
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListPropertyValueModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListPropertyValueModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListPropertyValueModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListPropertyValueModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ListPropertyValueModelAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListPropertyValueModelAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder.
- */
- @Override
- protected void engageModel_() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- /**
- * Stop listening to the list holder.
- */
- @Override
- protected void disengageModel_() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
- // ********** collection change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsAdded(@SuppressWarnings("unused") ListAddEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were removed from the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsRemoved(@SuppressWarnings("unused") ListRemoveEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were replaced in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsReplaced(@SuppressWarnings("unused") ListReplaceEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Items were moved in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected void itemsMoved(@SuppressWarnings("unused") ListMoveEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped list holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void listCleared(@SuppressWarnings("unused") ListClearEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The value of the wrapped list holder has changed;
- * propagate the change notification appropriately.
- */
- protected void listChanged(@SuppressWarnings("unused") ListChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java
deleted file mode 100644
index a134101674..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ListValueModelWrapper.java
+++ /dev/null
@@ -1,164 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another list value model, "lazily" listen to it, and propagate
- * its change notifications. Subclasses must implement the appropriate
- * {@link ListValueModel}.
- */
-public abstract class ListValueModelWrapper<E>
- extends AbstractListValueModel
-{
- /** The wrapped list value model. */
- protected final ListValueModel<? extends E> listHolder;
-
- /** A listener that allows us to synch with changes to the wrapped list holder. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model with the specified wrapped
- * list value model.
- */
- protected ListValueModelWrapper(ListValueModel<? extends E> listHolder) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListValueModelWrapper.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListValueModelWrapper.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListValueModelWrapper.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListValueModelWrapper.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ListValueModelWrapper.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ListValueModelWrapper.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "list change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list holder.
- */
- @Override
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- /**
- * Stop listening to the list holder.
- */
- @Override
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- // 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> getItems(ListRemoveEvent event) {
- return (Iterable<E>) event.getItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getNewItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getNewItems();
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<E> getOldItems(ListReplaceEvent event) {
- return (Iterable<E>) event.getOldItems();
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsAdded(ListAddEvent event);
-
- /**
- * Items were removed from the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsRemoved(ListRemoveEvent event);
-
- /**
- * Items were replaced in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsReplaced(ListReplaceEvent event);
-
- /**
- * Items were moved in the wrapped list holder;
- * propagate the change notification appropriately.
- */
- protected abstract void itemsMoved(ListMoveEvent event);
-
- /**
- * The wrapped list holder was cleared;
- * propagate the change notification appropriately.
- */
- protected abstract void listCleared(ListClearEvent event);
-
- /**
- * The value of the wrapped list holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void listChanged(ListChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java
deleted file mode 100644
index 0ac493105c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullCollectionValueModel.java
+++ /dev/null
@@ -1,58 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * A read-only collection value model for when you
- * don't need to support a collection. In particular, this
- * is useful for the leaf nodes of a tree that never have
- * children.
- * <p>
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullCollectionValueModel() {
- super();
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public int size() {
- return 0;
- }
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
deleted file mode 100644
index 35a46b045d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullListValueModel.java
+++ /dev/null
@@ -1,71 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An empty list value model for when you don't
- * need to support a list.
- * <p>
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- private static final Object[] EMPTY_ARRAY = new Object[0];
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullListValueModel() {
- super();
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return EmptyIterator.instance();
- }
-
- public ListIterator<E> listIterator() {
- return EmptyListIterator.instance();
- }
-
- public int size() {
- return 0;
- }
-
- public E get(int index) {
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: 0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public Object[] toArray() {
- return EMPTY_ARRAY;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java
deleted file mode 100644
index 500f176ec0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullPropertyValueModel.java
+++ /dev/null
@@ -1,49 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A property value model for when you
- * don't need to support a value.
- * <p>
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullPropertyValueModel<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullPropertyValueModel() {
- super();
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T getValue() {
- return null;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java
deleted file mode 100644
index fbcc8b1bbd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/NullTreeValueModel.java
+++ /dev/null
@@ -1,52 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * A tree value model for when you
- * don't need to support any nodes.
- * <p>
- * We don't use a singleton because we hold on to listeners.
- */
-public final class NullTreeValueModel<E>
- extends AbstractModel
- implements TreeValueModel<E>
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Default constructor.
- */
- public NullTreeValueModel() {
- super();
- }
-
-
- // ********** TreeValueModel implementation **********
-
- public Iterator<E> nodes() {
- return EmptyIterator.instance();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java
deleted file mode 100644
index ecf7b77a4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyAspectAdapter.java
+++ /dev/null
@@ -1,128 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This {@link AspectPropertyValueModelAdapter} provides basic property change support.
- * This converts a set of one or more standard properties into
- * a single {@link #VALUE} property.
- * <p>
- * The typical subclass will override the following methods (see the descriptions
- * in {@link AspectPropertyValueModelAdapter}):<ul>
- * <li>{@link #buildValue_()}
- * <li>{@link #setValue_(Object)}
- * <li>{@link #buildValue()}
- * <li>{@link #setValue(Object)}
- * </ul>
- */
-public abstract class PropertyAspectAdapter<S extends Model, V>
- extends AspectPropertyValueModelAdapter<S, V>
-{
- /** The name of the subject's properties that we use for the value. */
- protected final String[] propertyNames;
- protected static final String[] EMPTY_PROPERTY_NAMES = new String[0];
-
- /** A listener that listens to the appropriate properties of the subject. */
- protected final PropertyChangeListener propertyChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a property aspect adapter for the specified subject
- * and property.
- */
- protected PropertyAspectAdapter(String propertyName, S subject) {
- this(new String[] {propertyName}, subject);
- }
-
- /**
- * Construct a property aspect adapter for the specified subject
- * and properties.
- */
- protected PropertyAspectAdapter(String[] propertyNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), propertyNames);
- }
-
- /**
- * Construct a property aspect adapter for the specified subject holder
- * and properties.
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... propertyNames) {
- super(subjectHolder);
- this.propertyNames = propertyNames;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- }
-
- /**
- * Construct a property aspect adapter for the specified subject holder
- * and properties.
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> propertyNames) {
- this(subjectHolder, propertyNames.toArray(new String[propertyNames.size()]));
- }
-
- /**
- * Construct a property aspect adapter for an "unchanging" property in
- * the specified subject. This is useful for a property aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new property. (A {@link TransformationPropertyValueModel} could also be
- * used in this situation.)
- */
- protected PropertyAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_PROPERTY_NAMES);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- // transform the subject's property change events into VALUE property change events
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyAspectAdapter.this.propertyChanged(event);
- }
- @Override
- public String toString() {
- return "property change listener: " + Arrays.asList(PropertyAspectAdapter.this.propertyNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected void engageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).addPropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String propertyName : this.propertyNames) {
- ((Model) this.subject).removePropertyChangeListener(propertyName, this.propertyChangeListener);
- }
- }
-
- protected void propertyChanged(@SuppressWarnings("unused") PropertyChangeEvent event) {
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java
deleted file mode 100644
index 6ad280ef72..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyCollectionValueModelAdapter.java
+++ /dev/null
@@ -1,141 +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.utility.internal.model.value;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * An adapter that allows us to make a {@link PropertyValueModel} behave like
- * a read-only, single-element {@link CollectionValueModel}, sorta.
- * <p>
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a collection with a <code>null</code> element).
- */
-public class PropertyCollectionValueModelAdapter<E>
- extends AbstractCollectionValueModel
- implements CollectionValueModel<E>
-{
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends E> valueHolder;
-
- /** A listener that forwards any events fired by the value holder. */
- protected final PropertyChangeListener propertyChangeListener;
-
- /** Cache the value. */
- protected E value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Convert the specified property value model to a collection
- * value model.
- */
- public PropertyCollectionValueModelAdapter(PropertyValueModel<? extends E> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- this.value = null;
- // postpone building the value and listening to the underlying value
- // until we have listeners ourselves...
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * collection change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- @SuppressWarnings("unchecked")
- E eventNewValue = (E) event.getNewValue();
- PropertyCollectionValueModelAdapter.this.valueChanged(eventNewValue);
- }
- @Override
- public String toString() {
- return "property change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return (this.value == null) ? EmptyIterator.<E>instance() : this.iterator_();
- }
-
- protected Iterator<E> iterator_() {
- return new SingleElementIterator<E>(this.value);
- }
-
- public int size() {
- return (this.value == null) ? 0 : 1;
- }
-
-
- // ********** AbstractCollectionValueModel implementation **********
-
- @Override
- protected void engageModel() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // synch our value *after* we start listening to the value holder,
- // since its value might change when a listener is added
- this.value = this.valueHolder.getValue();
- }
-
- @Override
- protected void disengageModel() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // clear out the value when we are not listening to the value holder
- this.value = null;
- }
-
-
- // ********** behavior **********
-
- /**
- * synchronize our internal value with the wrapped value
- * and fire the appropriate events
- */
- protected void valueChanged(E newValue) {
- E oldValue = this.value;
- this.value = newValue;
- if (oldValue == null) {
- // we wouldn't get the event if the new value were null too
- this.fireItemAdded(VALUES, newValue);
- } else {
- if (newValue == null) {
- this.fireItemRemoved(VALUES, oldValue);
- } else {
- // we wouldn't get the event if the new value was the same as the old
- this.fireCollectionChanged(VALUES, Collections.singleton(newValue));
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java
deleted file mode 100644
index 1cc5b19bdb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyListValueModelAdapter.java
+++ /dev/null
@@ -1,157 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * An adapter that allows us to make a {@link PropertyValueModel} behave like
- * a read-only, single-element {@link ListValueModel}, sorta.
- * <p>
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a collection with a <code>null</code> element).
- */
-public class PropertyListValueModelAdapter<E>
- extends AbstractListValueModel
- implements ListValueModel<E>
-{
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends E> valueHolder;
-
- /** A listener that forwards any events fired by the value holder. */
- protected final PropertyChangeListener propertyChangeListener;
-
- /** Cache the value. */
- protected E value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Convert the specified property value model to a list
- * value model.
- */
- public PropertyListValueModelAdapter(PropertyValueModel<? extends E> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.propertyChangeListener = this.buildPropertyChangeListener();
- // postpone building the value and listening to the underlying value
- // until we have listeners ourselves...
- }
-
- /**
- * The wrapped value has changed, forward an equivalent
- * list change event to our listeners.
- */
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- @SuppressWarnings("unchecked")
- E eventNewValue = (E) event.getNewValue();
- PropertyListValueModelAdapter.this.valueChanged(eventNewValue);
- }
- @Override
- public String toString() {
- return "property change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return (this.value == null) ?
- EmptyListIterator.<E>instance()
- :
- new SingleElementListIterator<E>(this.value);
- }
-
- public int size() {
- return (this.value == null) ? 0 : 1;
- }
-
- public E get(int index) {
- if (this.value == null) {
- throw this.buildIOOBE(index, 0);
- }
- if (index > 0) {
- throw this.buildIOOBE(index, 1);
- }
- return this.value;
- }
-
- protected static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
- public Object[] toArray() {
- return (this.value == null) ? EMPTY_OBJECT_ARRAY : new Object[] {this.value};
- }
-
-
- // ********** behavior **********
-
- protected IndexOutOfBoundsException buildIOOBE(int index, int size) {
- return new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Override
- protected void engageModel() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // synch our value *after* we start listening to the value holder,
- // since its value might change when a listener is added
- this.value = this.valueHolder.getValue();
- }
-
- @Override
- protected void disengageModel() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.propertyChangeListener);
- // clear out the value when we are not listening to the value holder
- this.value = null;
- }
-
- /**
- * synchronize our internal value with the wrapped value
- * and fire the appropriate events
- */
- protected void valueChanged(E newValue) {
- E oldValue = this.value;
- this.value = newValue;
- if (oldValue == null) {
- this.fireItemAdded(LIST_VALUES, 0, newValue);
- } else {
- if (newValue == null) {
- this.fireItemRemoved(LIST_VALUES, 0, oldValue);
- } else {
- this.fireItemReplaced(LIST_VALUES, 0, newValue, oldValue);
- }
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java
deleted file mode 100644
index 66a2f4c89f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/PropertyValueModelWrapper.java
+++ /dev/null
@@ -1,92 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * another property value model, "lazily" listen to it, and propagate
- * its change notifications. Subclasses must implement the appropriate
- * {@link PropertyValueModel}.
- * <p>
- * Subclasses must implement the following methods:<ul>
- * <li>{@link #valueChanged(PropertyChangeEvent)}<p>
- * implement this method to propagate the appropriate change notification
- * </ul>
- */
-public abstract class PropertyValueModelWrapper<V>
- extends AbstractPropertyValueModel
-{
- /** The wrapped property value model. */
- protected final PropertyValueModel<? extends V> valueHolder;
-
- /** A listener that allows us to synch with changes to the wrapped value holder. */
- protected final PropertyChangeListener valueChangeListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * property value model. The value holder is required.
- */
- protected PropertyValueModelWrapper(PropertyValueModel<? extends V> valueHolder) {
- super();
- if (valueHolder == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.valueChangeListener = this.buildValueChangeListener();
- }
-
- protected PropertyChangeListener buildValueChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PropertyValueModelWrapper.this.valueChanged(event);
- }
- @Override
- public String toString() {
- return "value change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Begin listening to the value holder.
- */
- @Override
- protected void engageModel() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
- /**
- * Stop listening to the value holder.
- */
- @Override
- protected void disengageModel() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
-
-
- // ********** property change support **********
-
- /**
- * The value of the wrapped value holder has changed;
- * propagate the change notification appropriately.
- */
- protected abstract void valueChanged(PropertyChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.java
deleted file mode 100644
index 1c3872a2cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ReadOnlyWritablePropertyValueModelWrapper.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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A simple implementation of {@link WritablePropertyValueModel} that actually
- * ... <em>isn't</em> ... writable. It can however be used in places that require a
- * {@link WritablePropertyValueModel} and where the developer is sure that no
- * attempt will be made to write to it.
- */
-public class ReadOnlyWritablePropertyValueModelWrapper<T>
- extends PropertyValueModelWrapper<T>
- implements WritablePropertyValueModel<T>
-{
- public ReadOnlyWritablePropertyValueModelWrapper(PropertyValueModel<? extends T> valueHolder) {
- super(valueHolder);
- }
-
-
- public T getValue() {
- return this.valueHolder.getValue();
- }
-
- public void setValue(T value) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- this.firePropertyChanged(event.clone(this));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SetCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SetCollectionValueModel.java
deleted file mode 100644
index 2562b5dabb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SetCollectionValueModel.java
+++ /dev/null
@@ -1,134 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A <code>SetCollectionValueModel</code> wraps another
- * {@link CollectionValueModel} and returns the items in the collection
- * only once.
- */
-public class SetCollectionValueModel<E>
- extends CollectionValueModelWrapper<E>
- implements CollectionValueModel<E>
-{
- private final HashBag<E> bag = new HashBag<E>();
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model with the specified wrapped
- * collection value model and a filter that simply accepts every object.
- */
- public SetCollectionValueModel(CollectionValueModel<? extends E> collectionHolder) {
- super(collectionHolder);
- }
-
- /**
- * Construct a collection value model with the specified wrapped
- * list value model and a filter that simply accepts every object.
- */
- public SetCollectionValueModel(ListValueModel<E> listHolder) {
- this(new ListCollectionValueModelAdapter<E>(listHolder));
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new ReadOnlyIterator<E>(this.bag.uniqueIterator());
- }
-
- public int size() {
- return this.bag.uniqueCount();
- }
-
-
- // ********** CollectionValueModelWrapper overrides/implementation **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch our cache *after* we start listening to the nested collection,
- // since its value might change when a listener is added
- CollectionTools.addAll(this.bag, this.collectionHolder);
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the cache when we are not listening to the nested collection
- this.bag.clear();
- }
-
- @Override
- protected void itemsAdded(CollectionAddEvent event) {
- ArrayList<E> addedItems = new ArrayList<E>(event.getItemsSize());
- int uniqueCount = this.bag.uniqueCount();
- for (E item : this.getItems(event)) {
- this.bag.add(item);
- if (this.bag.uniqueCount() > uniqueCount) {
- uniqueCount = this.bag.uniqueCount();
- addedItems.add(item);
- }
- }
- this.fireItemsAdded(VALUES, addedItems);
- }
-
- @Override
- protected void itemsRemoved(CollectionRemoveEvent event) {
- ArrayList<E> removedItems = new ArrayList<E>(event.getItemsSize());
- int uniqueCount = this.bag.uniqueCount();
- for (E item : this.getItems(event)) {
- if (this.bag.remove(item)) {
- if (this.bag.uniqueCount() < uniqueCount) {
- uniqueCount = this.bag.uniqueCount();
- removedItems.add(item);
- }
- } else {
- throw new IllegalStateException("missing item: " + item); //$NON-NLS-1$
- }
- }
- this.fireItemsRemoved(VALUES, removedItems);
- }
-
- @Override
- protected void collectionCleared(CollectionClearEvent event) {
- this.clearCollection(this.bag, VALUES);
- }
-
- @Override
- protected void collectionChanged(CollectionChangeEvent event) {
- this.bag.clear();
- CollectionTools.addAll(this.bag, this.collectionHolder);
- this.fireCollectionChanged(VALUES, new HashSet<E>(this.bag));
- }
-
- @Override
- public void toString(StringBuilder sb) {
- StringTools.append(sb, this);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
deleted file mode 100644
index 87cab8e322..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleCollectionValueModel.java
+++ /dev/null
@@ -1,188 +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.utility.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.WritableCollectionValueModel;
-
-/**
- * Implementation of {@link WritableCollectionValueModel} and {@link Collection}
- * that simply holds a collection and notifies listeners of any changes.
- */
-public class SimpleCollectionValueModel<E>
- extends AbstractModel
- implements WritableCollectionValueModel<E>, Collection<E>
-{
- /** The collection. */
- protected final Collection<E> collection;
-
-
- // ********** constructors **********
-
- /**
- * Construct a collection value model for the specified collection.
- */
- public SimpleCollectionValueModel(Collection<E> collection) {
- super();
- if (collection == null) {
- throw new NullPointerException();
- }
- this.collection = collection;
- }
-
- /**
- * Construct a collection value model with an empty initial collection.
- */
- public SimpleCollectionValueModel() {
- this(new HashBag<E>());
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, CollectionChangeListener.class, VALUES);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new LocalIterator<E>(this.collection.iterator());
- }
-
- public int size() {
- return this.collection.size();
- }
-
-
- // ********** WritableCollectionValueModel implementation **********
-
- /**
- * Allow the collection's elements to be replaced.
- */
- public void setValues(Iterable<E> values) {
- if (values == null) {
- throw new NullPointerException();
- }
- this.collection.clear();
- CollectionTools.addAll(this.collection, values);
- this.fireCollectionChanged(VALUES, this.collection);
- }
-
-
- // ********** Collection implementation **********
-
- public boolean isEmpty() {
- return this.collection.isEmpty();
- }
-
- public boolean contains(Object o) {
- return this.collection.contains(o);
- }
-
- public Object[] toArray() {
- return this.collection.toArray();
- }
-
- public <T extends Object> T[] toArray(T[] a) {
- return this.collection.toArray(a);
- }
-
- public boolean add(E o) {
- return this.addItemToCollection(o, this.collection, VALUES);
- }
-
- public boolean remove(Object o) {
- return this.removeItemFromCollection(o, this.collection, VALUES);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.collection.containsAll(c);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.addItemsToCollection(c, this.collection, VALUES);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.removeItemsFromCollection(c, this.collection, VALUES);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.retainItemsInCollection(c, this.collection, VALUES);
- }
-
- public void clear() {
- this.clearCollection(this.collection, VALUES);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ((o instanceof Collection<?>) && (o instanceof CollectionValueModel<?>)) {
- Collection<E> c1 = CollectionTools.collection(this.collection);
- @SuppressWarnings("unchecked")
- Collection<E> c2 = CollectionTools.collection(((Collection<E>) o).iterator());
- return c1.equals(c2);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return CollectionTools.collection(this.collection).hashCode();
- }
-
-
- // ********** miscellaneous **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.collection);
- }
-
-
- // ********** iterator **********
-
- private class LocalIterator<T> implements Iterator<T> {
- private final Iterator<T> iterator;
- private T next;
-
- LocalIterator(Iterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- return this.next = this.iterator.next();
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleCollectionValueModel.this.fireItemRemoved(VALUES, this.next);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java
deleted file mode 100644
index 5a91096ade..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimpleListValueModel.java
+++ /dev/null
@@ -1,322 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritableListValueModel;
-
-/**
- * Implementation of {@link ListValueModel} and {@link List} that simply holds a
- * list and notifies listeners of any changes.
- */
-public class SimpleListValueModel<E>
- extends AbstractModel
- implements WritableListValueModel<E>, List<E>
-{
- /** The list. */
- protected List<E> list;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list value model for the specified list.
- */
- public SimpleListValueModel(List<E> list) {
- super();
- if (list == null) {
- throw new NullPointerException();
- }
- this.list = list;
- }
-
- /**
- * Construct a list value model with an empty initial list.
- */
- public SimpleListValueModel() {
- this(new ArrayList<E>());
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, ListChangeListener.class, LIST_VALUES);
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return new LocalIterator<E>(this.list.iterator());
- }
-
- public ListIterator<E> listIterator() {
- return new LocalListIterator<E>(this.list.listIterator());
- }
-
- public int size() {
- return this.list.size();
- }
-
- public E get(int index) {
- return this.list.get(index);
- }
-
-
- // ********** WritableListValueModel implementation **********
-
- /**
- * Allow the list's elements to be replaced.
- */
- public void setListValues(Iterable<E> list) {
- if (list == null) {
- throw new NullPointerException();
- }
- this.list.clear();
- CollectionTools.addAll(this.list, list);
- this.fireListChanged(LIST_VALUES, this.list);
- }
-
-
- // ********** List implementation **********
-
- public boolean isEmpty() {
- return this.list.isEmpty();
- }
-
- public boolean contains(Object o) {
- return this.list.contains(o);
- }
-
- public Object[] toArray() {
- return this.list.toArray();
- }
-
- public <T extends Object> T[] toArray(T[] a) {
- return this.list.toArray(a);
- }
-
- public boolean add(E o) {
- return this.addItemToList(o, this.list, LIST_VALUES);
- }
-
- public boolean remove(Object o) {
- return this.removeItemFromList(o, this.list, LIST_VALUES);
- }
-
- public boolean containsAll(Collection<?> c) {
- return this.list.containsAll(c);
- }
-
- public boolean addAll(Collection<? extends E> c) {
- return this.addItemsToList(c, this.list, LIST_VALUES);
- }
-
- public boolean addAll(int index, Collection<? extends E> c) {
- return this.addItemsToList(index, c, this.list, LIST_VALUES);
- }
-
- public boolean removeAll(Collection<?> c) {
- return this.removeItemsFromList(c, this.list, LIST_VALUES);
- }
-
- public boolean retainAll(Collection<?> c) {
- return this.retainItemsInList(c, this.list, LIST_VALUES);
- }
-
- public void clear() {
- this.clearList(this.list, LIST_VALUES);
- }
-
- @Override
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if ((o instanceof List<?>) && (o instanceof ListValueModel<?>)) {
- List<E> l1 = CollectionTools.list(this.list);
- @SuppressWarnings("unchecked")
- List<E> l2 = CollectionTools.list(((List<E>) o).iterator());
- return l1.equals(l2);
- }
- return false;
- }
-
- @Override
- public int hashCode() {
- return this.list.hashCode();
- }
-
- public E set(int index, E element) {
- return this.setItemInList(index, element, this.list, LIST_VALUES);
- }
-
- public void add(int index, E element) {
- this.addItemToList(index, element, this.list, LIST_VALUES);
- }
-
- public E remove(int index) {
- return this.removeItemFromList(index, this.list, LIST_VALUES);
- }
-
- public int indexOf(Object o) {
- return this.list.indexOf(o);
- }
-
- public int lastIndexOf(Object o) {
- return this.list.lastIndexOf(o);
- }
-
- public ListIterator<E> listIterator(int index) {
- return new LocalListIterator<E>(this.list.listIterator(index));
- }
-
- public List<E> subList(int fromIndex, int toIndex) {
- // TODO hmmm ~bjv
- throw new UnsupportedOperationException();
- }
-
-
- // ********** additional behavior **********
-
- /**
- * Move a single element.
- */
- public void move(int targetIndex, int sourceIndex) {
- this.moveItemInList(targetIndex, sourceIndex, this.list, LIST_VALUES);
- }
-
- /**
- * Move a sub-list of elements.
- */
- public void move(int targetIndex, int sourceIndex, int length) {
- this.moveItemsInList(targetIndex, sourceIndex, length, this.list, LIST_VALUES);
- }
-
- /**
- * Remove a range of elements.
- */
- public void remove(int index, int length) {
- this.removeItemsFromList(index, length, this.list, LIST_VALUES);
- }
-
- /**
- * Set a range of elements.
- */
- public void set(int index, List<E> elements) {
- this.setItemsInList(index, elements, this.list, LIST_VALUES);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.list);
- }
-
-
- // ********** iterators **********
-
- private class LocalIterator<T> implements Iterator<T> {
- private final Iterator<T> iterator;
- private int index = -1;
- private T next;
-
- LocalIterator(Iterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- this.next = this.iterator.next();
- this.index++;
- return this.next;
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleListValueModel.this.fireItemRemoved(LIST_VALUES, this.index, this.next);
- }
-
- }
-
- private class LocalListIterator<T> implements ListIterator<T> {
- private final ListIterator<T> iterator;
- private int last = -1;
- private int next = 0;
- private T current;
-
- LocalListIterator(ListIterator<T> iterator) {
- super();
- this.iterator = iterator;
- }
-
- public boolean hasNext() {
- return this.iterator.hasNext();
- }
-
- public T next() {
- this.current = this.iterator.next();
- this.last = this.next++;
- return this.current;
- }
-
- public int nextIndex() {
- return this.iterator.nextIndex();
- }
-
- public boolean hasPrevious() {
- return this.iterator.hasPrevious();
- }
-
- public T previous() {
- this.current = this.iterator.previous();
- this.last = --this.next;
- return this.current;
- }
-
- public int previousIndex() {
- return this.iterator.previousIndex();
- }
-
- @SuppressWarnings("synthetic-access")
- public void set(T o) {
- this.iterator.set(o);
- SimpleListValueModel.this.fireItemReplaced(LIST_VALUES, this.last, o, this.current);
- }
-
- @SuppressWarnings("synthetic-access")
- public void add(T o) {
- this.iterator.add(o);
- SimpleListValueModel.this.fireItemAdded(LIST_VALUES, this.next, o);
- }
-
- @SuppressWarnings("synthetic-access")
- public void remove() {
- this.iterator.remove();
- SimpleListValueModel.this.fireItemRemoved(LIST_VALUES, this.last, this.current);
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java
deleted file mode 100644
index 47e16d6f89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SimplePropertyValueModel.java
+++ /dev/null
@@ -1,66 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Implementation of {@link WritablePropertyValueModel} that simply holds on to an
- * object and uses it as the value.
- */
-public class SimplePropertyValueModel<T>
- extends AbstractModel
- implements WritablePropertyValueModel<T>
-{
- /** The value. */
- protected T value;
-
-
- /**
- * Construct a property value model for the specified value.
- */
- public SimplePropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
- /**
- * Construct a property value model with a starting value of null.
- */
- public SimplePropertyValueModel() {
- this(null);
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new SingleAspectChangeSupport(this, PropertyChangeListener.class, VALUE);
- }
-
-
- public T getValue() {
- return this.value;
- }
-
- public void setValue(T value) {
- T old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE, old, value);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.java
deleted file mode 100644
index 36493a71e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelAdapter.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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * An adapter that allows us to make a {@link CollectionValueModel}
- * (or {@link ListValueModel}) behave like a {@link ListValueModel}
- * that keeps its contents sorted and notifies listeners appropriately.
- * <p>
- * The {@link Comparator} can be changed at any time; allowing the same
- * adapter to be used with different sort criteria (e.g. when the user
- * wants to sort a list of files first by name, then by date, then by size).
- * <p>
- * <strong>NB:</strong> Since we only listen to the wrapped collection when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * collection while we are listening to it, results to various methods
- * (e.g. {@link #size()}, {@link #get(int)}) will be
- * unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- *
- * @see SortedListValueModelWrapper
- */
-public class SortedListValueModelAdapter<E>
- extends CollectionListValueModelAdapter<E>
-{
- /**
- * A comparator used for sorting the elements;
- * if it is null, we use "natural ordering".
- */
- protected Comparator<E> comparator;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified collection value model and sort its contents
- * using the specified comparator.
- */
- public SortedListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder, Comparator<E> comparator) {
- super(collectionHolder);
- this.comparator = comparator;
- }
-
- /**
- * Wrap the specified collection value model and sort its contents
- * based on the elements' "natural ordering".
- */
- public SortedListValueModelAdapter(CollectionValueModel<? extends E> collectionHolder) {
- this(collectionHolder, null);
- }
-
-
- // ********** accessors **********
-
- public void setComparator(Comparator<E> comparator) {
- this.comparator = comparator;
- this.sortList();
- }
-
-
- // ********** behavior **********
-
- /**
- * Sort the internal list before the superclass
- * sends out change notification.
- */
- @Override
- protected void buildList(int size) {
- super.buildList(size);
- Collections.sort(this.list, this.comparator);
- }
-
- /**
- * the list will need to be sorted after the item is added
- */
- @Override
- protected void itemsAdded(CollectionAddEvent event) {
- // first add the items and notify our listeners...
- super.itemsAdded(event);
- // ...then sort the list
- this.sortList();
- }
-
- /**
- * sort the list and notify our listeners, if necessary;
- */
- protected void sortList() {
- // save the unsorted state of the sorted list so we can minimize the number of "replaced" items
- @SuppressWarnings("unchecked")
- ArrayList<E> unsortedList = (ArrayList<E>) this.list.clone();
- Collections.sort(this.list, this.comparator);
- Range diffRange = CollectionTools.identityDiffRange(unsortedList, this.list);
- if (diffRange.size > 0) {
- List<E> unsortedItems = unsortedList.subList(diffRange.start, diffRange.end + 1);
- List<E> sortedItems = this.list.subList(diffRange.start, diffRange.end + 1);
- this.fireItemsReplaced(LIST_VALUES, diffRange.start, sortedItems, unsortedItems);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelWrapper.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelWrapper.java
deleted file mode 100644
index ea39562a46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/SortedListValueModelWrapper.java
+++ /dev/null
@@ -1,250 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * A wrapper that keeps the contents of a {@link ListValueModel} sorted
- * and notifies listeners appropriately.
- * <p>
- * The {@link Comparator} can be changed at any time; allowing the same
- * adapter to be used with different sort criteria (e.g. when the user
- * wants to sort a list of files first by name, then by date, then by size).
- * <p>
- * <strong>NB:</strong> Since we only listen to the wrapped collection when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * collection while we are listening to it, results to various methods
- * (e.g. {@link #size()}, {@link #get(int)}) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, client objects will also be listeners.
- *
- * @see SortedListValueModelAdapter
- */
-public class SortedListValueModelWrapper<E>
- extends ListValueModelWrapper<E>
- implements ListValueModel<E>
-{
- /**
- * A comparator used for sorting the elements;
- * if it is null, we use "natural ordering".
- */
- protected Comparator<E> comparator;
-
- /**
- * Our internal list, which holds the same elements as
- * the wrapped list, but keeps them sorted.
- */
- // we declare this an ArrayList so we can use #clone() and #ensureCapacity(int)
- protected final ArrayList<E> sortedList;
-
-
- // ********** constructors **********
-
- /**
- * Wrap the specified list value model and sort its contents
- * using the specified comparator.
- */
- public SortedListValueModelWrapper(ListValueModel<? extends E> listHolder, Comparator<E> comparator) {
- super(listHolder);
- this.comparator = comparator;
- this.sortedList = new ArrayList<E>(listHolder.size());
- // postpone building the sorted list and listening to the wrapped list
- // until we have listeners ourselves...
- }
-
- /**
- * Wrap the specified list value model and sort its contents
- * based on the elements' "natural ordering".
- */
- public SortedListValueModelWrapper(ListValueModel<? extends E> listHolder) {
- this(listHolder, null);
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E> listIterator() {
- return new ReadOnlyListIterator<E>(this.sortedList);
- }
-
- public E get(int index) {
- return this.sortedList.get(index);
- }
-
- public int size() {
- return this.sortedList.size();
- }
-
- public Object[] toArray() {
- return this.sortedList.toArray();
- }
-
-
- // ********** accessors **********
-
- public void setComparator(Comparator<E> comparator) {
- this.comparator = comparator;
- this.sortList();
- }
-
-
- // ********** behavior **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch the sorted list *after* we start listening to the wrapped list holder,
- // since its value might change when a listener is added
- this.buildSortedList();
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the sorted list when we are not listening to the wrapped list holder
- this.sortedList.clear();
- }
-
- protected void buildSortedList() {
- // if the new list is empty, do nothing
- int size = this.listHolder.size();
- if (size != 0) {
- this.buildSortedList(size);
- }
- }
-
- protected void buildSortedList(int size) {
- this.sortedList.ensureCapacity(size);
- for (E each : this.listHolder) {
- this.sortedList.add(each);
- }
- Collections.sort(this.sortedList, this.comparator);
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list.
- */
- @Override
- protected void itemsAdded(ListAddEvent event) {
- // first add the items and notify our listeners...
- this.addItemsToList(this.getItems(event), this.sortedList, LIST_VALUES);
- // ...then sort the list and notify our listeners
- this.sortList();
- }
-
- /**
- * Items were removed from the wrapped list.
- */
- @Override
- protected void itemsRemoved(ListRemoveEvent event) {
- this.removeItemsFromList(this.getItems(event), this.sortedList, LIST_VALUES);
- // no sorting needed
- }
-
- /**
- * Items were replaced in the wrapped list.
- */
- @Override
- protected void itemsReplaced(ListReplaceEvent event) {
- // first remove the old items and notify our listeners...
- this.removeItemsFromList(this.getOldItems(event), this.sortedList, LIST_VALUES);
- // then add the new items and notify our listeners...
- this.addItemsToList(this.getNewItems(event), this.sortedList, LIST_VALUES);
- // ...then sort the list and notify our listeners
- this.sortList();
- }
-
- /**
- * Items were moved in the wrapped list.
- */
- @Override
- protected void itemsMoved(ListMoveEvent event) {
- // do nothing - sort order should remain unchanged
- }
-
- /**
- * The wrapped list was cleared.
- */
- @Override
- protected void listCleared(ListClearEvent event) {
- this.clearList(this.sortedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list has changed in some dramatic fashion.
- * Rebuild our sorted list and notify our listeners.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- int size = this.listHolder.size();
- if (size == 0) {
- if (this.sortedList.isEmpty()) {
- // no change
- } else {
- this.clearList(this.sortedList, LIST_VALUES);
- }
- } else {
- if (this.sortedList.isEmpty()) {
- this.buildSortedList(size);
- this.fireItemsAdded(LIST_VALUES, 0, this.sortedList);
- } else {
- this.sortedList.clear();
- this.buildSortedList(size);
- this.fireListChanged(LIST_VALUES, this.sortedList);
- }
- }
- }
-
- /**
- * sort the sorted list and notify our listeners, if necessary;
- */
- protected void sortList() {
- // save the unsorted state of the sorted list so we can minimize the number of "replaced" items
- @SuppressWarnings("unchecked")
- ArrayList<E> unsortedList = (ArrayList<E>) this.sortedList.clone();
- Collections.sort(this.sortedList, this.comparator);
- Range diffRange = CollectionTools.identityDiffRange(unsortedList, this.sortedList);
- if (diffRange.size > 0) {
- List<E> unsortedItems = unsortedList.subList(diffRange.start, diffRange.end + 1);
- List<E> sortedItems = this.sortedList.subList(diffRange.start, diffRange.end + 1);
- this.fireItemsReplaced(LIST_VALUES, diffRange.start, sortedItems, unsortedItems);
- }
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.sortedList);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.java
deleted file mode 100644
index c5edcfdbdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StatePropertyValueModelAdapter.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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a model, "lazily" listen to it, and convert
- * its state change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must implement:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current model
- * </ul>
- * Subclasses might want to override the following methods
- * to improve performance (by not recalculating the value, if possible):<ul>
- * <li>{@link #stateChanged(StateChangeEvent event)}
- * </ul>
- */
-public abstract class StatePropertyValueModelAdapter<T>
- extends AbstractPropertyValueModelAdapter<T>
-{
- /** The wrapped model. */
- protected final Model model;
-
- /** A listener that allows us to synch with changes to the wrapped model. */
- protected final StateChangeListener stateChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped model.
- */
- protected StatePropertyValueModelAdapter(Model model) {
- super();
- this.model = model;
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
- protected StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- StatePropertyValueModelAdapter.this.stateChanged(event);
- }
- @Override
- public String toString() {
- return "state change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the model.
- */
- @Override
- protected void engageModel_() {
- this.model.addStateChangeListener(this.stateChangeListener);
- }
-
- /**
- * Stop listening to the model.
- */
- @Override
- protected void disengageModel_() {
- this.model.removeStateChangeListener(this.stateChangeListener);
- }
-
-
- // ********** state change support **********
-
- /**
- * The model's state changed;
- * propagate the change notification appropriately.
- */
- protected void stateChanged(@SuppressWarnings("unused") StateChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java
deleted file mode 100644
index 7d6d063d75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticCollectionValueModel.java
+++ /dev/null
@@ -1,73 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-
-/**
- * Implementation of {@link CollectionValueModel} that can be used for
- * returning an iterator on a static collection, but still allows listeners to be added.
- * Listeners will <em>never</em> be notified of any changes, because there should be none.
- */
-public class StaticCollectionValueModel<E>
- extends AbstractModel
- implements CollectionValueModel<E>
-{
- /** The elements. */
- protected final Object[] elements;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static collection value model for the specified array.
- */
- public StaticCollectionValueModel(E... elements) {
- super();
- this.elements = elements.clone();
- }
-
- /**
- * Construct a static collection value model for the specified elements.
- */
- public StaticCollectionValueModel(Iterable<? extends E> elements) {
- super();
- this.elements = ArrayTools.array(elements);
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- public int size() {
- return this.elements.length;
- }
-
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- // we can cast here since our constructors require the elements to be
- // of type E and ArrayIterator is read-only
- return (Iterator<E>) new ArrayIterator<Object>(this.elements);
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(Arrays.toString(this.elements));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java
deleted file mode 100644
index c57c531b8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticListValueModel.java
+++ /dev/null
@@ -1,93 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * Implementation of {@link ListValueModel} that can be used for
- * returning a list iterator on a static list, but still allows listeners to be added.
- * Listeners will <em>never</em> be notified of any changes, because there should be none.
- */
-public class StaticListValueModel<E>
- extends AbstractModel
- implements ListValueModel<E>
-{
- /** The elements. */
- protected final Object[] elements;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static list value model for the specified elements.
- */
- public StaticListValueModel(E... elements) {
- super();
- this.elements = elements.clone();
- }
-
- /**
- * Construct a static list value model for the specified elements.
- */
- public StaticListValueModel(Iterable<? extends E> elements) {
- super();
- this.elements = ArrayTools.array(elements);
- }
-
-
- // ********** ListValueModel implementation **********
-
- @SuppressWarnings("unchecked")
- public Iterator<E> iterator() {
- // we can cast here since our constructors require the elements to be
- // of type E and ArrayIterator is read-only
- return (Iterator<E>) new ArrayIterator<Object>(this.elements);
- }
-
- @SuppressWarnings("unchecked")
- public ListIterator<E> listIterator() {
- // we can cast here since our constructors require the elements to be
- // of type E and ArrayListIterator is read-only
- return (ListIterator<E>) new ArrayListIterator<Object>(this.elements);
- }
-
- public int size() {
- return this.elements.length;
- }
-
- @SuppressWarnings("unchecked")
- public E get(int index) {
- // we can cast here since our constructors require the elements to be
- // of type E
- return (E) this.elements[index];
- }
-
- public Object[] toArray() {
- return this.elements.clone();
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(Arrays.toString(this.elements));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java
deleted file mode 100644
index ce107e89d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticPropertyValueModel.java
+++ /dev/null
@@ -1,53 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * Implementation of {@link PropertyValueModel} that can be used for
- * returning a static value, but still allows listeners to be added.
- * Listeners will <em>never</em> be notified of any changes, because there should be none.
- */
-public class StaticPropertyValueModel<T>
- extends AbstractModel
- implements PropertyValueModel<T>
-{
- /** The value. */
- protected final T value;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a static property value model for the specified value.
- */
- public StaticPropertyValueModel(T value) {
- super();
- this.value = value;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T getValue() {
- return this.value;
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java
deleted file mode 100644
index 5c39e2f040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/StaticTreeValueModel.java
+++ /dev/null
@@ -1,57 +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.utility.internal.model.value;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * Implementation of {@link TreeValueModel} that can be used for
- * returning an iterator on a static tree, but still allows listeners to be added.
- * Listeners will <em>never</em> be notified of any changes, because there should be none.
- */
-public class StaticTreeValueModel<E>
- extends AbstractModel
- implements TreeValueModel<E>
-{
- /** The tree's nodes. */
- protected final Iterable<? extends E> nodes;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a read-only tree value model for the specified nodes.
- */
- public StaticTreeValueModel(Iterable<? extends E> nodes) {
- super();
- if (nodes == null) {
- throw new NullPointerException();
- }
- this.nodes = nodes;
- }
-
- // ********** TreeValueModel implementation **********
-
- public Iterator<E> nodes() {
- return new ReadOnlyIterator<E>(this.nodes.iterator());
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.nodes);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java
deleted file mode 100644
index cea3c6b9dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationListValueModelAdapter.java
+++ /dev/null
@@ -1,266 +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.utility.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * An adapter that allows us to transform a {@link ListValueModel}
- * (or {@link CollectionValueModel}) into a read-only {@link ListValueModel}
- * whose items are tranformations of the items in the wrapped
- * {@link ListValueModel}. It will keep its contents in synch with
- * the contents of the wrapped {@link ListValueModel} and notifies its
- * listeners of any changes.
- * <p>
- * The {@link Transformer} can be changed at any time; allowing the same
- * adapter to be used with different transformations.
- * <p>
- * <strong>NB:</strong> Since we only listen to the wrapped list when we have
- * listeners ourselves and we can only stay in synch with the wrapped
- * list while we are listening to it, results to various methods
- * (e.g. {@link #size()}, {@link #get(int)}) will be unpredictable whenever
- * we do not have any listeners. This should not be too painful since,
- * most likely, clients will also be listeners.
- */
-public class TransformationListValueModelAdapter<E1, E2>
- extends ListValueModelWrapper<E1>
- implements ListValueModel<E2>
-{
-
- /** This transforms the items, unless the subclass overrides {@link #transformItem(Object)}). */
- protected Transformer<E1, E2> transformer;
-
- /** The list of transformed items. */
- protected final List<E2> transformedList;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder is required.
- */
- public TransformationListValueModelAdapter(ListValueModel<? extends E1> listHolder, Transformer<E1, E2> transformer) {
- super(listHolder);
- this.transformer = transformer;
- this.transformedList = new ArrayList<E2>();
- }
-
- /**
- * Constructor - the list holder is required.
- */
- public TransformationListValueModelAdapter(ListValueModel<? extends E1> listHolder) {
- this(listHolder, Transformer.Null.<E1, E2>instance());
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public TransformationListValueModelAdapter(CollectionValueModel<? extends E1> collectionHolder, Transformer<E1, E2> transformer) {
- this(new CollectionListValueModelAdapter<E1>(collectionHolder), transformer);
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public TransformationListValueModelAdapter(CollectionValueModel<? extends E1> collectionHolder) {
- this(new CollectionListValueModelAdapter<E1>(collectionHolder));
- }
-
-
- // ********** ListValueModel implementation **********
-
- public Iterator<E2> iterator() {
- return this.listIterator();
- }
-
- public ListIterator<E2> listIterator() {
- return new ReadOnlyListIterator<E2>(this.transformedList);
- }
-
- public E2 get(int index) {
- return this.transformedList.get(index);
- }
-
- public int size() {
- return this.transformedList.size();
- }
-
- public Object[] toArray() {
- return this.transformedList.toArray();
- }
-
- // ********** behavior **********
-
- @Override
- protected void engageModel() {
- super.engageModel();
- // synch the transformed list *after* we start listening to the list holder,
- // since its value might change when a listener is added
- this.transformedList.addAll(this.transformItems(this.listHolder));
- }
-
- @Override
- protected void disengageModel() {
- super.disengageModel();
- // clear out the list when we are not listening to the collection holder
- this.transformedList.clear();
- }
-
- /**
- * Transform the items in the specified list value model.
- */
- protected List<E2> transformItems(ListValueModel<? extends E1> lvm) {
- return this.transformItems(lvm, lvm.size());
- }
-
- /**
- * Transform the items associated with the specified event.
- */
- protected List<E2> transformItems(ListAddEvent event) {
- return this.transformItems(this.getItems(event), event.getItemsSize());
- }
-
- /**
- * Transform the items associated with the specified event.
- */
- protected List<E2> transformItems(ListRemoveEvent event) {
- return this.transformItems(this.getItems(event), event.getItemsSize());
- }
-
- /**
- * Transform the new items associated with the specified event.
- */
- protected List<E2> transformNewItems(ListReplaceEvent event) {
- return this.transformItems(this.getNewItems(event), event.getItemsSize());
- }
-
- /**
- * Transform the old items associated with the specified event.
- */
- protected List<E2> transformOldItems(ListReplaceEvent event) {
- return this.transformItems(this.getOldItems(event), event.getItemsSize());
- }
-
- /**
- * Transform the specified items.
- */
- protected List<E2> transformItems(Iterable<? extends E1> items, int size) {
- List<E2> result = new ArrayList<E2>(size);
- for (E1 item : items) {
- result.add(this.transformItem(item));
- }
- return result;
- }
-
- /**
- * Transform the specified item.
- */
- protected E2 transformItem(E1 item) {
- return this.transformer.transform(item);
- }
-
- /**
- * Change the transformer and rebuild the collection.
- */
- public void setTransformer(Transformer<E1, E2> transformer) {
- this.transformer = transformer;
- this.rebuildTransformedList();
- }
-
- /**
- * Synchronize our cache with the wrapped collection.
- */
- protected void rebuildTransformedList() {
- this.transformedList.clear();
- this.transformedList.addAll(this.transformItems(this.listHolder));
- this.fireListChanged(LIST_VALUES, this.transformedList);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.transformedList);
- }
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the wrapped list holder.
- * Transform them, add them to our transformation list,
- * and notify our listeners.
- */
- @Override
- protected void itemsAdded(ListAddEvent event) {
- this.addItemsToList(event.getIndex(), this.transformItems(event), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were removed from the wrapped list holder.
- * Remove the corresponding items from our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsRemoved(ListRemoveEvent event) {
- this.removeItemsFromList(event.getIndex(), event.getItemsSize(), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were replaced in the wrapped list holder.
- * Replace the corresponding items in our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsReplaced(ListReplaceEvent event) {
- this.setItemsInList(event.getIndex(), this.transformNewItems(event), this.transformedList, LIST_VALUES);
- }
-
- /**
- * Items were moved in the wrapped list holder.
- * Move the corresponding items in our transformation list
- * and notify our listeners.
- */
- @Override
- protected void itemsMoved(ListMoveEvent event) {
- this.moveItemsInList(event.getTargetIndex(), event.getSourceIndex(), event.getLength(), this.transformedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list holder was cleared.
- * Clear our transformation list and notify our listeners.
- */
- @Override
- protected void listCleared(ListClearEvent event) {
- this.clearList(this.transformedList, LIST_VALUES);
- }
-
- /**
- * The wrapped list holder has changed in some dramatic fashion.
- * Rebuild our transformation list and notify our listeners.
- */
- @Override
- protected void listChanged(ListChangeEvent event) {
- this.rebuildTransformedList();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
deleted file mode 100644
index c76ef7e01f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationPropertyValueModel.java
+++ /dev/null
@@ -1,144 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * A <code>TransformationPropertyValueModel</code> wraps another
- * {@link PropertyValueModel} and uses a {@link Transformer}
- * to transform the wrapped value before it is returned by {@link #getValue()}.
- * <p>
- * As an alternative to building a {@link Transformer},
- * a subclass of <code>TransformationPropertyValueModel</code> can
- * either override {@link #transform_(Object)} or,
- * if something other than null should be returned when the wrapped value
- * is null, override {@link #transform(Object)}.
- *
- * @see Transformer
- */
-public class TransformationPropertyValueModel<T1, T2>
- extends PropertyValueModelWrapper<T1>
- implements PropertyValueModel<T2>
-{
- protected final Transformer<T1, T2> transformer;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a property value model with the specified nested
- * property value model and the default transformer.
- * Use this constructor if you want to override
- * {@link #transform_(Object)} or {@link #transform(Object)}
- * method instead of building a {@link Transformer}.
- */
- public TransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder) {
- super(valueHolder);
- this.transformer = this.buildTransformer();
- }
-
- /**
- * Construct an property value model with the specified nested
- * property value model and transformer.
- */
- public TransformationPropertyValueModel(PropertyValueModel<? extends T1> valueHolder, Transformer<T1, T2> transformer) {
- super(valueHolder);
- this.transformer = transformer;
- }
-
- protected Transformer<T1, T2> buildTransformer() {
- return new DefaultTransformer();
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public T2 getValue() {
- // transform the object returned by the nested value model before returning it
- return this.transform(this.valueHolder.getValue());
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- // transform the values before propagating the change event
- @SuppressWarnings("unchecked")
- T1 eventOldValue = (T1) event.getOldValue();
- Object oldValue = this.transformOld(eventOldValue);
- @SuppressWarnings("unchecked")
- T1 eventNewValue = (T1) event.getNewValue();
- Object newValue = this.transformNew(eventNewValue);
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
-
- // ********** behavior **********
-
- /**
- * Transform the specified value and return the result.
- * This is called by
- * {@link #getValue()},
- * {@link #transformOld(T1)}, and
- * {@link #transformNew(T1)}.
- */
- protected T2 transform(T1 value) {
- return this.transformer.transform(value);
- }
-
- /**
- * Transform the specified, non-null, value and return the result.
- */
- protected T2 transform_(@SuppressWarnings("unused") T1 value) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
- /**
- * Transform the specified old value and return the result.
- * By default, call {@link #transform(Object)}.
- * This is called by {@link #valueChanged(PropertyChangeEvent)}.
- */
- protected T2 transformOld(T1 value) {
- return this.transform(value);
- }
-
- /**
- * Transform the specified new value and return the result.
- * By default, call {@link #transform(Object)}.
- * This is called by {@link #valueChanged(PropertyChangeEvent)}.
- */
- protected T2 transformNew(T1 value) {
- return this.transform(value);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-
- // ********** default transformer **********
-
- /**
- * The default transformer will return null if the wrapped value is null.
- * If the wrapped value is not null, it is transformed by a subclass
- * implementation of #transform_(Object).
- */
- protected class DefaultTransformer implements Transformer<T1, T2> {
- public T2 transform(T1 value) {
- return (value == null) ? null : TransformationPropertyValueModel.this.transform_(value);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
deleted file mode 100644
index f4bf546a25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TransformationWritablePropertyValueModel.java
+++ /dev/null
@@ -1,131 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * A <code>TransformationWritablePropertyValueModel</code> wraps another
- * {@link WritablePropertyValueModel} and uses a {@link BidiTransformer}
- * to:<ul>
- * <li>transform the wrapped value before it is returned by {@link #getValue()}
- * <li>"reverse-transform" the new value that comes in via
- * {@link #setValue(Object)}
- * </ul>
- * As an alternative to building a {@link BidiTransformer},
- * a subclass of <code>TransformationWritablePropertyValueModel</code> can
- * override {@link #transform_(Object)} and {@link #reverseTransform_(Object)};
- * or, if something other than null should be returned when the wrapped value
- * is null or the new value is null, override {@link #transform(Object)}
- * and {@link #reverseTransform(Object)}.
- */
-public class TransformationWritablePropertyValueModel<T1, T2>
- extends TransformationPropertyValueModel<T1, T2>
- implements WritablePropertyValueModel<T2>
-{
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and the default bidi transformer.
- * Use this constructor if you want to override the
- * {@link #transform_(Object)} and {@link #reverseTransform_(Object)}
- * (or {@link #transform(Object)} and {@link #reverseTransform(Object)})
- * methods instead of building a {@link BidiTransformer}.
- */
- public TransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder) {
- super(valueHolder);
- }
-
- /**
- * Construct a writable property value model with the specified nested
- * writable property value model and bidi transformer.
- */
- public TransformationWritablePropertyValueModel(WritablePropertyValueModel<T1> valueHolder, BidiTransformer<T1, T2> transformer) {
- super(valueHolder, transformer);
- }
-
- @Override
- protected BidiTransformer<T1, T2> buildTransformer() {
- return new DefaultBidiTransformer();
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(T2 value) {
- // "reverse-transform" the object before passing it to the the nested value model
- this.getValueHolder().setValue(this.reverseTransform(value));
- }
-
-
- // ********** behavior **********
-
- /**
- * "Reverse-transform" the specified value and return the result.
- * This is called by {@link #setValue(Object)}.
- */
- protected T1 reverseTransform(T2 value) {
- return this.getTransformer().reverseTransform(value);
- }
-
- /**
- * "Reverse-transform" the specified, non-<code>null</code>,
- * value and return the result.
- */
- protected T1 reverseTransform_(@SuppressWarnings("unused") T2 value) {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-
- // ********** queries **********
-
- /**
- * Our constructors accept only a {@link WritablePropertyValueModel<T1>},
- * so this cast should be safe.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<T1> getValueHolder() {
- return (WritablePropertyValueModel<T1>) this.valueHolder;
- }
-
- /**
- * Our constructors accept only a {@link BidiTransformer<T1, T2>},
- * so this cast should be safe.
- */
- protected BidiTransformer<T1, T2> getTransformer() {
- return (BidiTransformer<T1, T2>) this.transformer;
- }
-
-
- // ********** default bidi transformer **********
-
- /**
- * The default bidi transformer will return <code>null</code> if the
- * wrapped value is <code>null</code>.
- * If the wrapped value is not <code>null</code>, it is transformed by a subclass
- * implementation of {@link #transform_(Object)}.
- * The default bidi transformer will also return <code>null</code>
- * if the new value is <code>null</code>.
- * If the new value is not <code>null</code>, it is reverse-transformed
- * by a subclass implementation of {@link #reverseTransform_(Object)}.
- */
- protected class DefaultBidiTransformer
- extends DefaultTransformer
- implements BidiTransformer<T1, T2>
- {
- public T1 reverseTransform(T2 value) {
- return (value == null) ? null : TransformationWritablePropertyValueModel.this.reverseTransform_(value);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java
deleted file mode 100644
index b95622d0cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreeAspectAdapter.java
+++ /dev/null
@@ -1,155 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This extension of {@link AspectTreeValueModelAdapter} provides
- * basic tree change support.
- * This converts a set of one or more trees into
- * a single {@link #NODES} tree.
- * <p>
- * The typical subclass will override the following methods (see the descriptions
- * in {@link AspectTreeValueModelAdapter}):<ul>
- * <li>{@link #nodes_()}
- * <li>{@link #nodes()}
- * </ul>
- */
-public abstract class TreeAspectAdapter<S extends Model, E>
- extends AspectTreeValueModelAdapter<S, E>
-{
- /**
- * The name of the subject's trees that we use for the value.
- */
- protected final String[] treeNames;
- protected static final String[] EMPTY_TREE_NAMES = new String[0];
-
- /** A listener that listens to the subject's tree aspects. */
- protected final TreeChangeListener treeChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a tree aspect adapter for the specified subject
- * and tree.
- */
- protected TreeAspectAdapter(String treeName, S subject) {
- this(new String[] {treeName}, subject);
- }
-
- /**
- * Construct a tree aspect adapter for the specified subject
- * and trees.
- */
- protected TreeAspectAdapter(String[] treeNames, S subject) {
- this(new StaticPropertyValueModel<S>(subject), treeNames);
- }
-
- /**
- * Construct a tree aspect adapter for the specified subject holder
- * and trees.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder, String... treeNames) {
- super(subjectHolder);
- this.treeNames = treeNames;
- this.treeChangeListener = this.buildTreeChangeListener();
- }
-
- /**
- * Construct a tree aspect adapter for the specified subject holder
- * and trees.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder, Collection<String> treeNames) {
- this(subjectHolder, treeNames.toArray(new String[treeNames.size()]));
- }
-
- /**
- * Construct a tree aspect adapter for an "unchanging" tree in
- * the specified subject. This is useful for a tree aspect that does not
- * change for a particular subject; but the subject will change, resulting in
- * a new tree.
- */
- protected TreeAspectAdapter(PropertyValueModel<? extends S> subjectHolder) {
- this(subjectHolder, EMPTY_TREE_NAMES);
- }
-
-
- // ********** initialization **********
-
- protected TreeChangeListener buildTreeChangeListener() {
- // transform the subject's tree change events into VALUE tree change events
- return new TreeChangeListener() {
- public void nodeAdded(TreeAddEvent event) {
- TreeAspectAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeRemoveEvent event) {
- TreeAspectAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeClearEvent event) {
- TreeAspectAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- TreeAspectAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "tree change listener: " + Arrays.asList(TreeAspectAdapter.this.treeNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected void engageSubject_() {
- for (String treeName : this.treeNames) {
- ((Model) this.subject).addTreeChangeListener(treeName, this.treeChangeListener);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- for (String treeName : this.treeNames) {
- ((Model) this.subject).removeTreeChangeListener(treeName, this.treeChangeListener);
- }
- }
-
-
- // ********** behavior **********
-
- protected void nodeAdded(TreeAddEvent event) {
- this.fireNodeAdded(event.clone(this, NODES));
- }
-
- protected void nodeRemoved(TreeRemoveEvent event) {
- this.fireNodeRemoved(event.clone(this, NODES));
- }
-
- protected void treeCleared(TreeClearEvent event) {
- this.fireTreeCleared(event.clone(this, NODES));
- }
-
- protected void treeChanged(TreeChangeEvent event) {
- this.fireTreeChanged(event.clone(this, NODES));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java
deleted file mode 100644
index c72feb2c8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/TreePropertyValueModelAdapter.java
+++ /dev/null
@@ -1,144 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-
-/**
- * This abstract class provides the infrastructure needed to wrap
- * a tree value model, "lazily" listen to it, and convert
- * its change notifications into property value model change
- * notifications.
- * <p>
- * Subclasses must override:<ul>
- * <li>{@link #buildValue()}<p>
- * to return the current property value, as derived from the
- * current collection value
- * </ul>
- * Subclasses might want to override the following methods
- * to improve performance (by not recalculating the value, if possible):<ul>
- * <li>{@link #nodeAdded(TreeChangeEvent event)}
- * <li>{@link #nodeRemoved(TreeChangeEvent event)}
- * <li>{@link #treeCleared(TreeChangeEvent event)}
- * <li>{@link #treeChanged(TreeChangeEvent event)}
- * </ul>
- */
-public abstract class TreePropertyValueModelAdapter<T>
- extends AbstractPropertyValueModelAdapter<T>
-{
- /** The wrapped tree value model. */
- protected final TreeValueModel<?> treeHolder;
-
- /** A listener that allows us to synch with changes to the wrapped tree holder. */
- protected final TreeChangeListener treeChangeListener;
-
-
- // ********** constructor/initialization **********
-
- /**
- * Construct a property value model with the specified wrapped
- * tree value model.
- */
- protected TreePropertyValueModelAdapter(TreeValueModel<?> treeHolder) {
- super();
- this.treeHolder = treeHolder;
- this.treeChangeListener = this.buildTreeChangeListener();
- }
-
- protected TreeChangeListener buildTreeChangeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeAddEvent event) {
- TreePropertyValueModelAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeRemoveEvent event) {
- TreePropertyValueModelAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeClearEvent event) {
- TreePropertyValueModelAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- TreePropertyValueModelAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "tree change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the tree holder.
- */
- @Override
- protected void engageModel_() {
- this.treeHolder.addTreeChangeListener(TreeValueModel.NODES, this.treeChangeListener);
- }
-
- /**
- * Stop listening to the tree holder.
- */
- @Override
- protected void disengageModel_() {
- this.treeHolder.removeTreeChangeListener(TreeValueModel.NODES, this.treeChangeListener);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.treeHolder);
- }
-
-
- // ********** state change support **********
-
- /**
- * Nodes were added to the wrapped tree holder;
- * propagate the change notification appropriately.
- */
- protected void nodeAdded(@SuppressWarnings("unused") TreeAddEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * Nodes were removed from the wrapped tree holder;
- * propagate the change notification appropriately.
- */
- protected void nodeRemoved(@SuppressWarnings("unused") TreeRemoveEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped tree holder was cleared;
- * propagate the change notification appropriately.
- */
- protected void treeCleared(@SuppressWarnings("unused") TreeClearEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
- /**
- * The wrapped tree holder changed;
- * propagate the change notification appropriately.
- */
- protected void treeChanged(@SuppressWarnings("unused") TreeChangeEvent event) {
- // by default, simply recalculate the value and fire an event
- this.propertyChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java
deleted file mode 100644
index 9effcdb82d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueAspectAdapter.java
+++ /dev/null
@@ -1,201 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Abstract class that provides support for wrapping a {@link WritablePropertyValueModel}
- * and listening for changes to <em>aspects</em> of the <em>value</em> contained
- * by the {@link WritablePropertyValueModel}. Changes to the {@link WritablePropertyValueModel}'s
- * value are also monitored.
- * <p>
- * This is useful if you have a value that may change, but whose aspects can also
- * change in a fashion that might be of interest to the client.
- * <p>
- * <strong>NB:</strong> Clients will need to listen for two different change notifications:
- * a property change event will be be fired when the <em>value</em> changes;
- * a state change event will be fired when an <em>aspect</em> of the value changes.
- * <p>
- * Subclasses need to override two methods:<ul>
- * <li>{@link #engageValue_()}<p>
- * begin listening to the appropriate aspect of the value and call
- * {@link #valueAspectChanged()} whenever the aspect changes
- * (this will fire a state change event)
- * <li>{@link #disengageValue_()}<p>
- * stop listening to the appropriate aspect of the value
- * </ul>
- */
-public abstract class ValueAspectAdapter<V>
- extends PropertyValueModelWrapper<V>
- implements WritablePropertyValueModel<V>
-{
- /** Cache the value so we can disengage. Null until we have a listener*/
- protected V value;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Constructor - the value holder is required.
- */
- protected ValueAspectAdapter(WritablePropertyValueModel<V> valueHolder) {
- super(valueHolder);
- this.value = null;
- }
-
- /**
- * Override to allow both property and state change listeners.
- */
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new ChangeSupport(this);
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- public V getValue() {
- return this.value;
- }
-
-
- // ********** WritablePropertyValueModel implementation **********
-
- public void setValue(V value) {
- this.getValueHolder().setValue(value);
- }
-
-
- // ********** PropertyValueModelWrapper implementation **********
-
- @Override
- protected void valueChanged(PropertyChangeEvent event) {
- this.disengageValue();
- this.engageValue();
- this.firePropertyChanged(event.clone(this));
- }
-
-
- // ********** extend change support **********
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public synchronized void addStateChangeListener(StateChangeListener listener) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addStateChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public synchronized void removeStateChangeListener(StateChangeListener listener) {
- super.removeStateChangeListener(listener);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** AbstractPropertyValueModel overrides **********
-
- /**
- * Extend to check for state change listeners.
- */
- @Override
- protected boolean hasListeners() {
- return this.hasAnyStateChangeListeners() || super.hasListeners();
- }
-
-
- // ********** PropertyValueModelWrapper overrides **********
-
- /**
- * Extend to engage an aspect of the value model's value.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.engageValue();
- }
-
- /**
- * Extend to disengage an aspect of the value model's value.
- */
- @Override
- protected void disengageModel() {
- this.disengageValue();
- super.disengageModel();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to an aspect of the current value.
- */
- protected void engageValue() {
- this.value = this.valueHolder.getValue();
- if (this.value != null) {
- this.engageValue_();
- }
- }
-
- /**
- * Start listening to some aspect of the current value.
- * At this point we can be sure the value is not null.
- */
- protected abstract void engageValue_();
-
- /**
- * Stop listening to an aspect of the current value.
- */
- protected void disengageValue() {
- if (this.value != null) {
- this.disengageValue_();
- this.value = null;
- }
- }
-
- /**
- * Stop listening to an aspect of the current value.
- * At this point we can be sure the value is not null.
- */
- protected abstract void disengageValue_();
-
- /**
- * Subclasses should call this method whenever the value's aspect changes.
- */
- protected void valueAspectChanged() {
- this.fireStateChanged();
- }
-
- /**
- * Our constructor accepts only a {@link WritablePropertyValueModel}{@code<V>}.
- */
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<V> getValueHolder() {
- return (WritablePropertyValueModel<V>) this.valueHolder;
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getValue());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueChangeAdapter.java
deleted file mode 100644
index 0ad87ef1b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueChangeAdapter.java
+++ /dev/null
@@ -1,75 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.SimpleChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to all the aspects
- * of the value in the wrapped value model.
- */
-public class ValueChangeAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** Listener that listens to the value. */
- protected final ChangeListener valueAspectListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a change adapter for the specified value.
- */
- public ValueChangeAdapter(WritablePropertyValueModel<V> valueHolder) {
- super(valueHolder);
- this.valueAspectListener = this.buildValueAspectListener();
- }
-
-
- // ********** initialization **********
-
- protected ChangeListener buildValueAspectListener() {
- return new SimpleChangeListener() {
- @Override
- protected void modelChanged(ChangeEvent event) {
- ValueChangeAdapter.this.valueAspectChanged(event);
- }
- @Override
- public String toString() {
- return "value change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- this.value.addChangeListener(this.valueAspectListener);
- }
-
- @Override
- protected void disengageValue_() {
- this.value.removeChangeListener(this.valueAspectListener);
- }
-
-
- // ********** change events **********
-
- protected void valueAspectChanged(@SuppressWarnings("unused") ChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java
deleted file mode 100644
index 9512e782ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueCollectionAdapter.java
+++ /dev/null
@@ -1,107 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to one or more collection
- * aspects of the value in the wrapped value model.
- */
-public class ValueCollectionAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** The names of the value's collections that we listen to. */
- protected final String[] collectionNames;
-
- /** Listener that listens to the value. */
- protected final CollectionChangeListener valueCollectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value collections.
- */
- public ValueCollectionAdapter(WritablePropertyValueModel<V> valueHolder, String... collectionNames) {
- super(valueHolder);
- this.collectionNames = collectionNames;
- this.valueCollectionListener = this.buildValueCollectionListener();
- }
-
-
- // ********** initialization **********
-
- protected CollectionChangeListener buildValueCollectionListener() {
- return new CollectionChangeListener() {
- public void itemsAdded(CollectionAddEvent event) {
- ValueCollectionAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(CollectionRemoveEvent event) {
- ValueCollectionAdapter.this.itemsRemoved(event);
- }
- public void collectionCleared(CollectionClearEvent event) {
- ValueCollectionAdapter.this.collectionCleared(event);
- }
- public void collectionChanged(CollectionChangeEvent event) {
- ValueCollectionAdapter.this.collectionChanged(event);
- }
- @Override
- public String toString() {
- return "value collection listener: " + Arrays.asList(ValueCollectionAdapter.this.collectionNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- for (String collectionName : this.collectionNames) {
- this.value.addCollectionChangeListener(collectionName, this.valueCollectionListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String collectionName : this.collectionNames) {
- this.value.removeCollectionChangeListener(collectionName, this.valueCollectionListener);
- }
- }
-
-
- // ********** change events **********
-
- protected void itemsAdded(@SuppressWarnings("unused") CollectionAddEvent event) {
- this.valueAspectChanged();
- }
-
- protected void itemsRemoved(@SuppressWarnings("unused") CollectionRemoveEvent event) {
- this.valueAspectChanged();
- }
-
- protected void collectionCleared(@SuppressWarnings("unused") CollectionClearEvent event) {
- this.valueAspectChanged();
- }
-
- protected void collectionChanged(@SuppressWarnings("unused") CollectionChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java
deleted file mode 100644
index 97bd035da7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueListAdapter.java
+++ /dev/null
@@ -1,123 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to one or more list
- * aspects of the value in the wrapped value model.
- */
-public class ValueListAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** The names of the value's lists that we listen to. */
- protected final String[] listNames;
-
- /** Listener that listens to the value. */
- protected final ListChangeListener valueListListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value lists.
- */
- public ValueListAdapter(WritablePropertyValueModel<V> valueHolder, String... listNames) {
- super(valueHolder);
- this.listNames = listNames;
- this.valueListListener = this.buildValueListListener();
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildValueListListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ValueListAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ValueListAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ValueListAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ValueListAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ValueListAdapter.this.listCleared(event);
- }
- public void listChanged(ListChangeEvent event) {
- ValueListAdapter.this.listChanged(event);
- }
- @Override
- public String toString() {
- return "value list listener: " + Arrays.asList(ValueListAdapter.this.listNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- for (String listName : this.listNames) {
- this.value.addListChangeListener(listName, this.valueListListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String listName : this.listNames) {
- this.value.removeListChangeListener(listName, this.valueListListener);
- }
- }
-
-
- // ********** change events **********
-
- protected void itemsAdded(@SuppressWarnings("unused") ListAddEvent event) {
- this.valueAspectChanged();
- }
-
- protected void itemsRemoved(@SuppressWarnings("unused") ListRemoveEvent event) {
- this.valueAspectChanged();
- }
-
- protected void itemsReplaced(@SuppressWarnings("unused") ListReplaceEvent event) {
- this.valueAspectChanged();
- }
-
- protected void itemsMoved(@SuppressWarnings("unused") ListMoveEvent event) {
- this.valueAspectChanged();
- }
-
- protected void listCleared(@SuppressWarnings("unused") ListClearEvent event) {
- this.valueAspectChanged();
- }
-
- protected void listChanged(@SuppressWarnings("unused") ListChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
deleted file mode 100644
index 8814b68454..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValuePropertyAdapter.java
+++ /dev/null
@@ -1,82 +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.utility.internal.model.value;
-
-import java.util.Arrays;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to one or more
- * properties of the value in the wrapped value model.
- */
-public class ValuePropertyAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** The names of the value's properties we listen to. */
- protected final String[] propertyNames;
-
- /** Listener that listens to the value. */
- protected final PropertyChangeListener valuePropertyListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value properties.
- */
- public ValuePropertyAdapter(WritablePropertyValueModel<V> valueHolder, String... propertyNames) {
- super(valueHolder);
- this.propertyNames = propertyNames;
- this.valuePropertyListener = this.buildValuePropertyListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValuePropertyListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ValuePropertyAdapter.this.propertyChanged(event);
- }
- @Override
- public String toString() {
- return "value property listener: " + Arrays.asList(ValuePropertyAdapter.this.propertyNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- for (String propertyName : this.propertyNames) {
- this.value.addPropertyChangeListener(propertyName, this.valuePropertyListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String propertyName : this.propertyNames) {
- this.value.removePropertyChangeListener(propertyName, this.valuePropertyListener);
- }
- }
-
-
- // ********** change events **********
-
- protected void propertyChanged(@SuppressWarnings("unused") PropertyChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
deleted file mode 100644
index e7a4ba91e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueStateAdapter.java
+++ /dev/null
@@ -1,73 +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.utility.internal.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to the
- * "state" of the value in the wrapped value model.
- */
-public class ValueStateAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** Listener that listens to value. */
- protected final StateChangeListener valueStateListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the value state.
- */
- public ValueStateAdapter(WritablePropertyValueModel<V> valueHolder) {
- super(valueHolder);
- this.valueStateListener = this.buildValueStateListener();
- }
-
-
- // ********** initialization **********
-
- protected StateChangeListener buildValueStateListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- ValueStateAdapter.this.stateChanged(event);
- }
- @Override
- public String toString() {
- return "value state listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- this.value.addStateChangeListener(this.valueStateListener);
- }
-
- @Override
- protected void disengageValue_() {
- this.value.removeStateChangeListener(this.valueStateListener);
- }
-
-
- // ********** change events **********
-
- protected void stateChanged(@SuppressWarnings("unused") StateChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.java
deleted file mode 100644
index 913116300c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/ValueTreeAdapter.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.utility.internal.model.value;
-
-import java.util.Arrays;
-
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * Extend {@link ValueAspectAdapter} to listen to one or more
- * tree aspects of the value in the wrapped value model.
- */
-public class ValueTreeAdapter<V extends Model>
- extends ValueAspectAdapter<V>
-{
- /** The names of the value's trees that we listen to. */
- protected final String[] treeNames;
-
- /** Listener that listens to the value. */
- protected final TreeChangeListener valueTreeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified value trees.
- */
- public ValueTreeAdapter(WritablePropertyValueModel<V> valueHolder, String... treeNames) {
- super(valueHolder);
- this.treeNames = treeNames;
- this.valueTreeListener = this.buildValueTreeListener();
- }
-
-
- // ********** initialization **********
-
- protected TreeChangeListener buildValueTreeListener() {
- return new TreeChangeListener() {
- public void nodeAdded(TreeAddEvent event) {
- ValueTreeAdapter.this.nodeAdded(event);
- }
- public void nodeRemoved(TreeRemoveEvent event) {
- ValueTreeAdapter.this.nodeRemoved(event);
- }
- public void treeCleared(TreeClearEvent event) {
- ValueTreeAdapter.this.treeCleared(event);
- }
- public void treeChanged(TreeChangeEvent event) {
- ValueTreeAdapter.this.treeChanged(event);
- }
- @Override
- public String toString() {
- return "value tree listener: " + Arrays.asList(ValueTreeAdapter.this.treeNames); //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueAspectAdapter implementation **********
-
- @Override
- protected void engageValue_() {
- for (String treeName : this.treeNames) {
- this.value.addTreeChangeListener(treeName, this.valueTreeListener);
- }
- }
-
- @Override
- protected void disengageValue_() {
- for (String treeName : this.treeNames) {
- this.value.removeTreeChangeListener(treeName, this.valueTreeListener);
- }
- }
-
-
- // ********** change events **********
-
- protected void nodeAdded(@SuppressWarnings("unused") TreeAddEvent event) {
- this.valueAspectChanged();
- }
-
- protected void nodeRemoved(@SuppressWarnings("unused") TreeRemoveEvent event) {
- this.valueAspectChanged();
- }
-
- protected void treeCleared(@SuppressWarnings("unused") TreeClearEvent event) {
- this.valueAspectChanged();
- }
-
- protected void treeChanged(@SuppressWarnings("unused") TreeChangeEvent event) {
- this.valueAspectChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyCollectionValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyCollectionValueModelAdapter.java
deleted file mode 100644
index 5014b4497b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyCollectionValueModelAdapter.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.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * An adapter that allows us to make a {@link WritablePropertyValueModel} behave like
- * a single-element {@link WritableCollectionValueModel}, sorta.
- * <p>
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a collection with a <code>null</code> element).
- * Also, only a single-element collection can be written to the adapter.
- */
-public class WritablePropertyCollectionValueModelAdapter<E>
- extends PropertyCollectionValueModelAdapter<E>
- implements WritableCollectionValueModel<E>
-{
-
- // ********** constructor **********
-
- /**
- * Convert the specified writable property value model to a writable
- * collection value model.
- */
- public WritablePropertyCollectionValueModelAdapter(WritablePropertyValueModel<E> valueHolder) {
- super(valueHolder);
- }
-
-
- // ********** WritableCollectionValueModel implementation **********
-
- public void setValues(Iterable<E> values) {
- Iterator<E> stream = values.iterator();
- if (stream.hasNext()) {
- E newValue = stream.next();
- if (stream.hasNext()) {
- throw new IllegalArgumentException("non-singleton collection: " + values); //$NON-NLS-1$
- }
- this.getValueHolder().setValue(newValue);
- } else {
- this.getValueHolder().setValue(null);
- }
- }
-
- // our constructor takes only writable property value models
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<E> getValueHolder() {
- return (WritablePropertyValueModel<E>) this.valueHolder;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyListValueModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyListValueModelAdapter.java
deleted file mode 100644
index c7d53395ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/WritablePropertyListValueModelAdapter.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.utility.internal.model.value;
-
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.model.value.WritableListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * An adapter that allows us to make a {@link WritablePropertyValueModel} behave like
- * a single-element {@link WritableListValueModel}, sorta.
- * <p>
- * If the property's value is null, an empty iterator is returned
- * (i.e. you can't have a list with a <code>null</code> element).
- * Also, only a single-element list can be written to the adapter.
- */
-public class WritablePropertyListValueModelAdapter<E>
- extends PropertyListValueModelAdapter<E>
- implements WritableListValueModel<E>
-{
-
- // ********** constructor **********
-
- /**
- * Convert the specified writable property value model to a writable
- * collection value model.
- */
- public WritablePropertyListValueModelAdapter(WritablePropertyValueModel<E> valueHolder) {
- super(valueHolder);
- }
-
-
- // ********** WritableListValueModel implementation **********
-
- public void setListValues(Iterable<E> listValues) {
- Iterator<E> stream = listValues.iterator();
- if (stream.hasNext()) {
- E newValue = stream.next();
- if (stream.hasNext()) {
- throw new IllegalArgumentException("non-singleton list: " + listValues); //$NON-NLS-1$
- }
- this.getValueHolder().setValue(newValue);
- } else {
- this.getValueHolder().setValue(null);
- }
- }
-
- // our constructor takes only writable property value models
- @SuppressWarnings("unchecked")
- protected WritablePropertyValueModel<E> getValueHolder() {
- return (WritablePropertyValueModel<E>) this.valueHolder;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
deleted file mode 100644
index 5314bb9250..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencePropertyValueModel.java
+++ /dev/null
@@ -1,346 +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.utility.internal.model.value.prefs;
-
-import java.util.EventListener;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.BidiStringConverter;
-import org.eclipse.jpt.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This adapter wraps a Preference and converts it into a PropertyValueModel.
- * It listens for the appropriate "preference" changes and converts them into
- * VALUE property changes. It also allows the specification of a default value
- * for the Preference, which, by default, is null (and is probably *not* a very
- * good default).
- *
- * You can configure whether the preference's value is returned,
- * unchanged, as a string or as some other object (e.g. an Integer) by
- * setting the adapter's converter. Internally, the preference's value
- * is stored as the converted object; and the conversions take place
- * when reading or writing from the preferences node or retrieving the
- * value from an event fired by the preferences node.
- *
- * This adapter is a bit different from most other adapters because the
- * change events fired off by a Preferences node are asynchronous from
- * the change itself. (AbstractPreferences uses an event dispatch daemon.)
- * As a result, a client can set our value with #setValue(Object) and we
- * will return from that method before we ever receive notification from
- * the Preferences node that *it* has changed. This means we cannot
- * rely on that event to keep our internally cached value in synch.
- */
-public class PreferencePropertyValueModel<P>
- extends AspectAdapter<Preferences>
- implements WritablePropertyValueModel<P>
-{
- /** The key to the preference we use for the value. */
- protected final String key;
-
- /**
- * Cache the current (object) value of the preference so we
- * can pass an "old value" when we fire a property change event.
- */
- protected P value;
-
- /**
- * The default (object) value returned if there is no value
- * associated with the preference.
- */
- protected final P defaultValue;
-
- /**
- * This converter is used to convert the preference's
- * string value to and from an object.
- */
- protected final BidiStringConverter<P> converter;
-
- /** A listener that listens to the appropriate preference. */
- protected final PreferenceChangeListener preferenceChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified preference.
- * The default value of the preference will be null.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key) {
- this(preferences, key, null);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key, P defaultValue) {
- this(preferences, key, defaultValue, BidiStringConverter.Default.<P>instance());
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(Preferences preferences, String key, P defaultValue, BidiStringConverter<P> converter) {
- this(new StaticPropertyValueModel<Preferences>(preferences), key, defaultValue, converter);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public static PreferencePropertyValueModel<Boolean> forBoolean(Preferences preferences, String key, boolean defaultValue) {
- return new PreferencePropertyValueModel<Boolean>(
- preferences,
- key,
- defaultValue ? Boolean.TRUE : Boolean.FALSE,
- BidiStringConverter.BooleanConverter.instance()
- );
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public static PreferencePropertyValueModel<Integer> forInteger(Preferences preferences, String key, int defaultValue) {
- return new PreferencePropertyValueModel<Integer>(
- preferences,
- key,
- Integer.valueOf(defaultValue),
- BidiStringConverter.IntegerConverter.instance()
- );
- }
-
- /**
- * Construct an adapter for the specified preference.
- * The default value of the preference will be null.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key) {
- this(preferencesHolder, key, null);
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key, P defaultValue) {
- this(preferencesHolder, key, defaultValue, BidiStringConverter.Default.<P>instance());
- }
-
- /**
- * Construct an adapter for the specified preference with
- * the specified default value for the preference.
- */
- public PreferencePropertyValueModel(PropertyValueModel<? extends Preferences> preferencesHolder, String key, P defaultValue, BidiStringConverter<P> converter) {
- super(preferencesHolder);
- this.key = key;
- this.defaultValue = defaultValue;
- this.converter = converter;
- this.preferenceChangeListener = this.buildPreferenceChangeListener();
- // our value is null when we are not listening to the preference
- this.value = null;
- }
-
-
- // ********** initialization **********
-
- /**
- * A preference has changed, notify the listeners if necessary.
- */
- protected PreferenceChangeListener buildPreferenceChangeListener() {
- // transform the preference change events into VALUE property change events
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent event) {
- PreferencePropertyValueModel.this.preferenceChanged(event.getKey(), event.getNewValue());
- }
- @Override
- public String toString() {
- return "preference change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ValueModel implementation **********
-
- /**
- * Return the cached (converted) value.
- */
- @Override
- public synchronized P getValue() {
- return this.value;
- }
-
-
- // ********** PropertyValueModel implementation **********
-
- /**
- * Set the cached value, then set the appropriate preference value.
- */
- public synchronized void setValue(P value) {
- if (this.hasNoListeners()) {
- return; // no changes allowed when we have no listeners
- }
-
- Object old = this.value;
- this.value = value;
- this.fireAspectChanged(old, value);
-
- if ((this.subject != null) && this.shouldSetPreference(old, value)) {
- this.setValue_(value);
- }
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return PropertyChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUE;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyPropertyChangeListeners(VALUE);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- this.firePropertyChanged(VALUE, oldValue, newValue);
- }
-
- @Override
- protected synchronized void engageSubject_() {
- this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
- this.value = this.buildValue();
- }
-
- @Override
- protected synchronized void disengageSubject_() {
- try {
- this.subject.removePreferenceChangeListener(this.preferenceChangeListener);
- } catch (IllegalStateException ex) {
- // for some odd reason, we are not allowed to remove a listener from a "dead"
- // preferences node; so handle the exception that gets thrown here
- if ( ! ex.getMessage().equals("Node has been removed.")) { //$NON-NLS-1$
- // if it is not the expected exception, re-throw it
- throw ex;
- }
- }
- this.value = null;
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.key);
- sb.append(" => "); //$NON-NLS-1$
- sb.append(this.value);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the preference's key.
- */
- public String getKey() {
- return this.key;
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return the preference's value.
- * At this point the subject may be null.
- */
- protected P buildValue() {
- return (this.subject == null) ? null : this.buildValue_();
- }
-
- /**
- * Return the appropriate preference, converted to the appropriate object.
- * At this point we can be sure that the subject is not null.
- */
- protected P buildValue_() {
- return this.convertToObject(this.subject.get(this.key, this.convertToString(this.defaultValue)));
- }
-
- /**
- * Set the appropriate preference after converting the value to a string.
- * At this point we can be sure that the subject is not null.
- */
- protected void setValue_(P value) {
- this.subject.put(this.key, this.convertToString(value));
- }
-
- /**
- * Return whether the specified new value should be passed
- * through to the preference. By default, only if the value has changed,
- * will it be passed through to the preference. This also has the
- * effect of not creating new preferences in the "backing store"
- * if the new value is the same as the default value.
- *
- * Subclasses can override this method to return true if they
- * would like to ALWAYS pass through the new value to the preference.
- */
- protected boolean shouldSetPreference(Object oldValue, Object newValue) {
- return this.attributeValueHasChanged(oldValue, newValue);
- }
-
- /**
- * Convert the specified object to a string that can be stored as
- * the value of the preference.
- */
- protected String convertToString(P o) {
- return this.converter.convertToString(o);
- }
-
- /**
- * Convert the specified preference value string to an
- * appropriately-typed object to be returned to the client.
- */
- protected P convertToObject(String s) {
- return this.converter.convertToObject(s);
- }
-
- protected void preferenceChanged(String prefKey, @SuppressWarnings("unused") String newValue) {
- if (prefKey.equals(this.key)) {
- this.preferenceChanged();
- }
- }
-
- /**
- * The underlying preference changed; either because we changed it
- * in #setValue_(Object) or a third-party changed it.
- * If this is called because of our own change, the event will be
- * swallowed because the old and new values are the same.
- */
- protected synchronized void preferenceChanged() {
- Object old = this.value;
- this.value = this.buildValue();
- this.fireAspectChanged(old, this.value);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java
deleted file mode 100644
index 3f08818f00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/prefs/PreferencesCollectionValueModel.java
+++ /dev/null
@@ -1,203 +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.utility.internal.model.value.prefs;
-
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.PreferenceChangeEvent;
-import java.util.prefs.PreferenceChangeListener;
-import java.util.prefs.Preferences;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.value.AspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * This adapter wraps a Preferences node and converts its preferences into a
- * CollectionValueModel of PreferencePropertyValueModels. It listens for
- * "preference" changes and converts them into VALUE collection changes.
- */
-public class PreferencesCollectionValueModel<P>
- extends AspectAdapter<Preferences>
- implements CollectionValueModel<PreferencePropertyValueModel<P>>
-{
-
- /** Cache the current preferences, stored in models and keyed by name. */
- protected final HashMap<String, PreferencePropertyValueModel<P>> preferences;
-
- /** A listener that listens to the preferences node for added or removed preferences. */
- protected final PreferenceChangeListener preferenceChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct an adapter for the specified preferences node.
- */
- public PreferencesCollectionValueModel(Preferences preferences) {
- this(new StaticPropertyValueModel<Preferences>(preferences));
- }
-
- /**
- * Construct an adapter for the specified preferences node.
- */
- public PreferencesCollectionValueModel(PropertyValueModel<? extends Preferences> preferencesHolder) {
- super(preferencesHolder);
- this.preferences = new HashMap<String, PreferencePropertyValueModel<P>>();
- this.preferenceChangeListener = this.buildPreferenceChangeListener();
- }
-
-
- // ********** initialization **********
-
- /**
- * A preferences have changed, notify the listeners.
- */
- protected PreferenceChangeListener buildPreferenceChangeListener() {
- // transform the preference change events into VALUE collection change events
- return new PreferenceChangeListener() {
- public void preferenceChange(PreferenceChangeEvent event) {
- PreferencesCollectionValueModel.this.preferenceChanged(event.getKey(), event.getNewValue());
- }
- @Override
- public String toString() {
- return "preference change listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** CollectionValueModel implementation **********
-
- /**
- * Return an iterator on the preference models.
- */
- public synchronized Iterator<PreferencePropertyValueModel<P>> iterator() {
- return this.preferences.values().iterator();
- }
-
- public synchronized int size() {
- return this.preferences.size();
- }
-
-
- // ********** AspectAdapter implementation **********
-
- @Override
- protected Object getValue() {
- return this.iterator();
- }
-
- @Override
- protected Class<? extends EventListener> getListenerClass() {
- return CollectionChangeListener.class;
- }
-
- @Override
- protected String getListenerAspectName() {
- return VALUES;
- }
-
- @Override
- protected boolean hasListeners() {
- return this.hasAnyCollectionChangeListeners(VALUES);
- }
-
- @Override
- protected void fireAspectChanged(Object oldValue, Object newValue) {
- @SuppressWarnings("unchecked") Iterator<PreferencePropertyValueModel<P>> iterator = (Iterator<PreferencePropertyValueModel<P>>) newValue;
- this.fireCollectionChanged(VALUES, CollectionTools.collection(iterator));
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addPreferenceChangeListener(this.preferenceChangeListener);
- for (Iterator<PreferencePropertyValueModel<P>> stream = this.preferenceModels(); stream.hasNext(); ) {
- PreferencePropertyValueModel<P> preferenceModel = stream.next();
- this.preferences.put(preferenceModel.getKey(), preferenceModel);
- }
- }
-
- @Override
- protected void disengageSubject_() {
- try {
- this.subject.removePreferenceChangeListener(this.preferenceChangeListener);
- } catch (IllegalStateException ex) {
- // for some odd reason, we are not allowed to remove a listener from a "dead"
- // preferences node; so handle the exception that gets thrown here
- if ( ! ex.getMessage().equals("Node has been removed.")) { //$NON-NLS-1$
- // if it is not the expected exception, re-throw it
- throw ex;
- }
- }
- this.preferences.clear();
- }
-
-
- // ********** AbstractModel implementation **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.subject);
- }
-
-
- // ********** internal methods **********
-
- /**
- * Return an iterator on the preference models.
- * At this point we can be sure that the subject is not null.
- */
- protected Iterator<PreferencePropertyValueModel<P>> preferenceModels() {
- String[] keys;
- try {
- keys = this.subject.keys();
- } catch (BackingStoreException ex) {
- throw new RuntimeException(ex);
- }
- return new TransformationIterator<String, PreferencePropertyValueModel<P>>(new ArrayIterator<String>(keys)) {
- @Override
- protected PreferencePropertyValueModel<P> transform(String key) {
- return PreferencesCollectionValueModel.this.buildPreferenceModel(key);
- }
- };
- }
-
- /**
- * Override this method to tweak the model used to wrap the
- * specified preference (e.g. to customize the model's converter).
- */
- protected PreferencePropertyValueModel<P> buildPreferenceModel(String key) {
- return new PreferencePropertyValueModel<P>(this.subjectHolder, key);
- }
-
- protected synchronized void preferenceChanged(String key, String newValue) {
- if (newValue == null) {
- // a preference was removed
- PreferencePropertyValueModel<P> preferenceModel = this.preferences.remove(key);
- this.fireItemRemoved(VALUES, preferenceModel);
- } else if ( ! this.preferences.containsKey(key)) {
- // a preference was added
- PreferencePropertyValueModel<P> preferenceModel = this.buildPreferenceModel(key);
- this.preferences.put(key, preferenceModel);
- this.fireItemAdded(VALUES, preferenceModel);
- } else {
- // a preference's value changed - do nothing
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java
deleted file mode 100644
index 302a83f1dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/AbstractTreeModel.java
+++ /dev/null
@@ -1,216 +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.utility.internal.model.value.swing;
-
-import java.io.Serializable;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.TreeModelEvent;
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreeModel;
-
-/**
- * Abstract class that should have been provided by the JDK
- * (à la javax.swing.AbstractListModel). This class provides:
- * - support for a collection of listeners
- * - a number of convenience methods for firing events for those listeners
- */
-public abstract class AbstractTreeModel
- implements TreeModel, Serializable
-{
- /** Our listeners. */
- protected final EventListenerList listenerList;
-
-
- // ********** constructors/initialization **********
-
- protected AbstractTreeModel() {
- super();
- this.listenerList = new EventListenerList();
- }
-
-
- // ********** partial TreeModel implementation **********
-
- public void addTreeModelListener(TreeModelListener l) {
- this.listenerList.add(TreeModelListener.class, l);
- }
-
- public void removeTreeModelListener(TreeModelListener l) {
- this.listenerList.remove(TreeModelListener.class, l);
- }
-
-
- // ********** queries **********
-
- /**
- * Return the model's current collection of listeners.
- * (There seems to be a pattern of making this type of method public;
- * although it should probably be protected....)
- */
- public TreeModelListener[] treeModelListeners() {
- return this.listenerList.getListeners(TreeModelListener.class);
- }
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoTreeModelListeners() {
- return this.listenerList.getListenerCount(TreeModelListener.class) == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasTreeModelListeners() {
- return ! this.hasNoTreeModelListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Notify listeners of a model change.
- * A significant property of the nodes changed, but the nodes themselves
- * are still the same objects.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesChanged(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesChanged(event);
- }
- }
- }
-
-
- /**
- * Notify listeners of a model change.
- * A significant property of the node changed, but the node itself is the same object.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeChanged(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesChanged(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * A significant property of the root changed, but the root itself is the same object.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeRootChanged(Object root) {
- this.fireTreeNodesChanged(new Object[] {root}, null, null);
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesInserted(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesInserted(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeInserted(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesInserted(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodesRemoved(Object[] path, int[] childIndices, Object[] children) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path, childIndices, children);
- }
- ((TreeModelListener) listeners[i+1]).treeNodesRemoved(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeNodeRemoved(Object[] path, int childIndex, Object child) {
- this.fireTreeNodesRemoved(path, new int[] {childIndex}, new Object[] {child});
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeStructureChanged(Object[] path) {
- // guaranteed to return a non-null array
- Object[] listeners = this.listenerList.getListenerList();
- TreeModelEvent event = null;
- // process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length-2; i>=0; i-=2) {
- if (listeners[i]==TreeModelListener.class) {
- // lazily create the event
- if (event == null) {
- event = new TreeModelEvent(this, path);
- }
- ((TreeModelListener) listeners[i+1]).treeStructureChanged(event);
- }
- }
- }
-
- /**
- * Notify listeners of a model change.
- * @see javax.swing.event.TreeModelEvent
- * @see javax.swing.event.TreeModelListener
- */
- protected void fireTreeRootReplaced(Object newRoot) {
- this.fireTreeStructureChanged(new Object[] {newRoot});
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java
deleted file mode 100644
index 126cbfa561..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/CheckBoxModelAdapter.java
+++ /dev/null
@@ -1,43 +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.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JCheckBox) in synch with a PropertyValueModel that
- * holds a boolean.
- *
- * Maybe not the richest class in our toolbox, but it was the
- * victim of refactoring.... ~bjv
- */
-public class CheckBoxModelAdapter
- extends ToggleButtonModelAdapter
-{
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder is required.
- */
- public CheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, boolean defaultValue) {
- super(booleanHolder, defaultValue);
- }
-
- /**
- * Constructor - the boolean holder is required.
- * The default value will be false.
- */
- public CheckBoxModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- super(booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java
deleted file mode 100644
index 482b5d2468..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ColumnAdapter.java
+++ /dev/null
@@ -1,49 +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.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.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.
- */
-public interface ColumnAdapter {
- /**
- * Return the number of columns in the table.
- * Typically this is static.
- */
- int columnCount();
-
- /**
- * Return the name of the specified column.
- */
- String columnName(int index);
-
- /**
- * Return the class of the specified column.
- */
- Class<?> columnClass(int index);
-
- /**
- * Return whether the specified column is editable.
- * Typically this is the same for every row.
- */
- boolean columnIsEditable(int index);
-
- /**
- * Return the cell models for the specified subject
- * that corresponds to a single row in the table.
- */
- WritablePropertyValueModel<Object>[] cellModels(Object subject);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java
deleted file mode 100644
index 8675f43035..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ComboBoxModelAdapter.java
+++ /dev/null
@@ -1,140 +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.utility.internal.model.value.swing;
-
-import javax.swing.ComboBoxModel;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ComboBoxModel can be used to keep a ListDataListener
- * (e.g. a JComboBox) in synch with a ListValueModel (or a CollectionValueModel).
- * For combo boxes, the model object that holds the current selection is
- * typically a different model object than the one that holds the collection
- * of choices.
- *
- * For example, a MWReference (the selectionOwner) has an attribute
- * "sourceTable" (the collectionOwner)
- * which holds on to a collection of MWDatabaseFields. When the selection
- * is changed this model will keep the listeners aware of the changes.
- * The inherited list model will keep its listeners aware of changes to the
- * collection model
- *
- * In addition to the collection holder required by the superclass,
- * an instance of this ComboBoxModel must be supplied with a
- * selection holder, which is a PropertyValueModel that provides access
- * to the selection (typically a PropertyAspectAdapter).
- */
-public class ComboBoxModelAdapter
- extends ListModelAdapter
- implements ComboBoxModel
-{
- protected final WritablePropertyValueModel<Object> selectionHolder;
- protected final PropertyChangeListener selectionListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the list holder and selection holder are required;
- */
- public ComboBoxModelAdapter(ListValueModel<?> listHolder, WritablePropertyValueModel<Object> selectionHolder) {
- super(listHolder);
- if (selectionHolder == null) {
- throw new NullPointerException();
- }
- this.selectionHolder = selectionHolder;
- this.selectionListener = this.buildSelectionListener();
- }
-
- /**
- * Constructor - the collection holder and selection holder are required;
- */
- public ComboBoxModelAdapter(CollectionValueModel<?> collectionHolder, WritablePropertyValueModel<Object> selectionHolder) {
- super(collectionHolder);
- if (selectionHolder == null) {
- throw new NullPointerException();
- }
- this.selectionHolder = selectionHolder;
- this.selectionListener = this.buildSelectionListener();
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildSelectionListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildSelectionListener_());
- }
-
- protected PropertyChangeListener buildSelectionListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- // notify listeners that the selection has changed
- ComboBoxModelAdapter.this.fireSelectionChanged();
- }
- @Override
- public String toString() {
- return "selection listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ComboBoxModel implementation **********
-
- public Object getSelectedItem() {
- return this.selectionHolder.getValue();
- }
-
- public void setSelectedItem(Object selectedItem) {
- this.selectionHolder.setValue(selectedItem);
- }
-
-
- // ********** behavior **********
-
- /**
- * Extend to engage the selection holder.
- */
- @Override
- protected void engageModel() {
- super.engageModel();
- this.selectionHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.selectionListener);
- }
-
- /**
- * Extend to disengage the selection holder.
- */
- @Override
- protected void disengageModel() {
- this.selectionHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.selectionListener);
- super.disengageModel();
- }
-
- /**
- * Notify the listeners that the selection has changed.
- */
- protected void fireSelectionChanged() {
- // I guess this will work...
- this.fireContentsChanged(this, -1, -1);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectionHolder + ":" + this.listHolder); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.java
deleted file mode 100644
index 710834c0e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DateSpinnerModelAdapter.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.utility.internal.model.value.swing;
-
-import java.util.Calendar;
-import java.util.Date;
-import javax.swing.SpinnerDateModel;
-import javax.swing.event.ChangeListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerDateModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a date.
- *
- * This class must be a sub-class of SpinnerDateModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see ListSpinnerModelAdapter
- * @see NumberSpinnerModelAdapter
- */
-public class DateSpinnerModelAdapter
- extends SpinnerDateModel
-{
-
- /**
- * The default spinner value; used when the underlying model date value is null.
- * The default is the current date.
- */
- private final Date defaultValue;
-
- /** A value model on the underlying date. */
- private final WritablePropertyValueModel<Object> dateHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying date. */
- private final PropertyChangeListener dateChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the date holder is required.
- * The default spinner value is the current date.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder) {
- this(dateHolder, new Date());
- }
-
- /**
- * Constructor - the date holder and default value are required.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Date defaultValue) {
- this(dateHolder, null, null, Calendar.DAY_OF_MONTH, defaultValue);
- }
-
- /**
- * Constructor - the date holder is required.
- * The default spinner value is the current date.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Comparable<?> start, Comparable<?> end, int calendarField) {
- this(dateHolder, start, end, calendarField, new Date());
- }
-
- /**
- * Constructor - the date holder is required.
- */
- public DateSpinnerModelAdapter(WritablePropertyValueModel<Object> dateHolder, Comparable<?> start, Comparable<?> end, int calendarField, Date defaultValue) {
- super(dateHolder.getValue() == null ? defaultValue : (Date) dateHolder.getValue(), start, end, calendarField);
- this.dateHolder = dateHolder;
- this.dateChangeListener = this.buildDateChangeListener();
- // postpone listening to the underlying date
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildDateChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildDateChangeListener_());
- }
-
- protected PropertyChangeListener buildDateChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DateSpinnerModelAdapter.this.synchronize(event.getNewValue());
- }
- @Override
- public String toString() {
- return "date listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.dateHolder.getValue()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying date directly.
- * The resulting event will be ignored: @see #synchronize(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.dateHolder.setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying date if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.dateHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.dateChangeListener);
- this.synchronize(this.dateHolder.getValue());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying date if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.dateHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.dateChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Date getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the spinner date has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.dateHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
deleted file mode 100644
index 70dec3419d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/DocumentAdapter.java
+++ /dev/null
@@ -1,375 +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.utility.internal.model.value.swing;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.EventObject;
-
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.EventListenerList;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
-import javax.swing.text.AttributeSet;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Document;
-import javax.swing.text.Element;
-import javax.swing.text.PlainDocument;
-import javax.swing.text.Position;
-import javax.swing.text.Segment;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.text.Document can be used to keep a DocumentListener
- * (e.g. a JTextField) in synch with a PropertyValueModel that holds a string.
- *
- * NB: This model should only be used for "small" documents;
- * i.e. documents used by text fields, not text panes.
- * @see #synchronizeDelegate(String)
- */
-public class DocumentAdapter
- implements Document, Serializable
-{
-
- /** The delegate document whose behavior we "enhance". */
- protected final Document delegate;
-
- /** A listener that allows us to forward any changes made to the delegate document. */
- protected final CombinedListener delegateListener;
-
- /** A value model on the underlying model string. */
- protected final WritablePropertyValueModel<String> stringHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying model string. */
- protected transient PropertyChangeListener stringListener;
-
- /** The event listener list for the document. */
- protected final EventListenerList listenerList = new EventListenerList();
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the string holder is required.
- * Wrap the specified document.
- */
- public DocumentAdapter(WritablePropertyValueModel<String> stringHolder, Document delegate) {
- super();
- if (stringHolder == null || delegate == null) {
- throw new NullPointerException();
- }
- this.stringHolder = stringHolder;
- // postpone listening to the underlying model string
- // until we have listeners ourselves...
- this.delegate = delegate;
- this.stringListener = this.buildStringListener();
- this.delegateListener = this.buildDelegateListener();
- }
-
- /**
- * Constructor - the string holder is required.
- * Wrap a plain document.
- */
- public DocumentAdapter(WritablePropertyValueModel<String> stringHolder) {
- this(stringHolder, new PlainDocument());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildStringListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildStringListener_());
- }
-
- protected PropertyChangeListener buildStringListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- DocumentAdapter.this.stringChanged(event);
- }
- @Override
- public String toString() {
- return "string listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected CombinedListener buildDelegateListener() {
- return new InternalListener();
- }
-
-
- // ********** Document implementation **********
-
- public int getLength() {
- return this.delegate.getLength();
- }
-
- /**
- * Extend to start listening to the underlying models if necessary.
- */
- public void addDocumentListener(DocumentListener listener) {
- if (this.listenerList.getListenerCount(DocumentListener.class) == 0) {
- this.delegate.addDocumentListener(this.delegateListener);
- this.engageStringHolder();
- }
- this.listenerList.add(DocumentListener.class, listener);
- }
-
- /**
- * Extend to stop listening to the underlying models if appropriate.
- */
- public void removeDocumentListener(DocumentListener listener) {
- this.listenerList.remove(DocumentListener.class, listener);
- if (this.listenerList.getListenerCount(DocumentListener.class) == 0) {
- this.disengageStringHolder();
- this.delegate.removeDocumentListener(this.delegateListener);
- }
- }
-
- /**
- * Extend to start listening to the delegate document if necessary.
- */
- public void addUndoableEditListener(UndoableEditListener listener) {
- if (this.listenerList.getListenerCount(UndoableEditListener.class) == 0) {
- this.delegate.addUndoableEditListener(this.delegateListener);
- }
- this.listenerList.add(UndoableEditListener.class, listener);
- }
-
- /**
- * Extend to stop listening to the delegate document if appropriate.
- */
- public void removeUndoableEditListener(UndoableEditListener listener) {
- this.listenerList.remove(UndoableEditListener.class, listener);
- if (this.listenerList.getListenerCount(UndoableEditListener.class) == 0) {
- this.delegate.removeUndoableEditListener(this.delegateListener);
- }
- }
-
- public Object getProperty(Object key) {
- return this.delegate.getProperty(key);
- }
-
- public void putProperty(Object key, Object value) {
- this.delegate.putProperty(key, value);
- }
-
- /**
- * Extend to update the underlying model string directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(String).
- */
- public void remove(int offset, int len) throws BadLocationException {
- this.delegate.remove(offset, len);
- this.stringHolder.setValue(this.delegate.getText(0, this.delegate.getLength()));
- }
-
- /**
- * Extend to update the underlying model string directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(String).
- */
- public void insertString(int offset, String insertedString, AttributeSet a) throws BadLocationException {
- this.delegate.insertString(offset, insertedString, a);
- this.stringHolder.setValue(this.delegate.getText(0, this.delegate.getLength()));
- }
-
- public String getText(int offset, int length) throws BadLocationException {
- return this.delegate.getText(offset, length);
- }
-
- public void getText(int offset, int length, Segment txt) throws BadLocationException {
- this.delegate.getText(offset, length, txt);
- }
-
- public Position getStartPosition() {
- return this.delegate.getStartPosition();
- }
-
- public Position getEndPosition() {
- return this.delegate.getEndPosition();
- }
-
- public Position createPosition(int offs) throws BadLocationException {
- return this.delegate.createPosition(offs);
- }
-
- public Element[] getRootElements() {
- return this.delegate.getRootElements();
- }
-
- public Element getDefaultRootElement() {
- return this.delegate.getDefaultRootElement();
- }
-
- public void render(Runnable r) {
- this.delegate.render(r);
- }
-
-
- // ********** queries **********
-
- public DocumentListener[] documentListeners() {
- return this.listenerList.getListeners(DocumentListener.class);
- }
-
- public UndoableEditListener[] undoableEditListeners() {
- return this.listenerList.getListeners(UndoableEditListener.class);
- }
-
-
- // ********** behavior **********
-
- /**
- * A third party has modified the underlying model string.
- * Synchronize the delegate document accordingly.
- */
- protected void stringChanged(PropertyChangeEvent event) {
- this.synchronizeDelegate((String) event.getNewValue());
- }
-
- /**
- * Replace the document's entire text string with the new string.
- */
- protected void synchronizeDelegate(String s) {
- try {
- int len = this.delegate.getLength();
- // check to see whether the delegate has already been synchronized
- // (via #insertString() or #remove())
- if ( ! this.delegate.getText(0, len).equals(s)) {
- this.delegate.remove(0, len);
- this.delegate.insertString(0, s, null);
- }
- } catch (BadLocationException ex) {
- throw new IllegalStateException(ex.getMessage()); // this should not happen...
- }
- }
-
- protected void engageStringHolder() {
- this.stringHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.stringListener);
- this.synchronizeDelegate(this.stringHolder.getValue());
- }
-
- protected void disengageStringHolder() {
- this.stringHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.stringListener);
- }
-
- protected void delegateChangedUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].changedUpdate(ee);
- }
- }
-
- protected void delegateInsertUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].insertUpdate(ee);
- }
- }
-
- protected void delegateRemoveUpdate(DocumentEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- DocumentEvent ee = new InternalDocumentEvent(this, event);
- DocumentListener[] listeners = this.documentListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].removeUpdate(ee);
- }
- }
-
- protected void delegateUndoableEditHappened(UndoableEditEvent event) {
- // no need to lazy-initialize the event;
- // we wouldn't get here if we did not have listeners...
- UndoableEditEvent ee = new UndoableEditEvent(this, event.getEdit());
- UndoableEditListener[] listeners = this.undoableEditListeners();
- for (int i = listeners.length; i-- > 0; ) {
- listeners[i].undoableEditHappened(ee);
- }
- }
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.stringHolder);
- }
-
- private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
- // read in any hidden stuff
- s.defaultReadObject();
- this.stringListener = this.buildStringListener();
- }
-
-
-// ********** inner class **********
-
- protected interface CombinedListener extends DocumentListener, UndoableEditListener, Serializable {
- // just consolidate the two interfaces
- }
-
- protected class InternalListener implements CombinedListener {
- private static final long serialVersionUID = 1L;
- public void changedUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateChangedUpdate(event);
- }
- public void insertUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateInsertUpdate(event);
- }
- public void removeUpdate(DocumentEvent event) {
- DocumentAdapter.this.delegateRemoveUpdate(event);
- }
- public void undoableEditHappened(UndoableEditEvent event) {
- DocumentAdapter.this.delegateUndoableEditHappened(event);
- }
- }
-
- protected static class InternalDocumentEvent
- extends EventObject
- implements DocumentEvent
- {
- protected DocumentEvent delegate;
-
- protected InternalDocumentEvent(Document document, DocumentEvent delegate) {
- super(document);
- this.delegate = delegate;
- }
- public ElementChange getChange(Element elem) {
- return this.delegate.getChange(elem);
- }
- public Document getDocument() {
- return (Document) this.source;
- }
- public int getLength() {
- return this.delegate.getLength();
- }
- public int getOffset() {
- return this.delegate.getOffset();
- }
- public EventType getType() {
- return this.delegate.getType();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java
deleted file mode 100644
index 5ca07951e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListModelAdapter.java
+++ /dev/null
@@ -1,292 +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.utility.internal.model.value.swing;
-
-import javax.swing.AbstractListModel;
-import javax.swing.event.ListDataListener;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This javax.swing.ListModel can be used to keep a ListDataListener
- * (e.g. a JList) in synch with a ListValueModel (or a CollectionValueModel).
- *
- * An instance of this ListModel *must* be supplied with a value model,
- * which is a ListValueModel on the bound list or a CollectionValueModel
- * on the bound collection. This is required - the list (or collection)
- * itself can be null, but the value model that holds it cannot.
- */
-public class ListModelAdapter
- extends AbstractListModel
-{
- /** A value model on the underlying model list. */
- protected ListValueModel<?> listHolder;
-
- /**
- * Cache the size of the list for "dramatic" changes.
- * @see #listChanged(ListChangeEvent)
- */
- protected int listSize;
-
- /** A listener that allows us to forward changes made to the underlying model list. */
- protected final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Default constructor - initialize stuff.
- */
- private ListModelAdapter() {
- super();
- this.listSize = 0;
- this.listChangeListener = this.buildListChangeListener();
- }
-
- /**
- * Constructor - the list holder is required.
- */
- public ListModelAdapter(ListValueModel<?> listHolder) {
- this();
- this.setModel(listHolder);
- }
-
- /**
- * Constructor - the collection holder is required.
- */
- public ListModelAdapter(CollectionValueModel<?> collectionHolder) {
- this();
- this.setModel(collectionHolder);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- ListModelAdapter.this.itemsAdded(event);
- }
- public void itemsRemoved(ListRemoveEvent event) {
- ListModelAdapter.this.itemsRemoved(event);
- }
- public void itemsReplaced(ListReplaceEvent event) {
- ListModelAdapter.this.itemsReplaced(event);
- }
- public void itemsMoved(ListMoveEvent event) {
- ListModelAdapter.this.itemsMoved(event);
- }
- public void listCleared(ListClearEvent event) {
- ListModelAdapter.this.listCleared();
- }
- public void listChanged(ListChangeEvent event) {
- ListModelAdapter.this.listChanged();
- }
- @Override
- public String toString() {
- return "list listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ListModel implementation **********
-
- public int getSize() {
- return this.listHolder.size();
- }
-
- public Object getElementAt(int index) {
- return this.listHolder.get(index);
- }
-
- /**
- * Extend to start listening to the underlying model list if necessary.
- */
- @Override
- public void addListDataListener(ListDataListener l) {
- if (this.hasNoListDataListeners()) {
- this.engageModel();
- this.listSize = this.listHolder.size();
- }
- super.addListDataListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model list if appropriate.
- */
- @Override
- public void removeListDataListener(ListDataListener l) {
- super.removeListDataListener(l);
- if (this.hasNoListDataListeners()) {
- this.disengageModel();
- this.listSize = 0;
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel<?> model() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel<?> listHolder) {
- if (listHolder == null) {
- throw new NullPointerException();
- }
- boolean hasListeners = this.hasListDataListeners();
- if (hasListeners) {
- this.disengageModel();
- }
- this.listHolder = listHolder;
- if (hasListeners) {
- this.engageModel();
- this.listChanged();
- }
- }
-
- /**
- * Set the underlying collection model.
- */
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public void setModel(CollectionValueModel<?> collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter(collectionHolder));
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoListDataListeners() {
- return this.getListDataListeners().length == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasListDataListeners() {
- return ! this.hasNoListDataListeners();
- }
-
-
- // ********** behavior **********
-
- protected void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- protected void disengageModel() {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
-
-
- // ********** list change support **********
-
- /**
- * Items were added to the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsAdded(ListAddEvent event) {
- int start = event.getIndex();
- int end = start + event.getItemsSize() - 1;
- this.fireIntervalAdded(this, start, end);
- this.listSize += event.getItemsSize();
- }
-
- /**
- * Items were removed from the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsRemoved(ListRemoveEvent event) {
- int start = event.getIndex();
- int end = start + event.getItemsSize() - 1;
- this.fireIntervalRemoved(this, start, end);
- this.listSize -= event.getItemsSize();
- }
-
- /**
- * Items were replaced in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsReplaced(ListReplaceEvent event) {
- int start = event.getIndex();
- int end = start + event.getItemsSize() - 1;
- this.fireContentsChanged(this, start, end);
- }
-
- /**
- * Items were moved in the underlying model list.
- * Notify listeners of the changes.
- */
- protected void itemsMoved(ListMoveEvent event) {
- int start = Math.min(event.getSourceIndex(), event.getTargetIndex());
- int end = Math.max(event.getSourceIndex(), event.getTargetIndex()) + event.getLength() - 1;
- this.fireContentsChanged(this, start, end);
- }
-
- /**
- * The underlying model list was cleared.
- * Notify listeners of the changes.
- */
- protected void listCleared() {
- if (this.listSize != 0) {
- this.fireIntervalRemoved(this, 0, this.listSize - 1);
- this.listSize = 0;
- }
- }
-
- /**
- * The underlying model list has changed "dramatically".
- * Notify listeners of the changes.
- */
- protected void listChanged() {
- if (this.listSize != 0) {
- this.fireIntervalRemoved(this, 0, this.listSize - 1);
- }
- this.listSize = this.listHolder.size();
- if (this.listSize != 0) {
- this.fireIntervalAdded(this, 0, this.listSize - 1);
- }
- }
-
-
- // ********** Object overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.listHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java
deleted file mode 100644
index 3a90616ebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ListSpinnerModelAdapter.java
+++ /dev/null
@@ -1,218 +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.utility.internal.model.value.swing;
-
-import java.util.Arrays;
-import java.util.List;
-import javax.swing.SpinnerListModel;
-import javax.swing.event.ChangeListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerListModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a value
- * in the list.
- *
- * This class must be a sub-class of SpinnerListModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * NB: This model should only be used for values that have a reasonably
- * inexpensive #equals() implementation.
- * @see #synchronize(Object)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see DateSpinnerModelAdapter
- * @see NumberSpinnerModelAdapter
- */
-public class ListSpinnerModelAdapter
- extends SpinnerListModel
-{
-
- /**
- * The default spinner value; used when the underlying model value is null.
- * The default is the first item on the list.
- */
- private final Object defaultValue;
-
- /** A value model on the underlying value. */
- private final WritablePropertyValueModel<Object> valueHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying value. */
- private final PropertyChangeListener valueChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder is required.
- * Use the model value itself as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder) {
- this(valueHolder, valueHolder.getValue());
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object defaultValue) {
- this(valueHolder, new Object[] {defaultValue}, defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * Use the first item in the list of values as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object[] values) {
- this(valueHolder, values, values[0]);
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object[] values, Object defaultValue) {
- this(valueHolder, Arrays.asList(values), defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * Use the first item in the list of values as the default spinner value.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, List<Object> values) {
- this(valueHolder, values, values.get(0));
- }
-
- /**
- * Constructor - the value holder is required.
- */
- public ListSpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, List<Object> values, Object defaultValue) {
- super(values);
- this.valueHolder = valueHolder;
- this.valueChangeListener = this.buildValueChangeListener();
- // postpone listening to the underlying value
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValueChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildValueChangeListener_());
- }
-
- protected PropertyChangeListener buildValueChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ListSpinnerModelAdapter.this.synchronize(event.getNewValue());
- }
- @Override
- public String toString() {
- return "value listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.valueHolder.getValue()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying value directly.
- * The resulting event will be ignored: @see #synchronize(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.valueHolder.setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying value if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- this.synchronize(this.valueHolder.getValue());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying value if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Object getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the spinner value has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
deleted file mode 100644
index aead92feff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/NumberSpinnerModelAdapter.java
+++ /dev/null
@@ -1,223 +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.utility.internal.model.value.swing;
-
-import javax.swing.SpinnerNumberModel;
-import javax.swing.event.ChangeListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerNumberModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a number.
- *
- * This class must be a sub-class of SpinnerNumberModel because of some
- * crappy jdk code.... ~bjv
- * @see javax.swing.JSpinner#createEditor(javax.swing.SpinnerModel)
- *
- * If this class needs to be modified, it would behoove us to review the
- * other, similar classes:
- * @see DateSpinnerModelAdapter
- * @see ListSpinnerModelAdapter
- */
-public class NumberSpinnerModelAdapter
- extends SpinnerNumberModel
-{
-
- /**
- * The default spinner value; used when the
- * underlying model number value is null.
- */
- private final Number defaultValue;
-
- /** A value model on the underlying number. */
- private final WritablePropertyValueModel<Number> numberHolder;
-
- /**
- * A listener that allows us to synchronize with
- * changes made to the underlying number.
- */
- private final PropertyChangeListener numberChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the number holder is required.
- * The default spinner value is zero.
- * The step size is one.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder) {
- this(numberHolder, 0);
- }
-
- /**
- * Constructor - the number holder is required.
- * The step size is one.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int defaultValue) {
- this(numberHolder, null, null, Integer.valueOf(1), Integer.valueOf(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- * Use the minimum value as the default spinner value.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int minimum, int maximum, int stepSize) {
- this(numberHolder, minimum, maximum, stepSize, minimum);
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, int minimum, int maximum, int stepSize, int defaultValue) {
- this(numberHolder, Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize), Integer.valueOf(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- * Use the minimum value as the default spinner value.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double minimum, double maximum, double stepSize) {
- this(numberHolder, minimum, maximum, stepSize, minimum);
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, double minimum, double maximum, double stepSize, double defaultValue) {
- this(numberHolder, Double.valueOf(minimum), Double.valueOf(maximum), Double.valueOf(stepSize), Double.valueOf(defaultValue));
- }
-
- /**
- * Constructor - the number holder is required.
- */
- public NumberSpinnerModelAdapter(WritablePropertyValueModel<Number> numberHolder, Comparable<?> minimum, Comparable<?> maximum, Number stepSize, Number defaultValue) {
- super(numberHolder.getValue() == null ? defaultValue : (Number) numberHolder.getValue(), minimum, maximum, stepSize);
- this.numberHolder = numberHolder;
- this.numberChangeListener = this.buildNumberChangeListener();
- // postpone listening to the underlying number
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildNumberChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildNumberChangeListener_());
- }
-
- protected PropertyChangeListener buildNumberChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- NumberSpinnerModelAdapter.this.synchronize(event.getNewValue());
- }
- @Override
- public String toString() {
- return "number listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- /**
- * Extend to check whether this method is being called before we
- * have any listeners.
- * This is necessary because some crappy jdk code gets the value
- * from the model *before* listening to the model. ~bjv
- * @see javax.swing.JSpinner.DefaultEditor(javax.swing.JSpinner)
- */
- @Override
- public Object getValue() {
- if (this.getChangeListeners().length == 0) {
- // sorry about this "lateral" call to super ~bjv
- super.setValue(this.spinnerValueOf(this.numberHolder.getValue()));
- }
- return super.getValue();
- }
-
- /**
- * Extend to update the underlying number directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(Object).
- */
- @Override
- public void setValue(Object value) {
- super.setValue(value);
- this.numberHolder.setValue((Number) value);
- }
-
- /**
- * Extend to start listening to the underlying number if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.getChangeListeners().length == 0) {
- this.numberHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.numberChangeListener);
- this.synchronize(this.numberHolder.getValue());
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying number if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.getChangeListeners().length == 0) {
- this.numberHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.numberChangeListener);
- }
- }
-
-
- // ********** queries **********
-
- protected Number getDefaultValue() {
- return this.defaultValue;
- }
-
- /**
- * Convert to a non-null value.
- */
- protected Object spinnerValueOf(Object value) {
- return (value == null) ? this.getDefaultValue() : value;
- }
-
-
- // ********** behavior **********
-
- /**
- * Set the spinner value if it has changed.
- */
- void synchronize(Object value) {
- Object newValue = this.spinnerValueOf(value);
- // check to see whether the date has already been synchronized
- // (via #setValue())
- if ( ! this.getValue().equals(newValue)) {
- this.setValue(newValue);
- }
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.numberHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
deleted file mode 100644
index eef2476212..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ObjectListSelectionModel.java
+++ /dev/null
@@ -1,427 +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.utility.internal.model.value.swing;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
-import javax.swing.DefaultListSelectionModel;
-import javax.swing.ListModel;
-import javax.swing.event.ListDataEvent;
-import javax.swing.event.ListDataListener;
-import javax.swing.event.ListSelectionListener;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-/**
- * This ListSelectionModel is aware of the ListModel and
- * provides convenience methods to access and set the
- * selected *objects*, as opposed to the selected *indexes*.
- */
-public class ObjectListSelectionModel
- extends DefaultListSelectionModel
-{
- /** The list model referenced by the list selection model. */
- private final ListModel listModel;
-
- /** A listener that allows us to clear the selection when the list model has changed. */
- private final ListDataListener listDataListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a list selection model for the specified list model.
- */
- public ObjectListSelectionModel(ListModel listModel) {
- super();
- this.listModel = listModel;
- this.listDataListener = this.buildListDataListener();
- }
-
-
- // ********** initialization **********
-
- private ListDataListener buildListDataListener() {
- return new ListDataListener() {
- public void intervalAdded(ListDataEvent event) {
- // this does not affect the selection
- }
- public void intervalRemoved(ListDataEvent event) {
- // this does not affect the selection
- }
- public void contentsChanged(ListDataEvent event) {
- ObjectListSelectionModel.this.listModelContentsChanged(event);
- }
- @Override
- public String toString() {
- return "list data listener"; //$NON-NLS-1$
- }
- };
- }
-
- /**
- * Typically, the selection does not need to be cleared when the
- * contents of the list have changed. Most of the time this just
- * means an item has changed in a way that affects its display string
- * or icon. We typically only use the class for edits involving
- * single selection.
- * A subclass can override this method if the selection
- * should be cleared because a change could mean the selection is invalid.
- */
- protected void listModelContentsChanged(@SuppressWarnings("unused") ListDataEvent event) {
- /**this.clearSelection();*/
- }
-
-
- // ********** ListSelectionModel implementation **********
-
- @Override
- public void addListSelectionListener(ListSelectionListener l) {
- if (this.hasNoListSelectionListeners()) {
- this.listModel.addListDataListener(this.listDataListener);
- }
- super.addListSelectionListener(l);
- }
-
- @Override
- public void removeListSelectionListener(ListSelectionListener l) {
- super.removeListSelectionListener(l);
- if (this.hasNoListSelectionListeners()) {
- this.listModel.removeListDataListener(this.listDataListener);
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoListSelectionListeners() { // private-protected
- return this.getListSelectionListeners().length == 0;
- }
-
- /**
- * Return the list model referenced by the list selection model.
- */
- public ListModel getListModel() {
- return this.listModel;
- }
-
- public int selectedValuesSize() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return 0;
- }
-
- int n = 0;
- int count = this.getListModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- n++;
- }
- }
- return n;
- }
-
- /**
- * Return the first selected value.
- * Return null if the selection is empty.
- */
- public Object selectedValue() {
- int index = this.getMinSelectionIndex();
- if (index == -1) {
- return null;
- }
- if (this.getListModel().getSize() <= index) {
- return null;
- }
- return this.getListModel().getElementAt(index);
- }
-
- /**
- * Return an array of the selected values.
- */
- public Object[] selectedValues() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return new Object[0];
- }
-
- int maxSize = (max - min) + 1;
- Object[] temp = new Object[maxSize];
- int n = 0;
- int count = this.getListModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- temp[n++] = this.getListModel().getElementAt(i);
- }
- }
- if (n == maxSize) {
- // all the elements in the range were selected
- return temp;
- }
- // only some of the elements in the range were selected
- Object[] result = new Object[n];
- System.arraycopy(temp, 0, result, 0, n);
- return result;
- }
-
- /**
- * Return an array of the selected indices in order.
- */
- public int[] selectedIndices() {
- int min = this.getMinSelectionIndex();
- int max = this.getMaxSelectionIndex();
-
- if ((min < 0) || (max < 0)) {
- return new int[0];
- }
-
- int maxSize = (max - min) + 1;
- int[] temp = new int[maxSize];
- int n = 0;
- int count = this.getListModel().getSize();
- for (int i = min; i <= max; i++) {
- if (this.isSelectedIndex(i) && (i < count)) {
- temp[n++] = i;
- }
- }
- if (n == maxSize) {
- // all the elements in the range were selected
- Arrays.sort(temp);
- return temp;
- }
- // only some of the elements in the range were selected
- int[] result = new int[n];
- System.arraycopy(temp, 0, result, 0, n);
- Arrays.sort(result);
- return result;
- }
-
- /**
- * Set the selected value.
- */
- public void setSelectedValue(Object object) {
- this.setSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- this.clearSelection();
- this.addSelectedValuesInternal(objects);
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Collection<?> objects) {
- this.setSelectedValues(objects.iterator());
- }
-
- /**
- * Set the current set of selected objects to the specified objects.
- * @see javax.swing.ListSelectionModel#setSelectionInterval(int, int)
- */
- public void setSelectedValues(Object[] objects) {
- this.setSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * Add the specified object to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValue(Object object) {
- this.addSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- this.addSelectedValuesInternal(objects);
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Collection<?> objects) {
- this.addSelectedValues(objects.iterator());
- }
-
- /**
- * Add the specified objects to the current set of selected objects.
- * @see javax.swing.ListSelectionModel#addSelectionInterval(int, int)
- */
- public void addSelectedValues(Object[] objects) {
- this.addSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * Remove the specified object from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValue(Object object) {
- this.removeSelectedValues(CollectionTools.singletonIterator(object));
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Iterator<?> objects) {
- this.setValueIsAdjusting(true);
- ListModel lm = this.getListModel();
- int lmSize = lm.getSize();
- while (objects.hasNext()) {
- int index = this.indexOf(objects.next(), lm, lmSize);
- this.removeSelectionInterval(index, index);
- }
- this.setValueIsAdjusting(false);
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Collection<?> objects) {
- this.removeSelectedValues(objects.iterator());
- }
-
- /**
- * Remove the specified objects from the current set of selected objects.
- * @see javax.swing.ListSelectionModel#removeSelectionInterval(int, int)
- */
- public void removeSelectedValues(Object[] objects) {
- this.removeSelectedValues(CollectionTools.iterator(objects));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getAnchorSelectionIndex()
- * Return null if the anchor selection is empty.
- */
- public Object getAnchorSelectedValue() {
- int index = this.getAnchorSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.getListModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#setAnchorSelectionIndex(int)
- */
- public void setAnchorSelectedValue(Object object) {
- this.setAnchorSelectionIndex(this.indexOf(object));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getLeadSelectionIndex()
- * Return null if the lead selection is empty.
- */
- public Object getLeadSelectedValue() {
- int index = this.getLeadSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.getListModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#setLeadSelectionIndex(int)
- */
- public void setLeadSelectedValue(Object object) {
- this.setLeadSelectionIndex(this.indexOf(object));
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getMaxSelectionIndex()
- * Return null if the max selection is empty.
- */
- public Object getMaxSelectedValue() {
- int index = this.getMaxSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.getListModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#getMinSelectionIndex()
- * Return null if the min selection is empty.
- */
- public Object getMinSelectedValue() {
- int index = this.getMinSelectionIndex();
- if (index == -1) {
- return null;
- }
- return this.getListModel().getElementAt(index);
- }
-
- /**
- * @see javax.swing.ListSelectionModel#isSelectedIndex(int)
- */
- public boolean valueIsSelected(Object object) {
- return this.isSelectedIndex(this.indexOf(object));
- }
-
- /**
- * Add the specified objects to the current set of selected objects,
- * without wrapping the actions in "adjusting" events.
- */
- private void addSelectedValuesInternal(Iterator<?> objects) {
- ListModel lm = this.getListModel();
- int listModelSize = lm.getSize();
- while (objects.hasNext()) {
- int index = this.indexOf(objects.next(), lm, listModelSize);
- this.addSelectionInterval(index, index);
- }
- }
-
- /**
- * Return the index in the list model of the specified object.
- * Return -1 if the object is not in the list model.
- */
- private int indexOf(Object object) {
- ListModel lm = this.getListModel();
- return this.indexOf(object, lm, lm.getSize());
- }
-
- /**
- * Return the index in the list model of the specified object.
- * Return -1 if the object is not in the list model.
- */
- // we're just jerking around with performance optimizations here
- // (in memory of Phil...);
- // call this method inside loops that do not modify the listModel
- private int indexOf(Object object, ListModel lm, int listModelSize) {
- for (int i = listModelSize; i-- > 0; ) {
- if (lm.getElementAt(i).equals(object)) {
- return i;
- }
- }
- return -1;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java
deleted file mode 100644
index 5a19127741..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/PrimitiveListTreeModel.java
+++ /dev/null
@@ -1,239 +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.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.MutableTreeNode;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-
-/**
- * This TreeModel implementation provides a tree with a "null" root that
- * has a set of "primitive" children. These "primitive" children do not have
- * children themselves, making the tree a maximum of 2 levels deep.
- * This model automatically synchronizes the root's children with a
- * ListValueModel that holds a collection of primitive (non-model) objects
- * (e.g. Strings).
- *
- * This is useful for providing an "editable" list of primitives. Since the JDK
- * does not provide us with an editable listbox, we must use an editable tree.
- * We wrap everything in DefaultMutableTreeNodes.
- *
- * Subclasses must implement #primitiveChanged(int, Object) and update
- * the model appropriately. This method is called when the user edits the
- * list directly and presses <Enter>.
- *
- * The JTree using this model must be configured as "editable":
- * tree.setEditable(true);
- */
-// TODO convert to use an adapter instead of requiring subclass
-public abstract class PrimitiveListTreeModel
- extends DefaultTreeModel
-{
- /** a model on the list of primitives */
- private final ListValueModel<?> listHolder;
-
- /** a listener that handles the adding, removing, and replacing of the primitives */
- private final ListChangeListener listChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Public constructor - the list holder is required
- */
- public PrimitiveListTreeModel(ListValueModel<?> listHolder) {
- super(new DefaultMutableTreeNode(null, true)); // true = the root can have children
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.listChangeListener = this.buildListChangeListener();
- // postpone listening to the model until we have listeners ourselves
- }
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new PrimitiveListChangeListener();
- }
-
-
- // ********** behavior **********
-
- /**
- * Subclasses should override this method to update the
- * model appropriately. The primitive at the specified index was
- * edited directly by the user and the new value is as specified.
- * Convert the value appropriately and place it in the model.
- */
- protected abstract void primitiveChanged(int index, Object newValue);
-
-
- // ********** TreeModel implementation **********
-
- /**
- * Override to change the underlying model instead of changing the node directly.
- */
- @Override
- public void valueForPathChanged(TreePath path, Object newValue) {
- TreeNode node = (TreeNode) path.getLastPathComponent();
- int index = ((TreeNode) this.getRoot()).getIndex(node);
- this.primitiveChanged(index, newValue);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTreeModelListener(TreeModelListener l) {
- if (this.getTreeModelListeners().length == 0) {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- this.synchronizeList();
- }
- super.addTreeModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeTreeModelListener(TreeModelListener l) {
- super.removeTreeModelListener(l);
- if (this.getTreeModelListeners().length == 0) {
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Synchronize our list of nodes with the list of primitives
- */
- void synchronizeList() {
- this.clearList();
- this.buildList();
- }
-
- void clearList() {
- int childcount = this.root.getChildCount();
- for (int i = childcount - 1; i >= 0; i--) {
- this.removeNodeFromParent((MutableTreeNode)this.root.getChildAt(i));
- }
- }
-
- private void buildList() {
- for (Iterator<?> stream = this.listHolder.iterator(); stream.hasNext(); ) {
- this.addPrimitive(stream.next());
- }
- }
-
- /**
- * Add the specified primitive to the end of the list.
- */
- private void addPrimitive(Object primitive) {
- this.insertPrimitive(this.root.getChildCount(), primitive);
- }
-
- /**
- * Create a node for the specified primitive
- * and insert it as a child of the root.
- */
- void insertPrimitive(int index, Object primitive) {
- DefaultMutableTreeNode node = new DefaultMutableTreeNode(primitive, false); // don't allow children on the child node
- this.insertNodeInto(node, (MutableTreeNode) this.root, index);
- }
-
- /**
- * Remove node at the specified index.
- */
- MutableTreeNode removeNode(int index) {
- MutableTreeNode node = (MutableTreeNode) this.root.getChildAt(index);
- this.removeNodeFromParent(node);
- return node;
- }
-
- /**
- * Replace the user object of the node at childIndex.
- */
- void replacePrimitive(int index, Object primitive) {
- MutableTreeNode node = (MutableTreeNode) this.root.getChildAt(index);
- node.setUserObject(primitive);
- this.nodeChanged(node);
- }
-
-
- // ********** inner class **********
-
- private class PrimitiveListChangeListener implements ListChangeListener {
- PrimitiveListChangeListener() {
- super();
- }
-
- public void itemsAdded(ListAddEvent event) {
- int i = event.getIndex();
- for (Object item : event.getItems()) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, item);
- }
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- for (int i = 0; i < event.getItemsSize(); i++) {
- PrimitiveListTreeModel.this.removeNode(event.getIndex());
- }
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- int i = event.getIndex();
- for (Object item : event.getNewItems()) {
- PrimitiveListTreeModel.this.replacePrimitive(i++, item);
- }
- }
-
- public void itemsMoved(ListMoveEvent event) {
- ArrayList<MutableTreeNode> temp = new ArrayList<MutableTreeNode>(event.getLength());
- for (int i = 0; i < event.getLength(); i++) {
- temp.add(PrimitiveListTreeModel.this.removeNode(event.getSourceIndex()));
- }
- int i = event.getTargetIndex();
- for (MutableTreeNode node : temp) {
- PrimitiveListTreeModel.this.insertPrimitive(i++, node);
- }
- }
-
- public void listCleared(ListClearEvent event) {
- PrimitiveListTreeModel.this.clearList();
- }
-
- public void listChanged(ListChangeEvent event) {
- PrimitiveListTreeModel.this.synchronizeList();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
deleted file mode 100644
index fba8a53208..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/RadioButtonModelAdapter.java
+++ /dev/null
@@ -1,151 +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.utility.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JRadioButton) in synch with a (typically shared)
- * PropertyValueModel that holds one value out of a set of values.
- *
- * NOTE: Do *not* use this model with a ButtonGroup, since the
- * shared value holder and the wrappers built by this adapter will
- * keep the appropriate radio button checked. Also, this allows
- * us to uncheck all the radio buttons in a group when the shared
- * value is null.
- */
-public class RadioButtonModelAdapter
- extends ToggleButtonModelAdapter
-{
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder is required.
- */
- public RadioButtonModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object buttonValue, boolean defaultValue) {
- super(buildBooleanHolder(valueHolder, buttonValue), defaultValue);
- }
-
- /**
- * Constructor - the value holder is required.
- * The default value will be false.
- */
- public RadioButtonModelAdapter(WritablePropertyValueModel<Object> valueHolder, Object buttonValue) {
- super(buildBooleanHolder(valueHolder, buttonValue));
- }
-
-
- // ********** static methods **********
-
- /**
- * Build up a set of wrappers that will convert the
- * specified value holder and button value to/from a boolean.
- *
- * If the value holder's value matches the button value,
- * the wrapper will return true. Likewise, if the value holder's
- * value is set to true, the wrapper will set the value holder's
- * value to the button value.
- */
- public static WritablePropertyValueModel<Boolean> buildBooleanHolder(WritablePropertyValueModel<Object> valueHolder, Object buttonValue) {
- WritablePropertyValueModel<Object> filteringPVM = new FilteringWritablePropertyValueModel<Object>(valueHolder, new RadioButtonFilter(buttonValue));
- return new TransformationWritablePropertyValueModel<Object, Boolean>(filteringPVM, new RadioButtonTransformer(buttonValue));
- }
-
-
- // ********** overrides **********
-
- /**
- * The user cannot de-select a radio button - the user
- * can only *select* a radio button. Only the model can
- * cause a radio button to be de-selected. We use the
- * ARMED flag to indicate whether we are being de-selected
- * by the user.
- */
- @Override
- public void setSelected(boolean b) {
- // do not allow the user to de-select a radio button
- // radio buttons can
- if ((b == false) && this.isArmed()) {
- return;
- }
- super.setSelected(b);
- }
-
-
- // ********** inner classes **********
-
- /**
- * This filter will only pass through a new value to the wrapped
- * value holder when it matches the configured button value.
- */
- public static class RadioButtonFilter implements BidiFilter<Object> {
- private Object buttonValue;
-
- public RadioButtonFilter(Object buttonValue) {
- super();
- this.buttonValue = buttonValue;
- }
-
- /**
- * always return the wrapped value
- */
- public boolean accept(Object value) {
- return true;
- }
-
- /**
- * pass through the value to the wrapped property value model
- * *only* when it matches our button value
- */
- public boolean reverseAccept(Object value) {
- return (value != null) && value.equals(this.buttonValue);
- }
-
- }
-
- /**
- * This transformer will convert the wrapped value to Boolean.TRUE
- * when it matches the configured button value.
- */
- public static class RadioButtonTransformer implements BidiTransformer<Object, Boolean> {
- private Object buttonValue;
-
- public RadioButtonTransformer(Object buttonValue) {
- super();
- this.buttonValue = buttonValue;
- }
-
- /**
- * if the wrapped value matches our button value return true,
- * if it is some other value return false;
- * but if it is null simply pass it through because it will cause the
- * button model's default value to be used
- */
- public Boolean transform(Object value) {
- return (value == null) ? null : Boolean.valueOf(value.equals(this.buttonValue));
- }
-
- /**
- * if the new value is true, pass through the our button value;
- * otherwise pass through null
- */
- public Object reverseTransform(Boolean value) {
- return (value.booleanValue()) ? this.buttonValue : null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java
deleted file mode 100644
index 20896e6b5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/SpinnerModelAdapter.java
+++ /dev/null
@@ -1,207 +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.utility.internal.model.value.swing;
-
-import javax.swing.AbstractSpinnerModel;
-import javax.swing.SpinnerModel;
-import javax.swing.SpinnerNumberModel;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.SpinnerModel can be used to keep a ChangeListener
- * (e.g. a JSpinner) in synch with a PropertyValueModel that holds a value.
- *
- * Note: it is likely you want to use one of the following classes instead of
- * this one:
- * DateSpinnerModelAdapter
- * NumberSpinnerModelAdapter
- * ListSpinnerModelAdapter
- *
- * NB: This model should only be used for values that have a fairly
- * inexpensive #equals() implementation.
- * @see #synchronizeDelegate(Object)
- */
-public class SpinnerModelAdapter
- extends AbstractSpinnerModel
-{
- /** The delegate spinner model whose behavior we "enhance". */
- protected final SpinnerModel delegate;
-
- /** A listener that allows us to forward any changes made to the delegate spinner model. */
- protected final ChangeListener delegateListener;
-
- /** A value model on the underlying value. */
- protected final WritablePropertyValueModel<Object> valueHolder;
-
- /** A listener that allows us to synchronize with changes made to the underlying value. */
- protected final PropertyChangeListener valueListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the value holder and delegate are required.
- */
- public SpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder, SpinnerModel delegate) {
- super();
- if (valueHolder == null || delegate == null) {
- throw new NullPointerException();
- }
- this.valueHolder = valueHolder;
- this.delegate = delegate;
- // postpone listening to the underlying value
- // until we have listeners ourselves...
- this.valueListener = this.buildValueListener();
- this.delegateListener = this.buildDelegateListener();
- }
-
- /**
- * Constructor - the value holder is required.
- * This will wrap a simple number spinner model.
- */
- public SpinnerModelAdapter(WritablePropertyValueModel<Object> valueHolder) {
- this(valueHolder, new SpinnerNumberModel());
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildValueListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildValueListener_());
- }
-
- protected PropertyChangeListener buildValueListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- SpinnerModelAdapter.this.valueChanged(event);
- }
- @Override
- public String toString() {
- return "value listener"; //$NON-NLS-1$
- }
- };
- }
-
- /**
- * expand access a bit for inner class
- */
- @Override
- protected void fireStateChanged() {
- super.fireStateChanged();
- }
-
- protected ChangeListener buildDelegateListener() {
- return new ChangeListener() {
- public void stateChanged(ChangeEvent event) {
- // forward the event, with this as the source
- SpinnerModelAdapter.this.fireStateChanged();
- }
- @Override
- public String toString() {
- return "delegate listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** SpinnerModel implementation **********
-
- public Object getValue() {
- return this.delegate.getValue();
- }
-
- /**
- * Extend to update the underlying value directly.
- * The resulting event will be ignored: @see #synchronizeDelegate(Object).
- */
- public void setValue(Object value) {
- this.delegate.setValue(value);
- this.valueHolder.setValue(value);
- }
-
- public Object getNextValue() {
- return this.delegate.getNextValue();
- }
-
- public Object getPreviousValue() {
- return this.delegate.getPreviousValue();
- }
-
- /**
- * Extend to start listening to the underlying value if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener listener) {
- if (this.listenerList.getListenerCount(ChangeListener.class) == 0) {
- this.delegate.addChangeListener(this.delegateListener);
- this.engageValueHolder();
- }
- super.addChangeListener(listener);
- }
-
- /**
- * Extend to stop listening to the underlying value if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener listener) {
- super.removeChangeListener(listener);
- if (this.listenerList.getListenerCount(ChangeListener.class) == 0) {
- this.disengageValueHolder();
- this.delegate.removeChangeListener(this.delegateListener);
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * A third party has modified the underlying value.
- * Synchronize the delegate model accordingly.
- */
- protected void valueChanged(PropertyChangeEvent event) {
- this.synchronizeDelegate(event.getNewValue());
- }
-
- /**
- * Set the delegate's value if it has changed.
- */
- protected void synchronizeDelegate(Object value) {
- // check to see whether the delegate has already been synchronized
- // (via #setValue())
- if ( ! this.delegate.getValue().equals(value)) {
- this.delegate.setValue(value);
- }
- }
-
- protected void engageValueHolder() {
- this.valueHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.valueListener);
- this.synchronizeDelegate(this.valueHolder.getValue());
- }
-
- protected void disengageValueHolder() {
- this.valueHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.valueListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.valueHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java
deleted file mode 100644
index 0c18cd5e57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TableModelAdapter.java
+++ /dev/null
@@ -1,420 +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.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.event.TableModelListener;
-import javax.swing.table.AbstractTableModel;
-
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This TableModel can be used to keep a TableModelListener (e.g. a JTable)
- * in synch with a ListValueModel that holds a collection of model objects,
- * each of which corresponds to a row in the table.
- * Typically, each column of the table will be bound to a different aspect
- * of the contained model objects.
- *
- * For example, a MWTable has an attribute 'databaseFields' that holds
- * a collection of MWDatabaseFields that would correspond to the rows of
- * a JTable; and each MWDatabaseField has a number
- * of attributes (e.g. name, type, size) that can be bound to the columns of
- * a row in the JTable. As these database fields are added, removed, and
- * changed, this model will keep the listeners aware of the changes.
- *
- * An instance of this TableModel must be supplied with a
- * list holder (e.g. the 'databaseFields'), which is a value
- * model on the bound collection This is required - the
- * collection itself can be null, but the list value model that
- * holds it is required. Typically this list will be sorted (@see
- * SortedListValueModelAdapter).
- *
- * This TableModel must also be supplied with a ColumnAdapter that
- * will be used to configure the headers, renderers, editors, and contents
- * of the various columns.
- *
- * Design decision:
- * Cell listener options (from low space/high time to high space/low time):
- * - 1 cell listener listening to every cell (this is the current implementation)
- * - 1 cell listener per row
- * - 1 cell listener per cell
- */
-public class TableModelAdapter<E>
- extends AbstractTableModel
-{
- /**
- * a list of user objects that are converted to
- * rows via the column adapter
- */
- private ListValueModel<? extends E> listHolder;
- private final ListChangeListener listChangeListener;
-
- /**
- * each row is an array of cell models
- */
- // declare as ArrayList so we can use #ensureCapacity(int)
- private final ArrayList<WritablePropertyValueModel<Object>[]> rows;
-
- /**
- * client-supplied adapter that provides with the various column
- * settings and converts the objects in the LVM
- * into an array of cell models
- */
- private final ColumnAdapter columnAdapter;
-
- /**
- * the single listener that listens to every cell's model
- */
- private final PropertyChangeListener cellListener;
-
-
- // ********** constructors **********
-
- /**
- * Construct a table model adapter for the specified objects
- * and adapter.
- */
- public TableModelAdapter(ListValueModel<? extends E> listHolder, ColumnAdapter columnAdapter) {
- super();
- if (listHolder == null) {
- throw new NullPointerException();
- }
- this.listHolder = listHolder;
- this.columnAdapter = columnAdapter;
- this.listChangeListener = this.buildListChangeListener();
- this.rows = new ArrayList<WritablePropertyValueModel<Object>[]>();
- this.cellListener = this.buildCellListener();
- }
-
- /**
- * Construct a table model adapter for the specified objects
- * and adapter.
- */
- public TableModelAdapter(CollectionValueModel<? extends E> collectionHolder, ColumnAdapter columnAdapter) {
- this(new CollectionListValueModelAdapter<E>(collectionHolder), columnAdapter);
- }
-
-
- // ********** initialization **********
-
- protected ListChangeListener buildListChangeListener() {
- return new AWTListChangeListenerWrapper(this.buildListChangeListener_());
- }
-
- protected ListChangeListener buildListChangeListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- TableModelAdapter.this.addRows(event.getIndex(), event.getItemsSize(), this.getItems(event));
- }
- public void itemsRemoved(ListRemoveEvent event) {
- TableModelAdapter.this.removeRows(event.getIndex(), event.getItemsSize());
- }
- public void itemsReplaced(ListReplaceEvent event) {
- TableModelAdapter.this.replaceRows(event.getIndex(), this.getNewItems(event));
- }
- public void itemsMoved(ListMoveEvent event) {
- TableModelAdapter.this.moveRows(event.getTargetIndex(), event.getSourceIndex(), event.getLength());
- }
- public void listCleared(ListClearEvent event) {
- TableModelAdapter.this.clearTable();
- }
- public void listChanged(ListChangeEvent event) {
- TableModelAdapter.this.rebuildTable();
- }
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<Object> getItems(ListAddEvent event) {
- return (Iterable<Object>) event.getItems();
- }
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<Object> getNewItems(ListReplaceEvent event) {
- return (Iterable<Object>) event.getNewItems();
- }
- @Override
- public String toString() {
- return "list listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- protected PropertyChangeListener buildCellListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildCellListener_());
- }
-
- protected PropertyChangeListener buildCellListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- TableModelAdapter.this.cellChanged((WritablePropertyValueModel<Object>) event.getSource());
- }
- @Override
- public String toString() {
- return "cell listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** TableModel implementation **********
-
- public int getColumnCount() {
- return this.columnAdapter.columnCount();
- }
-
- public int getRowCount() {
- return this.rows.size();
- }
-
- @Override
- public String getColumnName(int column) {
- return this.columnAdapter.columnName(column);
- }
-
- @Override
- public Class<?> getColumnClass(int columnIndex) {
- return this.columnAdapter.columnClass(columnIndex);
- }
-
- @Override
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return this.columnAdapter.columnIsEditable(columnIndex);
- }
-
- public Object getValueAt(int rowIndex, int columnIndex) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(rowIndex);
- return row[columnIndex].getValue();
- }
-
- @Override
- public void setValueAt(Object value, int rowIndex, int columnIndex) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(rowIndex);
- row[columnIndex].setValue(value);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTableModelListener(TableModelListener l) {
- if (this.hasNoTableModelListeners()) {
- this.engageModel();
- }
- super.addTableModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if necessary.
- */
- @Override
- public void removeTableModelListener(TableModelListener l) {
- super.removeTableModelListener(l);
- if (this.hasNoTableModelListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** public API **********
-
- /**
- * Return the underlying list model.
- */
- public ListValueModel<? extends E> getModel() {
- return this.listHolder;
- }
-
- /**
- * Set the underlying list model.
- */
- public void setModel(ListValueModel<E> listHolder) {
- if (listHolder == null) {
- throw new NullPointerException();
- }
- boolean hasListeners = this.hasTableModelListeners();
- if (hasListeners) {
- this.disengageModel();
- }
- this.listHolder = listHolder;
- if (hasListeners) {
- this.engageModel();
- this.fireTableDataChanged();
- }
- }
-
- /**
- * Set the underlying collection model.
- */
- public void setModel(CollectionValueModel<E> collectionHolder) {
- this.setModel(new CollectionListValueModelAdapter<E>(collectionHolder));
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether this model has no listeners.
- */
- protected boolean hasNoTableModelListeners() {
- return this.listenerList.getListenerCount(TableModelListener.class) == 0;
- }
-
- /**
- * Return whether this model has any listeners.
- */
- protected boolean hasTableModelListeners() {
- return ! this.hasNoTableModelListeners();
- }
-
-
- // ********** behavior **********
-
- /**
- * Start listening to the list of objects and the various aspects
- * of the objects that make up the rows.
- */
- private void engageModel() {
- this.listHolder.addListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- this.engageAllCells();
- }
-
- /**
- * Convert the objects into rows and listen to the cells.
- */
- private void engageAllCells() {
- this.rows.ensureCapacity(this.listHolder.size());
- for (Iterator<? extends E> stream = this.listHolder.iterator(); stream.hasNext(); ) {
- WritablePropertyValueModel<Object>[] row = this.columnAdapter.cellModels(stream.next());
- this.engageRow(row);
- this.rows.add(row);
- }
- }
-
- /**
- * Listen to the cells in the specified row.
- */
- private void engageRow(WritablePropertyValueModel<Object>[] row) {
- for (int i = row.length; i-- > 0; ) {
- row[i].addPropertyChangeListener(PropertyValueModel.VALUE, this.cellListener);
- }
- }
-
- /**
- * Stop listening.
- */
- private void disengageModel() {
- this.disengageAllCells();
- this.listHolder.removeListChangeListener(ListValueModel.LIST_VALUES, this.listChangeListener);
- }
-
- private void disengageAllCells() {
- for (WritablePropertyValueModel<Object>[] row : this.rows) {
- this.disengageRow(row);
- }
- this.rows.clear();
- }
-
- private void disengageRow(WritablePropertyValueModel<Object>[] row) {
- for (int i = row.length; i-- > 0; ) {
- row[i].removePropertyChangeListener(PropertyValueModel.VALUE, this.cellListener);
- }
- }
-
- /**
- * brute-force search for the cell(s) that changed...
- */
- void cellChanged(WritablePropertyValueModel<Object> cellHolder) {
- for (int i = this.rows.size(); i-- > 0; ) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(i);
- for (int j = row.length; j-- > 0; ) {
- if (row[j] == cellHolder) {
- this.fireTableCellUpdated(i, j);
- }
- }
- }
- }
-
- /**
- * convert the items to rows
- */
- void addRows(int index, int size, Iterable<Object> items) {
- List<WritablePropertyValueModel<Object>[]> newRows = new ArrayList<WritablePropertyValueModel<Object>[]>(size);
- for (Object item : items) {
- WritablePropertyValueModel<Object>[] row = this.columnAdapter.cellModels(item);
- this.engageRow(row);
- newRows.add(row);
- }
- this.rows.addAll(index, newRows);
- this.fireTableRowsInserted(index, index + size - 1);
- }
-
- void removeRows(int index, int size) {
- for (int i = 0; i < size; i++) {
- this.disengageRow(this.rows.remove(index));
- }
- this.fireTableRowsDeleted(index, index + size - 1);
- }
-
- void replaceRows(int index, Iterable<Object> items) {
- int i = index;
- for (Object item : items) {
- WritablePropertyValueModel<Object>[] row = this.rows.get(i);
- this.disengageRow(row);
- row = this.columnAdapter.cellModels(item);
- this.engageRow(row);
- this.rows.set(i, row);
- i++;
- }
- this.fireTableRowsUpdated(index, i - 1);
- }
-
- void moveRows(int targetIndex, int sourceIndex, int length) {
- ArrayList<WritablePropertyValueModel<Object>[]> temp = new ArrayList<WritablePropertyValueModel<Object>[]>(length);
- for (int i = 0; i < length; i++) {
- temp.add(this.rows.remove(sourceIndex));
- }
- this.rows.addAll(targetIndex, temp);
-
- int start = Math.min(targetIndex, sourceIndex);
- int end = Math.max(targetIndex, sourceIndex) + length - 1;
- this.fireTableRowsUpdated(start, end);
- }
-
- void clearTable() {
- this.disengageAllCells();
- this.fireTableDataChanged();
- }
-
- void rebuildTable() {
- this.disengageAllCells();
- this.engageAllCells();
- this.fireTableDataChanged();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java
deleted file mode 100644
index eb9aa3b617..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/ToggleButtonModelAdapter.java
+++ /dev/null
@@ -1,224 +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.utility.internal.model.value.swing;
-
-import java.awt.event.ActionListener;
-import java.awt.event.ItemListener;
-import javax.swing.JToggleButton.ToggleButtonModel;
-import javax.swing.event.ChangeListener;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * This javax.swing.ButtonModel can be used to keep a listener
- * (e.g. a JCheckBox or a JRadioButton) in synch with a PropertyValueModel
- * on a boolean.
- */
-public class ToggleButtonModelAdapter
- extends ToggleButtonModel
-{
- /**
- * The default setting for the toggle button; for when the underlying model is null.
- * The default [default value] is false (i.e. the toggle button is unchecked/empty).
- */
- protected final boolean defaultValue;
-
- /** A value model on the underlying model boolean. */
- protected final WritablePropertyValueModel<Boolean> booleanHolder;
-
- /**
- * A listener that allows us to synchronize with
- * changes made to the underlying model boolean.
- */
- protected final PropertyChangeListener booleanChangeListener;
-
-
- // ********** constructors **********
-
- /**
- * Constructor - the boolean holder is required.
- */
- public ToggleButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder, boolean defaultValue) {
- super();
- if (booleanHolder == null) {
- throw new NullPointerException();
- }
- this.booleanHolder = booleanHolder;
- this.booleanChangeListener = this.buildBooleanChangeListener();
- // postpone listening to the underlying model
- // until we have listeners ourselves...
- this.defaultValue = defaultValue;
- }
-
- /**
- * Constructor - the boolean holder is required.
- * The default value will be false.
- */
- public ToggleButtonModelAdapter(WritablePropertyValueModel<Boolean> booleanHolder) {
- this(booleanHolder, false);
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildBooleanChangeListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildBooleanChangeListener_());
- }
-
- protected PropertyChangeListener buildBooleanChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- ToggleButtonModelAdapter.this.booleanChanged(event);
- }
- @Override
- public String toString() {
- return "boolean listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** ButtonModel implementation **********
-
- /**
- * Extend to update the underlying model if necessary.
- */
- @Override
- public void setSelected(boolean b) {
- if (this.isSelected() != b) { // stop the recursion!
- super.setSelected(b);//put the super call first, otherwise the following gets called twice
- this.booleanHolder.setValue(Boolean.valueOf(b));
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addActionListener(ActionListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addActionListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeActionListener(ActionListener l) {
- super.removeActionListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addItemListener(ItemListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addItemListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeItemListener(ItemListener l) {
- super.removeItemListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addChangeListener(ChangeListener l) {
- if (this.hasNoListeners()) {
- this.engageModel();
- }
- super.addChangeListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeChangeListener(ChangeListener l) {
- super.removeChangeListener(l);
- if (this.hasNoListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** queries **********
-
- /**
- * Return whether we have no listeners at all.
- */
- protected boolean hasNoListeners() {
- return this.listenerList.getListenerCount() == 0;
- }
-
- protected boolean getDefaultValue() {
- return this.defaultValue;
- }
-
-
- // ********** behavior **********
-
- /**
- * Synchronize with the specified value.
- * If it is null, use the default value (which is typically false).
- */
- protected void setSelected(Boolean value) {
- if (value == null) {
- this.setSelected(this.getDefaultValue());
- } else {
- this.setSelected(value.booleanValue());
- }
- }
-
- /**
- * The underlying model has changed - synchronize accordingly.
- */
- protected void booleanChanged(PropertyChangeEvent event) {
- this.setSelected((Boolean) event.getNewValue());
- }
-
- protected void engageModel() {
- this.booleanHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- this.setSelected(this.booleanHolder.getValue());
- }
-
- protected void disengageModel() {
- this.booleanHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.booleanChangeListener);
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.booleanHolder);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java
deleted file mode 100644
index ba0868f044..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/model/value/swing/TreeModelAdapter.java
+++ /dev/null
@@ -1,914 +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.utility.internal.model.value.swing;
-
-import java.util.ArrayList;
-import java.util.IdentityHashMap;
-import java.util.List;
-
-import javax.swing.event.TreeModelListener;
-import javax.swing.tree.TreePath;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTListChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.listener.awt.AWTStateChangeListenerWrapper;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-
-/**
- * This javax.swing.tree.TreeModel can be used to keep a TreeModelListener
- * (e.g. a JTree) in synch with a tree of TreeNodeValueModel objects. Unlike
- * javax.swing.tree.DefaultTreeModel, you do not add and remove nodes with
- * methods implemented here. You can add and remove nodes by adding and
- * removing them directly to/from the nodes (or, more typically, the domain
- * objects the nodes are wrapping and listening to).
- *
- * Due to limitations in JTree, the root of the tree can never be null,
- * which, typically, should not be a problem. (If you want to display an empty
- * tree you can set the JTree's treeModel to null.)
- */
-public class TreeModelAdapter<T>
- extends AbstractTreeModel
-{
- /**
- * A value model on the underlying tree's root node and its
- * corresponding listener. This allows clients to swap out
- * the entire tree. Due to limitations in JTree, the root should
- * never be set to null while we have listeners.
- */
- private final PropertyValueModel<TreeNodeValueModel<T>> rootHolder;
- private final PropertyChangeListener rootListener;
-
- /**
- * A listener that notifies us when a node's internal
- * "state" changes (as opposed to the node's value or list of
- * children), allowing us to forward notification to our listeners.
- */
- private final StateChangeListener nodeStateListener;
-
- /**
- * A listener that notifies us when a node's "value"
- * changes (as opposed to the node's state or list of
- * children), allowing us to forward notification to our listeners.
- * Typically, this will only happen with nodes that hold
- * primitive data.
- */
- private final PropertyChangeListener nodeValueListener;
-
- /**
- * A listener that notifies us when an underlying node's
- * "list" of children changes, allowing us to keep our
- * internal tree in synch with the underlying tree model.
- */
- private final ListChangeListener childrenListener;
-
- /* these attributes make up our internal tree */
- /**
- * The root cannot be null while we have listeners, which is
- * most of the time. The root is cached so we can disengage
- * from it when it has been swapped out.
- */
- private TreeNodeValueModel<T> root;
-
- /**
- * Map the nodes to their lists of children.
- * We cache these so we can swap out the entire list of children
- * when we receive a #listChanged() event (which does not include
- * the items that were affected).
- * @see EventChangePolicy#rebuildChildren()
- */
- final IdentityHashMap<TreeNodeValueModel<T>, List<TreeNodeValueModel<T>>> childrenLists;
-
- /**
- * Map the children models to their parents.
- * We cache these so we can figure out the "real" source of the
- * list change events (the parent).
- * @see EventChangePolicy#parent()
- */
- final IdentityHashMap<ListValueModel<TreeNodeValueModel<T>>, TreeNodeValueModel<T>> parents;
-
-
- // ********** constructors **********
-
- /**
- * Construct a tree model for the specified root.
- */
- public TreeModelAdapter(PropertyValueModel<TreeNodeValueModel<T>> rootHolder) {
- super();
- if (rootHolder == null) {
- throw new NullPointerException();
- }
- this.rootHolder = rootHolder;
- this.rootListener = this.buildRootListener();
- this.nodeStateListener = this.buildNodeStateListener();
- this.nodeValueListener = this.buildNodeValueListener();
- this.childrenListener = this.buildChildrenListener();
- this.childrenLists = new IdentityHashMap<TreeNodeValueModel<T>, List<TreeNodeValueModel<T>>>();
- this.parents = new IdentityHashMap<ListValueModel<TreeNodeValueModel<T>>, TreeNodeValueModel<T>>();
- }
-
- /**
- * Construct a tree model for the specified root.
- */
- public TreeModelAdapter(TreeNodeValueModel<T> root) {
- this(new StaticPropertyValueModel<TreeNodeValueModel<T>>(root));
- }
-
-
- // ********** initialization **********
-
- protected PropertyChangeListener buildRootListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildRootListener_());
- }
-
- protected PropertyChangeListener buildRootListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- TreeModelAdapter.this.rootChanged();
- }
- @Override
- public String toString() {
- return "root listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected PropertyChangeListener buildNodeValueListener() {
- return new AWTPropertyChangeListenerWrapper(this.buildNodeValueListener_());
- }
-
- protected PropertyChangeListener buildNodeValueListener_() {
- return new PropertyChangeListener() {
- @SuppressWarnings("unchecked")
- public void propertyChanged(PropertyChangeEvent event) {
- TreeModelAdapter.this.nodeChanged((TreeNodeValueModel<T>) event.getSource());
- }
- @Override
- public String toString() {
- return "node value listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected StateChangeListener buildNodeStateListener() {
- return new AWTStateChangeListenerWrapper(this.buildNodeStateListener_());
- }
-
- protected StateChangeListener buildNodeStateListener_() {
- return new StateChangeListener() {
- @SuppressWarnings("unchecked")
- public void stateChanged(StateChangeEvent event) {
- TreeModelAdapter.this.nodeChanged((TreeNodeValueModel<T>) event.getSource());
- }
- @Override
- public String toString() {
- return "node state listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected ListChangeListener buildChildrenListener() {
- return new AWTListChangeListenerWrapper(this.buildChildrenListener_());
- }
-
- protected ListChangeListener buildChildrenListener_() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent event) {
- new AddEventChangePolicy(event).addChildren();
- }
- public void itemsRemoved(ListRemoveEvent event) {
- new RemoveEventChangePolicy(event).removeChildren();
- }
- public void itemsReplaced(ListReplaceEvent event) {
- new ReplaceEventChangePolicy(event).replaceChildren();
- }
- public void itemsMoved(ListMoveEvent event) {
- new MoveEventChangePolicy(event).moveChildren();
- }
- public void listCleared(ListClearEvent event) {
- new ClearEventChangePolicy(event).clearChildren();
- }
- public void listChanged(ListChangeEvent event) {
- new ChangeEventChangePolicy(event).rebuildChildren();
- }
- @Override
- public String toString() {
- return "children listener"; //$NON-NLS-1$
- }
- };
- }
-
-
- // ********** TreeModel implementation **********
-
- public Object getRoot() {
- return this.root;
- }
-
- @SuppressWarnings("unchecked")
- public Object getChild(Object parent, int index) {
- return ((TreeNodeValueModel<T>) parent).child(index);
- }
-
- @SuppressWarnings("unchecked")
- public int getChildCount(Object parent) {
- return ((TreeNodeValueModel<T>) parent).childrenSize();
- }
-
- @SuppressWarnings("unchecked")
- public boolean isLeaf(Object node) {
- return ((TreeNodeValueModel<T>) node).isLeaf();
- }
-
- @SuppressWarnings("unchecked")
- public void valueForPathChanged(TreePath path, Object newValue) {
- ((TreeNodeValueModel<T>) path.getLastPathComponent()).setValue((T) newValue);
- }
-
- @SuppressWarnings("unchecked")
- public int getIndexOfChild(Object parent, Object child) {
- return ((TreeNodeValueModel<T>) parent).indexOfChild((TreeNodeValueModel<T>) child);
- }
-
- /**
- * Extend to start listening to the underlying model if necessary.
- */
- @Override
- public void addTreeModelListener(TreeModelListener l) {
- if (this.hasNoTreeModelListeners()) {
- this.engageModel();
- }
- super.addTreeModelListener(l);
- }
-
- /**
- * Extend to stop listening to the underlying model if appropriate.
- */
- @Override
- public void removeTreeModelListener(TreeModelListener l) {
- super.removeTreeModelListener(l);
- if (this.hasNoTreeModelListeners()) {
- this.disengageModel();
- }
- }
-
-
- // ********** behavior **********
-
- /**
- * Listen to the root and all the other nodes
- * in the underlying tree model.
- */
- private void engageModel() {
- this.rootHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.rootListener);
- this.root = this.rootHolder.getValue();
- if (this.root == null) {
- throw new NullPointerException(); // the root cannot be null while we have listeners
- }
- this.engageNode(this.root);
- this.addRoot();
- }
-
- /**
- * Add the root and all of the nodes to the underlying tree.
- */
- private void addRoot() {
- this.addNode(0, this.root);
- }
-
- /**
- * Stop listening to the root and all the other
- * nodes in the underlying tree model.
- */
- private void disengageModel() {
- this.removeRoot();
- this.disengageNode(this.root);
- this.root = null;
- this.rootHolder.removePropertyChangeListener(PropertyValueModel.VALUE, this.rootListener);
- }
-
- /**
- * Remove the root and all of the nodes from the underlying tree.
- */
- private void removeRoot() {
- this.removeNode(0, this.root);
- }
-
- /**
- * The root has been swapped.
- * This method is a bit gnarly because the API for notifying listeners
- * that the root has changed is a bit inconsistent with that used for
- * non-root nodes.
- */
- void rootChanged() {
- TreeNodeValueModel<T> newRoot = this.rootHolder.getValue();
- if (newRoot == null) {
- throw new NullPointerException(); // the root cannot be null while we have listeners
- }
- // remove all the current root's children from the tree
- // and remove the it from the internal tree
- this.removeRoot();
-
- // save the old root and swap in the new root
- TreeNodeValueModel<T> oldRoot = this.root;
- this.root = newRoot;
-
- // we must be listening to both the old and new roots when we fire the event
- // because their values can be affected by whether they have listeners
- this.engageNode(this.root);
- this.fireTreeRootReplaced(this.root);
- // now we can stop listening to the old root
- this.disengageNode(oldRoot);
-
- // add the new root to the internal tree and
- // add all its children to the tree also
- this.addRoot();
- }
-
- /**
- * Either the "value" or the "state" of the specified node has changed,
- * forward notification to our listeners.
- */
- void nodeChanged(TreeNodeValueModel<T> node) {
- TreeNodeValueModel<T> parent = node.parent();
- if (parent == null) {
- this.fireTreeRootChanged(node);
- } else {
- this.fireTreeNodeChanged(parent.path(), parent.indexOfChild(node), node);
- }
- }
-
- /**
- * Listen to the nodes, notify our listeners that the nodes were added,
- * and then add the nodes to our internal tree.
- * We must listen to the nodes before notifying anybody, because
- * adding a listener can change the value of a node.
- */
- void addChildren(TreeNodeValueModel<T>[] path, int[] childIndices, TreeNodeValueModel<T>[] children) {
- int len = childIndices.length;
- for (int i = 0; i < len; i++) {
- this.engageNode(children[i]);
- }
- this.fireTreeNodesInserted(path, childIndices, children);
- for (int i = 0; i < len; i++) {
- this.addNode(childIndices[i], children[i]);
- }
- }
-
- /**
- * Listen to the node and its children model.
- */
- private void engageNode(TreeNodeValueModel<T> node) {
- node.addStateChangeListener(this.nodeStateListener);
- node.addPropertyChangeListener(PropertyValueModel.VALUE, this.nodeValueListener);
- node.childrenModel().addListChangeListener(ListValueModel.LIST_VALUES, this.childrenListener);
- }
-
- /**
- * Add the node to our internal tree;
- * then recurse down through the node's children,
- * adding them to the internal tree also.
- */
- private void addNode(int index, TreeNodeValueModel<T> node) {
- this.addNodeToInternalTree(node.parent(), index, node, node.childrenModel());
- new NodeChangePolicy(node).addChildren();
- }
-
- /**
- * Add the specified node to our internal tree.
- */
- private void addNodeToInternalTree(TreeNodeValueModel<T> parent, int index, TreeNodeValueModel<T> node, ListValueModel<TreeNodeValueModel<T>> childrenModel) {
- List<TreeNodeValueModel<T>> siblings = this.childrenLists.get(parent);
- if (siblings == null) {
- siblings = new ArrayList<TreeNodeValueModel<T>>();
- this.childrenLists.put(parent, siblings);
- }
- siblings.add(index, node);
-
- this.parents.put(childrenModel, node);
- }
-
- /**
- * Remove nodes from our internal tree, notify our listeners that the
- * nodes were removed, then stop listening to the nodes.
- * We must listen to the nodes until after notifying anybody, because
- * removing a listener can change the value of a node.
- */
- void removeChildren(TreeNodeValueModel<T>[] path, int[] childIndices, TreeNodeValueModel<T>[] children) {
- int len = childIndices.length;
- for (int i = 0; i < len; i++) {
- // the indices slide down a notch each time we remove a child
- this.removeNode(childIndices[i] - i, children[i]);
- }
- this.fireTreeNodesRemoved(path, childIndices, children);
- for (int i = 0; i < len; i++) {
- this.disengageNode(children[i]);
- }
- }
-
- /**
- * First, recurse down through the node's children,
- * removing them from our internal tree;
- * then remove the node itself from our internal tree.
- */
- private void removeNode(int index, TreeNodeValueModel<T> node) {
- new NodeChangePolicy(node).removeChildren();
- this.removeNodeFromInternalTree(node.parent(), index, node.childrenModel());
- }
-
- /**
- * Remove the specified node from our internal tree.
- */
- private void removeNodeFromInternalTree(TreeNodeValueModel<T> parent, int index, ListValueModel<TreeNodeValueModel<T>> childrenModel) {
- this.parents.remove(childrenModel);
-
- List<TreeNodeValueModel<T>> siblings = this.childrenLists.get(parent);
- siblings.remove(index);
- if (siblings.isEmpty()) {
- this.childrenLists.remove(parent);
- }
- }
-
- /**
- * Stop listening to the node and its children model.
- */
- private void disengageNode(TreeNodeValueModel<T> node) {
- node.childrenModel().removeListChangeListener(ListValueModel.LIST_VALUES, this.childrenListener);
- node.removePropertyChangeListener(PropertyValueModel.VALUE, this.nodeValueListener);
- node.removeStateChangeListener(this.nodeStateListener);
- }
-
- void moveChildren(TreeNodeValueModel<T> parent, int targetIndex, int sourceIndex, int length) {
- List<TreeNodeValueModel<T>> childrenList = this.childrenLists.get(parent);
- ArrayList<TreeNodeValueModel<T>> temp = new ArrayList<TreeNodeValueModel<T>>(length);
- for (int i = 0; i < length; i++) {
- temp.add(childrenList.remove(sourceIndex));
- }
- childrenList.addAll(targetIndex, temp);
-
- this.fireTreeStructureChanged(parent.path());
- }
-
-
- // ********** standard methods **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.root);
- }
-
-
- // ********** inner classes **********
-
- /**
- * Coalesce some of the common change policy behavior.
- */
- abstract class ChangePolicy {
-
- ChangePolicy() {
- super();
- }
-
- /**
- * Add the current set of children.
- */
- void addChildren() {
- TreeModelAdapter.this.addChildren(this.parent().path(), this.childIndices(), this.childArray());
- }
-
- /**
- * Remove the current set of children.
- */
- void removeChildren() {
- TreeModelAdapter.this.removeChildren(this.parent().path(), this.childIndices(), this.childArray());
- }
-
- /**
- * Return an array of the indices of the current set of children,
- * which should be contiguous.
- */
- int[] childIndices() {
- return this.buildIndices(this.childrenStartIndex(), this.childrenSize());
- }
-
- /**
- * Return an array of the current set of children.
- */
- TreeNodeValueModel<T>[] childArray() {
- return this.buildArray(this.getChildren(), this.childrenSize());
- }
-
- /**
- * Build an array to hold the elements in the specified iterator.
- * If they are different sizes, something is screwed up...
- */
- TreeNodeValueModel<T>[] buildArray(Iterable<TreeNodeValueModel<T>> elements, int size) {
- @SuppressWarnings("unchecked")
- TreeNodeValueModel<T>[] array = new TreeNodeValueModel[size];
- int i = 0;
- for (TreeNodeValueModel<T> element : elements) {
- array[i++] = element;
- }
- return array;
- }
-
- /**
- * Return a set of indices, starting at zero and
- * continuing for the specified size.
- */
- int[] buildIndices(int size) {
- return buildIndices(0, size);
- }
-
- /**
- * Return a set of indices, starting at the specified index and
- * continuing for the specified size.
- */
- int[] buildIndices(int start, int size) {
- int[] indices = new int[size];
- int index = start;
- for (int i = 0; i < size; i++) {
- indices[i] = index++;
- }
- return indices;
- }
-
- /**
- * Return the parent of the current set of children.
- */
- abstract TreeNodeValueModel<T> parent();
-
- /**
- * Return the starting index for the current set of children.
- */
- abstract int childrenStartIndex();
-
- /**
- * Return the size of the current set of children.
- */
- abstract int childrenSize();
-
- /**
- * Return the current set of children.
- */
- abstract Iterable<TreeNodeValueModel<T>> getChildren();
-
- }
-
-
- /**
- * Wraps a ListEvent for adding, removing, replacing,
- * and changing children.
- */
- abstract class EventChangePolicy extends ChangePolicy {
- final ListEvent event;
-
- EventChangePolicy(ListEvent event) {
- super();
- this.event = event;
- }
-
- /**
- * Map the ListChangeEvent's source to the corresponding parent.
- */
- @Override
- TreeNodeValueModel<T> parent() {
- return TreeModelAdapter.this.parents.get(this.event.getSource());
- }
-
- }
-
-
- /**
- * Wraps a ListAddEvent for adding children.
- */
- class AddEventChangePolicy extends EventChangePolicy {
-
- AddEventChangePolicy(ListAddEvent event) {
- super(event);
- }
-
- private ListAddEvent getEvent() {
- return (ListAddEvent) this.event;
- }
-
- /**
- * The ListAddEvent's item index is the children start index.
- */
- @Override
- int childrenStartIndex() {
- return this.getEvent().getIndex();
- }
-
- /**
- * The ListAddEvent's size is the children size.
- */
- @Override
- int childrenSize() {
- return this.getEvent().getItemsSize();
- }
-
- /**
- * The ListAddEvent's items are the children.
- */
- @Override
- @SuppressWarnings("unchecked")
- Iterable<TreeNodeValueModel<T>> getChildren() {
- return (Iterable<TreeNodeValueModel<T>>) this.getEvent().getItems();
- }
-
- }
-
-
- /**
- * Wraps a ListRemoveEvent for adding children.
- */
- class RemoveEventChangePolicy extends EventChangePolicy {
-
- RemoveEventChangePolicy(ListRemoveEvent event) {
- super(event);
- }
-
- private ListRemoveEvent getEvent() {
- return (ListRemoveEvent) this.event;
- }
-
- /**
- * The ListRemoveEvent's item index is the children start index.
- */
- @Override
- int childrenStartIndex() {
- return this.getEvent().getIndex();
- }
-
- /**
- * The ListRemoveEvent's size is the children size.
- */
- @Override
- int childrenSize() {
- return this.getEvent().getItemsSize();
- }
-
- /**
- * The ListRemoveEvent's items are the children.
- */
- @Override
- @SuppressWarnings("unchecked")
- Iterable<TreeNodeValueModel<T>> getChildren() {
- return (Iterable<TreeNodeValueModel<T>>) this.getEvent().getItems();
- }
-
- }
-
-
- /**
- * Wraps a ListReplaceEvent for replacing children.
- */
- class ReplaceEventChangePolicy extends EventChangePolicy {
-
- ReplaceEventChangePolicy(ListReplaceEvent event) {
- super(event);
- }
-
- private ListReplaceEvent getEvent() {
- return (ListReplaceEvent) this.event;
- }
-
- /**
- * The ListReplaceEvent's item index is the children start index.
- */
- @Override
- int childrenStartIndex() {
- return this.getEvent().getIndex();
- }
-
- /**
- * The ListReplaceEvent's size is the children size.
- */
- @Override
- int childrenSize() {
- return this.getEvent().getItemsSize();
- }
-
- /**
- * The ListReplaceEvent's items are the children.
- */
- @Override
- @SuppressWarnings("unchecked")
- Iterable<TreeNodeValueModel<T>> getChildren() {
- return (Iterable<TreeNodeValueModel<T>>) this.getEvent().getNewItems();
- }
-
- /**
- * Remove the old nodes and add the new ones.
- */
- void replaceChildren() {
- TreeNodeValueModel<T>[] parentPath = this.parent().path();
- int[] childIndices = this.childIndices();
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, this.getOldChildren());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, this.childArray());
- }
-
- TreeNodeValueModel<T>[] getOldChildren() {
- return this.buildArray(this.getOldItems(), this.getEvent().getItemsSize());
- }
-
- // minimized scope of suppressed warnings
- @SuppressWarnings("unchecked")
- protected Iterable<TreeNodeValueModel<T>> getOldItems() {
- return (Iterable<TreeNodeValueModel<T>>) this.getEvent().getOldItems();
- }
-
- }
-
-
- /**
- * Wraps a ListMoveEvent for moving children.
- */
- class MoveEventChangePolicy extends EventChangePolicy {
-
- MoveEventChangePolicy(ListMoveEvent event) {
- super(event);
- }
-
- private ListMoveEvent getEvent() {
- return (ListMoveEvent) this.event;
- }
-
- void moveChildren() {
- TreeModelAdapter.this.moveChildren(this.parent(), this.getEvent().getTargetIndex(), this.getEvent().getSourceIndex(), this.getEvent().getLength());
- }
-
- @Override
- int childrenStartIndex() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- int childrenSize() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- Iterable<TreeNodeValueModel<T>> getChildren() {
- throw new UnsupportedOperationException();
- }
-
- }
-
-
- /**
- * Wraps a ListClearEvent for clearing children.
- */
- class ClearEventChangePolicy extends EventChangePolicy {
-
- ClearEventChangePolicy(ListClearEvent event) {
- super(event);
- }
-
- /**
- * Clear all the nodes.
- */
- void clearChildren() {
- TreeNodeValueModel<T> parent = this.parent();
- TreeNodeValueModel<T>[] parentPath = parent.path();
- List<TreeNodeValueModel<T>> childrenList = TreeModelAdapter.this.childrenLists.get(parent);
- int[] childIndices = this.buildIndices(childrenList.size());
- TreeNodeValueModel<T>[] childArray = this.buildArray(childrenList, childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
- }
-
- @Override
- int childrenStartIndex() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- int childrenSize() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- Iterable<TreeNodeValueModel<T>> getChildren() {
- throw new UnsupportedOperationException();
- }
-
- }
-
-
- /**
- * Wraps a ListChangeEvent for clearing children.
- */
- class ChangeEventChangePolicy extends EventChangePolicy {
-
- ChangeEventChangePolicy(ListChangeEvent event) {
- super(event);
- }
-
- /**
- * Remove all the old nodes and add all the new nodes.
- */
- void rebuildChildren() {
- TreeNodeValueModel<T> parent = this.parent();
- TreeNodeValueModel<T>[] parentPath = parent.path();
- List<TreeNodeValueModel<T>> childrenList = TreeModelAdapter.this.childrenLists.get(parent);
- int[] childIndices = this.buildIndices(childrenList.size());
- TreeNodeValueModel<T>[] childArray = this.buildArray(childrenList, childrenList.size());
- TreeModelAdapter.this.removeChildren(parentPath, childIndices, childArray);
-
- childIndices = this.buildIndices(parent.childrenModel().size());
- childArray = this.buildArray(parent.childrenModel(), parent.childrenSize());
- TreeModelAdapter.this.addChildren(parentPath, childIndices, childArray);
- }
-
- @Override
- int childrenStartIndex() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- int childrenSize() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- Iterable<TreeNodeValueModel<T>> getChildren() {
- throw new UnsupportedOperationException();
- }
-
- }
-
-
- /**
- * Wraps a TreeNodeValueModel for adding and removing its children.
- */
- class NodeChangePolicy extends ChangePolicy {
- private final TreeNodeValueModel<T> node;
-
- NodeChangePolicy(TreeNodeValueModel<T> node) {
- super();
- this.node = node;
- }
-
- /**
- * The node itself is the parent.
- */
- @Override
- TreeNodeValueModel<T> parent() {
- return this.node;
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children start index is always zero.
- */
- @Override
- int childrenStartIndex() {
- return 0;
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children size is always equal to the size
- * of the children model.
- */
- @Override
- int childrenSize() {
- return this.node.childrenModel().size();
- }
-
- /**
- * Since we will always be dealing with all of the node's
- * children, the children are all the objects held by
- * the children model.
- */
- @Override
- Iterable<TreeNodeValueModel<T>> getChildren() {
- return this.node.childrenModel();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java
deleted file mode 100644
index 3dd54dec6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AbstractNode.java
+++ /dev/null
@@ -1,941 +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.utility.internal.node;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.CallbackChangeSupport;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-
-/**
- * Base class for Node classes.
- * Provides support for the following:
- * initialization
- * enforced object identity wrt #equals()/#hashCode()
- * containment hierarchy (parent/child)
- * user comment
- * dirty flag
- * problems
- * sorting
- *
- * Typically, subclasses should consider implementing the following methods:
- * the appropriate constructors
- * (with the appropriately-restrictive type declaration for parent)
- * #initialize()
- * #initialize(Node parentNode)
- * #checkParent(Node parentNode)
- * #addChildrenTo(List list)
- * #nodeRemoved(Node)
- * #validator()
- * #transientAspectNames() or
- * #addTransientAspectNamesTo(Set transientAspectNames)
- * #addProblemsTo(List currentProblems)
- * #nonValidatedAspectNames()
- * #addNonValidatedAspectNamesTo(Set nonValidatedAspectNames)
- * #displayString()
- * #toString(StringBuilder sb)
- */
-public abstract class AbstractNode
- extends AbstractModel
- implements Node
-{
-
- /** Containment hierarchy. */
- private Node parent; // pseudo-final
-
- /** Track whether the node has changed. */
- private volatile boolean dirty;
- private volatile boolean dirtyBranch;
-
- /**
- * The node's problems, as calculated during validation.
- * This list should only be modified via a ProblemSynchronizer,
- * allowing for asynchronous modification from another thread.
- */
- private Vector<Problem> problems; // pseudo-final
- private static final Object[] EMPTY_PROBLEM_MESSAGE_ARGUMENTS = new Object[0];
-
- /**
- * Cache the node's "branch" problems, as calculated during validation.
- * This list should only be modified via a ProblemSynchronizer,
- * allowing for asynchronous modification from another thread.
- * This must be recalculated every time this node or one of its
- * descendants changes it problems.
- */
- private Vector<Problem> branchProblems; // pseudo-final
-
- /** User comment. */
- private volatile String comment;
-
-
- // ********** static fields **********
-
- /**
- * Sets of transient aspect names, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final HashMap<Class<? extends AbstractNode>, HashSet<String>> transientAspectNameSets = new HashMap<Class<? extends AbstractNode>, HashSet<String>>();
-
- /**
- * Sets of non-validated aspect names, keyed by class.
- * This is built up lazily, as the objects are modified.
- */
- private static final HashMap<Class<? extends AbstractNode>, HashSet<String>> nonValidatedAspectNameSets = new HashMap<Class<? extends AbstractNode>, HashSet<String>>();
-
-
- // ********** constructors **********
-
- /**
- * Most objects must have a parent.
- * Use this constructor to create a new node.
- * @see #initialize(Node)
- */
- protected AbstractNode(Node parent) {
- super();
- this.initialize();
- this.initialize(parent);
- }
-
-
- // ********** initialization **********
-
- /**
- * Initialize a newly-created instance.
- * @see #initialize(Node)
- */
- protected void initialize() {
- this.comment = ""; //$NON-NLS-1$
-
- // a new object is dirty, by definition
- this.dirty = true;
- this.dirtyBranch = true;
-
- this.problems = new Vector<Problem>();
- this.branchProblems = new Vector<Problem>();
-
- // when you override this method, don't forget to include:
- // super.initialize();
- }
-
- /**
- * Initialize a newly-created instance.
- * @see #initialize()
- */
- protected void initialize(Node parentNode) {
- this.checkParent(parentNode);
- this.parent = parentNode;
- // when you override this method, don't forget to include:
- // super.initialize(parentNode);
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new CallbackChangeSupport(this, this.buildChangeSupportListener());
- }
-
- protected CallbackChangeSupport.Listener buildChangeSupportListener() {
- return new CallbackChangeSupport.Listener() {
- public void aspectChanged(String aspectName) {
- AbstractNode.this.aspectChanged(aspectName);
- }
- };
- }
-
-
- // ********** equality **********
-
- /**
- * Enforce object identity - do not allow objects to be equal unless
- * they are the same object.
- * Do NOT override this method - we rely on object identity extensively.
- */
- @Override
- public final boolean equals(Object o) {
- return this == o;
- }
-
- /**
- * Enforce object identity - do not allow objects to be equal unless
- * they are the same object.
- * Do NOT override this method - we rely on object identity extensively.
- */
- @Override
- public final int hashCode() {
- return super.hashCode();
- }
-
-
- // ********** containment hierarchy (parent/children) **********
-
- /**
- * INTRA-TREE API?
- * Return the node's parent in the containment hierarchy.
- * Most nodes must have a parent.
- * @see #children()
- */
- public Node getParent() {
- return this.parent;
- }
-
- /**
- * Throw an IllegalArgumentException if the parent is not valid
- * for the node.
- * By default require a non-null parent. Override if other restrictions exist
- * or the parent should be null.
- * NB: Root node model implementations will need to override this method.
- */
- protected void checkParent(Node parentNode) {
- if (parentNode == null) {
- throw new IllegalArgumentException("The parent node cannot be null"); //$NON-NLS-1$
- }
- }
-
- /**
- * INTRA-TREE API?
- * Return the node's children, which are also nodes.
- * Do NOT override this method.
- * Override #addChildrenTo(List).
- * @see #getParent()
- * @see #addChildrenTo(java.util.List)
- */
- public final Iterator<Node> children() {
- List<Node> children = new ArrayList<Node>();
- this.addChildrenTo(children);
- return children.iterator();
- }
-
- /**
- * Subclasses should override this method to add their children
- * to the specified list.
- * @see #children()
- */
- protected void addChildrenTo(@SuppressWarnings("unused") List<Node> list) {
- // this class has no children, subclasses will...
- // when you override this method, don't forget to include:
- // super.addChildrenTo(list);
- }
-
- /**
- * INTRA-TREE API?
- * Return the containment hierarchy's root node.
- * Most nodes must have a root.
- * @see #getParent()
- * NB: Assume the root has no parent.
- */
- public Node root() {
- Node p = this.parent;
- return (p == null) ? this : p.root();
- }
-
- /**
- * Return whether the node is a descendant of the specified node.
- * By definition, a node is a descendant of itself.
- */
- public boolean isDescendantOf(Node node) {
- return (this == node) || this.parentIsDescendantOf(node);
- }
-
- protected boolean parentIsDescendantOf(Node node) {
- return (this.parent != null) && this.parent.isDescendantOf(node);
- }
-
- /**
- * Return a collection holding all the node's "references", and all
- * the node's descendants' "references". "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- */
- public Iterator<Node.Reference> branchReferences() {
- Collection<Node.Reference> branchReferences = new ArrayList<Node.Reference>(1000); // start big
- this.addBranchReferencesTo(branchReferences);
- return branchReferences.iterator();
- }
-
- /**
- * INTRA-TREE API
- * Add the node's "references", and all the node's descendants'
- * "references", to the specified collection. "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- * This method is of particular concern to Handles, since most
- * (hopefully all) "references" are held by Handles.
- * @see Reference
- * @see #children()
- */
- public void addBranchReferencesTo(Collection<Node.Reference> branchReferences) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addBranchReferencesTo(branchReferences);
- }
- }
-
- /**
- * Return all the nodes in the object's branch of the tree,
- * including the node itself. The nodes will probably returned
- * in "depth-first" order.
- * Only really used for testing and debugging.
- */
- public Iterator<Node> allNodes() {
- Collection<Node> nodes = new ArrayList<Node>(1000); // start big
- this.addAllNodesTo(nodes);
- return nodes.iterator();
- }
-
- /**
- * INTRA-TREE API?
- * Add all the nodes in the object's branch of the tree,
- * including the node itself, to the specified collection.
- * Only really used for testing and debugging.
- */
- public void addAllNodesTo(Collection<Node> nodes) {
- nodes.add(this);
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addAllNodesTo(nodes);
- }
- }
-
-
- // ********** model synchronization support **********
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * removed from the tree. The node receiving this notification
- * should perform any necessary updates to remain in synch
- * with the tree (e.g. clearing out or replacing any references
- * to the removed node or any of the removed node's descendants).
- * @see #isDescendantOf(Node)
- */
- public void nodeRemoved(Node node) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.nodeRemoved(node);
- }
- // when you override this method, don't forget to include:
- // super.nodeRemoved(node);
- }
-
- /**
- * convenience method
- * return whether node1 is a descendant of node2;
- * node1 can be null
- */
- protected boolean nodeIsDescendantOf(Node node1, Node node2) {
- return (node1 != null) && node1.isDescendantOf(node2);
- }
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * renamed. The node receiving this notification should mark its
- * branch dirty if necessary (i.e. it references the renamed node
- * or one of its descendants). This method is of particular concern
- * to Handles.
- * @see #isDescendantOf(Node)
- */
- public void nodeRenamed(Node node) {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.nodeRenamed(node);
- }
- // when you override this method, don't forget to include:
- // super.nodeRenamed(node);
- }
-
-
- // ********** user comment **********
-
- /**
- * Return the object's user comment.
- */
- public final String comment() {
- return this.comment;
- }
-
- /**
- * Set the object's user comment.
- */
- public final void setComment(String comment) {
- Object old = this.comment;
- this.comment = comment;
- this.firePropertyChanged(COMMENT_PROPERTY, old, comment);
- }
-
-
- // ********** change support **********
-
- /**
- * An aspect of the node has changed:
- * - if it is a persistent aspect, mark the object dirty
- * - if it is a significant aspect, validate the object
- */
- protected void aspectChanged(String aspectName) {
- if (this.aspectIsPersistent(aspectName)) {
- // System.out.println(Thread.currentThread() + " dirty change: " + this + ": " + aspectName);
- this.markDirty();
- }
- if (this.aspectChangeRequiresValidation(aspectName)) {
- // System.out.println(Thread.currentThread() + " validation change: " + this + ": " + aspectName);
- this.validate();
- }
- }
-
- protected void validate() {
- this.getValidator().validate();
- }
-
- /**
- * INTRA-TREE API
- * Return a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- * NB: Root node model implementations will need to override this method.
- */
- public Node.Validator getValidator() {
- if (this.parent == null) {
- throw new IllegalStateException("This node should not be firing change events during its construction."); //$NON-NLS-1$
- }
- return this.parent.getValidator();
- }
-
- /**
- * Set a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- * NB: Root node model implementations will need to override this method.
- */
- public void setValidator(Node.Validator validator) {
- if (this.parent == null) {
- throw new IllegalStateException("This root node should implement #setValidator(Node.Validator)."); //$NON-NLS-1$
- }
- throw new UnsupportedOperationException("Only root nodes implement #setValidator(Node.Validator)."); //$NON-NLS-1$
- }
-
-
- // ********** dirty flag support **********
-
- /**
- * Return whether any persistent aspects of the object
- * have changed since the object was last read or saved.
- * This does NOT include changes to the object's descendants.
- */
- public final boolean isDirty() {
- return this.dirty;
- }
-
- /**
- * Return whether any persistent aspects of the object,
- * or any of its descendants, have changed since the object and
- * its descendants were last read or saved.
- */
- public final boolean isDirtyBranch() {
- return this.dirtyBranch;
- }
-
- /**
- * Return whether the object is unmodified
- * since it was last read or saved.
- * This does NOT include changes to the object's descendants.
- */
- public final boolean isClean() {
- return ! this.dirty;
- }
-
- /**
- * Return whether the object and all of its descendants
- * are unmodified since the object and
- * its descendants were last read or saved.
- */
- public final boolean isCleanBranch() {
- return ! this.dirtyBranch;
- }
-
- /**
- * Set the dirty branch flag setting. This is set to true
- * when either the object or one of its descendants becomes dirty.
- */
- private void setIsDirtyBranch(boolean dirtyBranch) {
- boolean old = this.dirtyBranch;
- this.dirtyBranch = dirtyBranch;
- this.firePropertyChanged(DIRTY_BRANCH_PROPERTY, old, dirtyBranch);
- }
-
- /**
- * Mark the object as dirty and as a dirty branch.
- * An object is marked dirty when either a "persistent" attribute
- * has changed or its save location has changed.
- */
- private void markDirty() {
- this.dirty = true;
- this.markBranchDirty();
- }
-
- /**
- * INTRA-TREE API
- * Mark the node and its parent as dirty branches.
- * This message is propagated up the containment
- * tree when a particular node becomes dirty.
- */
- public void markBranchDirty() {
- // short-circuit any unnecessary propagation
- if (this.dirtyBranch) {
- // if this is already a dirty branch, the parent must be also
- return;
- }
-
- this.setIsDirtyBranch(true);
- this.markParentBranchDirty();
- }
-
- protected void markParentBranchDirty() {
- if (this.parent != null) {
- this.parent.markBranchDirty();
- }
- }
-
- /**
- * Mark the object and all its descendants as dirty.
- * This is used when the save location of some
- * top-level object is changed and the entire
- * containment tree must be marked dirty so it
- * will be written out.
- */
- public final void markEntireBranchDirty() {
- this.markDirty();
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.markEntireBranchDirty();
- }
- }
-
- /**
- * Mark the object and all its descendants as clean.
- * Then notify the object's parent that it (the parent)
- * might now be a clean branch also.
- * Typically used when the object has just been
- * read in or written out.
- */
- public final void markEntireBranchClean() {
- this.cascadeMarkEntireBranchClean();
- this.markParentBranchCleanIfPossible();
- }
-
- protected void markParentBranchCleanIfPossible() {
- if (this.parent != null) {
- this.parent.markBranchCleanIfPossible();
- }
- }
-
- /**
- * INTRA-TREE API
- * Mark the node and all its descendants as clean.
- * Typically used when the node has just been
- * read in or written out.
- * This method is for internal use only; it is not for
- * client use.
- * Not the best of method names.... :-(
- */
- public final void cascadeMarkEntireBranchClean() {
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.cascadeMarkEntireBranchClean();
- }
- this.dirty = false;
- this.setIsDirtyBranch(false);
- }
-
- /**
- * INTRA-TREE API
- * A child node's branch has been marked clean. If the node
- * itself is clean and if all of its children are also clean, the
- * node's branch can be marked clean. Then, if the node's
- * branch is clean, the node will notify its parent that it might
- * be clean also. This message is propagated up the containment
- * tree when a particular node becomes clean.
- */
- public final void markBranchCleanIfPossible() {
- // short-circuit any unnecessary propagation
- if (this.dirty) {
- // if the object is "locally" dirty, it is still a dirty branch
- return;
- }
-
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- if (child.isDirtyBranch()) {
- return;
- }
- }
-
- this.setIsDirtyBranch(false);
- this.markParentBranchCleanIfPossible();
- }
-
- private boolean aspectIsPersistent(String aspectName) {
- return ! this.aspectIsTransient(aspectName);
- }
-
- private boolean aspectIsTransient(String aspectName) {
- return this.transientAspectNames().contains(aspectName);
- }
-
- /**
- * Return a set of the object's transient aspect names.
- * These are the aspects that, when they change, will NOT cause the
- * object to be marked dirty.
- * If you need instance-based calculation of your transient aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addTransientAspectNamesTo(Set).
- */
- protected final Set<String> transientAspectNames() {
- synchronized (transientAspectNameSets) {
- HashSet<String> transientAspectNames = transientAspectNameSets.get(this.getClass());
- if (transientAspectNames == null) {
- transientAspectNames = new HashSet<String>();
- this.addTransientAspectNamesTo(transientAspectNames);
- transientAspectNameSets.put(this.getClass(), transientAspectNames);
- }
- return transientAspectNames;
- }
- }
-
- /**
- * Add the object's transient aspect names to the specified set.
- * These are the aspects that, when they change, will NOT cause the
- * object to be marked dirty.
- * If class-based calculation of your transient aspects is sufficient,
- * override this method. If you need instance-based calculation,
- * override #transientAspectNames().
- */
- protected void addTransientAspectNamesTo(Set<String> transientAspectNames) {
- transientAspectNames.add(DIRTY_BRANCH_PROPERTY);
- transientAspectNames.add(BRANCH_PROBLEMS_LIST);
- transientAspectNames.add(HAS_BRANCH_PROBLEMS_PROPERTY);
- // when you override this method, don't forget to include:
- // super.addTransientAspectNamesTo(transientAspectNames);
- }
-
- /**
- * Return the dirty nodes in the object's branch of the tree,
- * including the node itself (if appropriate).
- * Only really used for testing and debugging.
- */
- public final Iterator<Node> allDirtyNodes() {
- return new FilteringIterator<Node>(this.allNodes()) {
- @Override
- protected boolean accept(Node node) {
- return (node instanceof AbstractNode) && ((AbstractNode) node).isDirty();
- }
- };
- }
-
-
- // ********** problems **********
-
- /**
- * Return the node's problems.
- * This does NOT include the problems of the node's descendants.
- * @see #branchProblems()
- */
- public final Iterator<Problem> problems() {
- return new CloneIterator<Problem>(this.problems); // removes are not allowed
- }
-
- /**
- * Return the size of the node's problems.
- * This does NOT include the problems of the node's descendants.
- * @see #branchProblemsSize()
- */
- public final int problemsSize() {
- return this.problems.size();
- }
-
- /**
- * Return whether the node has problems
- * This does NOT include the problems of the node's descendants.
- * @see #hasBranchProblems()
- */
- public final boolean hasProblems() {
- return ! this.problems.isEmpty();
- }
-
- /**
- * Return all the node's problems along with all the
- * node's descendants' problems.
- */
- public final ListIterator<Problem> branchProblems() {
- return new CloneListIterator<Problem>(this.branchProblems); // removes are not allowed
- }
-
- /**
- * Return the size of all the node's problems along with all the
- * node's descendants' problems.
- */
- public final int branchProblemsSize() {
- return this.branchProblems.size();
- }
-
- /**
- * Return whether the node or any of its descendants have problems.
- */
- public final boolean hasBranchProblems() {
- return ! this.branchProblems.isEmpty();
- }
-
- public final boolean containsBranchProblem(Problem problem) {
- return this.branchProblems.contains(problem);
- }
-
- protected final Problem buildProblem(String messageKey, Object... messageArguments) {
- return new DefaultProblem(this, messageKey, messageArguments);
- }
-
- protected final Problem buildProblem(String messageKey) {
- return this.buildProblem(messageKey, EMPTY_PROBLEM_MESSAGE_ARGUMENTS);
- }
-
- /**
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * If the node's "branch" problems have changed,
- * notify the node's parent.
- */
- public void validateBranch() {
- if (this.validateBranchInternal()) {
- // if our "branch" problems have changed, then
- // our parent must rebuild its "branch" problems also
- this.rebuildParentBranchProblems();
- }
- }
-
- protected void rebuildParentBranchProblems() {
- if (this.parent != null) {
- this.parent.rebuildBranchProblems();
- }
- }
-
- /**
- * INTRA-TREE API
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- public boolean validateBranchInternal() {
- // rebuild "branch" problems in children first
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- // ignore the return value because we are going to rebuild our "branch"
- // problems no matter what, to see if they have changed
- child.validateBranchInternal();
- }
-
- this.problems.clear();
- this.addProblemsTo(this.problems);
-
- return this.checkBranchProblems();
- }
-
- /**
- * Check for any problems and add them to the specified list.
- * This method should ONLY add problems for this particular node;
- * it should NOT add problems for any of this node's descendants
- * or ancestors. (Although there will be times when it is debatable
- * as to which node a problem "belongs" to....)
- *
- * NB: This method should NOT modify ANY part of the node's state!
- * It is a READ-ONLY behavior. ONLY the list of current problems
- * passed in to the method should be modified.
- */
- protected void addProblemsTo(@SuppressWarnings("unused") List<Problem> currentProblems) {
- // The default is to do nothing.
- // When you override this method, don't forget to include:
- // super.addProblemsTo(currentProblems);
- }
-
- /**
- * Rebuild the "branch" problems and return whether they have
- * changed.
- * NB: The entire collection of "branch" problems must be re-calculated
- * with EVERY "significant" change - we cannot keep it in synch via
- * change notifications because if a descendant with problems is
- * removed or replaced we will not receive notification that its
- * problems were removed from our "branch" problems.
- */
- private boolean checkBranchProblems() {
- Vector<Problem> oldBranchProblems = new Vector<Problem>(this.branchProblems);
- int oldSize = this.branchProblems.size();
-
- this.branchProblems.clear();
- this.branchProblems.addAll(this.problems);
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- child.addBranchProblemsTo(this.branchProblems);
- }
-
- // if the size has changed to or from zero, our virtual flag has changed
- int newSize = this.branchProblems.size();
- if ((oldSize == 0) && (newSize != 0)) {
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, false, true);
- } else if ((oldSize != 0) && (newSize == 0)) {
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, true, false);
- }
-
- if (oldBranchProblems.equals(this.branchProblems)) {
- return false; // our "branch" problems did not change
- }
- // our "branch" problems changed
- this.fireListChanged(BRANCH_PROBLEMS_LIST, this.branchProblems);
- return true;
- }
-
- /**
- * INTRA-TREE API
- * Add all the problems of the node and all
- * the problems of its descendants to the
- * specified collection.
- */
- public final void addBranchProblemsTo(List<Problem> list) {
- list.addAll(this.branchProblems);
- }
-
- /**
- * INTRA-TREE API
- * A child node's "branch" problems changed;
- * therefore the node's "branch" problems have changed also and
- * must be rebuilt.
- */
- public final void rebuildBranchProblems() {
- if ( ! this.checkBranchProblems()) {
- throw new IllegalStateException("we should not get here unless our \"branch\" problems have changed"); //$NON-NLS-1$
- }
- this.rebuildParentBranchProblems();
- }
-
- /**
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * If the node's "branch" problems have changed,
- * notify the node's parent.
- */
- public final void clearAllBranchProblems() {
- if (this.clearAllBranchProblemsInternal()) {
- // if our "branch" problems have changed, then
- // our parent must rebuild its "branch" problems also
- this.rebuildParentBranchProblems();
- }
- }
-
- /**
- * INTRA-TREE API
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- public final boolean clearAllBranchProblemsInternal() {
- if (this.branchProblems.isEmpty()) {
- return false;
- }
- for (Iterator<Node> stream = this.children(); stream.hasNext(); ) {
- Node child = stream.next(); // pull out the child to ease debugging
- // ignore the return value because we are going to clear our "branch"
- // problems no matter what
- child.clearAllBranchProblemsInternal();
- }
- this.problems.clear();
- this.branchProblems.clear();
- this.firePropertyChanged(HAS_BRANCH_PROBLEMS_PROPERTY, true, false);
- this.fireListChanged(BRANCH_PROBLEMS_LIST, this.branchProblems);
- return true;
- }
-
- /**
- * Return whether a change to specified aspect requires a re-validation
- * of the node's tree.
- */
- private boolean aspectChangeRequiresValidation(String aspectName) {
- return ! this.aspectChangeDoesNotRequireValidation(aspectName);
- }
-
- private boolean aspectChangeDoesNotRequireValidation(String aspectName) {
- return this.nonValidatedAspectNames().contains(aspectName);
- }
-
- /**
- * Return a set of the object's "non-validated" aspect names.
- * These are the aspects that, when they change, will NOT cause the
- * object (or its containing tree) to be validated, i.e. checked for problems.
- * If you need instance-based calculation of your "non-validated" aspects,
- * override this method. If class-based calculation is sufficient,
- * override #addNonValidatedAspectNamesTo(Set).
- */
- protected final Set<String> nonValidatedAspectNames() {
- synchronized (nonValidatedAspectNameSets) {
- HashSet<String> nonValidatedAspectNames = nonValidatedAspectNameSets.get(this.getClass());
- if (nonValidatedAspectNames == null) {
- nonValidatedAspectNames = new HashSet<String>();
- this.addNonValidatedAspectNamesTo(nonValidatedAspectNames);
- nonValidatedAspectNameSets.put(this.getClass(), nonValidatedAspectNames);
- }
- return nonValidatedAspectNames;
- }
- }
-
- /**
- * Add the object's "non-validated" aspect names to the specified set.
- * These are the aspects that, when they change, will NOT cause the
- * object (or its containing tree) to be validated, i.e. checked for problems.
- * If class-based calculation of your "non-validated" aspects is sufficient,
- * override this method. If you need instance-based calculation,
- * override #nonValidatedAspectNames().
- */
- protected void addNonValidatedAspectNamesTo(Set<String> nonValidatedAspectNames) {
- nonValidatedAspectNames.add(COMMENT_PROPERTY);
- nonValidatedAspectNames.add(DIRTY_BRANCH_PROPERTY);
- nonValidatedAspectNames.add(BRANCH_PROBLEMS_LIST);
- nonValidatedAspectNames.add(HAS_BRANCH_PROBLEMS_PROPERTY);
- // when you override this method, don't forget to include:
- // super.addNonValidatedAspectNamesTo(nonValidatedAspectNames);
- }
-
-
- // ********** display methods **********
-
- /**
- * Return a developer-friendly String. If you want something useful for
- * displaying in a user interface, use #displayString().
- * If you want to give more information in your #toString(),
- * override #toString(StringBuilder sb).
- * Whatever you add to that string buffer will show up between the parentheses.
- * @see AbstractModel#toString(StringBuilder sb)
- * @see #displayString()
- */
- @Override
- public final String toString() {
- return super.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java
deleted file mode 100644
index fd2059cc8c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/AsynchronousValidator.java
+++ /dev/null
@@ -1,50 +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.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of the PluggableValidator.Delegate interface
- * simply sets a shared "validate" flag to true. This should trigger a
- * separate "validation" thread to begin validating the appropriate
- * branch of nodes.
- */
-public class AsynchronousValidator
- implements PluggableValidator.Delegate
-{
- private SynchronizedBoolean validateFlag;
-
- /**
- * Construct a validator delegate with the specified shared
- * "validate" flag. This flag should be shared with
- * another thread that will perform the actual validation.
- */
- public AsynchronousValidator(SynchronizedBoolean validateFlag) {
- super();
- this.validateFlag = validateFlag;
- }
-
- /**
- * Set the shared "validate" flag to true, triggering
- * an asynchronous validation of the appropriate
- * branch of nodes.
- */
- public void validate() {
- this.validateFlag.setTrue();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.validateFlag);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.java
deleted file mode 100644
index 079693adea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/DefaultProblem.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.utility.internal.node;
-
-import java.util.Arrays;
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This class is a straightforward implementation of the Problem interface.
- */
-public class DefaultProblem
- implements Problem
-{
- private final Node source;
- private final String messageKey;
- private final Object[] messageArguments;
-
-
- DefaultProblem(Node source, String messageKey, Object[] messageArguments) {
- super();
- this.source = source;
- this.messageKey = messageKey;
- this.messageArguments = messageArguments;
- }
-
-
- // ********** Problem implementation **********
-
- public Node source() {
- return this.source;
- }
-
- public String messageKey() {
- return this.messageKey;
- }
-
- public Object[] messageArguments() {
- return this.messageArguments;
- }
-
-
- // ********** Object overrides **********
-
- /**
- * We implement #equals(Object) because problems are repeatedly
- * re-calculated and the resulting problems merged with the existing
- * set of problems; and we want to keep the original problems and
- * ignore any freshly-generated duplicates.
- * Also, problems are not saved to disk....
- */
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof Problem)) {
- return false;
- }
- Problem other = (Problem) o;
- return this.source == other.source()
- && this.messageKey.equals(other.messageKey())
- && Arrays.equals(this.messageArguments, other.messageArguments());
- }
-
- @Override
- public int hashCode() {
- return this.source.hashCode() ^ this.messageKey.hashCode();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.messageKey);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java
deleted file mode 100644
index fa3d756696..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Node.java
+++ /dev/null
@@ -1,377 +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.utility.internal.node;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * This interface defines the methods that must be implemented
- * by any class whose instances are to be part of a containment hierarchy
- * that supports a "dirty" state and validation "problems".
- *
- * Note: Methods marked "INTRA-TREE API" are typically only used by
- * the nodes themselves, as opposed to clients of the nodes. These
- * methods are called by a node on either its parent or its children.
- */
-public interface Node extends Model {
-
-
- // ********** containment hierarchy (parent/children) **********
-
- /**
- * INTRA-TREE API?
- * Return the node's parent in the containment hierarchy.
- * Most nodes must have a parent. The parent is immutable.
- * @see #children()
- */
- Node getParent();
-
- /**
- * INTRA-TREE API?
- * Return the node's children, which are also nodes.
- * @see #getParent()
- */
- Iterator<Node> children();
-
- /**
- * INTRA-TREE API?
- * Return the containment hierarchy's root node.
- * Most nodes must have a root.
- * @see #getParent()
- */
- Node root();
-
- /**
- * Return whether the node is a descendant of the specified node.
- * By definition, a node is a descendant of itself.
- */
- boolean isDescendantOf(Node node);
-
- /**
- * INTRA-TREE API
- * Add the node's "references", and all the node's descendants'
- * "references", to the specified collection. "References" are
- * objects that are "referenced" by another object, as opposed
- * to "owned" by another object.
- * This method is of particular concern to Handles, since most
- * (hopefully all) "references" are held by Handles.
- * @see Reference
- * @see #children()
- */
- void addBranchReferencesTo(Collection<Node.Reference> branchReferences);
-
- /**
- * INTRA-TREE API?
- * Add all the nodes in the object's branch of the tree,
- * including the node itself, to the specified collection.
- * Only really used for testing and debugging.
- */
- void addAllNodesTo(Collection<Node> nodes);
-
-
- // ********** model synchronization support **********
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * removed from the tree. The node receiving this notification
- * should perform any necessary updates to remain in synch
- * with the tree (e.g. clearing out or replacing any references
- * to the removed node or any of the removed node's descendants).
- * @see #isDescendantOf(Node)
- */
- void nodeRemoved(Node node);
-
- /**
- * INTRA-TREE API
- * This is a general notification that the specified node has been
- * renamed. The node receiving this notification should mark its
- * branch dirty if necessary (i.e. it references the renamed node
- * or one of its descendants). This method is of particular concern
- * to Handles.
- * @see #isDescendantOf(Node)
- */
- void nodeRenamed(Node node);
-
-
- // ********** dirty flag support **********
-
- /**
- * Return whether any persistent aspects of the node,
- * or any of its descendants, have changed since the node and
- * its descendants were last read or saved.
- */
- boolean isDirtyBranch();
- String DIRTY_BRANCH_PROPERTY = "dirtyBranch"; //$NON-NLS-1$
-
- /**
- * INTRA-TREE API
- * Mark the node and its parent as dirty branches.
- * This message is propagated up the containment
- * tree when a particular node becomes dirty.
- */
- void markBranchDirty();
-
- /**
- * Mark the node and all its descendants as dirty.
- * This is used when the save location of some
- * top-level node is changed and the entire
- * containment tree must be marked dirty so it
- * will be written out.
- */
- void markEntireBranchDirty();
-
- /**
- * INTRA-TREE API
- * A child node's branch has been marked clean. If the node
- * itself is clean and if all of its children are also clean, the
- * node's branch can be marked clean. Then, if the node's
- * branch is clean, the node will notify its parent that it might
- * be clean also. This message is propagated up the containment
- * tree when a particular node becomes clean.
- */
- void markBranchCleanIfPossible();
-
- /**
- * INTRA-TREE API
- * Mark the node and all its descendants as clean.
- * Typically used when the node has just been
- * read in or written out.
- * This method is for internal use only; it is not for
- * client use.
- * Not the best of method names.... :-(
- */
- void cascadeMarkEntireBranchClean();
-
-
- // ********** problems **********
-
- /**
- * INTRA-TREE API
- * Return a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- */
- Validator getValidator();
-
- /**
- * Set a validator that will be invoked whenever a
- * "validated" aspect of the node tree changes.
- * Typically only the root node directly holds a validator.
- */
- void setValidator(Validator validator);
-
- /**
- * Validate the node and its descendants.
- * This is an explicit request invoked by a client; and it will
- * typically be followed by a call to one of the following methods:
- * #branchProblems()
- * #hasBranchProblems()
- * Whether the node maintains its problems on the fly
- * or waits until this method is called is determined by the
- * implementation.
- * @see Problem
- */
- void validateBranch();
-
- /**
- * INTRA-TREE API
- * Validate the node and all of its descendants,
- * and update their sets of "branch" problems.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- boolean validateBranchInternal();
-
- /**
- * Return all the node's problems along with all the
- * node's descendants' problems.
- */
- ListIterator<Problem> branchProblems();
- String BRANCH_PROBLEMS_LIST = "branchProblems"; //$NON-NLS-1$
-
- /**
- * Return the size of all the node's problems along with all the
- * node's descendants' problems.
- */
- int branchProblemsSize();
-
- /**
- * Return whether the node or any of its descendants have problems.
- */
- boolean hasBranchProblems();
- String HAS_BRANCH_PROBLEMS_PROPERTY = "hasBranchProblems"; //$NON-NLS-1$
-
- /**
- * Return whether the node contains the specified branch problem.
- */
- boolean containsBranchProblem(Problem problem);
-
- /**
- * INTRA-TREE API
- * Something changed, rebuild the node's collection of branch problems.
- */
- void rebuildBranchProblems();
-
- /**
- * INTRA-TREE API
- * Add the node's problems, and all the node's descendants'
- * problems, to the specified list.
- * A call to this method should be immediately preceded by a call to
- * #validateBranch() or all of the problems might not be
- * added to the list.
- * @see Problem
- */
- void addBranchProblemsTo(List<Problem> branchProblems);
-
- /**
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- */
- void clearAllBranchProblems();
-
- /**
- * INTRA-TREE API
- * Clear the node's "branch" problems and the "branch"
- * problems of all of its descendants.
- * Return true if the collection of "branch" problems has changed.
- * This method is for internal use only; it is not for
- * client use.
- */
- boolean clearAllBranchProblemsInternal();
-
-
- // ********** comment **********
-
- /**
- * Return the user comment concerning the node.
- */
- String comment();
- String COMMENT_PROPERTY = "comment"; //$NON-NLS-1$
-
- /**
- * Set the user comment concerning the node.
- */
- void setComment(String comment);
-
-
- // ********** displaying/sorting **********
-
- /**
- * Return a string representation of the model, suitable for sorting.
- */
- String displayString();
-
-
- // ********** sub-interfaces **********
-
- /**
- * Simple interface defining a "reference" between two nodes.
- * @see Node#addBranchReferencesTo(java.util.Collection)
- */
- interface Reference {
-
- /**
- * Return the "source" node of the reference, i.e. the node that
- * references the "target" node.
- */
- Node source();
-
- /**
- * Return the "target" node of the reference, i.e. the node that
- * is referenced by the "source" node.
- */
- Node target();
-
- }
-
-
- /**
- * A validator will validate a node as appropriate.
- * Typically the validation will
- * - occur whenever a node has changed
- * - encompass the entire tree containing the node
- * - execute asynchronously
- */
- interface Validator {
-
- /**
- * A "significant" aspect has changed;
- * validate the node as appropriate
- */
- void validate();
-
- /**
- * Stop all validation of the node until #resume() is called.
- * This can be used to improve the performance of any long-running
- * action that triggers numerous changes to the node. Be sure to
- * match a call to this method with a corresponding call to
- * #resume().
- */
- void pause();
-
- /**
- * Resume validation of the node. This method can only be
- * called after a matching call to #pause().
- */
- void resume();
-
- }
-
-
- // ********** helper implementations **********
-
- /**
- * Straightforward implementation of the Reference interface
- * defined above.
- */
- public class SimpleReference implements Reference {
- private Node source;
- private Node target;
- public SimpleReference(Node source, Node target) {
- super();
- if (source == null || target == null) {
- throw new NullPointerException();
- }
- this.source = source;
- this.target = target;
- }
- public Node source() {
- return this.source;
- }
- public Node target() {
- return this.target;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.source + " => " + this.target); //$NON-NLS-1$
- }
- }
-
-
- /**
- * This validator does nothing to validate the node.
- */
- Validator NULL_VALIDATOR =
- new PluggableValidator(PluggableValidator.Delegate.Null.instance()) {
- @Override
- public String toString() {
- return "Node.NULL_VALIDATOR"; //$NON-NLS-1$
- }
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java
deleted file mode 100644
index 247387b173..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/PluggableValidator.java
+++ /dev/null
@@ -1,121 +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.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This implementation of the Validator interface implements the
- * pause/resume portion of the protocol, but delegates the actual
- * validation to a "pluggable" delegate.
- */
-public class PluggableValidator
- implements Node.Validator
-{
- private boolean pause;
- private boolean validateOnResume;
- private final Delegate delegate;
-
-
- /**
- * Convenience factory method.
- */
- public static Node.Validator buildAsynchronousValidator(SynchronizedBoolean validateFlag) {
- return new PluggableValidator(new AsynchronousValidator(validateFlag));
- }
-
- /**
- * Convenience factory method.
- */
- public static Node.Validator buildSynchronousValidator(Node node) {
- return new PluggableValidator(new SynchronousValidator(node));
- }
-
- /**
- * Construct a validator with the specified delegate.
- */
- public PluggableValidator(Delegate delegate) {
- super();
- this.pause = false;
- this.validateOnResume = false;
- this.delegate = delegate;
- }
-
- public synchronized void validate() {
- if (this.pause) {
- this.validateOnResume = true;
- } else {
- this.delegate.validate();
- }
- }
-
- public synchronized void pause() {
- if (this.pause) {
- throw new IllegalStateException("already paused"); //$NON-NLS-1$
- }
- this.pause = true;
- }
-
- public synchronized void resume() {
- if ( ! this.pause) {
- throw new IllegalStateException("not paused"); //$NON-NLS-1$
- }
- this.pause = false;
- // validate any changes that occurred while the validation was paused
- if (this.validateOnResume) {
- this.validateOnResume = false;
- this.delegate.validate();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.delegate);
- }
-
-
- // ********** member interface **********
-
- /**
- * Interface implemented by any delegates of a pluggable validator.
- */
- public interface Delegate {
-
- /**
- * The validator is not "paused" - perform the appropriate validation.
- */
- void validate();
-
-
- /**
- * This delegate does nothing.
- */
- final class Null implements Delegate {
- public static final Delegate INSTANCE = new Null();
- public static Delegate instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void validate() {
- // do nothing
- }
- @Override
- public String toString() {
- return "PluggableValidator.Delegate.Null"; //$NON-NLS-1$
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java
deleted file mode 100644
index 4f8e730362..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/Problem.java
+++ /dev/null
@@ -1,46 +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.utility.internal.node;
-
-/**
- * Define an interface describing the problems associated with a node.
- */
-public interface Problem {
-
- /**
- * Return the node most closely associated with the problem.
- */
- Node source();
-
- /**
- * Return a key that can be used to uniquely identify the problem's message.
- */
- String messageKey();
-
- /**
- * Return the arguments associate with the problem's message.
- */
- Object[] messageArguments();
-
- /**
- * Return whether the problem is equal to the specified object.
- * It is equal if the specified object is a implementation of the
- * Problem interface and its source, message key, and message
- * arguments are all equal to this problem's.
- */
- boolean equals(Object o);
-
- /**
- * Return the problem's hash code, which should calculated as an
- * XOR of the source's hash code and the message key's hash code.
- */
- int hashCode();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java
deleted file mode 100644
index ede6b8b8f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/node/SynchronousValidator.java
+++ /dev/null
@@ -1,44 +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.utility.internal.node;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-
-/**
- * This implementation of the PluggableValidator.Delegate interface
- * will validate the node immediately.
- *
- * This is useful for debugging in a single thread or generating
- * problem reports.
- */
-public class SynchronousValidator
- implements PluggableValidator.Delegate
-{
- private final Node node;
-
- /**
- * Construct a validator that will immediately validate the
- * specified node.
- */
- public SynchronousValidator(Node node) {
- super();
- this.node = node;
- }
-
- public void validate() {
- this.node.validateBranch();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.node);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.java
deleted file mode 100644
index 8ebe2617e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CachingComboBoxModel.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.utility.internal.swing;
-
-import javax.swing.ComboBoxModel;
-
-/**
- * This interface allows a client to better control the performance of
- * a combo box model by allowing the client to specify when it is
- * acceptable for the model to "cache" and "uncache" its list of elements.
- * The model may ignore these hints if appropriate.
- */
-public interface CachingComboBoxModel extends ComboBoxModel {
-
- /**
- * Cache the comboBoxModel List. If you call this, you
- * must make sure to call uncacheList() as well. Otherwise
- * stale data will be in the ComboBox until cacheList() is
- * called again or uncacheList() is called.
- */
- void cacheList();
-
- /**
- * Clear the cached list. Next time the list is needed it will
- * be built when it is not cached.
- */
- void uncacheList();
-
- /**
- * Check to see if the list is already cached. This can be used for
- * MouseEvents, since they are not terribly predictable.
- */
- boolean isCached();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java
deleted file mode 100644
index 51ce1a83e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/CheckBoxTableCellRenderer.java
+++ /dev/null
@@ -1,206 +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.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import javax.swing.BorderFactory;
-import javax.swing.Icon;
-import javax.swing.JCheckBox;
-import javax.swing.JTable;
-import javax.swing.SwingConstants;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import org.eclipse.jpt.utility.internal.swing.TableCellEditorAdapter.ImmediateEditListener;
-
-/**
- * Make the cell look like a check box.
- */
-public class CheckBoxTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /** the component used to paint the cell */
- private final JCheckBox checkBox;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
- /** "normal" border - assume the default table "focus" border is 1 pixel thick */
- private static final Border NO_FOCUS_BORDER = BorderFactory.createEmptyBorder(1, 1, 1, 1);
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a cell renderer with no label or icon.
- */
- public CheckBoxTableCellRenderer() {
- super();
- this.checkBox = this.buildCheckBox();
- // by default, check boxes do not paint their borders
- this.checkBox.setBorderPainted(true);
- // this setting is recommended for check boxes inside of trees and tables
- this.checkBox.setBorderPaintedFlat(true);
- }
-
- /**
- * Construct a cell renderer with the specified text and icon,
- * either of which may be null.
- */
- public CheckBoxTableCellRenderer(String text, Icon icon) {
- this();
- this.setText(text);
- this.setIcon(icon);
- }
-
- /**
- * Construct a cell renderer with the specified text.
- */
- public CheckBoxTableCellRenderer(String text) {
- this(text, null);
- }
-
- /**
- * Construct a cell renderer with the specified icon.
- */
- public CheckBoxTableCellRenderer(Icon icon) {
- this(null, icon);
- }
-
- protected JCheckBox buildCheckBox() {
- JCheckBox cb = new JCheckBox();
- cb.addActionListener(this.buildActionListener());
- return cb;
- }
-
- private ActionListener buildActionListener() {
- return new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (CheckBoxTableCellRenderer.this.immediateEditListener != null) {
- CheckBoxTableCellRenderer.this.immediateEditListener.immediateEdit();
- }
- }
- };
- }
-
-
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- this.checkBox.setHorizontalAlignment(SwingConstants.CENTER);
- this.checkBox.setComponentOrientation(table.getComponentOrientation());
- this.checkBox.setFont(table.getFont());
- this.checkBox.setEnabled(table.isEnabled());
-
- this.checkBox.setForeground(this.foregroundColor(table, value, selected, hasFocus, row, column));
- this.checkBox.setBackground(this.backgroundColor(table, value, selected, hasFocus, row, column));
- // once the colors are set, calculate opaque setting
- this.checkBox.setOpaque(this.cellIsOpaqueIn(table, value, selected, hasFocus, row, column));
- this.checkBox.setBorder(this.border(table, value, selected, hasFocus, row, column));
-
- this.setValue(value);
- return this.checkBox;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground"); //$NON-NLS-1$
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground"); //$NON-NLS-1$
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(@SuppressWarnings("unused") JTable table, @SuppressWarnings("unused") Object value, @SuppressWarnings("unused") boolean selected, boolean hasFocus, @SuppressWarnings("unused") int row, @SuppressWarnings("unused") int column) {
- return hasFocus ? UIManager.getBorder("Table.focusCellHighlightBorder") : NO_FOCUS_BORDER; //$NON-NLS-1$
- }
-
- /**
- * Return whether the cell should be opaque in the table.
- * If the cell's background is the same as the table's background
- * and table is opaque, we don't need to paint the background -
- * the table will do it.
- */
- protected boolean cellIsOpaqueIn(JTable table, @SuppressWarnings("unused") Object value, @SuppressWarnings("unused") boolean selected, @SuppressWarnings("unused") boolean hasFocus, @SuppressWarnings("unused") int row, @SuppressWarnings("unused") int column) {
- Color cellBackground = this.checkBox.getBackground();
- Color tableBackground = table.getBackground();
- return ! (table.isOpaque() && cellBackground.equals(tableBackground));
- }
-
- /**
- * Set the check box's value.
- */
- protected void setValue(Object value) {
- // CR#3999318 - This null check needs to be removed once JDK bug is fixed
- if (value == null) {
- value = Boolean.FALSE;
- }
- this.checkBox.setSelected(((Boolean) value).booleanValue());
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return Boolean.valueOf(this.checkBox.isSelected());
- }
-
- public void setImmediateEditListener(ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
- // ********** public API **********
-
- /**
- * Set the check box's text; which by default is blank.
- */
- public void setText(String text) {
- this.checkBox.setText(text);
- }
-
- /**
- * Set the check box's icon; which by default is not present.
- */
- public void setIcon(Icon icon) {
- this.checkBox.setIcon(icon);
- }
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the table's row height to something the check box
- * will look good in....
- */
- public int preferredHeight() {
- // add in space for the border top and bottom
- return (int) this.checkBox.getPreferredSize().getHeight() + 2;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java
deleted file mode 100644
index 149b7fd098..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ComboBoxTableCellRenderer.java
+++ /dev/null
@@ -1,328 +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.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import javax.swing.BorderFactory;
-import javax.swing.ComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JTable;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-
-/**
- * Make the cell look like a combo-box.
- */
-public class ComboBoxTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /* caching the combo box because we are caching the comboBoxModel.
- * Everytime we rebuilt the comboBox we would set the model on it and not
- * remove the model from the old combo box. This meant that new listeners
- * kept being added to the comboBoxModel for every comboBox build.
- * Not sure if there is a way to clear out the old combo box, or why
- * we were buildig a new combo box every time so I went with caching it.
- */
- private JComboBox comboBox;
-
- /** the items used to populate the combo box */
- private CachingComboBoxModel model;
- private ListCellRenderer renderer;
- Object value;
- private static int height = -1;
- boolean fakeFocusFlag;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
- /** hold the original colors of the combo-box */
- private static Color defaultForeground;
- private static Color defaultBackground;
-
- /** "normal" border - assume the default table "focus" border is 1 pixel thick */
- private static final Border NO_FOCUS_BORDER = BorderFactory.createEmptyBorder(1, 1, 1, 1);
-
-
- // ********** constructors/initialization **********
-
- /**
- * Default constructor.
- */
- private ComboBoxTableCellRenderer() {
- super();
- initialize();
- }
-
- /**
- * Construct a cell renderer that uses the specified combo-box model.
- */
- public ComboBoxTableCellRenderer(ComboBoxModel model) {
- this(new NonCachingComboBoxModel(model));
- }
-
- /**
- * Construct a cell renderer that uses the specified caching combo-box model.
- */
- public ComboBoxTableCellRenderer(CachingComboBoxModel model) {
- this();
- this.model = model;
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * combo-box model and renderer.
- */
- public ComboBoxTableCellRenderer(ComboBoxModel model, ListCellRenderer renderer) {
- this(new NonCachingComboBoxModel(model), renderer);
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * caching combo-box model and renderer.
- */
- public ComboBoxTableCellRenderer(CachingComboBoxModel model, ListCellRenderer renderer) {
- this(model);
- this.renderer = renderer;
- }
-
- protected void initialize() {
- // save the original colors of the combo-box, so we
- // can use them to paint non-selected cells
- if (height == -1) {
- JComboBox cb = new JComboBox();
- cb.addItem("m"); //$NON-NLS-1$
-
- // add in space for the border top and bottom
- height = cb.getPreferredSize().height + 2;
-
- defaultForeground = cb.getForeground();
- defaultBackground = cb.getBackground();
- }
- }
-
- static JLabel prototypeLabel = new JLabel("Prototype", new EmptyIcon(16), SwingConstants.LEADING); //$NON-NLS-1$
-
- protected JComboBox buildComboBox() {
-
- final JComboBox result = new JComboBox() {
- private boolean fakeFocus;
- @Override
- public boolean hasFocus() {
- return fakeFocus || super.hasFocus();
- }
- @Override
- public void paint(Graphics g) {
- fakeFocus = ComboBoxTableCellRenderer.this.fakeFocusFlag;
- super.paint(g);
- fakeFocus = false;
- }
- //wrap the renderer to deal with the prototypeDisplayValue
- @Override
- public void setRenderer(final ListCellRenderer aRenderer) {
- super.setRenderer(new ListCellRenderer(){
- public Component getListCellRendererComponent(JList list, Object v, int index, boolean isSelected, boolean cellHasFocus) {
- if (v == prototypeLabel) {
- return prototypeLabel;
- }
- return aRenderer.getListCellRendererComponent(list, v, index, isSelected, cellHasFocus);
- }
- });
- }
- @Override
- public int getSelectedIndex() {
- boolean listNotCached = !listIsCached();
- if (listNotCached) {
- cacheList();
- }
-
- int index = super.getSelectedIndex();
-
- if (listNotCached) {
- uncacheList();
- }
- return index;
- }
-
- };
- // stole this code from javax.swing.DefaultCellEditor
- result.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE); //$NON-NLS-1$
- result.addActionListener(this.buildActionListener());
- result.addPopupMenuListener(this.buildPopupMenuListener());
-
- //These are used to workaround problems with Swing trying to
- //determine the size of a comboBox with a large model
- result.setPrototypeDisplayValue(prototypeLabel);
- getListBox(result).setPrototypeCellValue(prototypeLabel);
-
- return result;
- }
-
-
- private JList getListBox(JComboBox result) {
- return (JList) ReflectionTools.getFieldValue(result.getUI(), "listBox"); //$NON-NLS-1$
- }
-
-
- private ActionListener buildActionListener() {
- return new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- JComboBox cb = (JComboBox) e.getSource();
- Object selectedItem = cb.getSelectedItem();
-
- // Only update the selected item and invoke immediateEdit() if the
- // selected item actually changed, during the initialization of the
- // editing, the model changes and causes this method to be invoked,
- // it causes CR#3963675 to occur because immediateEdit() stop the
- // editing, which is done at the wrong time
- if (ComboBoxTableCellRenderer.this.value != selectedItem) {
- ComboBoxTableCellRenderer.this.value = cb.getSelectedItem();
- ComboBoxTableCellRenderer.this.immediateEdit();
- }
- }
- };
- }
-
- void immediateEdit() {
- if (this.immediateEditListener != null) {
- this.immediateEditListener.immediateEdit();
- }
- }
-
- private PopupMenuListener buildPopupMenuListener() {
- return new PopupMenuListener() {
-
- public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
- cacheList();
- }
-
- public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
-
- }
-
- public void popupMenuCanceled(PopupMenuEvent e) {
- if (listIsCached()) {
- uncacheList();
- }
- }
- };
- }
-
-
- void cacheList() {
- this.model.cacheList();
- }
-
- void uncacheList() {
- this.model.uncacheList();
- }
-
- boolean listIsCached() {
- return this.model.isCached();
- }
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object val, boolean selected, boolean hasFocus, int row, int column) {
- this.fakeFocusFlag = selected || hasFocus;
- if (this.comboBox == null) {
- this.comboBox = this.buildComboBox();
-
- this.comboBox.setComponentOrientation(table.getComponentOrientation());
- this.comboBox.setModel(this.model);
- if (this.renderer != null) {
- this.comboBox.setRenderer(this.renderer);
- }
- this.comboBox.setFont(table.getFont());
- this.comboBox.setEnabled(table.isEnabled());
- this.comboBox.setBorder(this.border(table, val, selected, hasFocus, row, column));
- }
-
- // We need to go through the model since JComboBox might prevent us from
- // selecting the value. This can happen when the value is not contained
- // in the model, see CR#3950044 for an example
- this.model.setSelectedItem(val);
-
- return this.comboBox;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, @SuppressWarnings("unused") Object val, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return defaultForeground;
- }
- return table.getSelectionForeground();
- }
- return defaultForeground;
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, @SuppressWarnings("unused") Object val, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return defaultBackground;
- }
- return table.getSelectionBackground();
- }
- return defaultBackground;
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(@SuppressWarnings("unused") JTable table, @SuppressWarnings("unused") Object val, @SuppressWarnings("unused") boolean selected, boolean hasFocus, @SuppressWarnings("unused") int row, @SuppressWarnings("unused") int column) {
- return hasFocus ?
- UIManager.getBorder("Table.focusCellHighlightBorder") //$NON-NLS-1$
- :
- NO_FOCUS_BORDER;
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return this.value;
- }
-
- public void setImmediateEditListener(TableCellEditorAdapter.ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
-
- // ********** public API **********
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the row height to something the combo-box will look good in....
- */
- public int preferredHeight() {
- return height;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java
deleted file mode 100644
index 93523eb951..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/Displayable.java
+++ /dev/null
@@ -1,44 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Used by general-purpose UI models and renderers to cast
- * application model objects to something displayable.
- */
-public interface Displayable
- extends Model
-{
-
- /**
- * Return a string that can be used to identify the model
- * in a textual UI setting (typically the object's name).
- * When the display string changes, the model should fire
- * the appropriate change notification:
- * this.firePropertyChanged(DISPLAY_STRING_PROPERTY, oldDisplayString, this.displayString());
- */
- String displayString();
- String DISPLAY_STRING_PROPERTY = "displayString"; //$NON-NLS-1$
-
- /**
- * Return an icon that can be used to identify the model
- * in a UI component that supports icons (the icon can be null).
- * When the icon changes, the model should fire
- * the appropriate change notification:
- * this.firePropertyChanged(ICON_PROPERTY, oldIcon, this.icon());
- */
- Icon icon();
- String ICON_PROPERTY = "icon"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.java
deleted file mode 100644
index 6464ea9881..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/EmptyIcon.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.utility.internal.swing;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import javax.swing.Icon;
-
-/**
- * Implement the Icon interface with an icon that has a size but
- * does not paint anything on the graphics context.
- */
-public class EmptyIcon
- implements Icon
-{
- private final int width;
- private final int height;
-
- public static final EmptyIcon NULL_INSTANCE = new EmptyIcon(0);
-
-
- public EmptyIcon(int width, int height) {
- super();
- this.width = width;
- this.height = height;
- }
-
- public EmptyIcon(int size) {
- this(size, size);
- }
-
-
- // ********** Icon implementation **********
-
- public void paintIcon(Component c, Graphics g, int x, int y) {
- // don't paint anything for an empty icon
- }
-
- public int getIconWidth() {
- return this.width;
- }
-
- public int getIconHeight() {
- return this.height;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java
deleted file mode 100644
index f175164ba6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListBrowser.java
+++ /dev/null
@@ -1,140 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-import javax.swing.JComboBox;
-import javax.swing.JOptionPane;
-import javax.swing.ListModel;
-
-/**
- * This implementation of LongListComponent.Browser uses a
- * JOptionPane to prompt the user for the selection. The JOPtionPane
- * is passed a FilteringListPanel to assist the user in making
- * a selection.
- */
-public class FilteringListBrowser<T>
- implements ListChooser.ListBrowser
-{
- private FilteringListPanel<T> panel;
-
- /**
- * Default constructor.
- */
- public FilteringListBrowser() {
- super();
- this.panel = this.buildPanel();
- }
-
- protected FilteringListPanel<T> buildPanel() {
- return new LocalFilteringListPanel<T>();
- }
-
- /**
- * Prompt the user using a JOptionPane with a filtering
- * list panel.
- */
- public void browse(ListChooser chooser) {
- this.initializeCellRenderer(chooser);
-
- int option =
- JOptionPane.showOptionDialog(
- chooser,
- this.message(chooser),
- this.title(chooser),
- this.optionType(chooser),
- this.messageType(chooser),
- this.icon(chooser),
- this.selectionValues(chooser),
- this.initialSelectionValue(chooser)
- );
-
- if (option == JOptionPane.OK_OPTION) {
- chooser.getModel().setSelectedItem(this.panel.selection());
- }
-
- // clear the text field so the list box is re-filtered
- this.panel.textField().setText(""); //$NON-NLS-1$
- }
-
- protected void initializeCellRenderer(JComboBox comboBox) {
- // default behavior should be to use the cell renderer from the combobox.
- this.panel.listBox().setCellRenderer(comboBox.getRenderer());
- }
-
- /**
- * the message can be anything - here we build a component
- */
- protected Object message(JComboBox comboBox) {
- this.panel.setCompleteList(this.convertToArray(comboBox.getModel()));
- this.panel.setSelection(comboBox.getModel().getSelectedItem());
- return this.panel;
- }
-
- protected String title(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected int optionType(@SuppressWarnings("unused") JComboBox comboBox) {
- return JOptionPane.OK_CANCEL_OPTION;
- }
-
- protected int messageType(@SuppressWarnings("unused") JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected Object[] selectionValues(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected Object initialSelectionValue(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- /**
- * Convert the list of objects in the specified list model
- * into an array.
- */
- protected Object[] convertToArray(ListModel model) {
- int size = model.getSize();
- Object[] result = new Object[size];
- for (int i = 0; i < size; i++) {
- result[i] = model.getElementAt(i);
- }
- return result;
- }
-
-
- // ********** custom panel **********
-
- protected static class LocalFilteringListPanel<S> extends FilteringListPanel<S> {
- protected static final Object[] EMPTY_ARRAY = new Object[0];
-
- protected LocalFilteringListPanel() {
- super(EMPTY_ARRAY, null);
- }
-
- /**
- * Disable the performance tweak because JOptionPane
- * will try open wide enough to disable the horizontal scroll bar;
- * and it looks a bit clumsy.
- */
- @Override
- protected String prototypeCellValue() {
- return null;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java
deleted file mode 100644
index 8b62ab6dd0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/FilteringListPanel.java
+++ /dev/null
@@ -1,455 +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.utility.internal.swing;
-
-import java.awt.BorderLayout;
-import java.awt.Font;
-import javax.swing.AbstractListModel;
-import javax.swing.BorderFactory;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.ListCellRenderer;
-import javax.swing.ListModel;
-import javax.swing.ListSelectionModel;
-import javax.swing.border.Border;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import org.eclipse.jpt.utility.internal.SimpleStringMatcher;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.StringMatcher;
-
-/**
- * This panel presents an entry field and a list box of choices that
- * allows the user to filter the entries in the list box by entering
- * a pattern in the entry field.
- *
- * By default, two wildcards are allowed in the pattern:
- * '*' will match any set of zero or more characters
- * '?' will match any single character
- *
- * The panel consists of 4 components that can be customized:
- * - 1 text field
- * - 1 list box
- * - 2 labels, one for each of the above
- *
- * Other aspects of the panel's behavior can be changed:
- * - the string converter determines how the objects in the
- * list are converted to strings and compared to the pattern
- * entered in the text field; by default the converter simply
- * uses the result of the object's #toString() method
- * (if you replace the string converter, you will probably
- * want to replace the list box's cell renderer also)
- * - the string matcher can also be changed if you would
- * like different pattern matching behavior than that
- * described above
- * - you can specify the maximum size of the list - this may
- * force the user to enter a pattern restrictive enough
- * to result in a list smaller than the maximum size; the
- * default is -1, which disables the restriction
- *
- * This panel is not a typical panel, in the sense that it does not share
- * its model with clients via value models. Instead, this panel's model
- * is set and queried directly because it is designed to be used in a
- * dialog that directs the user's behavior (as opposed to a "normal"
- * window).
- */
-public class FilteringListPanel<T> extends JPanel {
-
- /**
- * The complete list of available choices
- * (as opposed to the partial list held by the list box).
- */
- private Object[] completeList;
-
- /**
- * An adapter used to convert the objects in the list
- * to strings so they can be run through the matcher
- * and displayed in the text field.
- */
- StringConverter<T> stringConverter;
-
- /** The text field. */
- private JTextField textField;
- private JLabel textFieldLabel;
- private DocumentListener textFieldListener;
-
- /** The list box. */
- private JList listBox;
- private JLabel listBoxLabel;
-
- /** The maximum number of entries displayed in the list box. */
- private int maxListSize;
-
- /**
- * The matcher used to filter the list against
- * the pattern entered in the text field. By default,
- * this allows the two wildcard characters described in
- * the class comment.
- */
- private StringMatcher stringMatcher;
-
- /**
- * Performance tweak: We use this buffer instead of
- * a temporary variable during filtering so we don't have
- * to keep re-allocating it.
- */
- private Object[] buffer;
-
- private static final Border TEXT_FIELD_LABEL_BORDER = BorderFactory.createEmptyBorder(0, 0, 5, 0);
- private static final Border LIST_BOX_LABEL_BORDER = BorderFactory.createEmptyBorder(5, 0, 5, 0);
-
-
- // ********** constructors **********
-
- /**
- * Construct a FilteringListPanel with the specified list of choices
- * and initial selection. Use the default string converter to convert the
- * choices and selection to strings (which simply calls #toString() on
- * the objects).
- */
- public FilteringListPanel(Object[] completeList, Object initialSelection) {
- this(completeList, initialSelection, StringConverter.Default.<T>instance());
- }
-
- /**
- * Construct a FilteringListPanel with the specified list of choices
- * and initial selection. Use the specified string converter to convert the
- * choices and selection to strings.
- */
- public FilteringListPanel(Object[] completeList, Object initialSelection, StringConverter<T> stringConverter) {
- super(new BorderLayout());
- this.completeList = completeList;
- this.stringConverter = stringConverter;
- this.initialize(initialSelection);
- }
-
-
- // ********** initialization **********
-
- private void initialize(Object initialSelection) {
- this.maxListSize = this.defaultMaxListSize();
- this.buffer = this.buildBuffer();
-
- this.textFieldListener = this.buildTextFieldListener();
-
- this.stringMatcher = this.buildStringMatcher();
-
- this.initializeLayout(initialSelection);
- }
-
- private Object[] buildBuffer() {
- return new Object[this.max()];
- }
-
- /**
- * Return the current max number of entries allowed in the list box.
- */
- private int max() {
- if (this.maxListSize == -1) {
- return this.completeList.length;
- }
- return Math.min(this.maxListSize, this.completeList.length);
- }
-
- /**
- * Build a listener that will listen to changes in the text field
- * and filter the list appropriately.
- */
- private DocumentListener buildTextFieldListener() {
- return new DocumentListener() {
- public void insertUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- public void changedUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- public void removeUpdate(DocumentEvent e) {
- FilteringListPanel.this.filterList();
- }
- @Override
- public String toString() {
- return "text field listener"; //$NON-NLS-1$
- }
- };
- }
-
- private int defaultMaxListSize() {
- return -1;
- }
-
- private StringMatcher buildStringMatcher() {
- return new SimpleStringMatcher<T>();
- }
-
- private void initializeLayout(Object initialSelection) {
- // text field
- JPanel textFieldPanel = new JPanel(new BorderLayout());
- this.textFieldLabel = new JLabel();
- this.textFieldLabel.setBorder(TEXT_FIELD_LABEL_BORDER);
- textFieldPanel.add(this.textFieldLabel, BorderLayout.NORTH);
-
- this.textField = new JTextField();
- this.textField.getDocument().addDocumentListener(this.textFieldListener);
- this.textFieldLabel.setLabelFor(this.textField);
- textFieldPanel.add(this.textField, BorderLayout.CENTER);
-
- this.add(textFieldPanel, BorderLayout.NORTH);
-
- // list box
- JPanel listBoxPanel = new JPanel(new BorderLayout());
- this.listBoxLabel = new JLabel();
- this.listBoxLabel.setBorder(LIST_BOX_LABEL_BORDER);
- listBoxPanel.add(this.listBoxLabel, BorderLayout.NORTH);
-
- this.listBox = new JList();
- this.listBox.setDoubleBuffered(true);
- this.listBox.setModel(this.buildPartialArrayListModel(this.completeList, this.max()));
- this.listBox.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- // performance tweak(?)
- this.listBox.setPrototypeCellValue(this.prototypeCellValue());
- this.listBox.setPrototypeCellValue(null);
- this.listBox.setCellRenderer(this.buildDefaultCellRenderer());
- this.listBoxLabel.setLabelFor(this.listBox);
- // bug 2777802 - scroll bars shouldn't be on the tab sequence
- JScrollPane listBoxScrollPane = new JScrollPane(this.listBox);
- listBoxScrollPane.getHorizontalScrollBar().setFocusable(false);
- listBoxScrollPane.getVerticalScrollBar().setFocusable(false);
- listBoxPanel.add(listBoxScrollPane, BorderLayout.CENTER);
-
- // initialize the widgets
- this.listBox.setSelectedValue(initialSelection, true);
- this.textField.select(0, this.textField.getText().length());
-
- this.add(listBoxPanel, BorderLayout.CENTER);
- }
-
-
- // ********** public API **********
-
- public Object selection() {
- return this.listBox.getSelectedValue();
- }
-
- public void setSelection(Object selection) {
- this.listBox.setSelectedValue(selection, true);
- }
-
- public Object[] completeList() {
- return this.completeList;
- }
-
- /**
- * rebuild the filtering buffer and re-apply the filter
- * to the new list
- */
- public void setCompleteList(Object[] completeList) {
- this.completeList = completeList;
- if (this.buffer.length < this.max()) {
- // the buffer will never shrink - might want to re-consider... ~bjv
- this.buffer = this.buildBuffer();
- }
- this.filterList();
- }
-
- public int maxListSize() {
- return this.maxListSize;
- }
-
- public void setMaxListSize(int maxListSize) {
- this.maxListSize = maxListSize;
- if (this.buffer.length < this.max()) {
- // the buffer will never shrink - might want to re-consider... ~bjv
- this.buffer = this.buildBuffer();
- }
- this.filterList();
- }
-
- public StringConverter<T> stringConverter() {
- return this.stringConverter;
- }
-
- /**
- * apply the new filter to the list
- */
- public void setStringConverter(StringConverter<T> stringConverter) {
- this.stringConverter = stringConverter;
- this.filterList();
- }
-
- /**
- * allow client code to access the text field
- * (so we can set the focus)
- */
- public JTextField textField() {
- return this.textField;
- }
-
- /**
- * allow client code to access the text field label
- */
- public JLabel textFieldLabel() {
- return this.textFieldLabel;
- }
-
- /**
- * convenience method
- */
- public void setTextFieldLabelText(String text) {
- this.textFieldLabel.setText(text);
- }
-
- /**
- * allow client code to access the list box
- * (so we can add mouse listeners for double-clicking)
- */
- public JList listBox() {
- return this.listBox;
- }
-
- /**
- * convenience method
- */
- public void setListBoxCellRenderer(ListCellRenderer renderer) {
- this.listBox.setCellRenderer(renderer);
- }
-
- /**
- * allow client code to access the list box label
- */
- public JLabel listBoxLabel() {
- return this.listBoxLabel;
- }
-
- /**
- * convenience method
- */
- public void setListBoxLabelText(String text) {
- this.listBoxLabel.setText(text);
- }
-
- /**
- * convenience method
- */
- public void setComponentsFont(Font font) {
- this.textFieldLabel.setFont(font);
- this.textField.setFont(font);
- this.listBoxLabel.setFont(font);
- this.listBox.setFont(font);
- }
-
- public StringMatcher stringMatcher() {
- return this.stringMatcher;
- }
-
- /**
- * re-apply the filter to the list
- */
- public void setStringMatcher(StringMatcher stringMatcher) {
- this.stringMatcher = stringMatcher;
- this.filterList();
- }
-
-
- // ********** internal methods **********
-
- /**
- * Allow subclasses to disable performance tweak
- * by returning null here.
- */
- protected String prototypeCellValue() {
- return "==========> A_STRING_THAT_IS_DEFINITELY_LONGER_THAN_EVERY_STRING_IN_THE_LIST <=========="; //$NON-NLS-1$
- }
-
- /**
- * By default, use the string converter to build the text
- * used by the list box's cell renderer.
- */
- protected ListCellRenderer buildDefaultCellRenderer() {
- return new SimpleListCellRenderer() {
- @Override
- @SuppressWarnings("unchecked")
- protected String buildText(Object value) {
- return FilteringListPanel.this.stringConverter.convertToString((T) value);
- }
- };
- }
-
- /**
- * Something has changed that requires us to filter the list.
- *
- * This method is synchronized because a fast typist can
- * generate events quicker than we can filter the list. (? ~bjv)
- */
- synchronized void filterList() {
- // temporarily stop listening to the list box selection, since we will
- // be changing the selection during the filtering and don't want
- // that to affect the text field
- this.filterList(this.textField.getText());
- }
-
- /**
- * Filter the contents of the list box to match the
- * specified pattern.
- */
- private void filterList(String pattern) {
- if (pattern.length() == 0) {
- this.listBox.setModel(this.buildPartialArrayListModel(this.completeList, this.max()));
- } else {
- this.stringMatcher.setPatternString(pattern);
- int j = 0;
- int len = this.completeList.length;
- int max = this.max();
- for (int i = 0; i < len; i++) {
- if (this.stringMatcher.matches(this.stringConverter.convertToString(this.entry(i)))) {
- this.buffer[j++] = this.completeList[i];
- }
- if (j == max) {
- break;
- }
- }
- this.listBox.setModel(this.buildPartialArrayListModel(this.buffer, j));
- }
-
- // after filtering the list, determine the appropriate selection
- if (this.listBox.getModel().getSize() == 0) {
- this.listBox.getSelectionModel().clearSelection();
- } else {
- this.listBox.getSelectionModel().setAnchorSelectionIndex(0);
- this.listBox.getSelectionModel().setLeadSelectionIndex(0);
- this.listBox.ensureIndexIsVisible(0);
- }
- }
-
- /**
- * minimize scope of suppressed warnings
- */
- @SuppressWarnings("unchecked")
- private T entry(int index) {
- return (T) this.completeList[index];
- }
-
- /**
- * Build a list model that wraps only a portion of the specified array.
- * The model will include the array entries from 0 to (size - 1).
- */
- private ListModel buildPartialArrayListModel(final Object[] array, final int size) {
- return new AbstractListModel() {
- public int getSize() {
- return size;
- }
- public Object getElementAt(int index) {
- return array[index];
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java
deleted file mode 100644
index 600652ea49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/ListChooser.java
+++ /dev/null
@@ -1,430 +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.utility.internal.swing;
-
-import java.awt.AWTEvent;
-import java.awt.AWTException;
-import java.awt.Component;
-import java.awt.EventQueue;
-import java.awt.Point;
-import java.awt.Robot;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.ListCellRenderer;
-import javax.swing.SwingConstants;
-import javax.swing.event.PopupMenuEvent;
-import javax.swing.event.PopupMenuListener;
-import javax.swing.plaf.basic.BasicComboBoxUI;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-
-/**
- * This component provides a way to handle selecting an item from a
- * list that may grow too large to be handled conveniently by a combo-box.
- * If the list's size is less than the designated "long" list size,
- * the choice list will be displayed in a normal combo-box popup;
- * otherwise, a dialog will be used to prompt the user to choose a selection.
- *
- * To change the browse mechanism, subclasses may
- * - override the method #buildBrowser()
- * - override the method #browse(), in which case the method
- * #buildBrowser() may be ignored.
- */
-public class ListChooser
- extends JComboBox
-{
-
- /** the size of a "long" list - anything smaller is a "short" list */
- int longListSize = DEFAULT_LONG_LIST_SIZE;
-
- /** the default size of a "long" list, which is 20 (to match JOptionPane's behavior) */
- public static final int DEFAULT_LONG_LIST_SIZE = 20;
-
- /** property change associated with long list size */
- public static final String LONG_LIST_SIZE_PROPERTY = "longListSize"; //$NON-NLS-1$
-
- static JLabel prototypeLabel = new JLabel("Prototype", new EmptyIcon(17), SwingConstants.LEADING); //$NON-NLS-1$
-
- /**
- * whether the chooser is choosable. if a chooser is not choosable,
- * it only serves as a display widget. a user may not change its
- * selected value.
- */
- boolean choosable = true;
-
- /** property change associated with choosable */
- public static final String CHOOSABLE_PROPERTY = "choosable"; //$NON-NLS-1$
-
- /** the browser used to make a selection from the long list - typically via a dialog */
- private ListBrowser browser;
-
- private NodeSelector nodeSelector;
-
- /** INTERNAL - The popup is being shown. Used to prevent infinite loop. */
- boolean popupAlreadyInProgress;
-
-
- // **************** Constructors ******************************************
-
- /**
- * Construct a list chooser for the specified model.
- */
- public ListChooser(ComboBoxModel model) {
- this(model, new NodeSelector.DefaultNodeSelector());
- }
-
- public ListChooser(CachingComboBoxModel model) {
- this(model, new NodeSelector.DefaultNodeSelector());
- }
-
- public ListChooser(ComboBoxModel model, NodeSelector nodeSelector) {
- this(new NonCachingComboBoxModel(model), nodeSelector);
- }
-
- public ListChooser(CachingComboBoxModel model, NodeSelector nodeSelector) {
- super(model);
- this.initialize();
- this.nodeSelector = nodeSelector;
- }
- // **************** Initialization ****************************************
-
- protected void initialize() {
- this.addPopupMenuListener(this.buildPopupMenuListener());
- this.setRenderer(new DefaultListCellRenderer());
- this.addKeyListener(buildF3KeyListener());
-
- //These are used to workaround problems with Swing trying to
- //determine the size of a comboBox with a large model
- setPrototypeDisplayValue(prototypeLabel);
- listBox().setPrototypeCellValue(prototypeLabel);
- }
-
-
- private JList listBox() {
- return (JList) ReflectionTools.getFieldValue(this.ui, "listBox"); //$NON-NLS-1$
- }
-
- /**
- * When the popup is about to be shown, the event is consumed, and
- * PopupHandler determines whether to reshow the popup or to show
- * the long list browser.
- */
- private PopupMenuListener buildPopupMenuListener() {
- return new PopupMenuListener() {
- public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
- ListChooser.this.aboutToShowPopup();
- }
- public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
- // do nothing
- }
- public void popupMenuCanceled(PopupMenuEvent e) {
- // do nothing
- }
- @Override
- public String toString() {
- return "pop-up menu listener"; //$NON-NLS-1$
- }
- };
- }
-
- /**
- * If this code is being reached due to the PopupHandler already being in progress,
- * then do nothing. Otherwise, set the flag to true and launch the PopupHandler.
- */
- void aboutToShowPopup() {
- if (this.popupAlreadyInProgress) {
- return;
- }
-
- this.popupAlreadyInProgress = true;
- EventQueue.invokeLater(new PopupHandler());
- }
-
-
- private KeyListener buildF3KeyListener() {
- return new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_F3) {
- goToSelectedItem();
- }
- }
- @Override
- public String toString() {
- return "F3 key listener"; //$NON-NLS-1$
- }
- };
- }
-
- public void goToSelectedItem() {
- if (getSelectedItem() != null) {
- ListChooser.this.nodeSelector.selectNodeFor(getSelectedItem());
- }
- }
-
- // **************** Browsing **********************************************
-
- /**
- * Lazily initialize because subclasses may have further initialization to do
- * before browser can be built.
- */
- protected void browse() {
- if (this.browser == null) {
- this.browser = this.buildBrowser();
- }
-
- this.browser.browse(this);
- }
-
- /**
- * Return the "browser" used to make a selection from the long list,
- * typically via a dialog.
- */
- protected ListChooser.ListBrowser buildBrowser() {
- return new SimpleListBrowser();
- }
-
-
- // **************** Choosable functionality *******************************
-
- /** override behavior - consume selection if chooser is not choosable */
- @Override
- public void setSelectedIndex(int anIndex) {
- if (this.choosable) {
- super.setSelectedIndex(anIndex);
- }
- }
-
- private void updateArrowButton() {
- try {
- BasicComboBoxUI comboBoxUi = (BasicComboBoxUI) ListChooser.this.getUI();
- JButton arrowButton = (JButton) ReflectionTools.getFieldValue(comboBoxUi, "arrowButton"); //$NON-NLS-1$
- arrowButton.setEnabled(this.isEnabled() && this.choosable);
- }
- catch (Exception e) {
- // this is a huge hack to try and make the combo box look right,
- // so if it doesn't work, just swallow the exception
- }
- }
-
-
- // **************** List Caching *******************************
-
- void cacheList() {
- ((CachingComboBoxModel) getModel()).cacheList();
- }
-
- void uncacheList() {
- ((CachingComboBoxModel) getModel()).uncacheList();
- }
-
- boolean listIsCached() {
- return ((CachingComboBoxModel) getModel()).isCached();
- }
-
- // **************** Public ************************************************
-
- public int longListSize() {
- return this.longListSize;
- }
-
- public void setLongListSize(int newLongListSize) {
- int oldLongListSize = this.longListSize;
- this.longListSize = newLongListSize;
- this.firePropertyChange(LONG_LIST_SIZE_PROPERTY, oldLongListSize, newLongListSize);
- }
-
- public boolean isChoosable() {
- return this.choosable;
- }
-
- public void setChoosable(boolean newValue) {
- boolean oldValue = this.choosable;
- this.choosable = newValue;
- this.firePropertyChange(CHOOSABLE_PROPERTY, oldValue, newValue);
- this.updateArrowButton();
- }
-
- // **************** Handle selecting null as a value **********************
-
- private boolean selectedIndexIsNoneSelectedItem(int index) {
- return index == -1 &&
- getModel().getSize() > 0 &&
- getModel().getElementAt(0) == null;
- }
-
- @Override
- public int getSelectedIndex() {
- boolean listNotCached = !listIsCached();
- if (listNotCached) {
- cacheList();
- }
-
- int index = super.getSelectedIndex();
-
- // Use index 0 to show the <none selected> item since the actual value is
- // null and JComboBox does not handle null values
- if (selectedIndexIsNoneSelectedItem(index)) {
- index = 0;
- }
-
- if (listNotCached) {
- uncacheList();
- }
- return index;
- }
-
- //wrap the renderer to deal with the prototypeDisplayValue
- @Override
- public void setRenderer(final ListCellRenderer aRenderer) {
- super.setRenderer(new ListCellRenderer(){
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if (value == prototypeLabel) {
- return prototypeLabel;
- }
- return aRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- });
- }
-
-
- // **************** Member classes ****************************************
-
- /**
- * Define the API required by this ListChooser when it must
- * prompt the user to select an item from the "long" list.
- */
- public interface ListBrowser
- {
- /**
- * Prompt the user to make a selection from the specified
- * combo-box's model.
- */
- void browse(ListChooser parentChooser);
- }
-
-
- /**
- * Runnable class that consumes popup window and determines whether
- * to reshow popup or to launch browser, based on the size of the list.
- */
- private class PopupHandler
- implements Runnable
- {
- /** The mouse event */
- private MouseEvent lastMouseEvent;
-
- /** The component from which the last mouse event was thrown */
- private JComponent eventComponent;
-
- /** The location of the component at the time the last mouse event was thrown */
- private Point componentLocation;
-
- /** The location of the mouse at the time the last mouse event was thrown */
- private Point mouseLocation;
-
-
- PopupHandler() {
- this.initialize();
- }
-
- private void initialize() {
- AWTEvent event = EventQueue.getCurrentEvent();
-
- if (event instanceof MouseEvent) {
- this.lastMouseEvent = (MouseEvent) event;
- this.eventComponent = (JComponent) this.lastMouseEvent.getSource();
- this.componentLocation = this.eventComponent.getLocationOnScreen();
- this.mouseLocation = this.lastMouseEvent.getPoint();
- }
- else {
- this.eventComponent = null;
- this.componentLocation = null;
- this.mouseLocation = null;
- }
- }
-
- public void run() {
- ListChooser.this.hidePopup();
-
- cacheList();
- if (ListChooser.this.choosable == true) {
- // If the combo box model is of sufficient length, the browser will be shown.
- // Asking the combo box model for its size should be enough to ensure that
- // its size is recalculated.
- if (ListChooser.this.getModel().getSize() > ListChooser.this.longListSize) {
- this.checkComboBoxButton();
- ListChooser.this.browse();
- }
- else {
- ListChooser.this.showPopup();
- this.checkMousePosition();
- }
- }
- if (listIsCached()) {
- uncacheList();
- }
-
- ListChooser.this.popupAlreadyInProgress = false;
- }
-
- /** If this is not done, the button never becomes un-pressed */
- private void checkComboBoxButton() {
- try {
- BasicComboBoxUI comboBoxUi = (BasicComboBoxUI) ListChooser.this.getUI();
- JButton arrowButton = (JButton) ReflectionTools.getFieldValue(comboBoxUi, "arrowButton"); //$NON-NLS-1$
- arrowButton.getModel().setPressed(false);
- }
- catch (Exception ex) {
- // this is a huge hack to try and make the combo box look right,
- // so if it doesn't work, just swallow the exception
- this.handleException(ex);
- }
- }
-
- private void handleException(@SuppressWarnings("unused") Exception ex) {
- // do nothing for now
- }
-
- /**
- * Moves the mouse back to its original position before any jiggery pokery that we've done.
- */
- private void checkMousePosition() {
- if (this.eventComponent == null) {
- return;
- }
-
- final Point newComponentLocation = this.eventComponent.getLocationOnScreen();
- boolean componentMoved =
- newComponentLocation.x - this.componentLocation.x != 0
- || newComponentLocation.y - this.componentLocation.y != 0;
-
- if (componentMoved) {
- try {
- new Robot().mouseMove(
- newComponentLocation.x + this.mouseLocation.x,
- newComponentLocation.y + this.mouseLocation.y
- );
- }
- catch (AWTException ex) {
- // move failed - do nothing
- }
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java
deleted file mode 100644
index f8b4d148e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NodeSelector.java
+++ /dev/null
@@ -1,32 +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.utility.internal.swing;
-
-/**
- * This will be called when the user presses F3 or chooses
- * 'Go To' in the context menu
- */
-public interface NodeSelector
-{
- /**
- * Select the appropriate Node in the tree or the editor panel.
- */
- void selectNodeFor(Object item);
-
- /**
- * This NodeSelector will do nothing when selectNodeFor(Object) is called
- */
- class DefaultNodeSelector implements NodeSelector {
-
- public void selectNodeFor(Object item) {
- //default is to do nothing
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java
deleted file mode 100644
index ee7226457f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/NonCachingComboBoxModel.java
+++ /dev/null
@@ -1,73 +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.utility.internal.swing;
-
-import javax.swing.ComboBoxModel;
-import javax.swing.event.ListDataListener;
-
-/**
- * This implementation of the CachingComboBoxModel interface can be used
- * whenever there is no need for caching (i.e. the contents of the selection
- * list can be generated with little latency). All the normal ComboBoxModel
- * behavior is delegated to a client-supplied ComboBoxModel.
- */
-public class NonCachingComboBoxModel implements CachingComboBoxModel {
- private ComboBoxModel wrappedComboBoxModel;
-
- public NonCachingComboBoxModel(ComboBoxModel wrappedComboBoxModel) {
- this.wrappedComboBoxModel = wrappedComboBoxModel;
- }
-
-
- // ********** CachingComboBoxModel implementation **********
-
- public void cacheList() {
- //do nothing
- }
-
- public void uncacheList() {
- //do nothing
- }
-
- public boolean isCached() {
- return false;
- }
-
-
- // ********** ComboBoxModel implementation **********
-
- public void setSelectedItem(Object anItem) {
- this.wrappedComboBoxModel.setSelectedItem(anItem);
- }
-
- public Object getSelectedItem() {
- return this.wrappedComboBoxModel.getSelectedItem();
- }
-
-
- // ********** ListModel implementation **********
-
- public int getSize() {
- return this.wrappedComboBoxModel.getSize();
- }
-
- public Object getElementAt(int index) {
- return this.wrappedComboBoxModel.getElementAt(index);
- }
-
- public void addListDataListener(ListDataListener l) {
- this.wrappedComboBoxModel.addListDataListener(l);
- }
-
- public void removeListDataListener(ListDataListener l) {
- this.wrappedComboBoxModel.removeListDataListener(l);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
deleted file mode 100644
index 30ccdd5ab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleDisplayable.java
+++ /dev/null
@@ -1,170 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-
-/**
- * This implementation of Displayable converts any Object
- * to a Displayable. Subclass it to override #displayString() and
- * #icon() if necessary. Change notification will be fired if the
- * object is changed.
- *
- * This can be used for Strings - the display string
- * will simply be the String itself.
- */
-public class SimpleDisplayable
- extends AbstractModel
- implements Displayable
-{
- /** The object to be converted to a Displayable. */
- protected Object object;
-
-
- /**
- * Construct a displayable for the specified object.
- */
- public SimpleDisplayable(Object object) {
- super();
- this.object = object;
- }
-
- public SimpleDisplayable(boolean b) {
- this(Boolean.valueOf(b));
- }
-
- public SimpleDisplayable(char c) {
- this(Character.valueOf(c));
- }
-
- public SimpleDisplayable(byte b) {
- this(Byte.valueOf(b));
- }
-
- public SimpleDisplayable(short s) {
- this(Short.valueOf(s));
- }
-
- public SimpleDisplayable(int i) {
- this(Integer.valueOf(i));
- }
-
- public SimpleDisplayable(long l) {
- this(Long.valueOf(l));
- }
-
- public SimpleDisplayable(float f) {
- this(Float.valueOf(f));
- }
-
- public SimpleDisplayable(double d) {
- this(Double.valueOf(d));
- }
-
-
- // ********** Displayable implementation **********
-
- public String displayString() {
- return this.object.toString();
- }
-
- public Icon icon() {
- return null;
- }
-
-
- // ********** accessors **********
-
- public Object getObject() {
- return this.object;
- }
-
- public void setObject(Object object) {
- String oldDisplayString = this.displayString();
- Icon oldIcon = this.icon();
- this.object = object;
- this.firePropertyChanged(DISPLAY_STRING_PROPERTY, oldDisplayString, this.displayString());
- this.firePropertyChanged(ICON_PROPERTY, oldIcon, this.icon());
- }
-
- public boolean getBoolean() {
- return ((Boolean) this.object).booleanValue();
- }
-
- public void setBoolean(boolean b) {
- this.setObject(Boolean.valueOf(b));
- }
-
- public char getChar() {
- return ((Character) this.object).charValue();
- }
-
- public void setChar(char c) {
- this.setObject(Character.valueOf(c));
- }
-
- public byte getByte() {
- return ((Byte) this.object).byteValue();
- }
-
- public void setByte(byte b) {
- this.setObject(Byte.valueOf(b));
- }
-
- public short getShort() {
- return ((Short) this.object).shortValue();
- }
-
- public void setShort(short s) {
- this.setObject(Short.valueOf(s));
- }
-
- public int getInt() {
- return ((Integer) this.object).intValue();
- }
-
- public void setInt(int i) {
- this.setObject(Integer.valueOf(i));
- }
-
- public long getLong() {
- return ((Long) this.object).longValue();
- }
-
- public void setLong(long l) {
- this.setObject(Long.valueOf(l));
- }
-
- public float getFloat() {
- return ((Float) this.object).floatValue();
- }
-
- public void setFloat(float f) {
- this.setObject(Float.valueOf(f));
- }
-
- public double getDouble() {
- return ((Double) this.object).doubleValue();
- }
-
- public void setDouble(double d) {
- this.setObject(Double.valueOf(d));
- }
-
-
- // ********** override methods **********
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.object);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java
deleted file mode 100644
index b61c557adf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListBrowser.java
+++ /dev/null
@@ -1,86 +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.utility.internal.swing;
-
-import javax.swing.Icon;
-import javax.swing.JComboBox;
-import javax.swing.JOptionPane;
-import javax.swing.ListModel;
-
-/**
- * This implementation of ListChooser.Browser uses a
- * JOptionPane to prompt the user for the selection. Subclasses
- * can change the dialog's title, message, and/or icon.
- */
-public class SimpleListBrowser
- implements ListChooser.ListBrowser
-{
- /** Default constructor */
- protected SimpleListBrowser() {
- super();
- }
-
- /**
- * Prompt the user using a JOptionPane.
- */
- public void browse(ListChooser chooser) {
- Object selection =
- JOptionPane.showInputDialog(
- chooser,
- this.message(chooser),
- this.title(chooser),
- this.messageType(chooser),
- this.icon(chooser),
- this.selectionValues(chooser),
- this.initialSelectionValue(chooser)
- );
-
- if (selection != null) {
- chooser.getModel().setSelectedItem(selection);
- }
- }
-
- protected Object message(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected String title(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected int messageType(@SuppressWarnings("unused") JComboBox comboBox) {
- return JOptionPane.QUESTION_MESSAGE;
- }
-
- protected Icon icon(@SuppressWarnings("unused") JComboBox comboBox) {
- return null;
- }
-
- protected Object[] selectionValues(JComboBox comboBox) {
- return this.convertToArray(comboBox.getModel());
- }
-
- protected Object initialSelectionValue(JComboBox comboBox) {
- return comboBox.getModel().getSelectedItem();
- }
-
- /**
- * Convert the list of objects in the specified list model
- * into an array.
- */
- protected Object[] convertToArray(ListModel model) {
- int size = model.getSize();
- Object[] result = new Object[size];
- for (int i = 0; i < size; i++) {
- result[i] = model.getElementAt(i);
- }
- return result;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java
deleted file mode 100644
index 56a609a6cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SimpleListCellRenderer.java
+++ /dev/null
@@ -1,128 +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.utility.internal.swing;
-
-import java.awt.Component;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.Icon;
-import javax.swing.JList;
-
-/**
- * This renderer should behave the same as the DefaultListCellRenderer;
- * but it slightly refactors the calculation of the icon and text of the list
- * cell so that subclasses can easily override the methods that build
- * the icon and text.
- *
- * In most cases, you need only override:
- * #buildIcon(Object value)
- * #buildText(Object value)
- */
-public class SimpleListCellRenderer
- extends DefaultListCellRenderer
-{
-
- /**
- * Construct a simple renderer.
- */
- public SimpleListCellRenderer() {
- super();
- }
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- // substitute null for the cell value so nothing is drawn initially...
- super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
- this.setOpaque(true);
-
- // ...then set the icon and text manually
- this.setIcon(this.buildIcon(list, value, index, isSelected, cellHasFocus));
- this.setText(this.buildText(list, value, index, isSelected, cellHasFocus));
-
- this.setToolTipText(this.buildToolTipText(list, value, index, isSelected, cellHasFocus));
-
- // the context will be initialized only if a reader is running
- if (this.accessibleContext != null) {
- this.accessibleContext.setAccessibleName(this.buildAccessibleName(list, value, index, isSelected, cellHasFocus));
- }
-
- return this;
- }
-
- /**
- * Return the icon representation of the specified cell
- * value and other settings. (Even more settings are
- * accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected Icon buildIcon(@SuppressWarnings("unused") JList list, Object value, @SuppressWarnings("unused") int index, @SuppressWarnings("unused") boolean isSelected, @SuppressWarnings("unused") boolean cellHasFocus) {
- return this.buildIcon(value);
- }
-
- /**
- * Return the icon representation of the specified cell
- * value. The default is to display no icon at all unless the
- * value itself is an icon.
- */
- protected Icon buildIcon(Object value) {
- // replicate the default behavior
- return (value instanceof Icon) ? (Icon) value : null;
- }
-
- /**
- * Return the textual representation of the specified cell
- * value and other settings. (Even more settings are
- * accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildText(@SuppressWarnings("unused") JList list, Object value, @SuppressWarnings("unused") int index, @SuppressWarnings("unused") boolean isSelected, @SuppressWarnings("unused") boolean cellHasFocus) {
- return this.buildText(value);
- }
-
- /**
- * Return the textual representation of the specified cell
- * value. The default is to display the object's default string
- * representation (as returned by #toString()); unless the
- * value itself is an icon, in which case no text is displayed.
- */
- protected String buildText(Object value) {
- return (value instanceof Icon) ? "" : ((value == null) ? "" : value.toString()); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Return the text displayed when the cursor lingers over the specified cell.
- * (Even more settings are accessible via inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildToolTipText(@SuppressWarnings("unused") JList list, Object value, @SuppressWarnings("unused") int index, @SuppressWarnings("unused") boolean isSelected, @SuppressWarnings("unused") boolean cellHasFocus) {
- return this.buildToolTipText(value);
- }
-
- /**
- * Return the text displayed when the cursor lingers over the specified cell.
- */
- protected String buildToolTipText(@SuppressWarnings("unused") Object value) {
- return null;
- }
-
- /**
- * Return the accessible name to be given to the component used to render
- * the given value and other settings. (Even more settings are accessible via
- * inherited getters: hasFocus, isEnabled, etc.)
- */
- protected String buildAccessibleName(@SuppressWarnings("unused") JList list, Object value, @SuppressWarnings("unused") int index, @SuppressWarnings("unused") boolean isSelected, @SuppressWarnings("unused") boolean cellHasFocus) {
- return this.buildAccessibleName(value);
- }
-
- /**
- * Return the accessible name to be given to the component used to render
- * the given value.
- */
- protected String buildAccessibleName(@SuppressWarnings("unused") Object value) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
deleted file mode 100644
index 8cd5d39b53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/SpinnerTableCellRenderer.java
+++ /dev/null
@@ -1,186 +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.utility.internal.swing;
-
-import java.awt.Color;
-import java.awt.Component;
-import javax.swing.BorderFactory;
-import javax.swing.JComponent;
-import javax.swing.JSpinner;
-import javax.swing.JTable;
-import javax.swing.SpinnerModel;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-/**
- * Make the cell look like a spinner.
- */
-public class SpinnerTableCellRenderer implements TableCellEditorAdapter.Renderer {
-
- /** the component used to paint the cell */
- protected JSpinner spinner;
-
- /** the listener to be notified on an immediate edit */
- protected TableCellEditorAdapter.ImmediateEditListener immediateEditListener;
-
-
- // ********** constructors/initialization **********
-
- /**
- * Construct a cell renderer that uses the default
- * spinner model, which is a "number" model.
- */
- public SpinnerTableCellRenderer() {
- super();
- this.initialize();
- }
-
- /**
- * Construct a cell renderer that uses the specified
- * spinner model, which will determine how the values are displayed.
- */
- public SpinnerTableCellRenderer(SpinnerModel model) {
- this();
- this.setModel(model);
- }
-
- protected void initialize() {
- this.spinner = this.buildSpinner();
- }
-
- protected JSpinner buildSpinner() {
- JSpinner s = new JSpinner();
- s.addChangeListener(this.buildChangeListener());
- return s;
- }
-
- private ChangeListener buildChangeListener() {
- return new ChangeListener() {
- public void stateChanged(ChangeEvent e) {
- if (SpinnerTableCellRenderer.this.immediateEditListener != null) {
- SpinnerTableCellRenderer.this.immediateEditListener.immediateEdit();
- }
- }
- };
- }
-
-
- // ********** TableCellRenderer implementation **********
-
- public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean hasFocus, int row, int column) {
- this.spinner.setComponentOrientation(table.getComponentOrientation());
- this.spinner.setFont(table.getFont());
- this.spinner.setEnabled(table.isEnabled());
-
- JComponent editor = this.editor();
- editor.setForeground(this.foregroundColor(table, value, selected, hasFocus, row, column));
- editor.setBackground(this.backgroundColor(table, value, selected, hasFocus, row, column));
- this.spinner.setBorder(this.border(table, value, selected, hasFocus, row, column));
-
- this.setValue(value);
- return this.spinner;
- }
-
- /**
- * Return the cell's foreground color.
- */
- protected Color foregroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellForeground"); //$NON-NLS-1$
- }
- return table.getSelectionForeground();
- }
- return table.getForeground();
- }
-
- /**
- * Return the cell's background color.
- */
- protected Color backgroundColor(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, int row, int column) {
- if (selected) {
- if (hasFocus && table.isCellEditable(row, column)) {
- return UIManager.getColor("Table.focusCellBackground"); //$NON-NLS-1$
- }
- return table.getSelectionBackground();
- }
- return table.getBackground();
- }
-
- /**
- * Return the cell's border.
- */
- protected Border border(JTable table, @SuppressWarnings("unused") Object value, boolean selected, boolean hasFocus, @SuppressWarnings("unused") int row, @SuppressWarnings("unused") int column) {
- if (hasFocus) {
- return UIManager.getBorder("Table.focusCellHighlightBorder"); //$NON-NLS-1$
- }
- if (selected) {
- return BorderFactory.createLineBorder(table.getSelectionBackground(), 1);
- }
- return BorderFactory.createLineBorder(table.getBackground(), 1);
- }
-
- /**
- * Return the editor component whose colors should be set
- * by the renderer.
- */
- protected JComponent editor() {
- JComponent editor = this.spinner.getEditor();
- if (editor instanceof JSpinner.DefaultEditor) {
- // typically, the editor will be the default or one of its subclasses...
- editor = ((JSpinner.DefaultEditor) editor).getTextField();
- }
- return editor;
- }
-
- /**
- * Set the spinner's value
- */
- protected void setValue(Object value) {
- // CR#3999318 - This null check needs to be removed once JDK bug is fixed
- if (value == null) {
- value = Integer.valueOf(0);
- }
- this.spinner.setValue(value);
- }
-
-
- // ********** TableCellEditorAdapter.Renderer implementation **********
-
- public Object getValue() {
- return this.spinner.getValue();
- }
-
- public void setImmediateEditListener(TableCellEditorAdapter.ImmediateEditListener listener) {
- this.immediateEditListener = listener;
- }
-
-
- // ********** public API **********
-
- /**
- * Set the spinner's model.
- */
- public void setModel(SpinnerModel model) {
- this.spinner.setModel(model);
- }
-
- /**
- * Return the renderer's preferred height. This allows you
- * to set the row height to something the spinner will look good in....
- */
- public int preferredHeight() {
- // add in space for the border top and bottom
- return (int) this.spinner.getPreferredSize().getHeight() + 2;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java
deleted file mode 100644
index 045b4a9a03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/swing/TableCellEditorAdapter.java
+++ /dev/null
@@ -1,96 +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.utility.internal.swing;
-
-import java.awt.Component;
-import javax.swing.AbstractCellEditor;
-import javax.swing.JTable;
-import javax.swing.table.TableCellEditor;
-import javax.swing.table.TableCellRenderer;
-
-/**
- * A table cell editor that wraps a table cell renderer.
- */
-public class TableCellEditorAdapter extends AbstractCellEditor implements TableCellEditor {
-
- /** delegate to a renderer */
- private Renderer renderer;
-
-
- // ********** constructors/initialization **********
-
- private TableCellEditorAdapter() {
- super();
- }
-
- /**
- * Construct a cell editor that behaves like the specified renderer.
- */
- public TableCellEditorAdapter(Renderer renderer) {
- this();
- this.initialize(renderer);
- }
-
- protected void initialize(Renderer r) {
- this.renderer = r;
- r.setImmediateEditListener(this.buildImmediateEditListener());
- }
-
- private ImmediateEditListener buildImmediateEditListener() {
- return new ImmediateEditListener() {
- public void immediateEdit() {
- TableCellEditorAdapter.this.stopCellEditing();
- }
- };
- }
-
-
- // ********** CellEditor implementation **********
-
- public Object getCellEditorValue() {
- return this.renderer.getValue();
- }
-
-
- // ********** TableCellEditor implementation **********
-
- public Component getTableCellEditorComponent(JTable table, Object value, boolean selected, int row, int column) {
- return this.renderer.getTableCellRendererComponent(table, value, selected, true, row, column);
- }
-
-
- // ********** Member classes **********************************************
-
- /**
- * This interface defines the methods that must be implemented by a renderer
- * that can be wrapped by a TableCellEditorAdapter.
- */
- public interface Renderer extends TableCellRenderer {
-
- /**
- * Return the current value of the renderer.
- */
- Object getValue();
-
- /**
- * Set the immediate edit listener
- */
- void setImmediateEditListener(ImmediateEditListener listener);
- }
-
-
- public interface ImmediateEditListener {
-
- /**
- * Called when the renderer does an "immediate edit"
- */
- void immediateEdit();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/AsynchronousSynchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/AsynchronousSynchronizer.java
deleted file mode 100644
index 379a11a489..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/AsynchronousSynchronizer.java
+++ /dev/null
@@ -1,187 +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.utility.internal.synchronizers;
-
-import java.util.concurrent.ThreadFactory;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.ConsumerThreadCoordinator;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-
-/**
- * This synchronizer will perform synchronizations in a separate thread,
- * allowing calls to {@link Synchronizer#synchronize()} to return immediately.
- * <p>
- * <strong>NB:</strong> The client-supplied command should handle any exceptions
- * appropriately (e.g. log the exception and return gracefully so the thread
- * can continue the synchronization process).
- */
-public class AsynchronousSynchronizer
- implements Synchronizer
-{
- /**
- * This flag is shared with the synchronization/consumer thread. Setting it to true
- * will trigger the synchronization to begin or, if the synchronization is
- * currently executing, to execute again, once the current execution is
- * complete.
- */
- final SynchronizedBoolean synchronizeFlag = new SynchronizedBoolean(false);
-
- /**
- * Most of the thread-related behavior is delegated to this coordinator.
- */
- private final ConsumerThreadCoordinator consumerThreadCoordinator;
-
-
- // ********** construction **********
-
- /**
- * Construct an asynchronous synchronizer that uses the specified command to
- * perform the synchronization.
- * Use simple JDK thread(s) for the synchronization thread(s).
- * Allow the synchronization thread(s) to be assigned
- * JDK-generated names.
- */
- public AsynchronousSynchronizer(Command command) {
- this(command, null, null);
- }
-
- /**
- * Construct an asynchronous synchronizer that uses the specified command to
- * perform the synchronization.
- * Use the specified thread factory to construct the synchronization thread(s).
- * Allow the synchronization thread(s) to be assigned
- * JDK-generated names.
- */
- public AsynchronousSynchronizer(Command command, ThreadFactory threadFactory) {
- this(command, threadFactory, null);
- }
-
- /**
- * Construct an asynchronous synchronizer that uses the specified command to
- * perform the synchronization. Assign the synchronization thread(s) the specified
- * name.
- * Use simple JDK thread(s) for the synchronization thread(s).
- */
- public AsynchronousSynchronizer(Command command, String threadName) {
- this(command, null, threadName);
- }
-
- /**
- * Construct an asynchronous synchronizer that uses the specified command to
- * perform the synchronization.
- * Use the specified thread factory to construct the synchronization thread(s).
- * Assign the synchronization thread(s) the specified
- * name.
- */
- public AsynchronousSynchronizer(Command command, ThreadFactory threadFactory, String threadName) {
- super();
- if (command == null) {
- throw new NullPointerException();
- }
- this.consumerThreadCoordinator = new ConsumerThreadCoordinator(this.buildConsumer(command), threadFactory, threadName);
- }
-
- ConsumerThreadCoordinator.Consumer buildConsumer(Command command) {
- return new Consumer(command);
- }
-
-
- // ********** Synchronizer implementation **********
-
- /**
- * Build and start the synchronization thread, but postpone the first
- * synchronization until requested, i.e. via a call to
- * {@link #synchronize()}.
- * <p>
- * Note: We don't clear the "synchronize" flag here; so if the flag has
- * been set <em>before</em> getting here, the first synchronization will
- * start promptly (albeit, asynchronously).
- * The "synchronize" flag will be set if:<ul>
- * <li>{@link #synchronize()} was called after the synchronizer was
- * constructed but before {@link #start()} was called; or
- * <li>{@link #synchronize()} was called after {@link #stop()} was called
- * but before {@link #start()} was called (to restart the synchronizer); or
- * <li>{@link #stop()} was called when there was an outstanding request
- * for a synchronization (i.e. the "synchronization" flag was set at
- * the time {@link #stop()} was called)
- * </ul>
- */
- public void start() {
- this.consumerThreadCoordinator.start();
- }
-
- /**
- * Set the "synchronize" flag so the synchronization thread will either<ul>
- * <li>if the thread is quiesced, start a synchronization immediately, or
- * <li>if the thread is currently executing a synchronization, execute another
- * synchronization once the current synchronization is complete
- * </ul>
- */
- public void synchronize() {
- this.synchronizeFlag.setTrue();
- }
-
- /**
- * Interrupt the synchronization thread so that it stops executing at the
- * end of the current synchronization. Suspend the current thread until
- * the synchronization thread is finished executing. If any uncaught
- * exceptions were thrown while the synchronization thread was executing,
- * wrap them in a composite exception and throw the composite exception.
- */
- public void stop() {
- this.consumerThreadCoordinator.stop();
- }
-
-
- // ********** consumer **********
-
- /**
- * This implementation of {@link ConsumerThreadCoordinator.Consumer}
- * will execute the client-supplied "synchronize" command.
- * It will wait until the shared "synchronize" flag is set to execute the
- * command. Once the comand is executed, the thread will quiesce until
- * the flag is set again. If the flag was set during the execution of the
- * command (either recursively by the command itself or by another thread),
- * the command will be re-executed immediately. Stop the thread by calling
- * {@link Thread#interrupt()}.
- */
- class Consumer
- implements ConsumerThreadCoordinator.Consumer
- {
- /**
- * The client-supplied command that executes on the
- * synchronization/consumer thread.
- */
- private final Command command;
-
- Consumer(Command command) {
- super();
- this.command = command;
- }
-
- /**
- * Wait until the "synchronize" flag is set,
- * then clear it and allow the "synchronize" command to execute.
- */
- public void waitForProducer() throws InterruptedException {
- AsynchronousSynchronizer.this.synchronizeFlag.waitToSetFalse();
- }
-
- /**
- * Execute the client-supplied command.
- */
- public void execute() {
- this.command.execute();
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackAsynchronousSynchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackAsynchronousSynchronizer.java
deleted file mode 100644
index 2c30a3241f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackAsynchronousSynchronizer.java
+++ /dev/null
@@ -1,119 +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.utility.internal.synchronizers;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.ConsumerThreadCoordinator;
-import org.eclipse.jpt.utility.internal.ListenerList;
-
-/**
- * Extend the asynchronous synchronizer to notify listeners
- * when a synchronization "cycle" is complete; i.e. the synchronization has,
- * for the moment, handled every outstanding "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.
- * <p>
- * <strong>NB:</strong> Listeners should handle any exceptions
- * appropriately (e.g. log the exception and return gracefully so the thread
- * can continue the synchronization process).
- */
-public class CallbackAsynchronousSynchronizer
- extends AsynchronousSynchronizer
- implements CallbackSynchronizer
-{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
-
-
- // ********** construction **********
-
- /**
- * Construct a callback asynchronous synchronizer that uses the specified
- * command to perform the synchronization. Allow the synchronization thread(s)
- * to be assigned JDK-generated names.
- */
- public CallbackAsynchronousSynchronizer(Command command) {
- super(command);
- }
-
- /**
- * Construct a callback asynchronous synchronizer that uses the specified
- * command to perform the synchronization. Assign the synchronization thread(s)
- * the specified name.
- */
- public CallbackAsynchronousSynchronizer(Command command, String threadName) {
- super(command, threadName);
- }
-
- /**
- * Build a consumer that will let us know when the synchronization has
- * quiesced.
- */
- @Override
- ConsumerThreadCoordinator.Consumer buildConsumer(Command command) {
- return new CallbackConsumer(command);
- }
-
-
- // ********** 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 thread runnable **********
-
- /**
- * Extend {@link AsynchronousSynchronizer.Consumer}
- * 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 is asynchronous, 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.utility.internal.synchronizers.Synchronizer#synchronize());
- * but this synchronization will not occur until <em>after</em> all the
- * listeners have been notified.
- */
- class CallbackConsumer
- extends Consumer
- {
- CallbackConsumer(Command command) {
- super(command);
- }
-
- @Override
- public void execute() {
- super.execute();
- // hmmm - we will notify listeners even when we our thread is "interrupted";
- // that seems ok... ~bjv
- if (CallbackAsynchronousSynchronizer.this.synchronizeFlag.isFalse()) {
- CallbackAsynchronousSynchronizer.this.synchronizationQuiesced();
- }
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronizer.java
deleted file mode 100644
index 441a06d342..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronizer.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.utility.internal.synchronizers;
-
-import java.util.EventListener;
-
-/**
- * Extend {@link Synchronizer} to notify listeners
- * when a synchronization "cycle" is complete; i.e. the synchronization has,
- * for the moment, quiesced.
- */
-public interface CallbackSynchronizer
- extends Synchronizer
-{
- /**
- * Add the specified listener to be notified whenever the synchronizer has
- * quiesced.
- * @see #removeListener(Listener)
- */
- void addListener(Listener listener);
-
- /**
- * Remove the specified listener.
- * @see #addListener(Listener)
- */
- void removeListener(Listener listener);
-
-
- // ********** listener **********
-
- /**
- * Interface implemented by listeners to be notified whenever the
- * synchronizer has quiesced.
- */
- public interface Listener
- extends EventListener
- {
- /**
- * The specified synchronizer has quiesced.
- */
- void synchronizationQuiesced(CallbackSynchronizer synchronizer);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronousSynchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronousSynchronizer.java
deleted file mode 100644
index ab101511ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/CallbackSynchronousSynchronizer.java
+++ /dev/null
@@ -1,82 +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.utility.internal.synchronizers;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.ListenerList;
-
-/**
- * Extend the synchronous 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.
- * <p>
- * <strong>NB:</strong> If another synchronization is initiated while we are
- * notifying the synchronizer's listeners (i.e. the 'again' flag is set), it will not
- * start until all the listeners are notified.
- * Note also, the synchronizer's listeners can, themselves,
- * trigger another synchronization (by directly or indirectly calling
- * {@link org.eclipse.jpt.utility.internal.synchronizers.Synchronizer#synchronize());
- * but this synchronization will not occur until <em>after</em> all the
- * listeners have been notified.
- */
-public class CallbackSynchronousSynchronizer
- extends SynchronousSynchronizer
- implements CallbackSynchronizer
-{
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
-
-
- // ********** construction **********
-
- /**
- * Construct a callback synchronous synchronizer that uses the specified
- * command to perform the synchronization.
- */
- public CallbackSynchronousSynchronizer(Command command) {
- super(command);
- }
-
-
- // ********** CallbackSynchronizer implementation **********
-
- public void addListener(Listener listener) {
- this.listenerList.add(listener);
- }
-
- public void removeListener(Listener listener) {
- this.listenerList.remove(listener);
- }
-
- /**
- * Notify our listeners.
- */
- private void synchronizationQuiesced() {
- for (Listener listener : this.listenerList.getListeners()) {
- listener.synchronizationQuiesced(this);
- }
- }
-
-
- // ********** override **********
-
- @Override
- void execute_() {
- super.execute_();
- if (this.state.getValue() != State.REPEAT) {
- // hmmm - we will notify listeners even when we are "stopped";
- // that seems ok... ~bjv
- this.synchronizationQuiesced();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/Synchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/Synchronizer.java
deleted file mode 100644
index 7b5a459ec6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/Synchronizer.java
+++ /dev/null
@@ -1,83 +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.utility.internal.synchronizers;
-
-import java.io.Serializable;
-
-/**
- * This interface defines the protocol for starting, stopping, and executing a
- * long-running, repeatable, and possibly recursive "synchronization" process.
- * The intent is for the synchronizer to synchronize a "secondary" model with
- * a "primary" model. Any change to the "primary" model will trigger the
- * synchronization. The synchronizer implementation will determine whether the
- * "secondary" model remains in sync synchronously or asynchronously.
- * <p>
- * The assumption is that the {@link #start()} and {@link #stop()} methods will be called from
- * a single master thread that would control the synchronizer's lifecycle and
- * the {@link #synchronize()} method will be called multiple times, possibly from
- * multiple threads.
- */
-public interface Synchronizer {
-
- /**
- * Enable the synchronizer to allow future synchronizations as requested
- * by calls to {@link #synchronize()}.
- */
- void start();
-
- /**
- * Synchronize the dependent model with the primary model. Do nothing if
- * {@link #start()} has not previously been called. Do nothing if {@link #stop}
- * has been called (without any intermediate call to {@link #start()}.
- */
- void synchronize();
-
- /**
- * Stop the synchronizer immediately or, if a synchronization is currently
- * in progress, when it completes. Return when the synchronizer is stopped.
- * No further synchonizations will performed until {@link #start()} is called.
- */
- void stop();
-
-
- /**
- * Singleton implementation of the {@link Synchronizer} interface that will do
- * nothing.
- */
- final class Null implements Synchronizer, Serializable {
- public static final Synchronizer INSTANCE = new Null();
- public static Synchronizer instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void start() {
- // do nothing
- }
- public void synchronize() {
- // do nothing
- }
- public void stop() {
- // do nothing
- }
- @Override
- public String toString() {
- return "Synchronizer.Null"; //$NON-NLS-1$
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/SynchronousSynchronizer.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/SynchronousSynchronizer.java
deleted file mode 100644
index ea0c6090e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/internal/synchronizers/SynchronousSynchronizer.java
+++ /dev/null
@@ -1,263 +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.utility.internal.synchronizers;
-
-import java.util.Vector;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.CompositeException;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.SynchronizedObject;
-
-/**
- * This synchronizer will synchronize immediately and not return until the
- * synchronization and any nested (recursive) synchronizations are complete.
- * In some situations this implementation should be used sparingly, and for as
- * short a time as possible, as it increases the probability of deadlocks. A
- * deadlock can occur when {@link Synchronizer#synchronize()} is called from multiple
- * threads and multiple resources are locked by the synchronization in varying
- * orders.
- * <p>
- * As defined in the {@link Synchronizer} interface, {@link Synchronizer#start()}
- * and {@link Synchronizer#stop()}
- * should be called in the same thread, but it is not required.
- * {@link Synchronizer#synchronize()} should
- * always be called in the same thread (i.e. only recursively, beyond the
- * initial call); although, this too is not required.
- * This thread need not be the same thread that executes
- * {@link Synchronizer#start()} and {@link Synchronizer#stop()}.
- */
-public class SynchronousSynchronizer
- implements Synchronizer
-{
- /**
- * The client-supplied command that performs the synchronization. It may
- * trigger further calls to {@link #synchronize()} (i.e. the
- * synchronization may recurse).
- */
- private final Command command;
-
- /**
- * The synchronizer's current state.
- */
- final SynchronizedObject<State> state;
-
- /**
- * The synchronizer's initial state is {@link #STOPPED}.
- */
- enum State {
- STOPPED,
- READY,
- EXECUTING,
- REPEAT,
- STOPPING
- }
-
- /**
- * A list of the uncaught exceptions thrown by the command.
- */
- final Vector<Throwable> exceptions = new Vector<Throwable>();
-
-
- // ********** construction **********
-
- /**
- * Construct a synchronous synchronizer that uses the specified command to
- * perform the synchronization.
- */
- public SynchronousSynchronizer(Command command) {
- super();
- if (command == null) {
- throw new NullPointerException();
- }
- this.command = command;
- // use the synchronizer as the mutex so it is freed up by the wait in #stop()
- this.state = new SynchronizedObject<State>(State.STOPPED, this);
- }
-
-
- // ********** Synchronizer implementation **********
-
- /**
- * Set the synchronizer's {@link #state} to {@link State#READY READY}
- * and execute the first synchronization. Throw an exception if the
- * synchronizer is not {@link State#STOPPED STOPPED}.
- */
- public synchronized void start() {
- switch (this.state.getValue()) {
- case STOPPED:
- this.state.setValue(State.READY);
- this.synchronize();
- break;
- case READY:
- case EXECUTING:
- case REPEAT:
- case STOPPING:
- default:
- throw this.buildIllegalStateException();
- }
- }
-
- /**
- * It's possible to come back here if the synchronization command recurses
- * and triggers another synchronization.
- */
- public void synchronize() {
- if (this.beginSynchronization()) {
- this.synchronize_();
- }
- }
-
- /**
- * A client has requested a synchronization.
- * Return whether we can begin a new synchronization.
- * If a synchronization is already under way, return <code>false</code>;
- * but set the {@link #state} to {@link State#REPEAT REPEAT}
- * so another synchronization will occur once the current
- * synchronization is complete.
- */
- private synchronized boolean beginSynchronization() {
- switch (this.state.getValue()) {
- case STOPPED:
- // synchronization is not allowed
- return false;
- case READY:
- // begin a new synchronization
- this.state.setValue(State.EXECUTING);
- return true;
- case EXECUTING:
- // set flag so a new synchronization will occur once the current one is finished
- this.state.setValue(State.REPEAT);
- return false;
- case REPEAT:
- // the "repeat" flag is already set
- return false;
- case STOPPING:
- // no further synchronizations are allowed
- return false;
- default:
- throw this.buildIllegalStateException();
- }
- }
-
- /**
- * This method should be called only once per set of "recursing"
- * synchronizations. Any recursive call to {@link #synchronize()} will
- * simply set the {@link #state} to {@link State#REPEAT REPEAT},
- * causing the command to execute again.
- */
- private void synchronize_() {
- do {
- this.execute();
- } while (this.endSynchronization());
- }
-
- /**
- * Execute the client-supplied command. Do not allow any unhandled
- * exceptions to kill the thread. Store them up for later pain.
- */
- private void execute() {
- try {
- this.execute_();
- } catch (Throwable ex) {
- this.exceptions.add(ex);
- }
- }
-
- /**
- * By default, just execute the command.
- */
- void execute_() {
- this.command.execute();
- }
-
- /**
- * The current synchronization has finished.
- * Return whether we should begin another synchronization.
- */
- private synchronized boolean endSynchronization() {
- switch (this.state.getValue()) {
- case STOPPED:
- case READY:
- throw this.buildIllegalStateException();
- case EXECUTING:
- // synchronization has finished and there are no outstanding requests for another; return to "ready"
- this.state.setValue(State.READY);
- return false;
- case REPEAT:
- // the "repeat" flag was set; clear it and start another synchronization
- this.state.setValue(State.EXECUTING);
- return true;
- case STOPPING:
- // a client has initiated a "stop"; mark the "stop" complete and perform no more synchronizations
- this.state.setValue(State.STOPPED);
- return false;
- default:
- throw this.buildIllegalStateException();
- }
- }
-
- /**
- * Set the flags so that no further synchronizations occur. If any uncaught
- * exceptions were thrown while the synchronization was executing,
- * wrap them in a composite exception and throw the composite exception.
- */
- public synchronized void stop() {
- switch (this.state.getValue()) {
- case STOPPED:
- throw this.buildIllegalStateException();
- case READY:
- // simply return to "stopped" state
- this.state.setValue(State.STOPPED);
- break;
- case EXECUTING:
- case REPEAT:
- // set the "stopping" flag and wait until the synchronization has finished
- this.state.setValue(State.STOPPING);
- this.waitUntilStopped();
- break;
- case STOPPING:
- throw this.buildIllegalStateException();
- default:
- throw this.buildIllegalStateException();
- }
-
- if (this.exceptions.size() > 0) {
- Throwable[] temp = this.exceptions.toArray(new Throwable[this.exceptions.size()]);
- this.exceptions.clear();
- throw new CompositeException(temp);
- }
- }
-
- /**
- * This wait will free up the synchronizer's synchronized methods
- * (since the synchronizer is the state's mutex).
- */
- private void waitUntilStopped() {
- try {
- this.state.waitUntilValueIs(State.STOPPED);
- } catch (InterruptedException ex) {
- // the thread that called #stop() was interrupted while waiting
- // for the synchronization to finish - ignore;
- // 'state' is still set to 'STOPPING', so the #synchronize_() loop
- // will still stop - we just won't wait around for it...
- }
- }
-
- private IllegalStateException buildIllegalStateException() {
- return new IllegalStateException("state: " + this.state); //$NON-NLS-1$
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.state);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
deleted file mode 100644
index 422532b48f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/Model.java
+++ /dev/null
@@ -1,143 +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.utility.model;
-
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-
-/**
- * Interface to be implemented by models that notify listeners of
- * changes to bound properties, collections, lists, and/or trees.
- * <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 ChangeListener
- * @see StateChangeListener
- * @see PropertyChangeListener
- * @see CollectionChangeListener
- * @see ListChangeListener
- * @see TreeChangeListener
- * @see org.eclipse.jpt.utility.internal.model.AbstractModel
- */
-// TODO use objects (IDs?) instead of strings to identify aspects?
-public interface Model {
-
- // ********** change **********
-
- /**
- * Add a listener that listens to all change events.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addChangeListener(ChangeListener listener);
-
- /**
- * Remove the specified change listener.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removeChangeListener(ChangeListener listener);
-
-
- // ********** state change **********
-
- /**
- * Add a listener that listens to all state change events.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addStateChangeListener(StateChangeListener listener);
-
- /**
- * Remove the specified state change listener.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removeStateChangeListener(StateChangeListener listener);
-
-
- // ********** property change **********
-
- /**
- * Add a listener that listens to all property change events with
- * the specified property name.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addPropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
- /**
- * Remove a listener that listens to all property change events,
- * with the specified property name.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removePropertyChangeListener(String propertyName, PropertyChangeListener listener);
-
-
- // ********** collection change **********
-
- /**
- * Add a listener that listens to all collection change events with
- * the specified collection name.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addCollectionChangeListener(String collectionName, CollectionChangeListener listener);
-
- /**
- * Remove a listener that listens to all collection change events,
- * with the specified collection name.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removeCollectionChangeListener(String collectionName, CollectionChangeListener listener);
-
-
- // ********** list change **********
-
- /**
- * Add a listener that listens to all list change events with
- * the specified list name.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addListChangeListener(String listName, ListChangeListener listener);
-
- /**
- * Remove a listener that listens to all list change events,
- * with the specified list name.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removeListChangeListener(String listName, ListChangeListener listener);
-
-
- // ********** tree change **********
-
- /**
- * Add a listener that listens to all tree change events with
- * the specified tree name.
- * Throw an exception if the same listener is added more than once.
- * The listener cannot be null.
- */
- void addTreeChangeListener(String treeName, TreeChangeListener listener);
-
- /**
- * Remove a listener that listens to all tree change events,
- * with the specified tree name.
- * Throw an exception if the listener is null or if the listener was never added.
- */
- void removeTreeChangeListener(String treeName, TreeChangeListener listener);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java
deleted file mode 100644
index 890a9b82ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ChangeEvent.java
+++ /dev/null
@@ -1,66 +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.utility.model.event;
-
-import java.util.EventObject;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Abstract class for all the change events that can be fired by models.
- * <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 abstract class ChangeEvent extends EventObject {
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a new change event.
- *
- * @param source The object on which the event initially occurred.
- */
- protected ChangeEvent(Model source) {
- super(source);
- }
-
- /**
- * Covariant override.
- */
- @Override
- public Model getSource() {
- return (Model) super.getSource();
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- StringTools.buildSimpleToStringOn(this, sb);
- sb.append('(');
- int len = sb.length();
- this.toString(sb);
- if (sb.length() == len) {
- sb.deleteCharAt(len - 1);
- } else {
- sb.append(')');
- }
- return sb.toString();
- }
-
- protected void toString(@SuppressWarnings("unused") StringBuilder sb) {
- // subclasses should override this to do something a bit more helpful
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionAddEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionAddEvent.java
deleted file mode 100644
index 6968141f27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionAddEvent.java
+++ /dev/null
@@ -1,124 +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.utility.model.event;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection add" event gets delivered whenever a model adds items to a
- * "bound" or "constrained" collection. A <code>CollectionAddEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.CollectionChangeListener}.
- * <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.
- */
-/*
- * Design options:
- * - create a collection to wrap a single added or removed item
- * (this is the option we implemented below and in collaborating code)
- * since there is no way to optimize downstream code for
- * single items, we take another performance hit by building
- * a collection each time (@see Collections#singleton(Object))
- * and forcing downstream code to use an iterator every time
- *
- * - fire a separate event for each item added or removed
- * eliminates any potential for optimizations to downstream code
- *
- * - add protocol to support both single items and collections
- * adds conditional logic to downstream code
- */
-public final class CollectionAddEvent extends CollectionEvent {
-
- /** The items added to the collection. */
- private final Object[] items;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new collection add event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- * @param item The item added to the collection.
- */
- public CollectionAddEvent(Model source, String collectionName, Object item) {
- this(source, collectionName, new Object[] {item});
- }
-
- /**
- * Construct a new collection add event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- * @param items The items added to the collection.
- */
- public CollectionAddEvent(Model source, String collectionName, Collection<?> items) {
- this(source, collectionName, items.toArray()); // NPE if 'items' is null
- }
-
- private CollectionAddEvent(Model source, String collectionName, Object[] items) {
- super(source, collectionName);
- this.items = items;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the items added to the collection.
- */
- public Iterable<?> getItems() {
- return new ArrayIterable<Object>(this.items);
- }
-
- /**
- * Return the number of items added to the collection.
- */
- public int getItemsSize() {
- return this.items.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.items);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public CollectionAddEvent clone(Model newSource) {
- return this.clone(newSource, this.collectionName);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionAddEvent clone(Model newSource, String newCollectionName) {
- return new CollectionAddEvent(newSource, newCollectionName, this.items);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.java
deleted file mode 100644
index 0c2f4e0459..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionChangeEvent.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.utility.model.event;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection change" event gets delivered whenever a model changes a "bound"
- * or "constrained" collection in a manner that is not easily characterized by
- * the other collection events.
- * A <code>CollectionChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.CollectionChangeListener}.
- * A <code>CollectionChangeEvent</code> is accompanied by the collection name and
- * the current state of the collection.
- * <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 final class CollectionChangeEvent extends CollectionEvent {
-
- /**
- * The the collection in its current state.
- * Clients will need to calculate the necessary changes to synchronize
- * with the collection.
- */
- private final Object[] collection;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new collection change event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- */
- public CollectionChangeEvent(Model source, String collectionName, Collection<?> collection) {
- this(source, collectionName, collection.toArray()); // NPE if 'collection' is null
- }
-
- private CollectionChangeEvent(Model source, String collectionName, Object[] collection) {
- super(source, collectionName);
- this.collection = collection;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the current state of the collection.
- */
- public Iterable<?> getCollection() {
- return new ArrayIterable<Object>(this.collection);
- }
-
- /**
- * Return the number of items in the current state of the collection.
- */
- public int getCollectionSize() {
- return this.collection.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.collection);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public CollectionChangeEvent clone(Model newSource) {
- return this.clone(newSource, this.collectionName);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionChangeEvent clone(Model newSource, String newCollectionName) {
- return new CollectionChangeEvent(newSource, newCollectionName, this.collection);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionClearEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionClearEvent.java
deleted file mode 100644
index a982639701..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionClearEvent.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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection clear" event gets delivered whenever a model clears
- * a "bound" or "constrained" collection. A <code>CollectionClearEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.CollectionChangeListener}.
- * <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 final class CollectionClearEvent extends CollectionEvent {
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new collection clear event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- */
- public CollectionClearEvent(Model source, String collectionName) {
- super(source, collectionName);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public CollectionClearEvent clone(Model newSource) {
- return this.clone(newSource, this.collectionName);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionClearEvent clone(Model newSource, String newCollectionName) {
- return new CollectionClearEvent(newSource, newCollectionName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionEvent.java
deleted file mode 100644
index c6393b324e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionEvent.java
+++ /dev/null
@@ -1,63 +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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-// TODO add "item/original/nested event" for item changed?
-/**
- * A "collection" event gets delivered whenever a model changes a "bound"
- * or "constrained" collection. A <code>CollectionEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.CollectionChangeListener}.
- * The intent is that any listener
- * can keep itself synchronized with the model's collection via the collection
- * events it receives and need not maintain a reference to the original
- * collection.
- * <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 abstract class CollectionEvent extends ChangeEvent {
-
- /** Name of the collection that changed. */
- final String collectionName;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a new collection event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- */
- public CollectionEvent(Model source, String collectionName) {
- super(source);
- if (collectionName == null) {
- throw new NullPointerException();
- }
- this.collectionName = collectionName;
- }
-
- /**
- * Return the programmatic name of the collection that was changed.
- */
- public String getCollectionName() {
- return this.collectionName;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- sb.append(this.collectionName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionRemoveEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionRemoveEvent.java
deleted file mode 100644
index 7ed877e088..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/CollectionRemoveEvent.java
+++ /dev/null
@@ -1,112 +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.utility.model.event;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "collection remove" event gets delivered whenever a model removes items
- * from a "bound" or "constrained" collection. A <code>CollectionRemoveEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.CollectionChangeListener}.
- * <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.
- */
-/*
- * See design discussion in CollectionAddEvent
- */
-public final class CollectionRemoveEvent extends CollectionEvent {
-
- /** The items removed from the collection. */
- private final Object[] items;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new collection remove event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- * @param item The item removed from the collection.
- */
- public CollectionRemoveEvent(Model source, String collectionName, Object item) {
- this(source, collectionName, new Object[] {item});
- }
-
- /**
- * Construct a new collection remove event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the collection that was changed.
- * @param items The items removed from the collection.
- */
- public CollectionRemoveEvent(Model source, String collectionName, Collection<?> items) {
- this(source, collectionName, items.toArray()); // NPE if 'items' is null
- }
-
- private CollectionRemoveEvent(Model source, String collectionName, Object[] items) {
- super(source, collectionName);
- this.items = items;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the items removed from the collection.
- */
- public Iterable<?> getItems() {
- return new ArrayIterable<Object>(this.items);
- }
-
- /**
- * Return the number of items removed from the collection.
- */
- public int getItemsSize() {
- return this.items.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.items);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public CollectionRemoveEvent clone(Model newSource) {
- return this.clone(newSource, this.collectionName);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public CollectionRemoveEvent clone(Model newSource, String newCollectionName) {
- return new CollectionRemoveEvent(newSource, newCollectionName, this.items);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListAddEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListAddEvent.java
deleted file mode 100644
index 6736c4d948..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListAddEvent.java
+++ /dev/null
@@ -1,134 +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.utility.model.event;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list add" event gets delivered whenever a model adds items to a
- * "bound" or "constrained" list. A <code>ListAddEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * <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.
- */
-/*
- * See design discussion in CollectionAddEvent
- */
-public final class ListAddEvent extends ListEvent {
-
- /** The index at which the items were added. */
- private final int index;
-
- /** The items added to the list. */
- private final Object[] items;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new list add event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the items were added.
- * @param item The item added to the list.
- */
- public ListAddEvent(Model source, String listName, int index, Object item) {
- this(source, listName, index, new Object[] {item});
- }
-
- /**
- * Construct a new list add event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the items were added.
- * @param items The items added to the list.
- */
- public ListAddEvent(Model source, String listName, int index, List<?> items) {
- this(source, listName, index, items.toArray()); // NPE if 'items' is null
- }
-
- private ListAddEvent(Model source, String listName, int index, Object[] items) {
- super(source, listName);
- this.index = index;
- this.items = items;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the index at which the items were added to the list.
- */
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Return the items added to the list.
- */
- public Iterable<?> getItems() {
- return new ArrayIterable<Object>(this.items);
- }
-
- /**
- * Return the number of items added to the list.
- */
- public int getItemsSize() {
- return this.items.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.items);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListAddEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListAddEvent clone(Model newSource, String newListName) {
- return this.clone(newSource, newListName, 0);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name and displacing
- * the index by the specified amount.
- */
- public ListAddEvent clone(Model newSource, String newListName, int offset) {
- return new ListAddEvent(newSource, newListName, this.index + offset, this.items);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.java
deleted file mode 100644
index 33cbb9a415..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListChangeEvent.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.utility.model.event;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list change" event gets delivered whenever a model changes a "bound"
- * or "constrained" list in a manner that is not easily characterized by
- * the other list events.
- * A <code>ListChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * A <code>ListChangeEvent</code> is accompanied by the list name and
- * the current state of the list.
- * <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 final class ListChangeEvent extends ListEvent {
-
- /**
- * The the list in its current state.
- * Clients will need to calculate the necessary changes to synchronize
- * with the list.
- */
- private final Object[] list;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new list change event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- */
- public ListChangeEvent(Model source, String listName, List<?> list) {
- this(source, listName, list.toArray()); // NPE if 'list' is null
- }
-
- private ListChangeEvent(Model source, String listName, Object[] list) {
- super(source, listName);
- this.list = list;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the current state of the list.
- */
- public Iterable<?> getList() {
- return new ArrayIterable<Object>(this.list);
- }
-
- /**
- * Return the number of items in the current state of the list.
- */
- public int getListSize() {
- return this.list.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.list);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListChangeEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListChangeEvent clone(Model newSource, String newListName) {
- return new ListChangeEvent(newSource, newListName, this.list);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListClearEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListClearEvent.java
deleted file mode 100644
index f0c32f144c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListClearEvent.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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list clear" event gets delivered whenever a model clears
- * a "bound" or "constrained" list. A <code>ListClearEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * <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 final class ListClearEvent extends ListEvent {
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- /**
- * Construct a new list clear event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- */
- public ListClearEvent(Model source, String listName) {
- super(source, listName);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListClearEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListClearEvent clone(Model newSource, String newListName) {
- return new ListClearEvent(newSource, newListName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListEvent.java
deleted file mode 100644
index 7a3d383a1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListEvent.java
+++ /dev/null
@@ -1,64 +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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-// TODO add "item/original/nested event" for item changed?
-/**
- * A "list" event gets delivered whenever a model changes a "bound"
- * or "constrained" list. A <code>ListEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * The intent is that any listener
- * can keep itself synchronized with the model's list via the list
- * events it receives and need not maintain a reference to the original
- * list.
- * <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 ListEvent extends ChangeEvent {
-
- /** Name of the list that changed. */
- final String listName;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a new list event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- */
- public ListEvent(Model source, String listName) {
- super(source);
- if (listName == null) {
- throw new NullPointerException();
- }
- this.listName = listName;
- }
-
- /**
- * Return the programmatic name of the list that was changed.
- */
- public String getListName() {
- return this.listName;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- sb.append(this.listName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListMoveEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListMoveEvent.java
deleted file mode 100644
index 2de5c7a988..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListMoveEvent.java
+++ /dev/null
@@ -1,120 +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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list move" event gets delivered whenever a model moves the elements in
- * a "bound" or "constrained" list. A <code>ListMoveEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * <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 final class ListMoveEvent extends ListEvent {
-
- /** The index to which the items were moved. */
- private final int targetIndex;
-
- /** The index from which the items were moved. */
- private final int sourceIndex;
-
- /** The number of items moved. */
- private final int length;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- /**
- * Construct a new list move event.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param targetIndex The index to which the items were moved.
- * @param sourceIndex The index from which the items were moved.
- * @param length The number of items moved.
- */
- public ListMoveEvent(Model source, String listName, int targetIndex, int sourceIndex, int length) {
- super(source, listName);
- this.targetIndex = targetIndex;
- this.sourceIndex = sourceIndex;
- this.length = length;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the index to which the items were moved.
- */
- public int getTargetIndex() {
- return this.targetIndex;
- }
-
- /**
- * Return the index from which the items were moved.
- */
- public int getSourceIndex() {
- return this.sourceIndex;
- }
-
- /**
- * Return the number of items moved.
- */
- public int getLength() {
- return this.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- sb.append(this.sourceIndex);
- sb.append(" => "); //$NON-NLS-1$
- sb.append(this.targetIndex);
- sb.append(" length="); //$NON-NLS-1$
- sb.append(this.length);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListMoveEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListMoveEvent clone(Model newSource, String newListName) {
- return this.clone(newSource, newListName, 0);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name and displacing
- * the index by the specified amount.
- */
- public ListMoveEvent clone(Model newSource, String newListName, int offset) {
- return new ListMoveEvent(newSource, newListName, this.targetIndex + offset, this.sourceIndex + offset, this.length);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListRemoveEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListRemoveEvent.java
deleted file mode 100644
index 4666967aa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListRemoveEvent.java
+++ /dev/null
@@ -1,134 +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.utility.model.event;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list remove" event gets delivered whenever a model removes items
- * from a "bound" or "constrained" list. A <code>ListRemoveEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * <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.
- */
-/*
- * See design discussion in CollectionAddEvent
- */
-public final class ListRemoveEvent extends ListEvent {
-
- /** The index at which the items were removed. */
- private final int index;
-
- /** The items removed from the list. */
- private final Object[] items;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new list remove event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the list that was changed.
- * @param index The index at which the items were removed.
- * @param item The item removed from the list.
- */
- public ListRemoveEvent(Model source, String listName, int index, Object item) {
- this(source, listName, index, new Object[] {item});
- }
-
- /**
- * Construct a new list remove event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the list that was changed.
- * @param index The index at which the items were removed.
- * @param items The items removed from the list.
- */
- public ListRemoveEvent(Model source, String listName, int index, Collection<?> items) {
- this(source, listName, index, items.toArray()); // NPE if 'items' is null
- }
-
- private ListRemoveEvent(Model source, String listName, int index, Object[] items) {
- super(source, listName);
- this.index = index;
- this.items = items;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the index at which the items were removed from the list.
- */
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Return the items removed from the list.
- */
- public Iterable<?> getItems() {
- return new ArrayIterable<Object>(this.items);
- }
-
- /**
- * Return the number of items removed from the list.
- */
- public int getItemsSize() {
- return this.items.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.items);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListRemoveEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListRemoveEvent clone(Model newSource, String newListName) {
- return this.clone(newSource, newListName, 0);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name and displacing
- * the index by the specified amount.
- */
- public ListRemoveEvent clone(Model newSource, String newListName, int offset) {
- return new ListRemoveEvent(newSource, newListName, this.index + offset, this.items);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListReplaceEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListReplaceEvent.java
deleted file mode 100644
index 602aa40c99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/ListReplaceEvent.java
+++ /dev/null
@@ -1,150 +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.utility.model.event;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "list replace" event gets delivered whenever a model replaces items in a
- * "bound" or "constrained" list. A <code>ListReplaceEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.ListChangeListener}.
- * <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 final class ListReplaceEvent extends ListEvent {
-
- /** The index at which the items were replaced. */
- private final int index;
-
- /** The new items that replaced the old items in the list. */
- private final Object[] newItems;
-
- /** The old items that were replaced by the new items in the list. */
- private final Object[] oldItems;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new list replace event for a list of replaced items.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the item in the list was replaced.
- * @param newItem The new item in the list.
- * @param oldItem The old item in the list that were replaced.
- */
- public ListReplaceEvent(Model source, String listName, int index, Object newItem, Object oldItem) {
- this(source, listName, index, new Object[] {newItem}, new Object[] {oldItem});
- }
-
- /**
- * Construct a new list replace event for a list of replaced items.
- *
- * @param source The object on which the event initially occurred.
- * @param listName The programmatic name of the list that was changed.
- * @param index The index at which the items in the list were replaced.
- * @param newItems The new items in the list.
- * @param oldItems The old items in the list that were replaced.
- */
- public ListReplaceEvent(Model source, String listName, int index, List<?> newItems, List<?> oldItems) {
- this(source, listName, index, newItems.toArray(), oldItems.toArray()); // NPE if either 'newItems' or 'oldItems' is null
- }
-
- private ListReplaceEvent(Model source, String listName, int index, Object[] newItems, Object[] oldItems) {
- super(source, listName);
- if (newItems.length != oldItems.length) {
- throw new IllegalArgumentException("sizes must match - new items size: " + newItems.length //$NON-NLS-1$
- + " old items size: " + oldItems.length); //$NON-NLS-1$
- }
- this.index = index;
- this.newItems = newItems;
- this.oldItems = oldItems;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the index at which the items were replaced in the list.
- */
- public int getIndex() {
- return this.index;
- }
-
- /**
- * Return the new items that replaced the old items in the list.
- */
- public Iterable<?> getNewItems() {
- return new ArrayIterable<Object>(this.newItems);
- }
-
- /**
- * Return the old items that were replaced by the new items in the list.
- */
- public Iterable<?> getOldItems() {
- return new ArrayIterable<Object>(this.oldItems);
- }
-
- /**
- * Return the number of items that were replaced.
- */
- public int getItemsSize() {
- return this.newItems.length;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- super.toString(sb);
- sb.append(": "); //$NON-NLS-1$
- StringTools.append(sb, this.oldItems);
- sb.append(" => "); //$NON-NLS-1$
- StringTools.append(sb, this.newItems);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public ListReplaceEvent clone(Model newSource) {
- return this.clone(newSource, this.listName);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name.
- */
- public ListReplaceEvent clone(Model newSource, String newListName) {
- return this.clone(newSource, newListName, 0);
- }
-
- /**
- * Return a copy of the event with the specified source and list name
- * replacing the current source and list name and displacing
- * the index by the specified amount.
- */
- public ListReplaceEvent clone(Model newSource, String newListName, int offset) {
- return new ListReplaceEvent(newSource, newListName, this.index + offset, this.newItems, this.oldItems);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java
deleted file mode 100644
index 718695a4f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/PropertyChangeEvent.java
+++ /dev/null
@@ -1,109 +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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "property change" event gets delivered whenever a model changes a "bound"
- * or "constrained" property. A <code>PropertyChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.PropertyChangeListener}.
- * A <code>PropertyChangeEvent</code> is accompanied by the old and new values
- * of the property.
- * <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 final class PropertyChangeEvent extends ChangeEvent {
-
- /** Name of the property that changed. */
- private final String propertyName;
-
- /** The property's old value, before the change. */
- private final Object oldValue;
-
- /** The property's new value, after the change. */
- private final Object newValue;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new property change event.
- *
- * @param source The object on which the event initially occurred.
- * @param propertyName The programmatic name of the property that was changed.
- * @param oldValue The old value of the property.
- * @param newValue The new value of the property.
- */
- public PropertyChangeEvent(Model source, String propertyName, Object oldValue, Object newValue) {
- super(source);
- if (propertyName == null) {
- throw new NullPointerException();
- }
- this.propertyName = propertyName;
- this.oldValue = oldValue;
- this.newValue = newValue;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the programmatic name of the property that was changed.
- */
- public String getPropertyName() {
- return this.propertyName;
- }
-
- /**
- * Return the old value of the property.
- */
- public Object getOldValue() {
- return this.oldValue;
- }
-
- /**
- * Return the new value of the property.
- */
- public Object getNewValue() {
- return this.newValue;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- sb.append(this.propertyName);
- sb.append(": "); //$NON-NLS-1$
- sb.append(this.oldValue);
- sb.append(" => "); //$NON-NLS-1$
- sb.append(this.newValue);
- }
-
-
- // ********** cloning **********
-
- public PropertyChangeEvent clone(Model newSource) {
- return new PropertyChangeEvent(newSource, this.propertyName, this.oldValue, this.newValue);
- }
-
- /**
- * Return a copy of the event with the specified source and property name
- * replacing the current source and property name.
- */
- public PropertyChangeEvent clone(Model newSource, String newPropertyName) {
- return new PropertyChangeEvent(newSource, newPropertyName, this.oldValue, this.newValue);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java
deleted file mode 100644
index d5154df3de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/StateChangeEvent.java
+++ /dev/null
@@ -1,51 +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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A generic "state change" event gets delivered whenever a model changes to
- * such extent that it cannot be delineated all aspects of it that have changed.
- * Any listener can synchronize with the model as necessary since the model is
- * available as the event's 'source'.
- * A <code>StateChangeEvent</code> is sent as an argument to the
- * {@link org.eclipse.jpt.utility.model.listener.StateChangeListener}.
- * <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 final class StateChangeEvent extends ChangeEvent {
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new state change event.
- *
- * @param source The object on which the event initially occurred.
- */
- public StateChangeEvent(Model source) {
- super(source);
- }
-
-
- // ********** cloning **********
-
- public StateChangeEvent clone(Model newSource) {
- return new StateChangeEvent(newSource);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeAddEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeAddEvent.java
deleted file mode 100644
index 3441822f67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeAddEvent.java
+++ /dev/null
@@ -1,81 +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.utility.model.event;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree add" event gets delivered whenever a model adds a node to a "bound"
- * or "constrained" tree. A <code>TreeChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.TreeChangeListener}.
- * <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 final class TreeAddEvent extends TreeEvent {
-
- /**
- * Path to the node added to the tree.
- */
- protected final Object[] path;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new tree add event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- * @param path The path to the part of the tree that was added.
- */
- public TreeAddEvent(Model source, String treeName, List<?> path) {
- this(source, treeName, path.toArray()); // NPE if 'path' is null
- }
-
- private TreeAddEvent(Model source, String treeName, Object[] path) {
- super(source, treeName);
- this.path = path;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the path to the part of the tree that was added.
- */
- public Iterable<?> getPath() {
- return new ArrayIterable<Object>(this.path);
- }
-
-
- // ********** cloning **********
-
- public TreeAddEvent clone(Model newSource) {
- return this.clone(newSource, this.treeName);
- }
-
- /**
- * Return a copy of the event with the specified source and tree name
- * replacing the current source and tree name.
- */
- public TreeAddEvent clone(Model newSource, String newTreeName) {
- return new TreeAddEvent(newSource, newTreeName, this.path);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java
deleted file mode 100644
index 78b9a8f2f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeChangeEvent.java
+++ /dev/null
@@ -1,90 +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.utility.model.event;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree change" event gets delivered whenever a model changes a "bound"
- * or "constrained" tree in a manner that is not easily characterized by
- * the other tree events.
- * A <code>TreeChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.TreeChangeListener}.
- * <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 final class TreeChangeEvent extends TreeEvent {
-
- /**
- * The current nodes in the changed tree.
- */
- protected final Object[] nodes;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructor **********
-
- /**
- * Construct a new tree change event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- * @param nodes The current nodes in the changed tree.
- */
- public TreeChangeEvent(Model source, String treeName, Collection<?> nodes) {
- this(source, treeName, nodes.toArray()); // NPE if 'nodes' is null
- }
-
- private TreeChangeEvent(Model source, String treeName, Object[] nodes) {
- super(source, treeName);
- this.nodes = nodes;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the current nodes in the changed tree.
- */
- public Iterable<?> getNodes() {
- return new ArrayIterable<Object>(this.nodes);
- }
-
- /**
- * Return the current nodes in the changed tree.
- */
- public int getNodesSize() {
- return this.nodes.length;
- }
-
-
- // ********** cloning **********
-
- public TreeChangeEvent clone(Model newSource) {
- return this.clone(newSource, this.treeName);
- }
-
- /**
- * Return a copy of the event with the specified source and tree name
- * replacing the current source and tree name.
- */
- public TreeChangeEvent clone(Model newSource, String newTreeName) {
- return new TreeChangeEvent(newSource, newTreeName, this.nodes);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeClearEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeClearEvent.java
deleted file mode 100644
index 0c80dbe376..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeClearEvent.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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree clear" event gets delivered whenever a model clears
- * a "bound" or "constrained" tree. A <code>TreeClearEvent</code> is sent
- * as an argument to the {@link org.eclipse.jpt.utility.model.listener.TreeChangeListener}.
- * <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 final class TreeClearEvent extends TreeEvent {
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new tree clear event.
- *
- * @param source The object on which the event initially occurred.
- * @param collectionName The programmatic name of the tree that was changed.
- */
- public TreeClearEvent(Model source, String treeName) {
- super(source, treeName);
- }
-
-
- // ********** cloning **********
-
- /**
- * Return a copy of the event with the specified source
- * replacing the current source.
- */
- public TreeClearEvent clone(Model newSource) {
- return this.clone(newSource, this.treeName);
- }
-
- /**
- * Return a copy of the event with the specified source and collection name
- * replacing the current source and collection name.
- */
- public TreeClearEvent clone(Model newSource, String newCollectionName) {
- return new TreeClearEvent(newSource, newCollectionName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeEvent.java
deleted file mode 100644
index 72e763094d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeEvent.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.utility.model.event;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree" event gets delivered whenever a model changes a "bound"
- * or "constrained" tree. A <code>TreeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.TreeChangeListener}.
- * The intent is that any listener
- * can keep itself synchronized with the model's tree via the tree events
- * it receives and need not maintain a reference to the original tree.
- * <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 abstract class TreeEvent extends ChangeEvent {
-
- /** Name of the tree that changed. */
- final String treeName;
-
- private static final long serialVersionUID = 1L;
-
-
- /**
- * Construct a new tree event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- */
- public TreeEvent(Model source, String treeName) {
- super(source);
- if (treeName == null) {
- throw new NullPointerException();
- }
- this.treeName = treeName;
- }
-
- /**
- * Return the programmatic name of the tree that was changed.
- */
- public String getTreeName() {
- return this.treeName;
- }
-
- @Override
- protected void toString(StringBuilder sb) {
- sb.append(this.treeName);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeRemoveEvent.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeRemoveEvent.java
deleted file mode 100644
index ba4da15bba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/event/TreeRemoveEvent.java
+++ /dev/null
@@ -1,81 +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.utility.model.event;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * A "tree remove" event gets delivered whenever a model removes a node rom a
- * "bound" or "constrained" tree. A <code>TreeChangeEvent</code> is sent as an
- * argument to the {@link org.eclipse.jpt.utility.model.listener.TreeChangeListener}.
- * <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 final class TreeRemoveEvent extends TreeEvent {
-
- /**
- * Path to the node removed from the tree.
- */
- protected final Object[] path;
-
- private static final long serialVersionUID = 1L;
-
-
- // ********** constructors **********
-
- /**
- * Construct a new tree remove event.
- *
- * @param source The object on which the event initially occurred.
- * @param treeName The programmatic name of the tree that was changed.
- * @param path The path to the part of the tree that was removed.
- */
- public TreeRemoveEvent(Model source, String treeName, List<?> path) {
- this(source, treeName, path.toArray()); // NPE if 'path' is null
- }
-
- private TreeRemoveEvent(Model source, String treeName, Object[] path) {
- super(source, treeName);
- this.path = path;
- }
-
-
- // ********** standard state **********
-
- /**
- * Return the path to the part of the tree that was removed.
- */
- public Iterable<?> getPath() {
- return new ArrayIterable<Object>(this.path);
- }
-
-
- // ********** cloning **********
-
- public TreeRemoveEvent clone(Model newSource) {
- return this.clone(newSource, this.treeName);
- }
-
- /**
- * Return a copy of the event with the specified source and tree name
- * replacing the current source and tree name.
- */
- public TreeRemoveEvent clone(Model newSource, String newTreeName) {
- return new TreeRemoveEvent(newSource, newTreeName, this.path);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeAdapter.java
deleted file mode 100644
index 27060d73de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeAdapter.java
+++ /dev/null
@@ -1,109 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * Convenience implementation of {@link ChangeListener}.
- * <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 ChangeAdapter implements ChangeListener {
-
- // ***** state
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
-
- // ***** property
- public void propertyChanged(PropertyChangeEvent event) {
- // do nothing
- }
-
- // ***** collection
- public void itemsAdded(CollectionAddEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- // do nothing
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- // do nothing
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- // do nothing
- }
-
- // ***** list
- public void itemsAdded(ListAddEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- // do nothing
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- // do nothing
- }
-
- public void itemsMoved(ListMoveEvent event) {
- // do nothing
- }
-
- public void listCleared(ListClearEvent event) {
- // do nothing
- }
-
- public void listChanged(ListChangeEvent event) {
- // do nothing
- }
-
- // ***** tree
- public void nodeAdded(TreeAddEvent event) {
- // do nothing
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- // do nothing
- }
-
- public void treeCleared(TreeClearEvent event) {
- // do nothing
- }
-
- public void treeChanged(TreeChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java
deleted file mode 100644
index 3ff58e1502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ChangeListener.java
+++ /dev/null
@@ -1,25 +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.utility.model.listener;
-
-/**
- * General purpose change listener.
- * <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 ChangeListener
- extends StateChangeListener, PropertyChangeListener, CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- // combine the other listener interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java
deleted file mode 100644
index cf75b914b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeAdapter.java
+++ /dev/null
@@ -1,51 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-
-/**
- * Convenience implementation of {@link CollectionChangeListener}.
- * <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 CollectionChangeAdapter implements CollectionChangeListener {
-
- /**
- * Default constructor.
- */
- public CollectionChangeAdapter() {
- super();
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- // do nothing
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- // do nothing
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java
deleted file mode 100644
index c88b5c5d97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CollectionChangeListener.java
+++ /dev/null
@@ -1,65 +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.utility.model.listener;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-
-/**
- * A "collection change" event gets fired whenever a model changes a "bound"
- * collection. You can register a <code>CollectionChangeListener</code> with a source
- * model so as to be notified of any bound collection updates.
- * <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 CollectionChangeListener extends EventListener {
-
- /**
- * This method gets called when items are added to a bound collection.
- *
- * @param event An event describing the event source,
- * the collection that changed, and the items that were added.
- */
- void itemsAdded(CollectionAddEvent event);
-
- /**
- * This method gets called when items are removed from a bound collection.
- *
- * @param event An event describing the event source,
- * the collection that changed, and the items that were removed.
- */
- void itemsRemoved(CollectionRemoveEvent event);
-
- /**
- * This method gets called when a bound collection is cleared.
- *
- * @param event An event describing the event source
- * and the collection that changed.
- */
- void collectionCleared(CollectionClearEvent event);
-
- /**
- * This method gets called when a bound collection is changed in a manner
- * that is not easily characterized by the other methods in this interface.
- *
- * @param event An event describing the event source
- * and the collection that changed.
- */
- void collectionChanged(CollectionChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CommandChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CommandChangeListener.java
deleted file mode 100644
index 07da34c1f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/CommandChangeListener.java
+++ /dev/null
@@ -1,44 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.Command;
-
-/**
- * Convenience implementation of {@link ChangeListener}.
- * All change notifications are funneled through a single command.
- * <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 CommandChangeListener
- extends SimpleChangeListener
-{
- protected final Command command;
-
- /**
- * Construct a change listener that executes the specified command whenever
- * it receives any change notification from the model to which it is added
- * as a listener.
- */
- public CommandChangeListener(Command command) {
- super();
- this.command = command;
- }
-
- @Override
- protected void modelChanged() {
- this.command.execute();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
deleted file mode 100644
index 0af86fea69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeAdapter.java
+++ /dev/null
@@ -1,61 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-
-/**
- * Convenience implementation of {@link ListChangeListener}.
- * <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 ListChangeAdapter implements ListChangeListener {
-
- /**
- * Default constructor.
- */
- public ListChangeAdapter() {
- super();
- }
-
- public void itemsAdded(ListAddEvent event) {
- // do nothing
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- // do nothing
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- // do nothing
- }
-
- public void itemsMoved(ListMoveEvent event) {
- // do nothing
- }
-
- public void listCleared(ListClearEvent event) {
- // do nothing
- }
-
- public void listChanged(ListChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java
deleted file mode 100644
index 863873ddd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ListChangeListener.java
+++ /dev/null
@@ -1,87 +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.utility.model.listener;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-
-/**
- * A "list change" event gets fired whenever a model changes a "bound"
- * list. You can register a <code>ListChangeListener</code> with a source
- * model so as to be notified of any bound list updates.
- * <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 ListChangeListener extends EventListener {
-
- /**
- * This method gets called when items are added to a bound list.
- *
- * @param event An event describing the event source,
- * the list that changed, the items that were added, and the index
- * at which the items were added.
- */
- void itemsAdded(ListAddEvent event);
-
- /**
- * This method gets called when items are removed from a bound list.
- *
- * @param event An event describing the event source,
- * the list that changed, the items that were removed, and the index
- * at which the items were removed.
- */
- void itemsRemoved(ListRemoveEvent event);
-
- /**
- * This method gets called when items in a bound list are replaced.
- *
- * @param event An event describing the event source,
- * the list that changed, the items that were added, the items that were
- * replaced, and the index at which the items were replaced.
- */
- void itemsReplaced(ListReplaceEvent event);
-
- /**
- * This method gets called when items in a bound list are moved.
- *
- * @param event An event describing the event source,
- * the list that changed, and the indices of where items were moved
- * from and to.
- */
- void itemsMoved(ListMoveEvent event);
-
- /**
- * This method gets called when a bound list is cleared.
- *
- * @param event A ListClearEvent object describing the event source
- * and the list that changed.
- */
- void listCleared(ListClearEvent event);
-
- /**
- * This method gets called when a bound list is changed in a manner
- * that is not easily characterized by the other methods in this interface.
- *
- * @param event A ListChangeEvent object describing the event source
- * and the list that changed.
- */
- void listChanged(ListChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.java
deleted file mode 100644
index 5dbdd8f904..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/MultiMethodReflectiveChangeListener.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.utility.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * This class is used by {@link ReflectiveChangeListener} when the requested listener
- * needs to implement multiple methods (i.e. {@link CollectionChangeListener},
- * {@link ListChangeListener}, or {@link TreeChangeListener}).
- */
-class MultiMethodReflectiveChangeListener
- extends ReflectiveChangeListener
- implements CollectionChangeListener, ListChangeListener, TreeChangeListener
-{
- /** the methods we will invoke on the target object */
- private final Method addMethod;
- private final Method removeMethod;
- private final Method replaceMethod; // this can be null
- private final Method moveMethod; // this can be null
- private final Method clearMethod;
- private final Method changeMethod;
-
-
- /**
- * The "replace" and "move" methods are optional.
- */
- MultiMethodReflectiveChangeListener(Object target, Method addMethod, Method removeMethod, Method replaceMethod, Method moveMethod, Method clearMethod, Method changeMethod) {
- super(target);
- this.addMethod = addMethod;
- this.removeMethod = removeMethod;
- this.replaceMethod = replaceMethod;
- this.moveMethod = moveMethod;
- this.clearMethod = clearMethod;
- this.changeMethod = changeMethod;
- }
-
- /**
- * No "replace" or "move" methods.
- */
- MultiMethodReflectiveChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- this(target, addMethod, removeMethod, null, null, clearMethod, changeMethod);
- }
-
-
- // ********** CollectionChangeListener implementation **********
-
- private void invoke(Method method, CollectionEvent event) {
- if (method.getParameterTypes().length == 0) {
- ReflectionTools.executeMethod(method, this.target, EMPTY_OBJECT_ARRAY);
- } else {
- ReflectionTools.executeMethod(method, this.target, new CollectionEvent[] {event});
- }
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** ListChangeListener implementation **********
-
- private void invoke(Method method, ListEvent event) {
- if (method.getParameterTypes().length == 0) {
- ReflectionTools.executeMethod(method, this.target, EMPTY_OBJECT_ARRAY);
- } else {
- ReflectionTools.executeMethod(method, this.target, new ListEvent[] {event});
- }
- }
-
- public void itemsAdded(ListAddEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- this.invoke(this.replaceMethod, event);
- }
-
- public void itemsMoved(ListMoveEvent event) {
- this.invoke(this.moveMethod, event);
- }
-
- public void listCleared(ListClearEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void listChanged(ListChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-
- // ********** TreeChangeListener implementation **********
-
- private void invoke(Method method, TreeEvent event) {
- if (method.getParameterTypes().length == 0) {
- ReflectionTools.executeMethod(method, this.target, EMPTY_OBJECT_ARRAY);
- } else {
- ReflectionTools.executeMethod(method, this.target, new TreeEvent[] {event});
- }
- }
-
- public void nodeAdded(TreeAddEvent event) {
- this.invoke(this.addMethod, event);
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- this.invoke(this.removeMethod, event);
- }
-
- public void treeCleared(TreeClearEvent event) {
- this.invoke(this.clearMethod, event);
- }
-
- public void treeChanged(TreeChangeEvent event) {
- this.invoke(this.changeMethod, event);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java
deleted file mode 100644
index 800bdf6858..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeAdapter.java
+++ /dev/null
@@ -1,31 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-
-/**
- * Convenience implementation of {@link PropertyChangeListener}.
- * This is probably of limited use, since there only a single method to implement;
- * maybe as a null implementation.
- * <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 PropertyChangeAdapter implements PropertyChangeListener {
-
- public void propertyChanged(PropertyChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.java
deleted file mode 100644
index 1c9d40395b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/PropertyChangeListener.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.utility.model.listener;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-
-/**
- * A "property change" event gets fired whenever a model changes a "bound"
- * property. You can register a <code>PropertyChangeListener</code> with a source
- * model so as to be notified of any bound property updates.
- * <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 PropertyChangeListener extends EventListener {
-
- /**
- * This method gets called when a model has changed a bound property.
- *
- * @param event An event describing the event source
- * and the property's old and new values.
- */
- void propertyChanged(PropertyChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java
deleted file mode 100644
index 4840d56ac7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/ReflectiveChangeListener.java
+++ /dev/null
@@ -1,377 +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.utility.model.listener;
-
-import java.lang.reflect.Method;
-
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * This factory builds listeners that reflectively forward change events.
- * If you are worried about having too many little classes that have to be
- * loaded and maintained by the class loader, you can use one of these.
- * Of course, this comes with the additional overhead of reflection....
- * Also note that the validity of the method name is not checked at compile
- * time, but at runtime; although we <em>do</em> check the method as soon as the
- * listener is instantiated.
- * <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 abstract class ReflectiveChangeListener {
-
- /** the target object on which we will invoke the method */
- protected final Object target;
-
-
- protected static final Class<StateChangeEvent> STATE_CHANGE_EVENT_CLASS = StateChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<StateChangeEvent>[] STATE_CHANGE_EVENT_CLASS_ARRAY = new Class[] {STATE_CHANGE_EVENT_CLASS};
-
-
- protected static final Class<PropertyChangeEvent> PROPERTY_CHANGE_EVENT_CLASS = PropertyChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<PropertyChangeEvent>[] PROPERTY_CHANGE_EVENT_CLASS_ARRAY = new Class[] {PROPERTY_CHANGE_EVENT_CLASS};
-
-
- protected static final Class<CollectionEvent> COLLECTION_EVENT_CLASS = CollectionEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionEvent>[] COLLECTION_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_EVENT_CLASS};
-
- protected static final Class<CollectionAddEvent> COLLECTION_ADD_EVENT_CLASS = CollectionAddEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionAddEvent>[] COLLECTION_ADD_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_ADD_EVENT_CLASS};
-
- protected static final Class<CollectionRemoveEvent> COLLECTION_REMOVE_EVENT_CLASS = CollectionRemoveEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionRemoveEvent>[] COLLECTION_REMOVE_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_REMOVE_EVENT_CLASS};
-
- protected static final Class<CollectionClearEvent> COLLECTION_CLEAR_EVENT_CLASS = CollectionClearEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionClearEvent>[] COLLECTION_CLEAR_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_CLEAR_EVENT_CLASS};
-
- protected static final Class<CollectionChangeEvent> COLLECTION_CHANGE_EVENT_CLASS = CollectionChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<CollectionChangeEvent>[] COLLECTION_CHANGE_EVENT_CLASS_ARRAY = new Class[] {COLLECTION_CHANGE_EVENT_CLASS};
-
-
- protected static final Class<ListEvent> LIST_EVENT_CLASS = ListEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListEvent>[] LIST_EVENT_CLASS_ARRAY = new Class[] {LIST_EVENT_CLASS};
-
- protected static final Class<ListAddEvent> LIST_ADD_EVENT_CLASS = ListAddEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListAddEvent>[] LIST_ADD_EVENT_CLASS_ARRAY = new Class[] {LIST_ADD_EVENT_CLASS};
-
- protected static final Class<ListRemoveEvent> LIST_REMOVE_EVENT_CLASS = ListRemoveEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListRemoveEvent>[] LIST_REMOVE_EVENT_CLASS_ARRAY = new Class[] {LIST_REMOVE_EVENT_CLASS};
-
- protected static final Class<ListReplaceEvent> LIST_REPLACE_EVENT_CLASS = ListReplaceEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListReplaceEvent>[] LIST_REPLACE_EVENT_CLASS_ARRAY = new Class[] {LIST_REPLACE_EVENT_CLASS};
-
- protected static final Class<ListMoveEvent> LIST_MOVE_EVENT_CLASS = ListMoveEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListMoveEvent>[] LIST_MOVE_EVENT_CLASS_ARRAY = new Class[] {LIST_MOVE_EVENT_CLASS};
-
- protected static final Class<ListClearEvent> LIST_CLEAR_EVENT_CLASS = ListClearEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListClearEvent>[] LIST_CLEAR_EVENT_CLASS_ARRAY = new Class[] {LIST_CLEAR_EVENT_CLASS};
-
- protected static final Class<ListChangeEvent> LIST_CHANGE_EVENT_CLASS = ListChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<ListChangeEvent>[] LIST_CHANGE_EVENT_CLASS_ARRAY = new Class[] {LIST_CHANGE_EVENT_CLASS};
-
-
- protected static final Class<TreeEvent> TREE_EVENT_CLASS = TreeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeEvent>[] TREE_EVENT_CLASS_ARRAY = new Class[] {TREE_EVENT_CLASS};
-
- protected static final Class<TreeAddEvent> TREE_ADD_EVENT_CLASS = TreeAddEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeAddEvent>[] TREE_ADD_EVENT_CLASS_ARRAY = new Class[] {TREE_ADD_EVENT_CLASS};
-
- protected static final Class<TreeRemoveEvent> TREE_REMOVE_EVENT_CLASS = TreeRemoveEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeRemoveEvent>[] TREE_REMOVE_EVENT_CLASS_ARRAY = new Class[] {TREE_REMOVE_EVENT_CLASS};
-
- protected static final Class<TreeClearEvent> TREE_CLEAR_EVENT_CLASS = TreeClearEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeClearEvent>[] TREE_CLEAR_EVENT_CLASS_ARRAY = new Class[] {TREE_CLEAR_EVENT_CLASS};
-
- protected static final Class<TreeChangeEvent> TREE_CHANGE_EVENT_CLASS = TreeChangeEvent.class;
- @SuppressWarnings("unchecked")
- protected static final Class<TreeChangeEvent>[] TREE_CHANGE_EVENT_CLASS_ARRAY = new Class[] {TREE_CHANGE_EVENT_CLASS};
-
- protected static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-
-
- // ********** helper methods **********
-
- /**
- * Find and return a method implemented by the target that can be invoked
- * reflectively when a change event occurs.
- */
- private static Method findChangeListenerMethod(Object target, String methodName, Class<? extends ChangeEvent>[] eventClassArray) {
- try {
- return ReflectionTools.getMethod(target, methodName, eventClassArray);
- } catch (RuntimeException ex1) {
- return ReflectionTools.getMethod(target, methodName);
- }
- }
-
- /**
- * Check whether the specified method is suitable for being invoked when a
- * change event has occurred. Throw an exception if it is not suitable.
- */
- private static void checkChangeListenerMethod(Method method, Class<? extends ChangeEvent> eventClass) {
- Class<?>[] parmTypes = method.getParameterTypes();
- int parmTypesLength = parmTypes.length;
- if (parmTypesLength == 0) {
- return;
- }
- if ((parmTypesLength == 1) && parmTypes[0].isAssignableFrom(eventClass)) {
- return;
- }
- throw new IllegalArgumentException(method.toString());
- }
-
-
- // ********** factory methods: StateChangeListener **********
-
- /**
- * Construct a state change listener that will invoke the specified method
- * on the specified target.
- */
- public static StateChangeListener buildStateChangeListener(Object target, Method method) {
- checkChangeListenerMethod(method, STATE_CHANGE_EVENT_CLASS);
- return new SingleMethodReflectiveChangeListener(target, method);
- }
-
- /**
- * Construct a state change listener that will invoke the specified method
- * on the specified target. If a single-argument method with the specified
- * name and appropriate argument is found, it will be invoked; otherwise,
- * a zero-argument method with the specified name will be invoked.
- */
- public static StateChangeListener buildStateChangeListener(Object target, String methodName) {
- return buildStateChangeListener(target, findChangeListenerMethod(target, methodName, STATE_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: PropertyChangeListener **********
-
- /**
- * Construct a property change listener that will invoke the specified method
- * on the specified target.
- */
- public static PropertyChangeListener buildPropertyChangeListener(Object target, Method method) {
- checkChangeListenerMethod(method, PROPERTY_CHANGE_EVENT_CLASS);
- return new SingleMethodReflectiveChangeListener(target, method);
- }
-
- /**
- * Construct a property change listener that will invoke the specified method
- * on the specified target. If a single-argument method with the specified
- * name and appropriate argument is found, it will be invoked; otherwise,
- * a zero-argument method with the specified name will be invoked.
- */
- public static PropertyChangeListener buildPropertyChangeListener(Object target, String methodName) {
- return buildPropertyChangeListener(target, findChangeListenerMethod(target, methodName, PROPERTY_CHANGE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: CollectionChangeListener **********
-
- /**
- * Construct a collection change listener that will invoke the specified methods
- * on the specified target.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, COLLECTION_ADD_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, COLLECTION_REMOVE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, COLLECTION_CLEAR_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, COLLECTION_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a collection change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, Method method) {
- return buildCollectionChangeListener(target, method, method, method, method);
- }
-
- /**
- * Construct a collection change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, String addMethodName, String removeMethodName, String clearMethodName, String changeMethodName) {
- return buildCollectionChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, COLLECTION_ADD_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, COLLECTION_REMOVE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, COLLECTION_CLEAR_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, COLLECTION_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a collection change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static CollectionChangeListener buildCollectionChangeListener(Object target, String methodName) {
- return buildCollectionChangeListener(target, findChangeListenerMethod(target, methodName, COLLECTION_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: ListChangeListener **********
-
- /**
- * Construct a list change listener that will invoke the specified methods
- * on the specified target.
- */
- public static ListChangeListener buildListChangeListener(Object target, Method addMethod, Method removeMethod, Method replaceMethod, Method moveMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, LIST_ADD_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, LIST_REMOVE_EVENT_CLASS);
- checkChangeListenerMethod(replaceMethod, LIST_REPLACE_EVENT_CLASS);
- checkChangeListenerMethod(moveMethod, LIST_MOVE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, LIST_CLEAR_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, LIST_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, replaceMethod, moveMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a list change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static ListChangeListener buildListChangeListener(Object target, Method method) {
- return buildListChangeListener(target, method, method, method, method, method, method);
- }
-
- /**
- * Construct a list change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static ListChangeListener buildListChangeListener(Object target, String addMethodName, String removeMethodName, String replaceMethodName, String moveMethodName, String clearMethodName, String changeMethodName) {
- return buildListChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, LIST_ADD_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, LIST_REMOVE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, replaceMethodName, LIST_REPLACE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, moveMethodName, LIST_MOVE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, LIST_CLEAR_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, LIST_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a list change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static ListChangeListener buildListChangeListener(Object target, String methodName) {
- return buildListChangeListener(target, findChangeListenerMethod(target, methodName, LIST_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** factory methods: TreeChangeListener **********
-
- /**
- * Construct a tree change listener that will invoke the specified methods
- * on the specified target.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, Method addMethod, Method removeMethod, Method clearMethod, Method changeMethod) {
- checkChangeListenerMethod(addMethod, TREE_ADD_EVENT_CLASS);
- checkChangeListenerMethod(removeMethod, TREE_REMOVE_EVENT_CLASS);
- checkChangeListenerMethod(clearMethod, TREE_CLEAR_EVENT_CLASS);
- checkChangeListenerMethod(changeMethod, TREE_CHANGE_EVENT_CLASS);
- return new MultiMethodReflectiveChangeListener(target, addMethod, removeMethod, clearMethod, changeMethod);
- }
-
- /**
- * Construct a tree change listener that will invoke the specified method
- * on the specified target for any change event.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, Method method) {
- return buildTreeChangeListener(target, method, method, method, method);
- }
-
- /**
- * Construct a tree change listener that will invoke the specified methods
- * on the specified target for change events. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, String addMethodName, String removeMethodName, String clearMethodName, String changeMethodName) {
- return buildTreeChangeListener(
- target,
- findChangeListenerMethod(target, addMethodName, TREE_ADD_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, removeMethodName, TREE_REMOVE_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, clearMethodName, TREE_CLEAR_EVENT_CLASS_ARRAY),
- findChangeListenerMethod(target, changeMethodName, TREE_CHANGE_EVENT_CLASS_ARRAY)
- );
- }
-
- /**
- * Construct a tree change listener that will invoke the specified method
- * on the specified target for any change event. If a single-argument method
- * with the specified name and appropriate argument is found, it will be invoked;
- * otherwise, a zero-argument method with the specified name will be invoked.
- */
- public static TreeChangeListener buildTreeChangeListener(Object target, String methodName) {
- return buildTreeChangeListener(target, findChangeListenerMethod(target, methodName, TREE_EVENT_CLASS_ARRAY));
- }
-
-
- // ********** constructor **********
-
- /**
- * Construct a listener that will invoke the specified method
- * on the specified target.
- */
- protected ReflectiveChangeListener(Object target) {
- super();
- this.target = target;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SimpleChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SimpleChangeListener.java
deleted file mode 100644
index 6f83d9040f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SimpleChangeListener.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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * Convenience abstract implementation of {@link ChangeListener}.
- * All change notifications are funneled through a single method.
- * This class can be used by
- * subclassing it and overriding either {@link #modelChanged(ChangeEvent)}
- * (if access to the event is required) or {@link #modelChanged()} (if access
- * to the event is not required).
- * <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 abstract class SimpleChangeListener
- implements ChangeListener
-{
- public SimpleChangeListener() {
- super();
- }
-
- public void stateChanged(StateChangeEvent event) {
- this.modelChanged(event);
- }
-
- public void propertyChanged(PropertyChangeEvent event) {
- this.modelChanged(event);
- }
-
- public void collectionChanged(CollectionChangeEvent event) {
- this.modelChanged(event);
- }
-
- public void collectionCleared(CollectionClearEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsAdded(CollectionAddEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsRemoved(CollectionRemoveEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsAdded(ListAddEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsMoved(ListMoveEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsRemoved(ListRemoveEvent event) {
- this.modelChanged(event);
- }
-
- public void itemsReplaced(ListReplaceEvent event) {
- this.modelChanged(event);
- }
-
- public void listChanged(ListChangeEvent event) {
- this.modelChanged(event);
- }
-
- public void listCleared(ListClearEvent event) {
- this.modelChanged(event);
- }
-
- public void nodeAdded(TreeAddEvent event) {
- this.modelChanged(event);
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- this.modelChanged(event);
- }
-
- public void treeChanged(TreeChangeEvent event) {
- this.modelChanged(event);
- }
-
- public void treeCleared(TreeClearEvent event) {
- this.modelChanged(event);
- }
-
- /**
- * The model has notified the listener of the change described by the
- * specified change event. By default the listener executes {@link #modelChanged()}.
- */
- protected void modelChanged(@SuppressWarnings("unused") ChangeEvent event) {
- this.modelChanged();
- }
-
- /**
- * The model has notified the listener of a change.
- * By default the listener throws an exception.
- */
- protected void modelChanged() {
- throw new RuntimeException("This method was not overridden."); //$NON-NLS-1$
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java
deleted file mode 100644
index 4d085431e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/SingleMethodReflectiveChangeListener.java
+++ /dev/null
@@ -1,60 +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.utility.model.listener;
-
-import java.lang.reflect.Method;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * This class is used by {@link ReflectiveChangeListener} when the requested listener
- * need only implement a single method (i.e. {@link StateChangeListener} or
- * {@link PropertyChangeListener}).
- */
-class SingleMethodReflectiveChangeListener
- extends ReflectiveChangeListener
- implements StateChangeListener, PropertyChangeListener
-{
-
- /** the method we will invoke on the target object */
- private final Method method;
- /** cache the number of arguments */
- private final boolean methodIsZeroArgument;
-
- SingleMethodReflectiveChangeListener(Object target, Method method) {
- super(target);
- this.method = method;
- this.methodIsZeroArgument = method.getParameterTypes().length == 0;
- }
-
-
- // ********** StateChangeListener implementation **********
-
- public void stateChanged(StateChangeEvent event) {
- if (this.methodIsZeroArgument) {
- ReflectionTools.executeMethod(this.method, this.target, EMPTY_OBJECT_ARRAY);
- } else {
- ReflectionTools.executeMethod(this.method, this.target, new StateChangeEvent[] {event});
- }
- }
-
-
- // ********** PropertyChangeListener implementation **********
-
- public void propertyChanged(PropertyChangeEvent event) {
- if (this.methodIsZeroArgument) {
- ReflectionTools.executeMethod(this.method, this.target, EMPTY_OBJECT_ARRAY);
- } else {
- ReflectionTools.executeMethod(this.method, this.target, new PropertyChangeEvent[] {event});
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java
deleted file mode 100644
index 76b78518ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeAdapter.java
+++ /dev/null
@@ -1,31 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * Convenience implementation of {@link StateChangeListener}.
- * This is probably of limited use, since there only a single method to implement;
- * maybe as a null implementation.
- * <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 StateChangeAdapter implements StateChangeListener {
-
- public void stateChanged(StateChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.java
deleted file mode 100644
index 10189ca2d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/StateChangeListener.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.utility.model.listener;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-
-/**
- * A generic "state change" event gets delivered whenever a model changes to
- * such extent that it cannot be delineated all aspects of it that have changed.
- * You can register a <code>StateChangeListener</code> with a source model so as to be notified
- * of any such 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.
- */
-public interface StateChangeListener extends EventListener {
-
- /**
- * This method gets called when a model has changed in some general fashion.
- *
- * @param event An event describing the event source.
- */
- void stateChanged(StateChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java
deleted file mode 100644
index 051328c90f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeAdapter.java
+++ /dev/null
@@ -1,51 +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.utility.model.listener;
-
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * Convenience implementation of {@link TreeChangeListener}.
- * <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 TreeChangeAdapter implements TreeChangeListener {
-
- /**
- * Default constructor.
- */
- public TreeChangeAdapter() {
- super();
- }
-
- public void nodeAdded(TreeAddEvent event) {
- // do nothing
- }
-
- public void nodeRemoved(TreeRemoveEvent event) {
- // do nothing
- }
-
- public void treeCleared(TreeClearEvent event) {
- // do nothing
- }
-
- public void treeChanged(TreeChangeEvent event) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java
deleted file mode 100644
index 42408ab769..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/listener/TreeChangeListener.java
+++ /dev/null
@@ -1,67 +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.utility.model.listener;
-
-import java.util.EventListener;
-
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-
-/**
- * A "tree change" event gets fired whenever a model changes a "bound"
- * tree. You can register a <code>TreeChangeListener</code> with a source
- * model so as to be notified of any bound tree updates.
- * <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 TreeChangeListener extends EventListener {
-
- /**
- * This method gets called when a node is added to a bound tree.
- *
- * @param event An event describing the event source,
- * the tree that changed, and the path to the node that was added.
- */
- void nodeAdded(TreeAddEvent event);
-
- /**
- * This method gets called when a node is removed from a bound tree.
- *
- * @param event An event describing the event source,
- * the tree that changed, and the path to the node that was removed.
- */
- void nodeRemoved(TreeRemoveEvent event);
-
- /**
- * This method gets called when a bound tree is cleared.
- *
- * @param event An event describing the event source,
- * the tree that changed, and an empty path.
- */
- void treeCleared(TreeClearEvent event);
-
- /**
- * This method gets called when a portion of a bound tree is changed in
- * a manner that is not easily characterized by the other methods in this
- * interface.
- *
- * @param event An event describing the event source,
- * the tree that changed, and the current state of the
- * tree that changed.
- */
- void treeChanged(TreeChangeEvent event);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java
deleted file mode 100644
index 445ade6808..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/CollectionValueModel.java
+++ /dev/null
@@ -1,42 +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.utility.model.value;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract collection accessing and
- * change notification and make it more pluggable.
- * <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.
- *
- * @param <E> the type of values held by the model
- */
-public interface CollectionValueModel<E>
- extends Model, Iterable<E>
-{
-
- /**
- * Return the collection's values.
- */
- Iterator<E> iterator();
- String VALUES = "values"; //$NON-NLS-1$
-
- /**
- * Return the size of the collection.
- */
- int size();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java
deleted file mode 100644
index 8f400d2716..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/ListValueModel.java
+++ /dev/null
@@ -1,57 +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.utility.model.value;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract list accessing and
- * change notification and make it more pluggable.
- * <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.
- *
- * @param <E> the type of values held by the list model
- */
-public interface ListValueModel<E>
- extends Model, Iterable<E>
-{
- /**
- * Return the list's values.
- */
- Iterator<E> iterator();
- String LIST_VALUES = "list values"; //$NON-NLS-1$
-
- /**
- * Return the list's values.
- */
- ListIterator<E> listIterator();
-
- /**
- * Return the size of the list.
- */
- int size();
-
- /**
- * Return the item at the specified index of the list.
- */
- E get(int index);
-
- /**
- * Return the list's values.
- */
- Object[] toArray();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java
deleted file mode 100644
index b375e9f3c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/PropertyValueModel.java
+++ /dev/null
@@ -1,36 +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.utility.model.value;
-
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract property accessing and
- * change notification and make it more pluggable.
- * <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.
- *
- * @param <T> the type of value held by the model
- */
-public interface PropertyValueModel<T>
- extends Model
-{
-
- /**
- * Return the property's value.
- */
- T getValue();
- String VALUE = "value"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java
deleted file mode 100644
index 643e34e894..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeNodeValueModel.java
+++ /dev/null
@@ -1,74 +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.utility.model.value;
-
-/**
- * Extend {@link WritablePropertyValueModel} to better support
- * {@link org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter}.
- * <p>
- * Implementors of this interface should fire a "state change" event
- * whenever the node's internal state changes in a way that the
- * tree listeners should be notified.
- * <p>
- * Implementors of this interface should also fire a "value property change"
- * event whenever the node's value changes. Typically, only nodes that
- * hold "primitive" data will fire this event.
- * <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.
- *
- * @param <T> the type of values held by the model
- *
- * @see org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel
- */
-public interface TreeNodeValueModel<T>
- extends WritablePropertyValueModel<T>
-{
-
- /**
- * Return the node's parent node; null if the node
- * is the root.
- */
- TreeNodeValueModel<T> parent();
-
- /**
- * Return the path to the node.
- */
- TreeNodeValueModel<T>[] path();
-
- /**
- * Return a list value model of the node's child nodes.
- */
- ListValueModel<TreeNodeValueModel<T>> childrenModel();
-
- /**
- * Return the node's child at the specified index.
- */
- TreeNodeValueModel<T> child(int index);
-
- /**
- * Return the size of the node's list of children.
- */
- int childrenSize();
-
- /**
- * Return the index in the node's list of children of the specified child.
- */
- int indexOfChild(TreeNodeValueModel<T> child);
-
- /**
- * Return whether the node is a leaf (i.e. it has no children)
- */
- boolean isLeaf();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java
deleted file mode 100644
index 9dfa6fad19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/TreeValueModel.java
+++ /dev/null
@@ -1,36 +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.utility.model.value;
-
-import java.util.Iterator;
-import org.eclipse.jpt.utility.model.Model;
-
-/**
- * Interface used to abstract tree accessing and
- * change notification and make it more pluggable.
- * <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.
- *
- * @param <E> the type of values held by the model
- */
-public interface TreeValueModel<E>
- extends Model
-{
- /**
- * Return the tree's nodes.
- */
- Iterator<E> nodes();
- String NODES = "nodes"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableCollectionValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableCollectionValueModel.java
deleted file mode 100644
index 53ecb78ebe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableCollectionValueModel.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.utility.model.value;
-
-/**
- * Extend {@link CollectionValueModel} to allow the setting of the
- * collection's values.
- * <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.
- *
- * @param <E> the type of values held by the model
- */
-public interface WritableCollectionValueModel<E>
- extends CollectionValueModel<E>
-{
-
- /**
- * Set the values and fire a collection change notification.
- * @see CollectionValueModel#VALUES
- */
- void setValues(Iterable<E> values);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableListValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableListValueModel.java
deleted file mode 100644
index 9296f6b996..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritableListValueModel.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.utility.model.value;
-
-/**
- * Extend {@link ListValueModel} to allow the setting of the
- * lists's values.
- * <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.
- *
- * @param <E> the type of values held by the model
- */
-public interface WritableListValueModel<E>
- extends ListValueModel<E>
-{
-
- /**
- * Set the list values and fire a list change notification.
- * @see ListValueModel#LIST_VALUES
- */
- void setListValues(Iterable<E> values);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java b/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java
deleted file mode 100644
index 97231d61d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/src/org/eclipse/jpt/utility/model/value/WritablePropertyValueModel.java
+++ /dev/null
@@ -1,33 +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.utility.model.value;
-
-/**
- * Extend {@link PropertyValueModel} to allow the setting of the property's value.
- * <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.
- *
- * @param <T> the type of value held by the model
- */
-public interface WritablePropertyValueModel<T>
- extends PropertyValueModel<T>
-{
-
- /**
- * Set the value and fire a property change notification.
- * @see PropertyValueModel#VALUE
- */
- void setValue(T value);
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.classpath
deleted file mode 100644
index 764d64340c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.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/core/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
deleted file mode 100644
index a196dd7686..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args
-javaCompiler...args.* \ 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 bb6561e95f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 55044aaf02..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:32 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 929d54536d..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:18 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.core.tests.extension.resource/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index 1bd29e942c..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,22 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.core.tests.extension.resource;singleton:=true
-Bundle-Version: 2.3.0.qualifier
-Bundle-Activator: org.eclipse.jpt.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.core,
- org.eclipse.jpt.ui,
- org.eclipse.jpt.core,
- org.eclipse.jpt.gen,
- org.eclipse.jpt.db,
- org.eclipse.jpt.utility,
- org.eclipse.swt,
- org.eclipse.wst.validation
-Export-Package: org.eclipse.jpt.core.tests.extension.resource;x-friends:="org.eclipse.jpt.ui.tests,org.eclipse.jpt.core.tests"
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.tests.extension.resource/build.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
deleted file mode 100644
index f33b241f91..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/build.properties
+++ /dev/null
@@ -1,19 +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
-################################################################################
-javacSource=1.5
-javacTarget=1.5
-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.core.tests.extension.resource/plugin.properties b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.properties
deleted file mode 100644
index 0558789278..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.tests.extension.resource/plugin.xml b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/plugin.xml
deleted file mode 100644
index c0577cb922..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.core.jpaPlatforms">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- label="Test Jpa Platform"
- factoryClass="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformFactory"/>
-
- </extension>
-
- <extension
- point="org.eclipse.jpt.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="core.testJpaPlatform.ui"
- jpaPlatform="core.testJpaPlatform"
- factoryClass="org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformUiFactory"/>
-
- </extension>
-
-</plugin>
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/ExtensionTestPlugin.java
deleted file mode 100644
index 47ff993fb2..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/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.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.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.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
deleted file mode 100644
index 251439b2c9..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,33 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.core.resource.java.Annotation;
-
-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;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
deleted file mode 100644
index fcc3ff9f75..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
+++ /dev/null
@@ -1,52 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMappingDefinition;
-
-public class JavaTestAttributeMappingDefinition
- extends AbstractJavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaTestAttributeMappingDefinition 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 JavaTestAttributeMapping buildMapping(JavaPersistentAttribute parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestAttributeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
deleted file mode 100644
index ad0f8c8086..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,49 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTypeMapping;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-
-public class JavaTestTypeMapping extends AbstractJavaTypeMapping
-{
- 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);
- }
-
- public String getAnnotationName() {
- return TEST_TYPE_ANNOTATION_NAME;
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.<String>instance();
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public boolean shouldValidateDbInfo() {
- return false;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
deleted file mode 100644
index 98e38ab432..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
+++ /dev/null
@@ -1,52 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaFactory;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaTypeMappingDefinition;
-
-public class JavaTestTypeMappingDefinition
- extends AbstractJavaTypeMappingDefinition
-{
- // 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 JavaTestTypeMapping buildMapping(JavaPersistentType parent, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestTypeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
deleted file mode 100644
index 0816af9bb2..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaBasicMapping.java
+++ /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
- ******************************************************************************/
-package org.eclipse.jpt.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaBasicMapping;
-
-public class TestJavaBasicMapping extends AbstractJavaBasicMapping
-{
- public TestJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
deleted file mode 100644
index 89dbb7472b..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,31 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCacheable2_0;
-
-public class TestJavaEntity extends AbstractJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent) {
- super(parent);
- }
-
- public JavaCacheable2_0 getCacheable() {
- return null;
- }
-
- public boolean calculateDefaultCacheable() {
- return false;
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
deleted file mode 100644
index 1908ca3ef8..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaFactory.java
+++ /dev/null
@@ -1,38 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.internal.AbstractJpaFactory;
-
-public class TestJpaFactory extends AbstractJpaFactory
-{
-
- @Override
- public JavaEntity buildJavaEntity(JavaPersistentType parent) {
- return new TestJavaEntity(parent);
- }
-
- @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.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformFactory.java
deleted file mode 100644
index 1ee8e1034f..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformFactory.java
+++ /dev/null
@@ -1,66 +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.core.tests.extension.resource;
-
-import org.eclipse.jpt.core.JpaPlatform;
-import org.eclipse.jpt.core.JpaPlatformFactory;
-import org.eclipse.jpt.core.JpaPlatformVariation;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.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 GenericJpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider.instance()),
- TestJpaPlatformProvider.instance(),
- buildJpaPlatformVariation());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new SimpleVersion(JptCorePlugin.JPA_FACET_VERSION_1_0) {
- @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.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformProvider.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformProvider.java
deleted file mode 100644
index 466b73fd53..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformProvider.java
+++ /dev/null
@@ -1,144 +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.core.tests.extension.resource;
-
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.core.JpaPlatformProvider;
-import org.eclipse.jpt.core.JpaResourceModelProvider;
-import org.eclipse.jpt.core.JpaResourceType;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.ResourceDefinition;
-import org.eclipse.jpt.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.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 JpaResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected JpaResourceModelProvider[] buildResourceModelProviders() {
- // order should not be important here
- return new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()};
- }
-
-
- // ********** Java type mappings **********
-
- @Override
- protected JavaTypeMappingDefinition[] buildNonNullJavaTypeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (toplink) uses
- return new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance(),
- JavaTestTypeMappingDefinition.instance()}; // added
- }
-
-
- // ********** Java attribute mappings **********
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullDefaultJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (toplink) uses
- return new JavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()};
- }
-
- @Override
- protected JavaAttributeMappingDefinition[] buildNonNullSpecifiedJavaAttributeMappingDefinitions() {
- // order determined by analyzing order that reference implementation (toplink) uses
- return 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
- }
-
- // ********** Mapping Files **********
-
- @Override
- protected ResourceDefinition[] buildResourceDefinitions() {
- return new ResourceDefinition[] {
- GenericPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()};
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUiFactory.java b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/core/tests/extension/resource/TestJpaPlatformUiFactory.java
deleted file mode 100644
index c120dd3546..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/src/org/eclipse/jpt/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.core.tests.extension.resource;
-
-import org.eclipse.jpt.ui.JpaPlatformUi;
-import org.eclipse.jpt.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.ui.internal.GenericJpaPlatformUiProvider;
-import org.eclipse.jpt.ui.internal.platform.generic.GenericJpaPlatformUi;
-import org.eclipse.jpt.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.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.db.tests/.classpath
deleted file mode 100644
index ef8d91ca94..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
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 f5b0127a1e..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.db.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index b23d0c7038..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:11:11 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 929d54536d..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:59:18 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 8d2559e78a..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests
-Bundle-Version: 1.0.100.qualifier
-Bundle-Activator: org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin
-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.utility;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.jpt.db;bundle-version="[1.2.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.db.tests.internal;x-internal:=true,
- org.eclipse.jpt.db.tests.internal.platforms;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/about.html b/jpa/tests/org.eclipse.jpt.db.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.db.tests/build.properties
deleted file mode 100644
index d27ab8f407..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/derby.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/derby.properties
deleted file mode 100644
index 242d156070..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/mysql.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/mysql.properties
deleted file mode 100644
index d6407deb25..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10g.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/oracle10gXE.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle10gXE.properties
deleted file mode 100644
index e67c01a28e..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/oracle9i.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/postgresql.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/postgresql.properties
deleted file mode 100644
index 32fafe463b..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/sqlserver.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sqlserver.properties
deleted file mode 100644
index f72b645c52..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/config/sybase.properties b/jpa/tests/org.eclipse.jpt.db.tests/config/sybase.properties
deleted file mode 100644
index 493d5d4ad9..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.db.tests/plugin.properties
deleted file mode 100644
index 2c98779595..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTests.java
deleted file mode 100644
index ce05d768f8..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTools.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JDBCTools.java
deleted file mode 100644
index 57c98feafb..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.java
deleted file mode 100644
index ea34d083f6..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTests.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.db.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.db.tests.internal.platforms.AllPlatformTests;
-
-/**
- * JPT DB Tests
- */
-public class JptDbTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptDbTests.class.getPackage().getName());
-
- suite.addTest( AllPlatformTests.suite());
-
- return suite;
- }
-
- private JptDbTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.java
deleted file mode 100644
index 6d517b5635..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/JptDbTestsPlugin.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.db.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JptDbTestsPlugin
- */
-public class JptDbTestsPlugin extends Plugin {
-
- // The shared instance
- private static JptDbTestsPlugin INSTANCE;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptDbTestsPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * The constructor
- */
- public JptDbTestsPlugin() {
- 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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/AllPlatformTests.java
deleted file mode 100644
index 22ece7e151..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
deleted file mode 100644
index 7c3ecf1fc2..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,1027 +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.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.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-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.IManagedConnection;
-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.connection.ConnectionInfo;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ConnectionListener;
-import org.eclipse.jpt.db.ConnectionProfile;
-import org.eclipse.jpt.db.ConnectionProfileFactory;
-import org.eclipse.jpt.db.ConnectionProfileListener;
-import org.eclipse.jpt.db.Database;
-import org.eclipse.jpt.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.JptDbPlugin;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.SchemaContainer;
-import org.eclipse.jpt.db.Sequence;
-import org.eclipse.jpt.db.Table;
-import org.eclipse.jpt.db.ForeignKey.ColumnPair;
-import org.eclipse.jpt.db.tests.internal.JptDbTestsPlugin;
-import org.eclipse.jpt.utility.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ResultSetIterator;
-
-/**
- * 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.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 JptDbTestsPlugin.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 JptDbPlugin.instance().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 IManagedConnection getDTPManagedConnection() {
- return (IManagedConnection) ReflectionTools.getFieldValue(this.connectionProfile, "dtpManagedConnection");
- }
-
- 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, 20);
- }
-
- 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 (ArrayList<Object> row : this.execute(sql)) {
- for (Object columnValue : row) {
- StringTools.padOrTruncateOn(String.valueOf(columnValue), columnWidth, pw);
- pw.print(' ');
- }
- pw.println();
- }
- }
-
- protected ArrayList<ArrayList<Object>> execute(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- jdbcStatement.execute(sql);
- ArrayList<ArrayList<Object>> rows = this.buildRows(jdbcStatement.getResultSet());
- jdbcStatement.close();
- return rows;
- }
-
- protected ArrayList<ArrayList<Object>> buildRows(ResultSet resultSet) throws SQLException {
- ArrayList<ArrayList<Object>> rows = new ArrayList<ArrayList<Object>>();
- for (Iterator<ArrayList<Object>> stream = this.buildArrayIterator(resultSet); stream.hasNext(); ) {
- rows.add(stream.next());
- }
- return rows;
- }
-
- protected Iterator<ArrayList<Object>> buildArrayIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<ArrayList<Object>>(resultSet, new ListResultSetIteratorAdapter(resultSet.getMetaData().getColumnCount()));
- }
-
- public static class ListResultSetIteratorAdapter implements ResultSetIterator.Adapter<ArrayList<Object>> {
- private final int columnCount;
- public ListResultSetIteratorAdapter(int columnCount) {
- super();
- this.columnCount = columnCount;
- }
- public ArrayList<Object> buildNext(ResultSet rs) throws SQLException {
- ArrayList<Object> list = new ArrayList<Object>(this.columnCount);
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- list.add(rs.getObject(i));
- }
- return list;
- }
- }
-
- protected Statement createJDBCStatement() throws SQLException {
- return this.getJDBCConnection().createStatement();
- }
-
- protected Connection getJDBCConnection() {
- return ((ConnectionInfo) this.getDTPManagedConnection().getConnection().getRawConnection()).getSharedConnection();
- }
-
- 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<ColumnPair> stream = foreignKey.getColumnPairs().iterator(); stream.hasNext(); ) {
- 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<ArrayList<Object>> rows = this.buildRows(this.getDatabaseMetaData().getCatalogs());
- for (Iterator<ArrayList<Object>> stream = rows.iterator(); stream.hasNext(); ) {
- pw.println(stream.next().get(0));
- }
- 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<ArrayList<Object>> rows = this.buildRows(this.getDatabaseMetaData().getSchemas());
- for (ArrayList<Object> row : rows) {
- if (row.size() == 2) { // catalogs were added in jdk 1.4
- Object catalog = row.get(1);
- pw.print(catalog);
- pw.print('.');
- }
- Object schema = row.get(0);
- 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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/DerbyTests.java
deleted file mode 100644
index 6ec1ba4f6d..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java
deleted file mode 100644
index 28c944eeee..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/MySQLTests.java
+++ /dev/null
@@ -1,404 +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.db.tests.internal.platforms;
-
-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.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.db.Table;
-
-/**
- * MySQL
- *
- * Notes:
- * - We can only get database objects from the database associated with our
- * connection profile.
- * - We can reference objects across multiple databases, so they are sorta like
- * schemas....
- * - Foreign keys must be defined as table-level constraints; they cannot be
- * defined as part of the column clause.
- * - Case-sensitivity and -folding is whacked on MySQL....
- */
-@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 "dalitest";
- }
-
- @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.dropDatabase(this.getDatabaseName());
- this.executeUpdate("CREATE DATABASE " + this.getDatabaseName());
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable(this.getDatabaseName(), "foo_baz");
- this.dropTable(this.getDatabaseName(), "baz");
- this.dropTable(this.getDatabaseName(), "foo");
- this.dropTable(this.getDatabaseName(), "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.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(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(this.getDatabaseName(), "foo_baz");
- this.dropTable(this.getDatabaseName(), "baz");
- this.dropTable(this.getDatabaseName(), "foo");
- this.dropTable(this.getDatabaseName(), "bar");
-
- this.dropDatabase(this.getDatabaseName());
-
- 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 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(" 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.dropDatabase(this.getDatabaseName());
- this.executeUpdate("CREATE DATABASE " + this.getDatabaseName());
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable(this.getDatabaseName(), "test1");
- this.dropTable(this.getDatabaseName(), "TEST2");
- this.dropTable(this.getDatabaseName(), "`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))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
-
- // this probably only works on Windows
- Table test2Table = schema.getTableForIdentifier("test2");
- assertNotNull(test2Table);
-
- // this probably only works on Windows
- Table test3Table = schema.getTableForIdentifier("`test3`");
- assertNotNull(test3Table);
-
- this.dropTable(this.getDatabaseName(), "test1");
- this.dropTable(this.getDatabaseName(), "TEST2");
- this.dropTable(this.getDatabaseName(), "`TEST3`");
-
- this.dropDatabase(this.getDatabaseName());
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropDatabase(this.getDatabaseName());
- this.executeUpdate("CREATE DATABASE " + this.getDatabaseName());
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("ID"));
- assertNotNull(table.getColumnNamed("NAME"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (`Id` INTEGER, `Name` VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("`Id`"));
- assertNotNull(table.getColumnForIdentifier("`Name`"));
-
- this.dropTable(this.getDatabaseName(), "test");
-
- this.dropDatabase(this.getDatabaseName());
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- /**
- * We can only get a single "schema" per connection via DTP,
- * so cross-schema references are not visible.
- */
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropDatabase("xref_test2");
- this.dropDatabase("xref_test1");
-
- this.executeUpdate("CREATE DATABASE xref_test1");
- this.getJDBCConnection().setCatalog("xref_test1");
- this.executeUpdate("CREATE TABLE org (id INTEGER PRIMARY KEY, name VARCHAR(20))");
-
- 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, FOREIGN KEY (org_id) REFERENCES xref_test1.org(id))");
-
- this.getJDBCConnection().setCatalog("xref_test2");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema2 = this.getDefaultSchema();
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("emp");
- assertNotNull(empTable);
- // no foreign keys
- assertEquals(0, empTable.getForeignKeysSize());
-
- this.dropDatabase("xref_test2");
- this.dropDatabase("xref_test1");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String dbName, String tableName) throws Exception {
- this.executeUpdate("DROP TABLE IF EXISTS " + dbName + '.' + tableName);
- }
-
- private void dropDatabase(String name) throws Exception {
- this.executeUpdate("DROP DATABASE IF EXISTS " + name);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gTests.java
deleted file mode 100644
index c70e3437e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle10gXETests.java
deleted file mode 100644
index 7f309f8520..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/Oracle9iTests.java
deleted file mode 100644
index 9d1c474849..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/PostgreSQLTests.java
deleted file mode 100644
index 4b54bbf4fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SQLServerTests.java
deleted file mode 100644
index cedde5d7c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.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.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java b/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/db/tests/internal/platforms/SybaseTests.java
deleted file mode 100644
index 41cea99c95..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/src/org/eclipse/jpt/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.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.db.Catalog;
-import org.eclipse.jpt.db.Column;
-import org.eclipse.jpt.db.ForeignKey;
-import org.eclipse.jpt.db.Schema;
-import org.eclipse.jpt.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.eclipselink.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.classpath
deleted file mode 100644
index db34e47716..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.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/wst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.cvsignore
deleted file mode 100644
index c4ba612bad..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args \ 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 26141a5bbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.eclipselink.core.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 11155f4708..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:26:54 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8bab913c29..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Mon Jul 07 20:13:24 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.eclipselink.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 4c3d3fd864..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/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.eclipselink.core.tests
-Bundle-Version: 1.3.1.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",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.core.tests;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.utility;bundle-version="[1.2.0,2.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",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,1.3.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.eclipselink.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.caching;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.connection;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.customization;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.general;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.logging;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.options;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.schema.generation;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.eclipselink.core.tests.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.eclipselink1_1.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.eclipselink1_1.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink1_2.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.eclipselink2_0.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.persistence;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/about.html b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.eclipselink.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/build.properties
deleted file mode 100644
index 96de1ee6d2..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/build.properties
+++ /dev/null
@@ -1,18 +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
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/plugin.properties
deleted file mode 100644
index 5b9cfcd182..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.java
deleted file mode 100644
index 90888e5de4..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/JptEclipseLinkCoreTests.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.eclipselink.core.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.JptEclipseLinkCoreContextModelTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.resource.JptEclipselinkCoreResourceModelTests;
-
-/**
- * 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 JptEclipseLinkCoreTests
-{
- 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(JptEclipseLinkCoreTests.class.getPackage().getName());
- suite.addTest(JptEclipselinkCoreResourceModelTests.suite());
- suite.addTest(JptEclipseLinkCoreContextModelTests.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 JptEclipseLinkCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
deleted file mode 100644
index 24b8fa0b61..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
+++ /dev/null
@@ -1,50 +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.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLinkContextModelTestCase
- extends ContextModelTestCase
-{
- protected EclipseLinkContextModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetInstallDataModelProperties.PLATFORM_ID, EclipseLinkJpaPlatformProvider.ID);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- protected JavaEclipseLinkEntity getJavaEntity() {
- return (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
deleted file mode 100644
index 3ac7b8bfd5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
+++ /dev/null
@@ -1,146 +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.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJpaProjectTests extends EclipseLinkContextModelTestCase
-{
-
- public EclipseLinkJpaProjectTests(String name) {
- super(name);
- }
-
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- // don't build orm.xml
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.FALSE);
- return dataModel;
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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(JptCorePlugin.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(JptEclipseLinkCorePlugin.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(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- createEclipseLinkOrmXmlFile(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- private void createDefaultEclipseLinkOrmXmlFile() throws Exception {
- createEclipseLinkOrmXmlFile(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- private void createEclipseLinkOrmXmlFile(String filePath) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.setProperty(OrmFileCreationDataModelProperties.FILE_PATH, filePath);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml file
- createDefaultEclipseLinkOrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLinkOrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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("META-INF/orm2.xml");
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLinkOrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLink1_0CoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLink1_0CoreContextModelTests.java
deleted file mode 100644
index 1960a74cbe..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLink1_0CoreContextModelTests.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.eclipselink.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.java.JptEclipseLinkCoreJavaContextModelTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.orm.JptEclipseLinkCoreOrmContextModelTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.JptEclipseLinkCorePersistenceContextModelTests;
-
-public class JptEclipseLink1_0CoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink1_0CoreContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkJpaProjectTests.class);
- suite.addTest(JptEclipseLinkCorePersistenceContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreJavaContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreOrmContextModelTests.suite());
- return suite;
- }
-
- private JptEclipseLink1_0CoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLinkCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLinkCoreContextModelTests.java
deleted file mode 100644
index c0a16cde5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/JptEclipseLinkCoreContextModelTests.java
+++ /dev/null
@@ -1,45 +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.eclipselink.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.eclipselink.core.tests.internal.JptEclipseLinkCoreTests;
-import org.eclipse.jpt.eclipselink1_1.core.tests.internal.context.JptEclipseLink1_1CoreContextModelTests;
-import org.eclipse.jpt.eclipselink1_2.core.tests.internal.context.JptEclipseLink1_2CoreContextModelTests;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.JptEclipseLink2_0CoreContextModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-public class JptEclipseLinkCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreContextModelTests.class.getName());
- if(JptEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTest(JptEclipseLink1_0CoreContextModelTests.suite());
- suite.addTest(JptEclipseLink1_1CoreContextModelTests.suite());
- suite.addTest(JptEclipseLink1_2CoreContextModelTests.suite());
- suite.addTest(JptEclipseLink2_0CoreContextModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptEclipseLinkCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
deleted file mode 100644
index b9435956ca..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
+++ /dev/null
@@ -1,323 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, basicMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, 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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
-
- basicMapping.setConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setConverter(Converter.NO_CONVERTER);
- assertNull(attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- attributeResource.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.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());
-
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- attributeResource.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().attributes().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
deleted file mode 100644
index 6a9ca7bcc0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
+++ /dev/null
@@ -1,647 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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.hasExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getSpecifiedExistenceType());
-
- caching.setSpecifiedShared(null);
- EclipseLinkExpiryTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- caching.setSpecifiedShared(Boolean.FALSE);
- assertNull(caching.getExpiryTimeOfDay());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- assertNull(cacheAnnotation.getExpiryTimeOfDay());
- }
-
- public void testGetSpecifiedShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.CacheType.SOFT_WEAK, cacheAnnotation.getType());
-
- caching.setSpecifiedType(null);
- assertNull(caching.getSpecifiedType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
- }
-
- 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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setType(org.eclipse.jpt.eclipselink.core.resource.java.CacheType.HARD_WEAK);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.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.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setCoordinationType(org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.hasExistenceChecking());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, caching.hasExistenceChecking());
-
- typeResource.removeAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(false, caching.hasExistenceChecking());
- }
-
- public void testSetExistenceChecking() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(false, caching.hasExistenceChecking());
- assertNull(typeResource.getAnnotation(EclipseLink.EXISTENCE_CHECKING));
-
- caching.setExistenceChecking(true);
-
- assertEquals(true, caching.hasExistenceChecking());
- assertNotNull(typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) typeResource.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- existenceCheckingAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) typeResource.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
-
- assertEquals(org.eclipse.jpt.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.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.addAnnotation(EclipseLink.CACHE);
- assertNull(entity.getCaching().getExpiry());
-
- cacheAnnotation.setExpiry(Integer.valueOf(57));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(57), entity.getCaching().getExpiry());
-
- typeResource.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();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- caching.setExpiry(Integer.valueOf(58));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(58), cacheAnnotation.getExpiry());
-
-
- caching.setExpiry(null);
- cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertNull(cacheAnnotation);
- }
-
- public void testSetExpiryUnsetsExpiryTimeOfDay() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- caching.addExpiryTimeOfDay();
- caching.getExpiryTimeOfDay().setHour(Integer.valueOf(5));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkExpiryTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.addExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(caching.getExpiryTimeOfDay());
-
- caching.removeExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
- assertNull(caching.getExpiryTimeOfDay());
- assertNull(typeResource.getAnnotation(EclipseLink.CACHE));
- }
-
- public void testAddTimeOfDayExpiryUnsetsExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- caching.setExpiry(Integer.valueOf(800));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(new Integer(50), cacheAnnotation.getSize());
- }
-
- public void testGetSpecifiedSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) typeResource.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());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
deleted file mode 100644
index ecfa498ab6..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
+++ /dev/null
@@ -1,224 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- 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().attributes().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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
- basicMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- assertEquals(null, eclipseLinkConvert.getSpecifiedConverterName());
-
- eclipseLinkConvert.setSpecifiedConverterName("foo");
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConvertAnnotation convertAnnotation = (EclipseLinkConvertAnnotation) attributeResource.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
-
- assertEquals("foo", convertAnnotation.getValue());
-
- eclipseLinkConvert.setSpecifiedConverterName(null);
- convertAnnotation = (EclipseLinkConvertAnnotation) attributeResource.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- assertNotNull(convertAnnotation);
- assertEquals(null, convertAnnotation.getValue());
- }
-
- public void testGetConverterNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- attributeResource.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Converter.NO_CONVERTER, basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getSpecifiedMapping());
- }
-
-
- public void testGetConverter() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkConverter.TYPE_CONVERTER, eclipseLinkConvert.getConverter().getType());
- }
-
- public void testSetConverter() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- eclipseLinkConvert.setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- assertEquals(EclipseLinkConverter.TYPE_CONVERTER, eclipseLinkConvert.getConverter().getType());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNotNull(attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- assertEquals(EclipseLinkConverter.STRUCT_CONVERTER, eclipseLinkConvert.getConverter().getType());
- assertNotNull(attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(EclipseLinkConverter.NO_CONVERTER);
- assertEquals(null, eclipseLinkConvert.getConverter());
- assertNull(attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
-
- eclipseLinkConvert.setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- assertEquals(EclipseLinkConverter.STRUCT_CONVERTER, eclipseLinkConvert.getConverter().getType());
- assertNotNull(attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
-
-
- basicMapping.setConverter(Converter.NO_CONVERTER);
- assertNull(attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME));
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
deleted file mode 100644
index 9597c320e0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
+++ /dev/null
@@ -1,222 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- attributeResource.removeAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkCustomConverter converter = (EclipseLinkCustomConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverterClass("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- attributeResource.removeAnnotation(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
deleted file mode 100644
index 46e858fcad..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
+++ /dev/null
@@ -1,254 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- typeResource.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
- typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.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.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(typeResource.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) typeResource.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
deleted file mode 100644
index 4203a01dda..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
+++ /dev/null
@@ -1,387 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- typeResource.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.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.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(typeResource.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) typeResource.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.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(typeResource.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(typeResource.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 {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(null, readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- typeResource.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
deleted file mode 100644
index 2a9b203412..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
+++ /dev/null
@@ -1,324 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, idMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, 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().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
-
- idMapping.setConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setConverter(Converter.NO_CONVERTER);
- assertNull(attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, idMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) idMapping.getConverter()).getConverterName());
-
- attributeResource.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Converter.NO_CONVERTER, idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.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());
-
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- attributeResource.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().attributes().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
deleted file mode 100644
index 1a5e1e2d3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,149 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-
-@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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- attributeResource.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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(attributeResource.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) attributeResource.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java
deleted file mode 100644
index c4adaff77e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- attributeResource.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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(attributeResource.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) attributeResource.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
deleted file mode 100644
index 39e72a2fe0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,348 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.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(typeResource.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(typeResource.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());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(null, readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- typeResource.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.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.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(typeResource.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) typeResource.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
deleted file mode 100644
index 7a512b6789..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
+++ /dev/null
@@ -1,644 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- attributeResource.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- attributeResource.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- attributeResource.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- EclipseLinkConversionValue conversionValue = converter.addConversionValue(0);
- conversionValue.setDataValue("F");
- conversionValue.setObjectValue("female");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.conversionValues();
- 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.conversionValues();
- 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.conversionValues();
- 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<EclipseLinkConversionValue> conversionValues = converter.conversionValues();
- assertEquals(conversionValue2, conversionValues.next());
- assertEquals(conversionValue3, conversionValues.next());
- assertEquals(conversionValue, conversionValues.next());
-
- conversionValues = converter.conversionValues();
- 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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(2, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(1, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(0, CollectionTools.size(resourceConversionValues));
- }
-
- public void testMoveConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.moveConversionValue(2,0);
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
- assertEquals("F", resourceConversionValues.next().getDataValue());
-
- converter.moveConversionValue(0,1);
- resourceConversionValues = converterAnnotation.conversionValues();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.conversionValues();
- 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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<EclipseLinkConversionValue> conversionValues = converter.conversionValues();
- 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.conversionValues();
- 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.conversionValues();
- 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.conversionValues();
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.conversionValues();
- assertEquals("O", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(0);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.conversionValues();
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValuesSize() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, converter.conversionValuesSize());
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
-
- this.getJpaProject().synchronizeContextModel();
- assertEquals(3, converter.conversionValuesSize());
- }
-
-
- public void testGetDefaultObjectValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("baz", converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue(null);
- assertEquals(null, converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue("bar");
- assertEquals("bar", converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getDefaultObjectValue());
- }
-
- public void testGetDefaultObjectValueUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("bar", converter.getDefaultObjectValue());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDefaultObjectValue("baz");
- getJpaProject().synchronizeContextModel();
- assertEquals("baz", converter.getDefaultObjectValue());
-
- attributeResource.removeAnnotation(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals(1, converter.conversionValuesSize());
- assertEquals("f", converter.conversionValues().next().getDataValue());
- assertEquals("female", converter.conversionValues().next().getObjectValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
deleted file mode 100644
index b2df9c6c51..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,579 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(attributeResource.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- attributeResource.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- attributeResource.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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(attributeResource.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) attributeResource.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationshipReference relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationshipReference relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- public void testDefaultOneToMany() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- 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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(FetchType.LAZY, specifiedOneToManyMapping.getFetch());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToManySetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getSpecifiedTargetEntity());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setAll(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isAll());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isMerge());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isPersist());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRefresh());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertEquals(true, annotation.isCascadeRefresh());
- }
-
- public void testDefaultOneToManySetCascadeRemove() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRemove());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
deleted file mode 100644
index 2b43eaf239..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,449 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(attributeResource.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- attributeResource.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- attributeResource.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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(attributeResource.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) attributeResource.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- 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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(FetchType.LAZY, specifiedOneToOneMapping.getFetch());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToOneSetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getSpecifiedTargetEntity());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setAll(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isAll());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isMerge());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isPersist());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRefresh());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.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().attributes();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getSpecifiedMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRemove());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) attributeResource.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
deleted file mode 100644
index 418f65e5a8..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
+++ /dev/null
@@ -1,221 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- attributeResource.removeAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverter());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkStructConverter converter = (EclipseLinkStructConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverter("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- attributeResource.removeAnnotation(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
deleted file mode 100644
index a7f6c8af52..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
+++ /dev/null
@@ -1,313 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("foo", converter.getName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- attributeResource.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- attributeResource.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.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().attributes().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().attributes().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- EclipseLinkTypeConverter converter = (EclipseLinkTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- attributeResource.removeAnnotation(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, eclipseLinkConvert.getConverter());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
deleted file mode 100644
index b69855a25b..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
+++ /dev/null
@@ -1,323 +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.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.TemporalConverter;
-import org.eclipse.jpt.core.context.TemporalType;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, versionMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, 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().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
-
- versionMapping.setConverter(Converter.TEMPORAL_CONVERTER);
- ((TemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- TemporalAnnotation temporal = (TemporalAnnotation) attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setConverter(Converter.NO_CONVERTER);
- assertNull(attributeResource.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, versionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) versionMapping.getConverter()).getConverterName());
-
- attributeResource.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Converter.NO_CONVERTER, versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getSpecifiedMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.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());
-
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- attributeResource.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().attributes().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.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().attributes().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- attributeResource.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
deleted file mode 100644
index 415bf4fd14..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,43 +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.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);
- return suite;
- }
-
- private JptEclipseLinkCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
deleted file mode 100644
index c54e9f0fb9..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
+++ /dev/null
@@ -1,675 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-
-@SuppressWarnings("nls")
-public class EclipseLinkEntityMappingsTests extends EclipseLinkOrmContextModelTestCase
-{
- public EclipseLinkEntityMappingsTests(String name) {
- super(name);
- }
-
-
- public void testUpdateCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- EclipseLinkConverterHolder ormContextConverterHolder = contextEntityMappings.getConverterHolder();
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
deleted file mode 100644
index db8a63479d..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
+++ /dev/null
@@ -1,389 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmBasicMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
-
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.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();
-
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaBasicMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) ormBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- javaBasicMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals(Converter.NO_CONVERTER, 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);
-
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormBasicMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormBasicMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmContextModelTestCase.java
deleted file mode 100644
index 546f3dc205..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmContextModelTestCase.java
+++ /dev/null
@@ -1,81 +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.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationOperation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLinkOrmContextModelTestCase
- extends EclipseLinkContextModelTestCase
-{
- protected JpaXmlResource eclipseLinkOrmXmlResource;
-
-
- protected EclipseLinkOrmContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.eclipseLinkOrmXmlResource = getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- }
-
- @Override
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws Exception {
- TestJpaProject testJpaProject = super.buildJpaProject(projectName, autoBuild, jpaConfig);
-
- EclipseLinkOrmFileCreationOperation operation =
- new EclipseLinkOrmFileCreationOperation(buildEclipseLinkOrmConfig(testJpaProject));
- operation.execute(null, null);
-
- return testJpaProject;
- }
-
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, testJpaProject.getProject().getName());
- dataModel.setProperty(OrmFileCreationDataModelProperties.VERSION, EclipseLink.SCHEMA_VERSION);
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.eclipseLinkOrmXmlResource = null;
- super.tearDown();
- }
-
- @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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java
deleted file mode 100644
index 1a16fd135d..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmConverterTests
- extends EclipseLinkOrmContextModelTestCase
-{
-
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.CUSTOM_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkCustomConverter javaConverter = ((EclipseLinkCustomConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setConverterClass("bar");
- assertEquals("bar", ormConverter.getConverterClass());
- assertEquals("bar", javaConverter.getConverterClass());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.CUSTOM_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.CUSTOM_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (OrmEclipseLinkCustomConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkCustomConverter javaConverter = ((EclipseLinkCustomConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
- assertEquals("bar", ormConverter.getName());
- assertEquals("bar", javaConverter.getName());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.CUSTOM_CONVERTER);
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
deleted file mode 100644
index 46dc95a3de..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
+++ /dev/null
@@ -1,1035 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEmbeddableTests extends EclipseLinkOrmContextModelTestCase
-{
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestEmbeddableForCustomConverters();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- 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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- 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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEmbeddable.getConverterHolder();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
deleted file mode 100644
index 3cac1283b5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
+++ /dev/null
@@ -1,2394 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExpiryTimeOfDay;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEntityTests extends EclipseLinkOrmContextModelTestCase
-{
-
-
- 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.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.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.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.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 resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), resourceEntity.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), resourceEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- resourceEntity.getCache().setSize(null);
-
- assertEquals(null, resourceEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.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, resourceEntity.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);
- EclipseLinkExpiryTimeOfDay 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.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.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.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.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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextEntity.getConverterHolder();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
deleted file mode 100644
index adfc494486..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
+++ /dev/null
@@ -1,388 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmIdMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- contextId = (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmEclipseLinkBasicMapping contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceId.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- contextId = (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- OrmEclipseLinkBasicMapping contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceId.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.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();
-
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaIdMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) ormIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- javaIdMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals(Converter.NO_CONVERTER, 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);
-
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormIdMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormIdMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormIdMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
deleted file mode 100644
index 8e2b40665a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,378 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToManyMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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();
- OrmEclipseLinkManyToManyMapping manyToMany = (OrmEclipseLinkManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(manyToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- OrmEclipseLinkOneToManyMapping oneToMany = (OrmEclipseLinkOneToManyMapping) 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 = (OrmEclipseLinkManyToManyMapping) 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();
- OrmManyToManyMapping manyToMany = (OrmManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertEquals(true, manyToMany.getPersistentAttribute().isVirtual());
- OrmJoinTable ormJoinTable = manyToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName());
- assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.specifiedInverseJoinColumns().next().getName());
- assertEquals("empId", ormJoinTable.specifiedInverseJoinColumns().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");
- OrmOneToManyMapping oneToMany = (OrmOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertEquals(true, oneToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = oneToMany.getRelationshipReference().getJoinTableJoiningStrategy().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);
- manyToMany = (OrmManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(true, manyToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = manyToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName());
- assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.specifiedInverseJoinColumns().next().getName());
- assertEquals("empId", ormJoinTable.specifiedInverseJoinColumns().next().getReferencedColumnName());
-
-
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "employees");
- manyToMany = (OrmManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(false, manyToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = manyToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.specifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.specifiedInverseJoinColumnsSize());
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(ormManyToManyMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade cascade = ormManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(ormManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormManyToManyMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
deleted file mode 100644
index 9b842b1360..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,318 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToOneMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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();
- OrmEclipseLinkManyToOneMapping manyToOne = (OrmEclipseLinkManyToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(manyToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- OrmEclipseLinkOneToOneMapping oneToOne = (OrmEclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(oneToOne.getJoinFetch().getValue());
-
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employee").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(manyToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- manyToOne = (OrmEclipseLinkManyToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, manyToOne.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkManyToOneMapping ormManyToOneMapping = (OrmEclipseLinkManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormManyToOneMapping.getSpecifiedTargetEntity());
-
- OrmJoinColumn ormJoinColumn = ormManyToOneMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormManyToOneMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
deleted file mode 100644
index 9e204585e0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2147 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmMappedSuperclassTests extends EclipseLinkOrmContextModelTestCase
-{
- 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.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.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.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.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(50, 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(50, ormContextCaching.getSize());
- assertEquals(50, 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.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.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.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.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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
deleted file mode 100644
index 21cab6f54e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
+++ /dev/null
@@ -1,569 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.java.JavaEclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmObjectTypeConverterTests
- extends EclipseLinkOrmContextModelTestCase
-{
-
- 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");
- }
- });
- }
-
-
- 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 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDataType("bar");
- assertEquals("bar", ormConverter.getDataType());
- assertEquals("bar", javaConverter.getDataType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setObjectType("bar");
- assertEquals("bar", ormConverter.getObjectType());
- assertEquals("bar", javaConverter.getObjectType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (OrmEclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
- assertEquals("bar", ormConverter.getName());
- assertEquals("bar", javaConverter.getName());
-
-
- //set metadata-complete, test virtual mapping
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkObjectTypeConverter javaConverter = ((EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDefaultObjectValue("bar");
- assertEquals("bar", ormConverter.getDefaultObjectValue());
- assertEquals("bar", javaConverter.getDefaultObjectValue());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- 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.conversionValuesSize());
- 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.conversionValuesSize());
- ListIterator<EclipseLinkConversionValue> contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- 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.conversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- assertEquals(1, javaConverter.conversionValuesSize());
-
- //remove orm attribute mapping, verify virtual mapping has conversion values from java
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- assertEquals(1, ormConverter.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- contextConversionValue = contextConversionValues.next();
- assertEquals("baz", contextConversionValue.getDataValue());
- assertEquals(0, converterResource.getConversionValues().size());
- assertEquals(1, javaConverter.conversionValuesSize());
-
- //set metadata-complete to true, verify virtual mapping ignores the conversion values from java
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(EclipseLinkConverter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.OBJECT_TYPE_CONVERTER);
- EclipseLinkObjectTypeConverter ormConverter = (EclipseLinkObjectTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverter();
-
- assertEquals(0, ormConverter.conversionValuesSize());
- 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.conversionValuesSize());
- ListIterator<EclipseLinkConversionValue> contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- contextConversionValues = ormConverter.conversionValues();
- 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.conversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- }
-
- public void testInitializeConversionValues() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverterConversionValue();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) ormBasicMapping.getConverter();
- EclipseLinkObjectTypeConverter converter = (EclipseLinkObjectTypeConverter) eclipseLinkConvert.getConverter();
-
- assertEquals(1, converter.conversionValuesSize());
- assertEquals("f", converter.conversionValues().next().getDataValue());
- assertEquals("female", converter.conversionValues().next().getObjectValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
deleted file mode 100644
index 639013ff56..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,742 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToManyMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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();
- OrmEclipseLinkOneToManyMapping oneToMany = (OrmEclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToMany = (OrmEclipseLinkOneToManyMapping) 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 = (OrmEclipseLinkOneToManyMapping) 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();
- OrmOneToManyMapping oneToMany = (OrmOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertEquals(true, oneToMany.getPersistentAttribute().isVirtual());
- OrmJoinTable ormJoinTable = oneToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName());
- assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.specifiedInverseJoinColumns().next().getName());
- assertEquals("empId", ormJoinTable.specifiedInverseJoinColumns().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");
- oneToMany = (OrmOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertEquals(true, oneToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = oneToMany.getRelationshipReference().getJoinTableJoiningStrategy().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);
- oneToMany = (OrmOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(true, oneToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = oneToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName());
- assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.specifiedInverseJoinColumns().next().getName());
- assertEquals("empId", ormJoinTable.specifiedInverseJoinColumns().next().getReferencedColumnName());
-
-
- departmentPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "employees");
- oneToMany = (OrmOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(false, oneToMany.getPersistentAttribute().isVirtual());
- ormJoinTable = oneToMany.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.specifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.specifiedInverseJoinColumnsSize());
- 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");
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) 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 = (OrmOneToManyMapping) 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");
-
- OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- oneToManyMapping.candidateMapKeyNames();
- 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");
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.getPersistentAttribute().makeSpecified();
- ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- OrmEclipseLinkOneToManyRelationshipReference relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- OrmEclipseLinkOneToManyRelationshipReference relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkOneToManyMapping ormOneToManyMapping = (OrmEclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToManyMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade cascade = ormOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(ormOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormOneToManyMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- OrmEclipseLinkOneToManyMapping ormOneToManyMapping = (OrmEclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().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());
-
- assertEquals(null, ormOneToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
deleted file mode 100644
index e04b247220..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,452 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Cascade;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToOneMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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();
- OrmEclipseLinkOneToOneMapping oneToOne = (OrmEclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(oneToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToOne = (OrmEclipseLinkOneToOneMapping) 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 = (OrmEclipseLinkOneToOneMapping) 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkOneToOneMapping ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- OrmJoinColumn ormJoinColumn =
- ormOneToOneMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormOneToOneMapping.getJoinFetch().getValue());
- assertTrue(ormOneToOneMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- OrmEclipseLinkOneToOneMapping ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmEclipseLinkOneToOneMapping ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- //TODO default target entity in xml
- //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity());
-
- assertTrue(ormOneToOneMapping.getRelationshipReference().getJoinColumnJoiningStrategy().joinColumnsSize() > 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java
deleted file mode 100644
index 42438946f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmPersistentAttributeTests
- extends EclipseLinkOrmContextModelTestCase
-{
- public EclipseLinkOrmPersistentAttributeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- 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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.makeSpecified();
-
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormPersistentAttribute.makeSpecified();
-
- assertEquals(0, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.specifiedAttributes();
- 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.virtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericOrmNullAttributeMapping);
- ormPersistentAttribute.makeSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().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.virtualAttributes().next();
- ormPersistentAttribute.makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.specifiedAttributes();
-
- 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.virtualAttributesSize());
-
- ormPersistentType.virtualAttributes().next().makeSpecified();
- ormPersistentType.virtualAttributes().next().makeSpecified();
-
- assertEquals(0, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- assertEquals(0, ormPersistentType.specifiedAttributesSize());
-
- Iterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
- OrmPersistentAttribute 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.virtualAttributesSize());
-
- ormPersistentType.virtualAttributes().next().makeSpecified();
- ormPersistentType.virtualAttributes().next().makeSpecified();
-
-
- ormPersistentType.specifiedAttributes().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.virtualAttributes().next().getName());
- assertEquals("name", ormPersistentType.specifiedAttributes().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().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);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().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();
-
- OrmPersistentAttribute 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());
- JavaResourcePersistentAttribute javaResourcePersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute();
- assertTrue(javaResourcePersistentAttribute.isField());
- assertEquals("id", javaResourcePersistentAttribute.getName());
- assertEquals(javaPersistentType.getResourcePersistentType().persistableFields().next(), javaResourcePersistentAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.makeSpecified();
- 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 the property java resource persistent attribute is used in orm.
- ormPersistentAttribute.makeVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertNotSame(ormPersistentAttribute, ormPersistentType.getAttributeNamed("id"));
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- javaResourcePersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute();
- assertTrue(javaResourcePersistentAttribute.isProperty());
- assertEquals("id", javaResourcePersistentAttribute.getName());
- assertEquals(javaPersistentType.getResourcePersistentType().persistableProperties().next(), javaResourcePersistentAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentAttribute.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentAttribute.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
deleted file mode 100644
index a4beaf0824..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
+++ /dev/null
@@ -1,199 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmStructConverterTests
- extends EclipseLinkOrmContextModelTestCase
-{
-
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkStructConverter javaConverter = ((EclipseLinkStructConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setConverterClass("bar");
- assertEquals("bar", ormConverter.getConverterClass());
- assertEquals("bar", javaConverter.getConverterClass());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (OrmEclipseLinkStructConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkStructConverter javaConverter = ((EclipseLinkStructConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
- assertEquals("bar", ormConverter.getName());
- assertEquals("bar", javaConverter.getName());
-
-
- //set metadata-complete, test virtual mapping
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.STRUCT_CONVERTER);
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
deleted file mode 100644
index 0122ff4e15..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
+++ /dev/null
@@ -1,63 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTransientMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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);
-
- OrmPersistentAttribute 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.getSpecifiedMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
deleted file mode 100644
index 5d3d3f85b0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
+++ /dev/null
@@ -1,267 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTypeConverterTests
- extends EclipseLinkOrmContextModelTestCase
-{
-
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setDataType("bar");
- assertEquals("bar", ormConverter.getDataType());
- assertEquals("bar", javaConverter.getDataType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (EclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setObjectType("bar");
- assertEquals("bar", ormConverter.getObjectType());
- assertEquals("bar", javaConverter.getObjectType());
-
- //set metadata-complete, test virtual mapping
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormConverter = (OrmEclipseLinkTypeConverter) ((EclipseLinkConvert) ormBasicMapping.getConverter()).getConverter();
-
- EclipseLinkTypeConverter javaConverter = ((EclipseLinkTypeConverter) ((EclipseLinkConvert) javaBasicMapping.getConverter()).getConverter());
- javaConverter.setName("bar");
- assertEquals("bar", ormConverter.getName());
- assertEquals("bar", javaConverter.getName());
-
-
- //set metadata-complete, test virtual mapping
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- assertEquals(Converter.NO_CONVERTER, ormBasicMapping.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.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setConverter(EclipseLinkConverter.TYPE_CONVERTER);
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
deleted file mode 100644
index 61e645dea6..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
+++ /dev/null
@@ -1,388 +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.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Converter;
-import org.eclipse.jpt.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkVersionMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmVersionMappingTests
- extends EclipseLinkOrmContextModelTestCase
-{
- 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- contextVersion = (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmEclipseLinkBasicMapping contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceVersion.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, 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
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- contextVersion = (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("myDate");
- OrmEclipseLinkBasicMapping contextBasic = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- assertNull(resourceVersion.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, 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();
-
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaVersionMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentType.removeSpecifiedAttribute(ormPersistentAttribute);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) ormVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- javaVersionMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals(Converter.NO_CONVERTER, 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);
-
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormVersionMapping.setConverter(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormVersionMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.ECLIPSE_LINK_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormVersionMapping.setConverter(Converter.NO_CONVERTER);
- assertEquals(Converter.NO_CONVERTER, ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
deleted file mode 100644
index f3789147fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,369 +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.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitDefaultsTests extends EclipseLinkOrmContextModelTestCase
-{
- public EclipseLinkPersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults persistenceUnitDefaults() {
- return getEntityMappings().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());
-
- org.eclipse.jpt.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.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.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(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 = 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(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 = 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(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 = 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(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.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.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.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.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java
deleted file mode 100644
index 9a75e3731d..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.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.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.context.orm.PersistenceUnitMetadata;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata;
-
-public class EclipseLinkPersistenceUnitMetadataTests extends EclipseLinkOrmContextModelTestCase
-{
- public EclipseLinkPersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected PersistenceUnitMetadata 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(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- PersistenceUnitMetadata 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 {
- PersistenceUnitMetadata 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 {
- PersistenceUnitMetadata 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
deleted file mode 100644
index 13621f86eb..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,47 +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.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);
- return suite;
- }
-
-
- private JptEclipseLinkCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java
deleted file mode 100644
index 582ef0d5cb..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.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.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-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(JpaFacetInstallDataModelProperties.PLATFORM_ID, EclipseLinkJpaPlatformProvider.ID);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
deleted file mode 100644
index 3a9df3a81e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
+++ /dev/null
@@ -1,176 +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.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.orm.EclipseLinkOrmContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitTests
- extends EclipseLinkOrmContextModelTestCase
-{
- public EclipseLinkPersistenceUnitTests(String name) {
- super(name);
- }
-
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, testJpaProject.getProject().getName());
- 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.specifiedMappingFileRefs()));
-
- 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.mappingFileRefs();
-
- assertEquals(persistenceUnit.getImpliedMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- assertEquals(persistenceUnit.getImpliedEclipseLinkMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- }
-
- public void testMappingFileRefsSize() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- assertEquals(2, persistenceUnit.mappingFileRefsSize());
- }
-
- 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(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java
deleted file mode 100644
index 825e5d5a32..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.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.eclipselink.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.caching.JptEclipseLinkPersistenceCachingTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.connection.JptEclipseLinkPersistenceConnectionTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.customization.JptEclipseLinkPersistenceCustomizationTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.general.JptEclipseLinkPersistenceGeneralTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.logging.JptEclipseLinkPersistenceLoggingTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.options.JptEclipseLinkPersistenceOptionsTests;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.schema.generation.JptEclipseLinkPersistenceSchemaGenerationTests;
-
-public class JptEclipseLinkCorePersistenceContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCorePersistenceContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkPersistenceUnitTests.class);
- suite.addTest(JptEclipseLinkPersistenceGeneralTests.suite());
- suite.addTest(JptEclipseLinkPersistenceConnectionTests.suite());
- suite.addTest(JptEclipseLinkPersistenceCustomizationTests.suite());
- suite.addTest(JptEclipseLinkPersistenceCachingTests.suite());
- suite.addTest(JptEclipseLinkPersistenceLoggingTests.suite());
- suite.addTest(JptEclipseLinkPersistenceOptionsTests.suite());
- suite.addTest(JptEclipseLinkPersistenceSchemaGenerationTests.suite());
- return suite;
- }
-
- private JptEclipseLinkCorePersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingAdapterTests.java
deleted file mode 100644
index e1db05a936..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingAdapterTests.java
+++ /dev/null
@@ -1,444 +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.eclipselink.core.tests.internal.context.persistence.caching;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.FlushClearCache;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * 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 ListChangeEvent 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(Entity.CACHE_TYPE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Entity.CACHE_SIZE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Entity.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.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(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.entityChanged(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- }
-
- void entityChanged(ListChangeEvent e) {
- this.entitiesEvent = e;
- }
-
- // ********** entities list **********
- public void testEntitiesList() throws Exception {
- // add
- this.clearEvent();
- int originalNumberOfEntities = this.caching.entitiesSize();
-
- this.caching.addEntity(ENTITY_TEST_2);
- assertEquals("Entity not added", this.caching.entitiesSize(), 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.entitiesSize(), 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(
- Entity.CACHE_TYPE_PROPERTY,
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheType() throws Exception {
- this.verifyAddRemoveCachingProperty(
- Entity.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(
- Entity.CACHE_SIZE_PROPERTY,
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE,
- CACHE_SIZE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheSize() throws Exception {
- this.verifyAddRemoveCachingProperty(
- Entity.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(
- Entity.SHARED_CACHE_PROPERTY,
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE_2);
- }
-
- public void testAddRemoveSharedCache() throws Exception {
- this.verifyAddRemoveCachingProperty(
- Entity.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
- Entity entity = (Entity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(Entity.CACHE_TYPE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheTypeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheTypeOf(entityName));
- }
- else if (propertyName.equals(Entity.CACHE_SIZE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheSizeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheSizeOf(entityName));
- }
- else if (propertyName.equals(Entity.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(Entity.CACHE_TYPE_PROPERTY))
- this.caching.setCacheTypeOf(entityName, (CacheType) newValue);
- else if (propertyName.equals(Entity.CACHE_SIZE_PROPERTY))
- this.caching.setCacheSizeOf(entityName, (Integer) newValue);
- else if (propertyName.equals(Entity.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(Entity.CACHE_SIZE_PROPERTY))
- modelValue = this.caching.getCacheSizeOf(ENTITY_TEST);
- else if (propertyName.equals(Entity.CACHE_TYPE_PROPERTY))
- modelValue = this.caching.getCacheTypeOf(ENTITY_TEST);
- else if (propertyName.equals(Entity.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingValueModelTests.java
deleted file mode 100644
index da14c36e29..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/CachingValueModelTests.java
+++ /dev/null
@@ -1,444 +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.eclipselink.core.tests.internal.context.persistence.caching;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.CacheType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.caching.Caching;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.caching.Entity;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * 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() {
- Entity entity = this.buildEntity("TestEntity", CacheType.full, 100, true);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- Entity entity1 = this.buildEntity("TestEntityA", CacheType.full, 100, true);
- Entity entity2 = this.buildEntity("TestEntityB", CacheType.full, 100, true);
- assertEquals(entity1, entity2);
- Entity entity3 = this.buildEntity("TestEntityC", CacheType.full, 100, true);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- Entity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.caching.setCacheSizeOf(entity.getName(), 100);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(Entity original, Entity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private Entity buildEntity(String name) {
- return this.caching.addEntity(name);
- }
-
- private Entity buildEntity(String name, CacheType cacheType, Integer size, Boolean isShared) {
- Entity 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/JptEclipseLinkPersistenceCachingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/JptEclipseLinkPersistenceCachingTests.java
deleted file mode 100644
index 42da1ba956..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/caching/JptEclipseLinkPersistenceCachingTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.caching;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceCachingTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceCachingTests.class.getPackage().getName());
-
- suite.addTestSuite(CachingValueModelTests.class);
- suite.addTestSuite(CachingAdapterTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceCachingTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/EclipseLinkConnectionTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/EclipseLinkConnectionTests.java
deleted file mode 100644
index a08dde0e16..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/EclipseLinkConnectionTests.java
+++ /dev/null
@@ -1,542 +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.eclipselink.core.tests.internal.context.persistence.connection;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.BatchWriting;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.ExclusiveConnectionMode;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/JptEclipseLinkPersistenceConnectionTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/JptEclipseLinkPersistenceConnectionTests.java
deleted file mode 100644
index df33d3274a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/connection/JptEclipseLinkPersistenceConnectionTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.connection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceConnectionTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceConnectionTests.class.getPackage().getName());
-
-// suite.addTestSuite(ConnectionValueModelTests.class);
- suite.addTestSuite(EclipseLinkConnectionTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceConnectionTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/CustomizationValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/CustomizationValueModelTests.java
deleted file mode 100644
index 77e5f36412..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/CustomizationValueModelTests.java
+++ /dev/null
@@ -1,204 +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.eclipselink.core.tests.internal.context.persistence.customization;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * CustomizationValueModelTests
- */
-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() {
- Entity entity = this.buildEntity("TestEntity", CUSTOMIZER_TEST_VALUE);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- Entity entity1 = this.buildEntity("TestEntityA", CUSTOMIZER_TEST_VALUE);
- Entity entity2 = this.buildEntity("TestEntityB", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity2);
- Entity entity3 = this.buildEntity("TestEntityC", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- Entity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.customization.setDescriptorCustomizerOf(entity.getName(), CUSTOMIZER_TEST_VALUE);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(Entity original, Entity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private Entity buildEntity(String name) {
- return this.customization.addEntity(name);
- }
-
- private Entity buildEntity(String name, String aClassName) {
- Entity 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/EclipseLinkCustomizationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/EclipseLinkCustomizationTests.java
deleted file mode 100644
index 1f4391e698..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/EclipseLinkCustomizationTests.java
+++ /dev/null
@@ -1,745 +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.eclipselink.core.tests.internal.context.persistence.customization;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Customization;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Profiler;
-import org.eclipse.jpt.eclipselink.core.context.persistence.customization.Weaving;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.EclipseLinkCustomization;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.customization.Entity;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * 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 ListChangeEvent entitiesEvent;
- private ListChangeEvent 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(Entity.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.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(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.entityChanged(e);
- }
- };
- }
-
- private ListChangeListener buildSessionCustomizersChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(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.sessionCustomizerChanged(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- this.sessionCustomizersEvent = null;
- }
-
- void entityChanged(ListChangeEvent e) {
- this.entitiesEvent = e;
- }
-
- void sessionCustomizerChanged(ListChangeEvent 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.sessionCustomizers();
- if(iterator.hasNext()) {
- modelValue = iterator.next();
- }
- }
- else if (propertyName.equals(Entity.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(
- Entity.DESCRIPTOR_CUSTOMIZER_PROPERTY,
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE,
- CUSTOMIZER_TEST_VALUE_2);
- }
-
- public void testAddRemoveCustomization() throws Exception {
- this.verifyAddRemoveCustomizationProperty(
- Entity.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
- Entity entity = (Entity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(Entity.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(Entity.DESCRIPTOR_CUSTOMIZER_PROPERTY))
- this.customization.setDescriptorCustomizerOf(entityName, (String) newValue);
- else
- this.throwMissingDefinition("setCustomizationProperty", propertyName);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/JptEclipseLinkPersistenceCustomizationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/JptEclipseLinkPersistenceCustomizationTests.java
deleted file mode 100644
index 9082c62599..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/customization/JptEclipseLinkPersistenceCustomizationTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.customization;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceCustomizationTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceCustomizationTests.class.getPackage().getName());
-
- suite.addTestSuite(CustomizationValueModelTests.class);
- suite.addTestSuite(EclipseLinkCustomizationTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceCustomizationTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesAdapterTests.java
deleted file mode 100644
index e69c8efae5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesAdapterTests.java
+++ /dev/null
@@ -1,105 +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.eclipselink.core.tests.internal.context.persistence.general;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesValueModelTests.java
deleted file mode 100644
index be6cc075b2..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/GeneralPropertiesValueModelTests.java
+++ /dev/null
@@ -1,162 +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.eclipselink.core.tests.internal.context.persistence.general;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.general.GeneralProperties;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/JptEclipseLinkPersistenceGeneralTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/JptEclipseLinkPersistenceGeneralTests.java
deleted file mode 100644
index 2ba84831d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/general/JptEclipseLinkPersistenceGeneralTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.general;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceGeneralTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceGeneralTests.class.getPackage().getName());
-
- suite.addTestSuite(GeneralPropertiesValueModelTests.class);
- suite.addTestSuite(GeneralPropertiesAdapterTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceGeneralTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/JptEclipseLinkPersistenceLoggingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/JptEclipseLinkPersistenceLoggingTests.java
deleted file mode 100644
index 51dc7e4f3a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/JptEclipseLinkPersistenceLoggingTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.logging;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceLoggingTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceLoggingTests.class.getPackage().getName());
-
- suite.addTestSuite(LoggingValueModelTests.class);
- suite.addTestSuite(LoggingAdapterTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceLoggingTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingAdapterTests.java
deleted file mode 100644
index 405ca17d77..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingAdapterTests.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.eclipselink.core.tests.internal.context.persistence.logging;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logger;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * Tests the update of model objects by the Logging adapter when the
- * PersistenceUnit changes.
- */
-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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingValueModelTests.java
deleted file mode 100644
index 1f49368a2f..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/logging/LoggingValueModelTests.java
+++ /dev/null
@@ -1,162 +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.eclipselink.core.tests.internal.context.persistence.logging;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.Logging;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/JptEclipseLinkPersistenceOptionsTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/JptEclipseLinkPersistenceOptionsTests.java
deleted file mode 100644
index 5ce21dea5e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/JptEclipseLinkPersistenceOptionsTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink.core.tests.internal.context.persistence.options;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceOptionsTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceOptionsTests.class.getPackage().getName());
-
- suite.addTestSuite(OptionsValueModelTests.class);
- suite.addTestSuite(OptionsAdapterTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceOptionsTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsAdapterTests.java
deleted file mode 100644
index 52850b624a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsAdapterTests.java
+++ /dev/null
@@ -1,379 +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.eclipselink.core.tests.internal.context.persistence.options;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetDatabase;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.TargetServer;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * Tests the update of model objects by the Option adapter when the
- * PersistenceUnit changes.
- */
-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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsValueModelTests.java
deleted file mode 100644
index bf6b8a2f7a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/options/OptionsValueModelTests.java
+++ /dev/null
@@ -1,161 +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.eclipselink.core.tests.internal.context.persistence.options;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.options.Options;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/JptEclipseLinkPersistenceSchemaGenerationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/JptEclipseLinkPersistenceSchemaGenerationTests.java
deleted file mode 100644
index 8ae6c55d11..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/JptEclipseLinkPersistenceSchemaGenerationTests.java
+++ /dev/null
@@ -1,35 +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.eclipselink.core.tests.internal.context.persistence.schema.generation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLinkPersistenceSchemaGenerationTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkPersistenceSchemaGenerationTests.class.getPackage().getName());
-
- suite.addTestSuite(SchemaGenerationValueModelTests.class);
- suite.addTestSuite(SchemaGenerationBasicAdapterTests.class);
- suite.addTestSuite(SchemaGenerationAdapterTests.class);
-
- return suite;
- }
-
- private JptEclipseLinkPersistenceSchemaGenerationTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationAdapterTests.java
deleted file mode 100644
index b561df5951..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationAdapterTests.java
+++ /dev/null
@@ -1,254 +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.eclipselink.core.tests.internal.context.persistence.schema.generation;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationBasicAdapterTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationBasicAdapterTests.java
deleted file mode 100644
index fcaab10092..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationBasicAdapterTests.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.eclipselink.core.tests.internal.context.persistence.schema.generation;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-
-/**
- * Tests the update of OutputMode model object by the SchemaGeneration adapter
- * when the PersistenceUnit changes.
- */
-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 ListIterator<PersistenceUnit.Property> listIterator_() {
- return this.subject.properties();
- }
-
- @Override
- protected int size_() {
- return this.subject.propertiesSize();
- }
- };
- }
-
- // ********** 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationValueModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationValueModelTests.java
deleted file mode 100644
index f76ab96f58..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/persistence/schema/generation/SchemaGenerationValueModelTests.java
+++ /dev/null
@@ -1,232 +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.eclipselink.core.tests.internal.context.persistence.schema.generation;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.DdlGenerationType;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.OutputMode;
-import org.eclipse.jpt.eclipselink.core.context.persistence.schema.generation.SchemaGeneration;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.persistence.EclipseLinkPersistenceUnitTestCase;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-
-/**
- * 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/JptEclipselinkCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/JptEclipselinkCoreResourceModelTests.java
deleted file mode 100644
index 2e8e2362cc..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/JptEclipselinkCoreResourceModelTests.java
+++ /dev/null
@@ -1,41 +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.eclipselink.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.eclipselink.core.tests.internal.JptEclipseLinkCoreTests;
-import org.eclipse.jpt.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 JptEclipselinkCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipselinkCoreResourceModelTests.class.getName());
- if(JptEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTest(JptEclipseLinkCoreJavaResourceModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptEclipselinkCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CacheTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CacheTests.java
deleted file mode 100644
index 0bc656b0a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CacheTests.java
+++ /dev/null
@@ -1,447 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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 createTestExistenceCheckingWithCoordinationType() 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)");
- }
- });
- }
-
- public void testCache() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertNotNull(cache);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheType.SOFT, cache.getType());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getSize());
- }
-
- public void testSetSize() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithSize();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
- }
-
- public void testSetShared() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
-
- cache.setShared(null);
- assertNull(typeResource.getAnnotation(EclipseLink.CACHE));
-
- assertSourceDoesNotContain("@Cache", cu);
- }
-
- public void testGetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getExpiry());
- }
-
- public void testSetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertNotNull(timeOfDay);
- }
-
- public void testAddExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- cache.addExpiryTimeOfDay();
-
- assertNotNull(cache.getExpiryTimeOfDay());
-
- assertSourceContains("@Cache(expiryTimeOfDay = @TimeOfDay)", cu);
- }
-
- public void testRemoveExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiryTimeOfDay();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
- }
-
- public void testSetAlwaysRefresh() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
-
- cache.setAlwaysRefresh(null);
- assertNull(typeResource.getAnnotation(EclipseLink.CACHE));
-
- assertSourceDoesNotContain("@Cache", cu);
- }
-
- public void testGetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
- }
-
- public void testSetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
-
- cache.setRefreshOnlyIfNewer(null);
- assertNull(typeResource.getAnnotation(EclipseLink.CACHE));
-
- assertSourceDoesNotContain("@Cache", cu);
- }
-
- public void testGetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
- }
-
- public void testSetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
-
- cache.setDisableHits(null);
- assertNull(typeResource.getAnnotation(EclipseLink.CACHE));
-
- assertSourceDoesNotContain("@Cache", cu);
- }
-
-
- public void testGetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithCoordinationType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cache.getCoordinationType());
- }
-
- public void testSetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithCoordinationType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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);
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
deleted file mode 100644
index b0a30dd5e6..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
+++ /dev/null
@@ -1,88 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) typeResource.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) typeResource.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertEquals(ChangeTrackingType.DEFERRED, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
deleted file mode 100644
index 1000e0826f..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
+++ /dev/null
@@ -1,131 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
- }
-
- public void testSetDataValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.conversionValuesSize());
-
- 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.conversionValuesSize());
- }
-
- public void testGetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
- }
-
- public void testSetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.conversionValuesSize());
-
- 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.conversionValuesSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
deleted file mode 100644
index d827614b04..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
+++ /dev/null
@@ -1,105 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.CONVERT));
-
- attributeResource.removeAnnotation(EclipseLink.CONVERT);
- assertNull(attributeResource.getAnnotation(EclipseLink.CONVERT));
-
- attributeResource.addAnnotation(EclipseLink.CONVERT);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.CONVERT));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
deleted file mode 100644
index 9ed93a7c02..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
+++ /dev/null
@@ -1,155 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.CONVERTER));
-
- attributeResource.removeAnnotation(EclipseLink.CONVERTER);
- assertNull(attributeResource.getAnnotation(EclipseLink.CONVERTER));
-
- attributeResource.addAnnotation(EclipseLink.CONVERTER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.CONVERTER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.getAnnotation(EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
deleted file mode 100644
index 442b1b5f0a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
+++ /dev/null
@@ -1,99 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertNotNull(typeResource.getAnnotation(EclipseLink.CUSTOMIZER));
-
- typeResource.removeAnnotation(EclipseLink.CUSTOMIZER);
- assertNull(typeResource.getAnnotation(EclipseLink.CUSTOMIZER));
-
- typeResource.addAnnotation(EclipseLink.CUSTOMIZER);
- assertNotNull(typeResource.getAnnotation(EclipseLink.CUSTOMIZER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) typeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
deleted file mode 100644
index d5fcd62b67..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +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.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.core.JpaAnnotationProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.core.internal.GenericJpaAnnotationProvider;
-import org.eclipse.jpt.core.tests.internal.resource.java.JavaResourceModelTestCase;
-import org.eclipse.jpt.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-
-public class EclipseLinkJavaResourceModelTestCase extends JavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLinkJavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected JpaAnnotationProvider buildAnnotationProvider() {
- return new GenericJpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java
deleted file mode 100644
index a59142792e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- assertNotNull(typeResource.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- typeResource.removeAnnotation(EclipseLink.PRIMARY_KEY);
- assertNull(typeResource.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- typeResource.addAnnotation(EclipseLink.PRIMARY_KEY);
- assertNotNull(typeResource.getAnnotation(EclipseLink.PRIMARY_KEY));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
deleted file mode 100644
index b1159cc83a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
+++ /dev/null
@@ -1,88 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.ExistenceType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) typeResource.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) typeResource.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertEquals(ExistenceType.ASSUME_EXISTENCE, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) typeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
deleted file mode 100644
index 29353c0cf8..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
+++ /dev/null
@@ -1,92 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) attributeResource.getAnnotation(EclipseLink.JOIN_FETCH);
- assertNotNull(joinFetch);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) attributeResource.getAnnotation(EclipseLink.JOIN_FETCH);
- assertEquals(JoinFetchType.OUTER, joinFetch.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java
deleted file mode 100644
index 439f1cadec..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.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.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);
-
- return suite;
- }
-
- private JptEclipseLinkCoreJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
deleted file mode 100644
index c0ac7249bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
+++ /dev/null
@@ -1,111 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.MUTABLE));
-
- attributeResource.removeAnnotation(EclipseLink.MUTABLE);
- assertNull(attributeResource.getAnnotation(EclipseLink.MUTABLE));
-
- attributeResource.addAnnotation(EclipseLink.MUTABLE);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.MUTABLE));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
deleted file mode 100644
index 35ddba444c..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,426 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
-
- attributeResource.removeAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNull(attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
-
- attributeResource.addAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER));
- }
-
- public void testGetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
- }
-
- public void testSetDefaultObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(0, converter.conversionValuesSize());
- assertFalse(converter.conversionValues().hasNext());
- }
-
- public void testConversionValues2() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
-
- converter.addConversionValue(0);
- converter.addConversionValue(1);
-
- assertEquals(2, converter.conversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.conversionValues();
- assertTrue(conversionValues.hasNext());
- assertNotNull(conversionValues.next());
- assertNotNull(conversionValues.next());
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValues3() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(2, converter.conversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.conversionValues();
- 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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- Iterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.conversionValues();
- 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.conversionValues();
- 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.conversionValues();
- 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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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.conversionValuesSize());
- 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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) attributeResource.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.conversionValuesSize());
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
deleted file mode 100644
index 4cca0e564e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
+++ /dev/null
@@ -1,49 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkPrivateOwnedAnnotation privateOwned = (EclipseLinkPrivateOwnedAnnotation) attributeResource.getAnnotation(EclipseLink.PRIVATE_OWNED);
- assertNotNull(privateOwned);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java
deleted file mode 100644
index 07358f94be..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkReadOnlyAnnotation readOnly = (EclipseLinkReadOnlyAnnotation) typeResource.getAnnotation(EclipseLink.READ_ONLY);
- assertNotNull(readOnly);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
deleted file mode 100644
index d18a117d73..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
+++ /dev/null
@@ -1,155 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- attributeResource.removeAnnotation(EclipseLink.READ_TRANSFORMER) ;
- assertNull(attributeResource.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- attributeResource.addAnnotation(EclipseLink.READ_TRANSFORMER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.READ_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
deleted file mode 100644
index 57a21be7eb..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
+++ /dev/null
@@ -1,155 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.STRUCT_CONVERTER));
-
- attributeResource.removeAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertNull(attributeResource.getAnnotation(EclipseLink.STRUCT_CONVERTER));
-
- attributeResource.addAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.STRUCT_CONVERTER));
- }
-
- public void testGetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
- }
-
- public void testSetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.getAnnotation(EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
deleted file mode 100644
index 4b184787f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
+++ /dev/null
@@ -1,220 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
-
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
-
- assertNotNull(timeOfDay);
- }
-
- public void testGetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getHour());
- }
-
- public void testSetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMinute());
- }
-
- public void testSetMinute() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMinute();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getSecond());
- }
-
- public void testSetSecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithSecond();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMillisecond());
- }
-
- public void testSetMillisecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMillisecond();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) typeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
deleted file mode 100644
index 790448fc35..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
+++ /dev/null
@@ -1,158 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.FetchType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.TRANSFORMATION));
-
- attributeResource.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- assertNull(attributeResource.getAnnotation(EclipseLink.TRANSFORMATION));
-
- attributeResource.setPrimaryAnnotation(EclipseLink.TRANSFORMATION, EmptyIterable.<String>instance());
- assertNotNull(attributeResource.getAnnotation(EclipseLink.TRANSFORMATION));
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
deleted file mode 100644
index 7aa34e25a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,214 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER));
-
- attributeResource.removeAnnotation(EclipseLink.TYPE_CONVERTER);
- assertNull(attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER));
-
- attributeResource.addAnnotation(EclipseLink.TYPE_CONVERTER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER));
- }
-
- public void testGetTypeDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.getAnnotation(EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
deleted file mode 100644
index f0e68ecf13..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
+++ /dev/null
@@ -1,219 +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.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- assertNotNull(attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- attributeResource.removeAnnotation(EclipseLink.WRITE_TRANSFORMER) ;
- assertNull(attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- attributeResource.addAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(writeTransformer.getColumn());
- assertEquals("FOO", writeTransformer.getColumn().getName());
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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();
- JavaResourcePersistentType typeResource = buildJavaTypeResource(cu);
- JavaResourcePersistentAttribute attributeResource = typeResource.fields().next();
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) attributeResource.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java
deleted file mode 100644
index 1dadc77fdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.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.eclipselink1_1.core.tests.internal.context;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.eclipselink.core.internal.v1_1.EclipseLink1_1JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-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 IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetInstallDataModelProperties.PLATFORM_ID, EclipseLink1_1JpaPlatformProvider.ID);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java
deleted file mode 100644
index a58aa26b34..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/EclipseLink1_1JpaProjectTests.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.eclipselink1_1.core.tests.internal.context;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.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 EclipseLink1_1ContextModelTestCase
-{
-
- public EclipseLink1_1JpaProjectTests(String name) {
- super(name);
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptCorePlugin.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(JptEclipseLinkCorePlugin.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(JptEclipseLinkCorePlugin.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(JptCorePlugin.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(JptEclipseLinkCorePlugin.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(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.setProperty(OrmFileCreationDataModelProperties.FILE_PATH, JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_1ContentType() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- private void createDefaultEclipseLink1_1OrmXmlFile() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- private void createEclipseLink1_1OrmXmlFile(String filePath) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.setProperty(OrmFileCreationDataModelProperties.VERSION, EclipseLink1_1.SCHEMA_VERSION);
- config.setProperty(OrmFileCreationDataModelProperties.FILE_PATH, filePath);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.1 file
- createDefaultEclipseLink1_1OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_1OrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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("META-INF/orm2.xml");
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_1OrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/JptEclipseLink1_1CoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/JptEclipseLink1_1CoreContextModelTests.java
deleted file mode 100644
index f156a4abcc..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/JptEclipseLink1_1CoreContextModelTests.java
+++ /dev/null
@@ -1,31 +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.eclipselink1_1.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.eclipselink1_1.core.tests.internal.context.orm.JptEclipseLink1_1CoreOrmContextModelTests;
-
-public class JptEclipseLink1_1CoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink1_1CoreContextModelTests.class.getName());
- suite.addTestSuite(EclipseLink1_1JpaProjectTests.class);
- suite.addTest(JptEclipseLink1_1CoreOrmContextModelTests.suite());
- return suite;
- }
-
- private JptEclipseLink1_1CoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmContextModelTestCase.java
deleted file mode 100644
index 346253a8b3..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmContextModelTestCase.java
+++ /dev/null
@@ -1,88 +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.eclipselink1_1.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationOperation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.eclipselink1_1.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLink1_1OrmContextModelTestCase
- extends EclipseLink1_1ContextModelTestCase
-{
- protected JpaXmlResource eclipseLink1_1OrmXmlResource;
-
-
- protected EclipseLink1_1OrmContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.eclipseLink1_1OrmXmlResource = getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- }
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- // don't create default orm.xml - instead build eclipselink-orm.xml
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.FALSE);
- return dataModel;
- }
-
- @Override
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws Exception {
- TestJpaProject testJpaProject = super.buildJpaProject(projectName, autoBuild, jpaConfig);
-
- EclipseLinkOrmFileCreationOperation operation =
- new EclipseLinkOrmFileCreationOperation(buildEclipseLinkOrmConfig(testJpaProject));
- operation.execute(null, null);
-
- return testJpaProject;
- }
-
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(OrmFileCreationDataModelProperties.PROJECT_NAME, testJpaProject.getProject().getName());
- dataModel.setProperty(OrmFileCreationDataModelProperties.VERSION, EclipseLink1_1.SCHEMA_VERSION);
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.eclipseLink1_1OrmXmlResource = null;
- super.tearDown();
- }
-
- @Override
- protected JpaXmlResource getOrmXmlResource() {
- return this.eclipseLink1_1OrmXmlResource;
- }
-
- @Override
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
- @Override
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) super.getEntityMappings();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
deleted file mode 100644
index d1637e7e80..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,431 +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.eclipselink1_1.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.internal.jpa1.context.orm.GenericOrmNullAttributeMapping;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentAttributeTests
- extends EclipseLink1_1OrmContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentAttributeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- // create both orm.xml and eclipselink-orm.xml
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- 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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.makeSpecified();
-
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormPersistentAttribute.makeSpecified();
-
- assertEquals(0, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.specifiedAttributes();
- 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.virtualAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericOrmNullAttributeMapping);
- ormPersistentAttribute.makeSpecified(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
- ormPersistentAttribute.makeSpecified(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.specifiedAttributes();
-
- 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.virtualAttributesSize());
-
- ormPersistentType.virtualAttributes().next().makeSpecified();
- ormPersistentType.virtualAttributes().next().makeSpecified();
-
- assertEquals(0, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(2, ormPersistentType.virtualAttributesSize());
- assertEquals(0, ormPersistentType.specifiedAttributesSize());
-
- Iterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
- OrmPersistentAttribute 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.virtualAttributesSize());
-
- ormPersistentType.virtualAttributes().next().makeSpecified();
- ormPersistentType.virtualAttributes().next().makeSpecified();
-
-
- ormPersistentType.specifiedAttributes().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(2, ormPersistentType.specifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- specifiedOrmPersistentAttribute.makeVirtual();
- assertEquals(1, ormPersistentType.virtualAttributesSize());
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.virtualAttributes().next().getName());
- assertEquals("name", ormPersistentType.specifiedAttributes().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().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);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().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();
-
- OrmPersistentAttribute 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());
- JavaResourcePersistentAttribute javaResourcePersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute();
- assertTrue(javaResourcePersistentAttribute.isField());
- assertEquals("id", javaResourcePersistentAttribute.getName());
- assertEquals(javaPersistentType.getResourcePersistentType().persistableFields().next(), javaResourcePersistentAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.makeSpecified();
- 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 the property java resource persistent attribute is used in orm.
- ormPersistentAttribute.makeVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertNotSame(ormPersistentAttribute, ormPersistentType.getAttributeNamed("id"));
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- javaResourcePersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute();
- assertTrue(javaResourcePersistentAttribute.isProperty());
- assertEquals("id", javaResourcePersistentAttribute.getName());
- assertEquals(javaPersistentType.getResourcePersistentType().persistableProperties().next(), javaResourcePersistentAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentAttribute.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentAttribute.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.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();
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getOwningPersistentType().getAccess());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
-
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isProperty());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isField());
-
- ormPersistentAttribute.setSpecifiedAccess(AccessType.FIELD);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isField());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isField());
- }
-
- public void testGetAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isField());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isField());
-
-
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isField());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isField());
-
-
- 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.getResourcePersistentAttribute().isField());
- }
-
- public void testGetAccessPropertyInJava() throws Exception {
- createTestEntityIdMappingPropertyAccess();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isProperty());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isProperty());
-
-
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourcePersistentAttribute().isProperty());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourcePersistentAttribute().isProperty());
-
-
- 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.getResourcePersistentAttribute().isProperty());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
deleted file mode 100644
index d12e71fca3..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
+++ /dev/null
@@ -1,301 +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.eclipselink1_1.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AccessType;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentTypeTests extends EclipseLink1_1OrmContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentTypeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- // create both orm.xml and eclipselink-orm.xml
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- 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());
-
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.makeSpecified();
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
deleted file mode 100644
index 67ca161100..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
+++ /dev/null
@@ -1,63 +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.eclipselink1_1.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmTransientMappingTests
- extends EclipseLink1_1OrmContextModelTestCase
-{
- 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);
-
- OrmPersistentAttribute 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.getSpecifiedMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/JptEclipseLink1_1CoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/JptEclipseLink1_1CoreOrmContextModelTests.java
deleted file mode 100644
index d1388517d0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_1/core/tests/internal/context/orm/JptEclipseLink1_1CoreOrmContextModelTests.java
+++ /dev/null
@@ -1,33 +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.eclipselink1_1.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLink1_1CoreOrmContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink1_1CoreOrmContextModelTests.class.getName());
-
- suite.addTestSuite(EclipseLink1_1OrmPersistentAttributeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmPersistentTypeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmTransientMappingTests.class);
-
- return suite;
- }
-
-
- private JptEclipseLink1_1CoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java
deleted file mode 100644
index 5b0cc23539..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.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.eclipselink1_2.core.tests.internal.context;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.eclipselink.core.internal.v1_2.EclipseLink1_2JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-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 IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM_ID, EclipseLink1_2JpaPlatformProvider.ID);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
deleted file mode 100644
index 57bf306441..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
+++ /dev/null
@@ -1,168 +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.eclipselink1_2.core.tests.internal.context;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.eclipselink.core.internal.JptEclipseLinkCorePlugin;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.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 EclipseLink1_2ContextModelTestCase
-{
-
- public EclipseLink1_2JpaProjectTests(String name) {
- super(name);
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptCorePlugin.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(JptEclipseLinkCorePlugin.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(JptEclipseLinkCorePlugin.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(JptCorePlugin.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(JptEclipseLinkCorePlugin.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(OrmFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JpaFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.setProperty(JpaFileCreationDataModelProperties.FILE_PATH, JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_2ContentType() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- }
-
- private void createDefaultEclipseLink1_2OrmXmlFile() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- }
-
- private void createEclipseLink1_2OrmXmlFile(String filePath) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JpaFileCreationDataModelProperties.PROJECT_NAME, getJpaProject().getProject().getName());
- config.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink1_2.SCHEMA_VERSION);
- config.setProperty(JpaFileCreationDataModelProperties.FILE_PATH, filePath);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.2 file
- createDefaultEclipseLink1_2OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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(JptEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_FILE_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_2OrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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("META-INF/orm2.xml");
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_2OrmXmlFile("META-INF/orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource("META-INF/orm2.xml");
- assertNotNull(resource);
- assertEquals(JptEclipseLinkCorePlugin.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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/JptEclipseLink1_2CoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/JptEclipseLink1_2CoreContextModelTests.java
deleted file mode 100644
index b5e46ef8fa..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink1_2/core/tests/internal/context/JptEclipseLink1_2CoreContextModelTests.java
+++ /dev/null
@@ -1,30 +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.eclipselink1_2.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLink1_2CoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink1_2CoreContextModelTests.class.getName());
- suite.addTestSuite(EclipseLink1_2JpaProjectTests.class);
- // suite.addTest(JptEclipseLink1_2CoreOrmContextModelTests.suite());
- return suite;
- }
-
- private JptEclipseLink1_2CoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java
deleted file mode 100644
index 4f90ab7950..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.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.eclipselink2_0.core.tests.internal.context;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformProvider;
-import org.eclipse.jpt.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLink2_0ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_0ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JptCorePlugin.JPA_FACET_VERSION_2_0);
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM_ID, EclipseLink2_0JpaPlatformProvider.ID);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/JptEclipseLink2_0CoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/JptEclipseLink2_0CoreContextModelTests.java
deleted file mode 100644
index df6e40ecf5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/JptEclipseLink2_0CoreContextModelTests.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.eclipselink2_0.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.java.JptEclipseLink2_0JavaContextModelTests;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.orm.JptEclipseLink2_0OrmContextModelTests;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.persistence.JptEclipseLink2_0CorePersistenceContextModelTests;
-
-/**
- * JptEclipseLink2_0CoreContextModelTests
- */
-public class JptEclipseLink2_0CoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink2_0CoreContextModelTests.class.getName());
-
- suite.addTest(JptEclipseLink2_0CorePersistenceContextModelTests.suite());
- suite.addTest(JptEclipseLink2_0JavaContextModelTests.suite());
- suite.addTest(JptEclipseLink2_0OrmContextModelTests.suite());
-
- return suite;
- }
-
- private JptEclipseLink2_0CoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
deleted file mode 100644
index daf10785d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
+++ /dev/null
@@ -1,722 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.UniqueConstraint;
-import org.eclipse.jpt.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable);
-
-
- //set name in the resource model, verify context model updated
- attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.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());
-
- attributeResource.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable3 = (CollectionTable2_0Annotation) attributeResource.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) attributeResource.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(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //add the collection table annotation, verify default collection table name is the same
- attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
- assertNotNull(attributeResource.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().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
-
- //set schema in the resource model, verify context model updated
- attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.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());
-
- attributeResource.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.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) attributeResource.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(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
-
- //set catalog in the resource model, verify context model updated
- attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.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());
-
- attributeResource.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) attributeResource.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) attributeResource.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(attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
-
- JoinColumn joinColumn = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) attributeResource.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<JoinColumn> joinColumns = collectionTable.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = collectionTable.specifiedJoinColumns();
- 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().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.joinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.joinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.joinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.joinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.joinColumnsSize());
-
-
- collectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JoinColumn> joinColumns = collectionTable.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) attributeResource.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<JoinColumn> joinColumns = collectionTable.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(collectionTable.specifiedJoinColumns().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.specifiedJoinColumnsSize());
-
- collectionTable.addSpecifiedJoinColumn(0);
- assertEquals(1, collectionTable.specifiedJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, collectionTable.specifiedJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.uniqueConstraintsSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, collectionTable.uniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().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");
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.uniqueConstraints();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().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");
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.uniqueConstraints();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.uniqueConstraintsSize());
-
- collectionTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.uniqueConstraintsSize());
-
-
- collectionTable.moveUniqueConstraint(2, 0);
- ListIterator<UniqueConstraint> uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
-
-
- collectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNames().next());
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNames().next());
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().attributes().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) attributeResource.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<UniqueConstraint> uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
deleted file mode 100644
index d5b35d2a62..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
+++ /dev/null
@@ -1,2064 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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 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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertNull(persistentAttribute.getSpecifiedMapping());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertNull(attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(attributeResource.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) attributeResource.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollection.setTargetClass("newTargetClass");
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the resource model
- elementCollection.setTargetClass(null);
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) attributeResource.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().attributes().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().specifiedClassRefs();
- 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().attributes().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().attributes().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().attributes().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().attributes().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().attributes().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());
- }
-
- public void testResolvedTargetEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target embeddable not in the persistence unit
- assertNull(elementCollectionMapping.getResolvedTargetEmbeddable());
-
- //add target embeddable to the persistence unit, now target embeddable should resolve
- createTestTargetEmbeddableAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, elementCollectionMapping.getResolvedTargetEmbeddable());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertNull(elementCollectionMapping.getResolvedTargetEmbeddable());
-
-
- elementCollectionMapping.setSpecifiedTargetClass(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, elementCollectionMapping.getResolvedTargetEmbeddable());
-
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(addressTypeMapping, elementCollectionMapping.getResolvedTargetEmbeddable());
- }
-
- public void testResolvedTargetEmbeddableWithBasicType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target is a basic type, so resolved target embeddable is null
- assertNull(elementCollectionMapping.getResolvedTargetEmbeddable());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) attributeResource.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.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) attributeResource.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.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.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().attributes().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().attributes().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().attributes().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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.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");
- attributeResource.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(attributeResource.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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- elementCollectionMapping2_0.candidateMapKeyNames();
- 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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = elementCollectionMapping2_0.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("Address");
- mapKeyNames = elementCollectionMapping2_0.candidateMapKeyNames();
- 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.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClass);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClass.setValue("myMapKeyClass");
- 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");
- attributeResource.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.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(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().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().attributes().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().attributes().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().attributes().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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getSpecifiedMapping();
-
- assertNull(elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getName());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- ColumnAnnotation column = (ColumnAnnotation) attributeResource.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.specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- 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
- attributeResource.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- 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();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("addresses", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = attributeOverrideContainer.virtualAttributeOverrides().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().specifiedClassRefs();
- 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", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().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) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.specifiedAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(6, attributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, attributeOverrideContainer.attributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("state.name");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- attributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("state.abbr", attributeOverrideContainer.virtualAttributeOverrides().next().getName());
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- attributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- attributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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().specifiedClassRefs();
- PersistentType persistentType = specifiedClassRefs.next().getJavaPersistentType();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
- ListIterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- AttributeOverride 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.virtualAttributeOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.virtualAttributeOverrides();
- 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().getAttributeOverrideNamed("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().attributes().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getSpecifiedMapping();
-
- 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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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.specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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
- attributeResource.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("parcels", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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().specifiedClassRefs();
- 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", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().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) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
-
-
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.virtualAttributeOverrides().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().specifiedClassRefs();
- 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", attributeResource.getName());
-
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().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) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.specifiedAttributeOverridesSize());
- assertEquals(0, mapKeyAttributeOverrideContainer.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, valueAttributeOverrideContainer.specifiedAttributeOverridesSize());
- assertEquals(1, mapKeyAttributeOverrideContainer.specifiedAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(5, mapKeyAttributeOverrideContainer.attributeOverridesSize());
- assertEquals(5, valueAttributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, mapKeyAttributeOverrideContainer.attributeOverridesSize());
- assertEquals(6, valueAttributeOverrideContainer.attributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.city");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(2, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.state.name");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(1, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- valueAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- valueAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("tax", valueAttributeOverrideContainer.virtualAttributeOverrides().next().getName());
- assertEquals(2, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals("state.abbr", mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().getName());
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- valueAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<AttributeOverride> virtualAttributeOverrides = valueAttributeOverrideContainer.virtualAttributeOverrides();
- assertEquals("tax", virtualAttributeOverrides.next().getName());
- assertEquals("parcelNumber", virtualAttributeOverrides.next().getName());
- assertEquals("size", virtualAttributeOverrides.next().getName());
- assertEquals(3, valueAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- virtualAttributeOverrides = mapKeyAttributeOverrideContainer.virtualAttributeOverrides();
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- valueAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- ListIterator<AttributeOverride> specifiedOverrides = valueAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
-
- attributeResource.moveAnnotation(3, 2, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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.allOverrideableAttributeMappingNames().hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
deleted file mode 100644
index 85fcd7777e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
+++ /dev/null
@@ -1,1808 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.MappedSuperclass;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AssociationOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().overridableAttributeNames();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().overridableAttributeNames();
- 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().overridableAttributeNames();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().overridableAttributeNames();
- 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().allOverridableAttributeNames();
- 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().allOverridableAttributeNames();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.allOverridableAttributeNames();
- 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().allOverridableAssociationNames();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.allOverridableAssociationNames();
- 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().allOverridableAttributeNames();
- 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().allOverridableAttributeNames();
- 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<JavaAttributeOverride> specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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
- typeResource.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- typeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- typeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- typeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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().specifiedClassRefs();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- AttributeOverride virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride = virtualAttributeOverride.setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().specifiedClassRefs();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- AttributeOverride virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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, typeResource.getName());
- assertNull(typeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride = virtualAttributeOverride.setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) typeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) typeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.specifiedAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(1, overrideContainer.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(0, overrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.attributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.attributeOverridesSize());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) typeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, overrideContainer.attributeOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> attributeOverrides = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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<JavaAttributeOverride> virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> attributeOverrides = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(3, CollectionTools.size(typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)));
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
-
- Iterator<NestableAnnotation> attributeOverrideResources = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<JavaAttributeOverride> attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrideResources = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrideResources = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(typeResource.getAnnotation(AttributeOverridesAnnotation.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.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- overrideContainer.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<AttributeOverride> attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = typeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- 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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((AttributeOverrideAnnotation) typeResource.addAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) typeResource.addAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) typeResource.addAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<AttributeOverride> attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.moveAnnotation(2, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.moveAnnotation(0, 1, AttributeOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- typeResource.removeAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- AttributeOverride 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.virtualAttributeOverrides().next().setVirtual(false);
- AttributeOverride specifiedAttributeOverride = overrideContainer.specifiedAttributeOverrides().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- 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().overridableAssociationNames();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().overridableAssociationNames();
- 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().allOverridableAssociationNames();
- 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().allOverridableAssociationNames();
- 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<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) typeResource.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) typeResource.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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
- typeResource.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- typeResource.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- typeResource.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- typeResource.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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().specifiedClassRefs();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(SUB_TYPE_NAME, typeResource.getName());
- assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.virtualAssociationOverridesSize());
- AssociationOverride virtualAssociationOverride = overrideContainer.virtualAssociationOverrides().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, typeResource.getName());
- assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.virtualAssociationOverridesSize());
- virtualAssociationOverride = overrideContainer.virtualAssociationOverrides().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.virtualAssociationOverrides().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride = virtualAssociationOverride.setVirtual(false);
- assertEquals(3, overrideContainer.virtualAssociationOverridesSize());
-
-
-
-// //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();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(0, overrideContainer.specifiedAssociationOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) typeResource.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) typeResource.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.specifiedAssociationOverridesSize());
- }
-
- 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.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(2, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(1, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(0, overrideContainer.virtualAssociationOverridesSize());
- }
-
- 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.associationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(4, overrideContainer.associationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(4, overrideContainer.associationOverridesSize());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) typeResource.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, overrideContainer.associationOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> associationOverrides = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
-
- 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<JavaAssociationOverride> virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- Iterator<NestableAnnotation> associationOverrides = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
-
- 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.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertEquals(2, CollectionTools.size(typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)));
-
- overrideContainer.specifiedAssociationOverrides().next().setVirtual(true);
-
- Iterator<NestableAnnotation> associationOverrideResources = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.specifiedAssociationOverrides().next().setVirtual(true);
- associationOverrideResources = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.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.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedAssociationOverride(1, 0);
- ListIterator<AssociationOverride> associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedAssociationOverride(0, 1);
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = typeResource.annotations(AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- 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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
-
- ((AssociationOverrideAnnotation) typeResource.addAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) typeResource.addAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) typeResource.addAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<AssociationOverride> associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.moveAnnotation(2, 0, AssociationOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.moveAnnotation(0, 1, AssociationOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- typeResource.removeAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME, AssociationOverridesAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaAssociationOverride> virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- AssociationOverride 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.virtualAssociationOverrides().next().setVirtual(false);
- AssociationOverride specifiedAssociationOverride = overrideContainer.specifiedAssociationOverrides().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- 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().specifiedClassRefs();
- 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.virtualAttributeOverridesSize());
- ListIterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- AttributeOverride 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 = attributeOverrideContainer.getAttributeOverrideNamed("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 = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getAttributeOverrideNamed("plusfour").setVirtual(false);
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = attributeOverrideContainer.getAttributeOverrideNamed("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.setVirtual(false);
- 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(null, specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals(null, 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().specifiedClassRefs();
- 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.virtualAttributeOverridesSize());
- ListIterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- AttributeOverride 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 = attributeOverrideContainer.getAttributeOverrideNamed("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 = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getAttributeOverrideNamed("plusfour").setVirtual(false);
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = attributeOverrideContainer.getAttributeOverrideNamed("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.setVirtual(false);
- 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(null, specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals(null, 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().specifiedClassRefs();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.virtualAssociationOverridesSize());
- ListIterator<AssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.virtualAssociationOverrides();
- AssociationOverride 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().specifiedClassRefs();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.virtualAssociationOverridesSize());
- ListIterator<AssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.virtualAssociationOverrides();
- AssociationOverride 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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getResourcePersistentType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().removeAnnotation(JPA2_0.CACHEABLE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
deleted file mode 100644
index c0309730c5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,1300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinTableJoiningStrategy;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.PersistentType;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.INNER);
-
- assertEquals(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- attributeResource.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().attributes().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getSpecifiedMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) attributeResource.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.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(attributeResource.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) attributeResource.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.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()).attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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()).attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.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");
- attributeResource.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.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());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- manyToManyMapping2_0.candidateMapKeyNames();
- 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().attributes().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = manyToManyMapping2_0.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = manyToManyMapping2_0.candidateMapKeyNames();
- 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.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClass);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClass.setValue("myMapKeyClass");
- assertEquals("myMapKeyClass", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClass.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClass.setValue(null);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClass.getValue());
-
- mapKeyClass.setValue("myMapKeyClass");
- attributeResource.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.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(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().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().attributes().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().attributes().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.getRelationshipReference().getJoinTableJoiningStrategy().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().attributes().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- manyToManyMapping.getRelationshipReference().setMappedByJoiningStrategy();
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().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();
- ((JoinTableJoiningStrategy) owningManyToManyMapping.getRelationshipReference().getPredominantJoiningStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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().attributes().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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.specifiedAttributeOverrides();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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
- attributeResource.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("parcels", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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().specifiedClassRefs();
- 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", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().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) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.specifiedAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.virtualAttributeOverrides();
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
deleted file mode 100644
index f0a6c081de..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,329 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.ManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceAttribute.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceAttribute.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceAttribute.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null);
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
-
- ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
deleted file mode 100644
index cbb6b3846d..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,528 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(typeResource.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(typeResource.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(typeResource.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());
-
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- typeResource.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(null, readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- typeResource.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.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
-
- typeResource.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();
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) typeResource.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.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.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.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(typeResource.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) typeResource.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getResourcePersistentType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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().getResourcePersistentType().removeAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getResourcePersistentType().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 = (PersistenceUnit2_0) 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 = (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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
deleted file mode 100644
index fe53fd9e39..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,1416 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Embeddable;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.persistence.ClassRef;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OneToManyRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.core.resource.java.AttributeOverridesAnnotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-/**
- * 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().attributes().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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- 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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) attributeResource.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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- 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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) attributeResource.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(attributeResource.getAnnotation(JPA.ONE_TO_MANY)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) attributeResource.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(attributeResource.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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) attributeResource.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.getSpecifiedMapping());
-
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- attributeResource.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertNull(persistentAttribute.getSpecifiedMapping());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.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");
- attributeResource.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) attributeResource.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());
- assertNull(attributeResource.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- 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.candidateMapKeyNames();
- 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.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaOneToManyMapping.candidateMapKeyNames();
- 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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- attributeResource.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClass);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClass.setValue("myMapKeyClass");
- assertEquals("myMapKeyClass", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClass.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClass.setValue(null);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClass.getValue());
-
- mapKeyClass.setValue("myMapKeyClass");
- attributeResource.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) attributeResource.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(attributeResource.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().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().attributes().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().attributes().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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- oneToManyMapping.getRelationshipReference().setMappedByJoiningStrategy();
- oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name
-
- oneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
-
- JoinColumn joinColumn = oneToManyMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
-
- 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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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().attributes().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
- ((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);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- 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.specifiedAttributeOverrides();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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
- attributeResource.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeResource.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- 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();
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- assertEquals("parcels", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- AttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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().specifiedClassRefs();
- 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", attributeResource.getName());
- assertNull(attributeResource.getAnnotation(AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(attributeResource.getAnnotation(AttributeOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().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) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.specifiedAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.specifiedAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.attributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) attributeResource.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.virtualAttributeOverrides();
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.virtualAttributeOverridesSize());
- }
-
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- mapKeyAttributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
-
- attributeResource.moveAnnotation(1, 0, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = attributeResource.annotations(AttributeOverrideAnnotation.ANNOTATION_NAME, AttributeOverridesAnnotation.ANNOTATION_NAME);
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
deleted file mode 100644
index 5cfe6c71ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,812 +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.eclipselink2_0.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceAttribute.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceAttribute.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceAttribute.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceAttribute.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null);
- assertNotNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentType resourceType =
- getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaOneToOneMapping2_0);
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
- assertNull(resourceAttribute.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaManyToOneMapping2_0);
-
- contextAttribute.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertNull(resourceAttribute.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()).attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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()).attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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().attributes().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().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getSpecifiedMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getSpecifiedMapping();
- 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().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) attributeResource.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().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getSpecifiedMapping();
-
- assertEquals(Boolean.FALSE, this.getOrphanRemovalOf(oneToOneMapping).getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) attributeResource.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(attributeResource.getAnnotation(JPA.ONE_TO_ONE)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) attributeResource.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(attributeResource.getAnnotation(JPA.ONE_TO_ONE));
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) attributeResource.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.getSpecifiedMapping());
-
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- attributeResource.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertNull(persistentAttribute.getSpecifiedMapping());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setPrimaryKeyJoinColumnJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourcePersistentAttribute resourceAttribute = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceAttribute.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().attributes().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationshipReference2_0 relationshipReference = mapping.getRelationshipReference();
-
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceAttribute.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/JptEclipseLink2_0JavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/JptEclipseLink2_0JavaContextModelTests.java
deleted file mode 100644
index 95cac0fda0..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/JptEclipseLink2_0JavaContextModelTests.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.eclipselink2_0.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLink2_0JavaContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink2_0JavaContextModelTests.class.getName());
- 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 JptEclipseLink2_0JavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
deleted file mode 100644
index 9ed05a7538..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmCollectionTableTests extends EclipseLink2_0OrmContextModelTestCase
-{
- public EclipseLink2_0OrmCollectionTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptCorePlugin.DEFAULT_ORM_XML_FILE_PATH);
- 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);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(TYPE_NAME + "_projects", ormCollectionTable.getSpecifiedName());
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertEquals(0, ormCollectionTable.specifiedJoinColumnsSize());
- OrmJoinColumn ormJoinColumn = ormCollectionTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.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", ormCollectionTable.getSpecifiedName());
- assertEquals("CATALOG", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", ormCollectionTable.getSpecifiedSchema());
- assertEquals(1, ormCollectionTable.specifiedJoinColumnsSize());
- ormJoinColumn = ormCollectionTable.specifiedJoinColumns().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.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.makeVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals("JAVA_COLLECTION_TABLE", ormCollectionTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName(null);
- assertEquals("Bar_projects", ormCollectionTable.getSpecifiedName());
- assertEquals("Bar_projects", ormCollectionTable.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.specifiedJoinColumns();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormCollectionTable.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- 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.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.specifiedJoinColumns();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(0);
- assertFalse(ormCollectionTable.specifiedJoinColumns().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.uniqueConstraints();
- 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.uniqueConstraints();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().columnNames().next());
- assertEquals("foo", uniqueConstraints.next().columnNames().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.uniqueConstraintsSize());
-
- 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.uniqueConstraintsSize());
- }
-
- 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.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(1);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(0);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- 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.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().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.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().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.uniqueConstraints();
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("BAR", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertEquals("FOO", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(0);
- uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.attributes().next().getMapping();
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormElementCollectionMapping.getPersistentAttribute().isVirtual());
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.uniqueConstraints();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping2_0 = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().attributes().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 = ormCollectionTable.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());
-
- ormElementCollectionMapping.getPersistentAttribute().makeSpecified();
-
- ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.attributes().next().getMapping();
- assertEquals(0, ormElementCollectionMapping.getCollectionTable().uniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmContextModelTestCase.java
deleted file mode 100644
index f1a68e786f..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmContextModelTestCase.java
+++ /dev/null
@@ -1,89 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationOperation;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLink2_0OrmContextModelTestCase
- extends EclipseLink2_0ContextModelTestCase
-{
- protected JpaXmlResource eclipseLink2_0OrmXmlResource;
-
-
- protected EclipseLink2_0OrmContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.eclipseLink2_0OrmXmlResource = getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- }
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- // don't create default orm.xml - instead build eclipselink-orm.xml
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.FALSE);
- return dataModel;
- }
-
- @Override
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws Exception {
- TestJpaProject testJpaProject = super.buildJpaProject(projectName, autoBuild, jpaConfig);
-
- EclipseLinkOrmFileCreationOperation operation =
- new EclipseLinkOrmFileCreationOperation(buildEclipseLinkOrmConfig(testJpaProject));
- operation.execute(null, null);
-
- return testJpaProject;
- }
-
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(JpaFileCreationDataModelProperties.PROJECT_NAME, testJpaProject.getProject().getName());
- dataModel.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink2_0.SCHEMA_VERSION);
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.eclipseLink2_0OrmXmlResource = null;
- super.tearDown();
- }
-
- @Override
- protected JpaXmlResource getOrmXmlResource() {
- return this.eclipseLink2_0OrmXmlResource;
- }
-
- @Override
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
- @Override
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) super.getEntityMappings();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
deleted file mode 100644
index a757dec534..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
+++ /dev/null
@@ -1,1438 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.IdMapping;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.ManyToOneMapping;
-import org.eclipse.jpt.core.context.OneToManyMapping;
-import org.eclipse.jpt.core.context.TransientMapping;
-import org.eclipse.jpt.core.context.VersionMapping;
-import org.eclipse.jpt.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.core.context.orm.OrmColumn;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmElementCollectionMappingTests extends EclipseLink2_0OrmContextModelTestCase
-{
- 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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals("java.lang.String", ormElementCollectionMapping.getSpecifiedTargetClass());
-
- ormPersistentAttribute.makeSpecified();
- ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.makeSpecified(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.setSpecifiedMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.specifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.specifiedAttributes().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.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.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.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
-
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.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");
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(ormElementCollectionMapping.getMapKey());
- assertFalse(ormElementCollectionMapping.isPkMapKey());
- assertFalse(ormElementCollectionMapping.isCustomMapKey());
- assertTrue(ormElementCollectionMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setPkMapKey(true);
- assertEquals(null, ormElementCollectionMapping.getMapKey());//no primary key on an embeddable
- assertTrue(ormElementCollectionMapping.isPkMapKey());
- assertFalse(ormElementCollectionMapping.isCustomMapKey());
- assertFalse(ormElementCollectionMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setCustomMapKey(true);
- javaElementCollectionMapping.setSpecifiedMapKey("city");
- assertEquals("city", ormElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("city", ormElementCollectionMapping.getMapKey());
- assertFalse(ormElementCollectionMapping.isPkMapKey());
- assertTrue(ormElementCollectionMapping.isCustomMapKey());
- assertFalse(ormElementCollectionMapping.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());
- }
-
- 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");
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- ormElementCollectionMapping.candidateMapKeyNames();
- 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");
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormElementCollectionMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = ormElementCollectionMapping.candidateMapKeyNames();
- 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.getPersistentAttribute().makeSpecified();
- ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormElementCollectionMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = ormElementCollectionMapping.candidateMapKeyNames();
- 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.candidateMapKeyNames();
- 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");
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormElementCollectionMapping.getMapKeyClass());
- assertEquals("java.lang.String", ormElementCollectionMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("java.lang.Integer", ormElementCollectionMapping.getMapKeyClass());
- assertEquals("java.lang.Integer", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormElementCollectionMapping.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.makeVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- orderable = (Orderable2_0) elementCollectionMapping.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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
- assertEquals("addresses", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
-
- //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", 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 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(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 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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
-
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
-
- //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", ormColumn.getSpecifiedTable());
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getSpecifiedTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesVirtualMapping.getValueColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.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.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- 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.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.specifiedAttributeOverrides().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.virtualAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.specifiedAttributeOverrides().hasNext());
- assertFalse(attributeOverrideContainer.virtualAttributeOverrides().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
- OrmPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("addresses");
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.attributeOverridesSize());
- assertEquals(0, attributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(4, attributeOverrideContainer.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- OrmAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaElementCollectionMapping.getValueAttributeOverrideContainer().specifiedAttributeOverrides().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.attributeOverridesSize());
- assertEquals(0, attributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(4, attributeOverrideContainer.specifiedAttributeOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.specifiedAttributeOverrides();
- 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());
-
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("addresses").makeSpecified();
- elementCollectionMapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.attributeOverridesSize());
- assertEquals(4, attributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals(0, attributeOverrideContainer.specifiedAttributeOverridesSize());
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", attributeOverride.getColumn().getTable());
- assertEquals(null, attributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, attributeOverride.getColumn().isInsertable());
- assertEquals(true, attributeOverride.getColumn().isUpdatable());
- assertEquals(false, attributeOverride.getColumn().isUnique());
- assertEquals(true, attributeOverride.getColumn().isNullable());
- assertEquals(255, attributeOverride.getColumn().getLength());
- assertEquals(0, attributeOverride.getColumn().getPrecision());
- assertEquals(0, attributeOverride.getColumn().getScale());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- assertEquals(TYPE_NAME + "_addresses", attributeOverride.getColumn().getDefaultTable());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- assertEquals(4, attributeOverrideContainer.attributeOverridesSize());
- assertEquals(1, attributeOverrideContainer.specifiedAttributeOverridesSize());
- assertEquals(3, attributeOverrideContainer.virtualAttributeOverridesSize());
- assertEquals("city", attributeOverrideContainer.specifiedAttributeOverrides().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
-
- //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", 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 {
- 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(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 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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getSpecifiedTable());
-
- //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", ormColumn.getSpecifiedTable());
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getSpecifiedTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- }
-
- public void testSelfReferentialElementCollectionMapping() throws Exception {
- createSelfReferentialElementCollection();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- OrmElementCollectionMapping2_0 mapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("elementCollection").getMapping();
- assertFalse(mapping.allOverrideableAttributeMappingNames().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
deleted file mode 100644
index ac72012b41..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
+++ /dev/null
@@ -1,1801 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.core.context.BasicMapping;
-import org.eclipse.jpt.core.context.EmbeddedMapping;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.InheritanceType;
-import org.eclipse.jpt.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmEntityTests extends EclipseLink2_0OrmContextModelTestCase
-{
- 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.overridableAttributeNames();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.overridableAttributeNames();
- 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.overridableAttributeNames();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.overridableAttributeNames();
- 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().allOverridableAttributeNames();
- 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.allOverridableAttributeNames();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAttributes = abstractEntity.allOverridableAttributeNames();
- 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.allOverridableAssociationNames();
- 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.allOverridableAssociationNames();
- 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.allOverridableAttributeNames();
- 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();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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.virtualAttributeOverridesSize());
- AttributeOverride virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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").makeSpecified();
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride = virtualAttributeOverride.setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
- AttributeOverride virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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").makeSpecified();
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.virtualAttributeOverridesSize());
- virtualAttributeOverride = overrideContainer.virtualAttributeOverrides().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.virtualAttributeOverrides().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride = virtualAttributeOverride.setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.specifiedAttributeOverridesSize());
-
- 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.specifiedAttributeOverridesSize());
- }
-
- 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.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(2, overrideContainer.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(1, overrideContainer.virtualAttributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(0, overrideContainer.virtualAttributeOverridesSize());
- }
-
- 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.attributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.attributeOverridesSize());
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.attributeOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("bar");
- assertEquals(4, overrideContainer.attributeOverridesSize());
- }
-
- 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.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- 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();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- 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();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
-
- Iterator<OrmAttributeOverride> attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals(1, entityResource.getAttributeOverrides().size());
-
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.specifiedAttributeOverrides().next().setVirtual(true);
- assertEquals(0, entityResource.getAttributeOverrides().size());
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
- overrideContainer.virtualAttributeOverrides().next().setVirtual(false);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedAttributeOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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.moveSpecifiedAttributeOverride(0, 1);
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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();
- AttributeOverrideContainer 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.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- 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.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- attributeOverrides = overrideContainer.specifiedAttributeOverrides();
- 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();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- AttributeOverride 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.virtualAttributeOverrides().next().setVirtual(false);
- AttributeOverride specifiedAttributeOverride = overrideContainer.specifiedAttributeOverrides().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.virtualAttributeOverrides();
- 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.overridableAssociationNames();
- 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.allOverridableAssociationNames();
- 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.allOverridableAssociationNames();
- 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();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
-
- 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.specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(1, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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.specifiedAssociationOverrides();
- 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.specifiedAssociationOverrides();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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.virtualAssociationOverridesSize());
- AssociationOverride virtualAssociationOverride = overrideContainer.virtualAssociationOverrides().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.virtualAssociationOverridesSize());
- virtualAssociationOverride = overrideContainer.virtualAssociationOverrides().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.virtualAssociationOverrides().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride = virtualAssociationOverride.setVirtual(false);
- assertEquals(3, overrideContainer.virtualAssociationOverridesSize());
-
-
-
-// //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.specifiedAssociationOverridesSize());
-
- //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.specifiedAssociationOverridesSize());
- }
-
- 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.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(3, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(2, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(1, overrideContainer.virtualAssociationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(0, overrideContainer.virtualAssociationOverridesSize());
- }
-
- 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.associationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(4, overrideContainer.associationOverridesSize());
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- assertEquals(4, overrideContainer.associationOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("bar");
- assertEquals(5, overrideContainer.associationOverridesSize());
- }
-
- 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.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- 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();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- 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();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
- overrideContainer.specifiedAssociationOverrides().next().setVirtual(true);
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, entityResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.specifiedAssociationOverrides().next().setVirtual(true);
- assertEquals(0, entityResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
- overrideContainer.virtualAssociationOverrides().next().setVirtual(false);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedAssociationOverride(1, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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.moveSpecifiedAssociationOverride(0, 1);
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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();
- AssociationOverrideContainer 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.specifiedAssociationOverrides();
- 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.specifiedAssociationOverrides();
- 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.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.specifiedAssociationOverrides();
- 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();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- AssociationOverride 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.virtualAssociationOverrides().next().setVirtual(false);
- AssociationOverride specifiedAssociationOverride = overrideContainer.specifiedAssociationOverrides().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.virtualAssociationOverrides();
- 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 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");
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.virtualAttributeOverridesSize());
- ListIterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- AttributeOverride 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").makeSpecified();
- 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 = attributeOverrideContainer.getAttributeOverrideNamed("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").makeSpecified();
- AttributeOverride specifiedAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getAttributeOverrideNamed("plusfour").setVirtual(false);
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = attributeOverrideContainer.getAttributeOverrideNamed("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.setVirtual(false);
- 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(null, specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals(null, 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").setSpecifiedMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.virtualAttributeOverridesSize());
- ListIterator<AttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.virtualAttributeOverrides();
- AttributeOverride 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").makeSpecified();
- 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 = attributeOverrideContainer.getAttributeOverrideNamed("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").makeSpecified();
- AttributeOverride specifiedAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getAttributeOverrideNamed("plusfour").setVirtual(false);
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = attributeOverrideContainer.getAttributeOverrideNamed("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.setVirtual(false);
- 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(null, specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals(null, 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");
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.virtualAssociationOverridesSize());
- ListIterator<AssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.virtualAssociationOverrides();
- AssociationOverride 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");
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.virtualAssociationOverridesSize());
- ListIterator<AssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.virtualAssociationOverrides();
- AssociationOverride 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
deleted file mode 100644
index a3dc603ca8..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,960 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.ManyToManyMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmManyToManyMappingTests
- extends EclipseLink2_0OrmContextModelTestCase
-{
- 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");
-
- PersistentAttribute persistentAttribute = ormPersistentType.attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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");
-
- PersistentAttribute persistentAttribute = ormPersistentType.attributes().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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");
-
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(ormManyToManyMapping.getMapKey());
- assertFalse(ormManyToManyMapping.isPkMapKey());
- assertFalse(ormManyToManyMapping.isCustomMapKey());
- assertTrue(ormManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", ormManyToManyMapping.getMapKey());
- assertTrue(ormManyToManyMapping.isPkMapKey());
- assertFalse(ormManyToManyMapping.isCustomMapKey());
- assertFalse(ormManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", ormManyToManyMapping.getMapKey());
- assertFalse(ormManyToManyMapping.isPkMapKey());
- assertTrue(ormManyToManyMapping.isCustomMapKey());
- assertFalse(ormManyToManyMapping.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());
- }
-
- 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");
-
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- ormManyToManyMapping.candidateMapKeyNames();
- 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");
-
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormManyToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormManyToManyMapping.candidateMapKeyNames();
- 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());
-
- ormManyToManyMapping.getPersistentAttribute().makeSpecified();
- ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormManyToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormManyToManyMapping.candidateMapKeyNames();
- 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());
-
- ormManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormManyToManyMapping.candidateMapKeyNames();
- 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");
-
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", ormManyToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormManyToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("java.lang.Integer", ormManyToManyMapping.getMapKeyClass());
- assertEquals("java.lang.Integer", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormManyToManyMapping.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.getRelationshipReference().setMappedByJoiningStrategy();
- jobsMapping.getRelationshipReference().getMappedByJoiningStrategy().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.getRelationshipReference().getJoinTableJoiningStrategy().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.makeVirtual();
- jobsPersistentAttribute = printQueuePersistentType.getAttributeNamed("jobs");
- jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping();
- jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(false, jobsOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", jobsOrderable.getOrderColumn().getName());
- queuesPersistentAttribute.makeVirtual();
- queuesPersistentAttribute = printJobPersistentType.getAttributeNamed("queues");
- queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
- queuesOrderable = ((Orderable2_0) queuesMapping.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.getRelationshipReference().getJoinTableJoiningStrategy().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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
-
- //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");
- //becomes a 1-m by default
- OrmOneToManyMapping2_0 addressesMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
- }
-
- 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(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 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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getSpecifiedTable());
-
- //set Column table element in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getSpecifiedTable());
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getSpecifiedTable());
-
- //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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(ormManyToManyMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = ormManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(ormManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormManyToManyMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = 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());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
deleted file mode 100644
index 5d831278e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2375 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.context.orm.EclipseLinkConverterHolder;
-import org.eclipse.jpt.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmMappedSuperclassTests extends EclipseLink2_0OrmContextModelTestCase
-{
- 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.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.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.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.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.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.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.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.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 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(50, 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(50, ormContextCaching.getSize());
- assertEquals(50, 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 {
- 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.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.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.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.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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ListIterator<EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.customConverters();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- 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.allConverters()));
-
- //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.customConvertersSize());
- ormContextConverters = ormContextConverterHolder.customConverters();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.customConvertersSize());
- assertFalse(ormContextConverterHolder.customConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ListIterator<EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- 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.allConverters()));
-
- //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.typeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.typeConverters();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.typeConvertersSize());
- assertFalse(ormContextConverterHolder.typeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ListIterator<EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- 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.allConverters()));
-
- //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.objectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.objectTypeConverters();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.objectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.objectTypeConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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();
- EclipseLinkConverterHolder ormContextConverterHolder = ormContextMappedSuperclass.getConverterHolder();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ListIterator<EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.structConverters();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- 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.allConverters()));
-
- //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.structConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.structConverters();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.allConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.structConvertersSize());
- assertFalse(ormContextConverterHolder.structConverters().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.allConverters()));
- }
-
- 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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
deleted file mode 100644
index 947f1468dc..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,1067 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.Column;
-import org.eclipse.jpt.core.context.Entity;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.JoinColumn;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentAttribute;
-import org.eclipse.jpt.core.resource.java.JavaResourcePersistentType;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyRelationshipReference;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-/**
- * EclipseLink2_0OrmOneToManyMappingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToManyMappingTests
- extends EclipseLink2_0OrmContextModelTestCase
-{
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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");
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) 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);
- 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");
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- ormOneToManyMapping.candidateMapKeyNames();
- 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");
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- 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.getPersistentAttribute().makeSpecified();
- ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.candidateMapKeyNames();
- 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.candidateMapKeyNames();
- 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");
-
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", ormOneToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("java.lang.Integer", ormOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.Integer", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormOneToManyMapping.getDefaultMapKeyClass());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(null, ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", ormOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", ormOneToManyMapping.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.getRelationshipReference().setMappedByJoiningStrategy();
- oneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().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.makeVirtual();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("jobs");
- oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
-
- //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.virtualAttributes().next();
- OrmOneToManyMapping2_0 addressesMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", ormColumn.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Column.DEFAULT_LENGTH, ormColumn.getSpecifiedLength().intValue());
- assertEquals(Column.DEFAULT_PRECISION, ormColumn.getSpecifiedPrecision().intValue());
- assertEquals(Column.DEFAULT_SCALE, ormColumn.getSpecifiedScale().intValue());
- }
-
- 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(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 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
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.virtualAttributes().next();
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getSpecifiedTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getSpecifiedTable());
-
- //set Column table element in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getSpecifiedTable());
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getSpecifiedTable());
-
- //make name persistent attribute not virtual
- addressesPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "addresses");
- addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", ormColumn.getDefaultTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- OrmEclipseLinkOneToManyRelationshipReference relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- OrmEclipseLinkOneToManyRelationshipReference relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- }
-
- 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
- OrmPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getSpecifiedMapping();
- javaOneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
-
- JoinColumn joinColumn = oneToManyMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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.makeSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(oneToManyMapping.getRelationshipReference().usesJoinColumnJoiningStrategy());
-
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
- joinColumn = oneToManyMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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
- OrmPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getSpecifiedMapping();
- javaOneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
-
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_KEY", 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());
-
- JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) attributeResource.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.makeSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(oneToManyMapping.getRelationshipReference().usesJoinColumnJoiningStrategy());
-
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
- 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
- OrmPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getSpecifiedMapping();
- javaOneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
- assertEquals("addresses_ORDER", orderColumn.getSpecifiedName());
- 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.makeSpecified();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getSpecifiedMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(oneToManyMapping.getRelationshipReference().usesJoinColumnJoiningStrategy());
-
- oneToManyMapping.getRelationshipReference().setJoinColumnJoiningStrategy();
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkOneToManyMapping ormOneToManyMapping = (OrmEclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToManyMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = ormOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(ormOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertTrue(((OrmOrphanRemovalHolder2_0) ormOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- assertEquals(EclipseLinkJoinFetchType.INNER, ormOneToManyMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- OrmEclipseLinkOneToManyMapping ormOneToManyMapping = (OrmEclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationshipReference().getMappedByJoiningStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = 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());
- assertEquals(null, ormOneToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
deleted file mode 100644
index 7f52d5ca1b..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,905 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.OneToOneMapping;
-import org.eclipse.jpt.core.context.PersistentAttribute;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.OrmEclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToOneMappingTests
- extends EclipseLink2_0OrmContextModelTestCase
-{
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
-
- 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().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(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().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(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().getSpecifiedValue());
- }
-
- 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");
-
- PersistentAttribute persistentAttribute = ormPersistentType.attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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");
-
- PersistentAttribute persistentAttribute = ormPersistentType.attributes().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().candidateMappedByAttributeNames();
- 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);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- javaOneToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- OrmJoinTable ormJoinTable = ormOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, ormJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getSpecifiedName());
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertEquals(0, ormJoinTable.specifiedJoinColumnsSize());
- assertEquals(0, ormJoinTable.specifiedInverseJoinColumnsSize());
- OrmJoinColumn ormJoinColumn = ormJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- OrmJoinColumn inverseOrmJoinColumn = ormJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = javaOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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.specifiedJoinColumnsSize());
- assertEquals(1, ormJoinTable.specifiedInverseJoinColumnsSize());
- ormJoinColumn = ormJoinTable.specifiedJoinColumns().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = ormJoinTable.specifiedInverseJoinColumns().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();
- ormOneToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- OrmJoinTable ormJoinTable = ormOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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();
- javaOneToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- javaOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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.makeVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ormJoinTable = ormOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", ormJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName(null);
- ormJoinTable = ormOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertNull(ormJoinTable);
- javaOneToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- ormJoinTable = ormOneToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("BAR_FOO", ormJoinTable.getSpecifiedName());
- 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 {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationshipReference2_0 relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setMappedByJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setPrimaryKeyJoinColumnJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationshipReference2_0 relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesPrimaryKeyJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesMappedByJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkOneToOneMapping2_0 ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getRelationshipReference().
- getMappedByJoiningStrategy().getMappedByAttribute());
-
- OrmJoinColumn ormJoinColumn =
- ormOneToOneMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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 = ormOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormOneToOneMapping.getJoinFetch().getValue());
- assertTrue(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
-
- assertTrue(((OrmOrphanRemovalHolder2_0) ormOneToOneMapping).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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- OrmEclipseLinkOneToOneMapping2_0 ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationshipReference().getMappedByJoiningStrategy().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 = 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(((OrmOrphanRemovalHolder2_0) ormOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java
deleted file mode 100644
index 282b641874..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,586 +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.eclipselink2_0.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.core.MappingKeys;
-import org.eclipse.jpt.core.context.FetchType;
-import org.eclipse.jpt.core.context.java.JavaEntity;
-import org.eclipse.jpt.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmEntity;
-import org.eclipse.jpt.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmManyToOneRelationshipReference2_0;
-import org.eclipse.jpt.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.core.resource.java.JPA;
-import org.eclipse.jpt.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.context.orm.OrmEclipseLinkManyToOneMapping2_0;
-import org.eclipse.jpt.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class Eclipselink2_0OrmManyToOneMappingTests
- extends EclipseLink2_0OrmContextModelTestCase
-{
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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 (OrmPersistentAttribute each : CollectionTools.iterable(ormPersistentType.attributes())) {
- each.makeSpecified();
- }
- }
-
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedValue(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedValue());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
-
- 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().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(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().getSpecifiedValue());
-
- contextAttribute.setSpecifiedMappingKey(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().getSpecifiedValue());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- javaManyToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- OrmJoinTable ormJoinTable = ormManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, ormJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getSpecifiedName());
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertEquals(0, ormJoinTable.specifiedJoinColumnsSize());
- assertEquals(0, ormJoinTable.specifiedInverseJoinColumnsSize());
- OrmJoinColumn ormJoinColumn = ormJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- OrmJoinColumn inverseOrmJoinColumn = ormJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = javaManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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.specifiedJoinColumnsSize());
- assertEquals(1, ormJoinTable.specifiedInverseJoinColumnsSize());
- ormJoinColumn = ormJoinTable.specifiedJoinColumns().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = ormJoinTable.specifiedInverseJoinColumns().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();
- ormManyToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- OrmJoinTable ormJoinTable = ormManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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();
- javaManyToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- javaManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().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.makeVirtual();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ormJoinTable = ormManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", ormJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName(null);
- ormJoinTable = ormManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertNull(ormJoinTable);
- javaManyToOneMapping.getRelationshipReference().setJoinTableJoiningStrategy();
- ormJoinTable = ormManyToOneMapping.getRelationshipReference().getJoinTableJoiningStrategy().getJoinTable();
- assertEquals("BAR_FOO", ormJoinTable.getSpecifiedName());
- 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);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationshipReference2_0 relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinTableJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
-
- relationshipReference.setJoinColumnJoiningStrategy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationshipReference2_0 relationshipReference = contextMapping.getRelationshipReference();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getResourceTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(relationshipReference.usesJoinColumnJoiningStrategy());
- assertFalse(relationshipReference.usesJoinTableJoiningStrategy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(relationshipReference.usesJoinColumnJoiningStrategy());
- assertTrue(relationshipReference.usesJoinTableJoiningStrategy());
- }
-
- 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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.virtualAttributes().next();
-
- OrmEclipseLinkManyToOneMapping2_0 ormManyToOneMapping = (OrmEclipseLinkManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", ormManyToOneMapping.getSpecifiedTargetEntity());
-
- OrmJoinColumn ormJoinColumn = ormManyToOneMapping.getRelationshipReference().getJoinColumnJoiningStrategy().specifiedJoinColumns().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 = ormManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ormManyToOneMapping.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.virtualAttributesSize());
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.makeSpecified(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.specifiedAttributes().next();
-
- OrmEclipseLinkManyToOneMapping2_0 ormManyToOneMapping = (OrmEclipseLinkManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade2_0 cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertEquals(null, ormManyToOneMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/JptEclipseLink2_0OrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/JptEclipseLink2_0OrmContextModelTests.java
deleted file mode 100644
index 484105f77c..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/JptEclipseLink2_0OrmContextModelTests.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.eclipselink2_0.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLink2_0OrmContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink2_0OrmContextModelTests.class.getName());
- 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 JptEclipseLink2_0OrmContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
deleted file mode 100644
index 7e47171437..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
+++ /dev/null
@@ -1,172 +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.eclipselink2_0.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.eclipselink.core.context.persistence.connection.Connection;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.connection.Connection2_0;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * EclipseLink2_0ConnectionTests
- */
-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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
deleted file mode 100644
index ee6345e01e..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
+++ /dev/null
@@ -1,430 +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.eclipselink2_0.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.context.persistence.logging.LoggingLevel;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.logging.Logging2_0;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * EclipseLink2_0LoggingTests
- */
-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.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
deleted file mode 100644
index af783777a8..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
+++ /dev/null
@@ -1,212 +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.eclipselink2_0.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.eclipselink.core.v2_0.context.persistence.options.Options2_0;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-
-/**
- * EclipseLinkOptions2_0Tests
- */
-public class EclipseLink2_0OptionsTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Options2_0 options;
-
- 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);
-
- 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("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(LOCK_TIMEOUT_KEY, LOCK_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(QUERY_TIMEOUT_KEY, QUERY_TIMEOUT_TEST_VALUE.toString());
-
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_PERSIST_KEY, VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_UPDATE_KEY, VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_REMOVE_KEY, VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE.toString());
- }
-
- @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))
- modelValue = this.options.getValidationGroupPrePersist();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- modelValue = this.options.getValidationGroupPreUpdate();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- modelValue = this.options.getValidationGroupPreRemove();
- 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.setValidationGroupPrePersist((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.setValidationGroupPreUpdate((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.setValidationGroupPreRemove((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.verifySetProperty(
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPrePersist() throws Exception {
- this.verifyAddRemoveProperty(
- 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.verifySetProperty(
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreUpdate() throws Exception {
- this.verifyAddRemoveProperty(
- 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.verifySetProperty(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreRemove() throws Exception {
- this.verifyAddRemoveProperty(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
deleted file mode 100644
index fe4ddb37e2..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
+++ /dev/null
@@ -1,57 +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.eclipselink2_0.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.core.JptCorePlugin;
-import org.eclipse.jpt.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformProvider;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-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, JptCorePlugin.JPA_FACET_VERSION_2_0);
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM_ID, EclipseLink2_0JpaPlatformProvider.ID);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/JptEclipseLink2_0CorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/JptEclipseLink2_0CorePersistenceContextModelTests.java
deleted file mode 100644
index 7d3e1c8071..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/persistence/JptEclipseLink2_0CorePersistenceContextModelTests.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.eclipselink2_0.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * decentralize test creation code
- */
-public class JptEclipseLink2_0CorePersistenceContextModelTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLink2_0CorePersistenceContextModelTests.class.getPackage().getName());
-
- suite.addTestSuite(EclipseLink2_0ConnectionTests.class);
- suite.addTestSuite(EclipseLink2_0LoggingTests.class);
- suite.addTestSuite(EclipseLink2_0OptionsTests.class);
-
- return suite;
- }
-
- private JptEclipseLink2_0CorePersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/test.xml
deleted file mode 100644
index 09669091c6..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.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.eclipselink.core.tests.internal.resource.JptEclipselinkCoreResourceModelTests" />
- <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.eclipselink.core.tests.internal.context.JptEclipseLinkCoreContextModelTests" /> <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.gen.tests/.classpath b/jpa/tests/org.eclipse.jpt.gen.tests/.classpath
deleted file mode 100644
index 482a6d9aa6..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/gen/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
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 2159feb5ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.gen.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 2c6dda4a74..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:14 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8bab913c29..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Mon Jul 07 20:13:24 EDT 2008
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.gen.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.gen.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index febf670332..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.gen.tests
-Bundle-Version: 2.0.0
-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.utility;bundle-version="1.2.0",
- org.eclipse.jpt.db;bundle-version="1.1.1",
- org.eclipse.jpt.gen;bundle-version="1.1.0",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.gen.tests.internal;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/about.html b/jpa/tests/org.eclipse.jpt.gen.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.gen.tests/build.properties b/jpa/tests/org.eclipse.jpt.gen.tests/build.properties
deleted file mode 100644
index e68d4bf9e4..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/build.properties
+++ /dev/null
@@ -1,18 +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
-################################################################################
-javacSource = 1.5
-javacTarget = 1.5
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.gen.tests/plugin.properties
deleted file mode 100644
index f81a674adc..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java b/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/EntityGenToolsTests.java
deleted file mode 100644
index 944e9f402f..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/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.gen.tests.internal;
-
-import java.util.HashSet;
-import org.eclipse.jpt.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.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java b/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.java
deleted file mode 100644
index 1e79d7d032..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/src/org/eclipse/jpt/gen/tests/internal/JptGenTests.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.gen.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.gen.tests.internal.EntityGenToolsTests;
-
-/**
- *
- */
-public class JptGenTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("JPT Entity Generation Tests"); //$NON-NLS-1$
- suite.addTestSuite(EntityGenToolsTests.class);
- return suite;
- }
-
- private JptGenTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/test.xml b/jpa/tests/org.eclipse.jpt.gen.tests/test.xml
deleted file mode 100644
index 2b842d92fc..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.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.gen.tests.internal.JptGenTests" />
- <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.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.ui.tests/.classpath
deleted file mode 100644
index 382639e1d7..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.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/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
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 0240774761..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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.ui.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index d364a0f24e..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Mon Apr 07 14:27:16 EDT 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d909c105d5..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:01 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 8a2119e1f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/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.ui.tests
-Bundle-Version: 1.0.1
-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.core.tests,
- org.eclipse.jpt.core.tests.extension.resource,
- org.eclipse.jpt.utility,
- org.eclipse.jpt.core,
- org.eclipse.jpt.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.ui.tests;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.jface;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.swt;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.util;x-internal:=true,
- org.eclipse.jpt.ui.tests.internal.utility.swt;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.ui.tests/build.properties
deleted file mode 100644
index 50f0aa3fd9..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.ui.tests/plugin.properties
deleted file mode 100644
index cd93615334..0000000000
--- a/jpa/tests/org.eclipse.jpt.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=Java Persistence API UI Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
deleted file mode 100644
index 310abb7607..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/JptUiTests.java
+++ /dev/null
@@ -1,36 +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.ui.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.ui.tests.internal.platform.JptUiPlatformTests;
-import org.eclipse.jpt.ui.tests.internal.swt.JptUiSWTTests;
-import org.eclipse.jpt.ui.tests.internal.util.JptUiUtilTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiTests.class.getPackage().getName());
- suite.addTest(JptUiPlatformTests.suite());
- suite.addTest(JptUiSWTTests.suite());
- suite.addTest(JptUiUtilTests.suite());
- return suite;
- }
-
- private JptUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingLabelProviderUiTest.java
deleted file mode 100644
index 47e8fc281c..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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.ui.internal.jface.AbstractItemLabelProvider;
-import org.eclipse.jpt.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.ui.jface.ItemLabelProviderFactory;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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) model()),
- 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) model()),
- 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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
deleted file mode 100644
index 96460f58f1..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/jface/DelegatingTreeContentProviderUiTest.java
+++ /dev/null
@@ -1,566 +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.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.ui.internal.jface.AbstractTreeItemContentProvider;
-import org.eclipse.jpt.ui.internal.jface.DelegatingTreeContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.DelegatingContentAndLabelProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProvider;
-import org.eclipse.jpt.ui.jface.TreeItemContentProviderFactory;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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;
- }
- }) {
- @Override
- protected boolean accept(Child c) {
- return c != null;
- }
- };
- }
- }
-
-
- 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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
deleted file mode 100644
index 91d7edc374..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JpaPlatformUiExtensionTests.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.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.core.JpaProject;
-import org.eclipse.jpt.core.internal.JpaPlatformRegistry;
-import org.eclipse.jpt.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.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(JpaPlatformRegistry.instance().getJpaPlatform(this.testProject.getProject()));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/platform/JptUiPlatformTests.java
deleted file mode 100644
index 50bcc99cfc..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
deleted file mode 100644
index d6d12ea579..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/AbstractComboModelAdapterTest.java
+++ /dev/null
@@ -1,773 +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.ui.tests.internal.swt;
-
-import static org.junit.Assert.*;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.utility.internal.StringConverter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/ComboModelAdapterTest.java
deleted file mode 100644
index 0fb152a17f..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.ui.tests.internal.swt;
-
-import org.eclipse.jpt.ui.internal.swt.AbstractComboModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.ComboModelAdapter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/JptUiSWTTests.java
deleted file mode 100644
index 79dc602321..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java
deleted file mode 100644
index cf1629fb2d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/SpinnerModelAdapterTest.java
+++ /dev/null
@@ -1,340 +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.ui.tests.internal.swt;
-
-import static org.junit.Assert.*;
-import org.eclipse.jpt.ui.internal.swt.SpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java
deleted file mode 100644
index 057b8b4f3a..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TableModelAdapterTest.java
+++ /dev/null
@@ -1,1203 +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.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.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter.SelectionChangeEvent;
-import org.eclipse.jpt.ui.internal.swt.TableModelAdapter.SelectionChangeListener;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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> employees) {
- this.employees.clear();
- this.employees.addAll(employees);
- fireListChanged(EMPLOYEES_LIST, employees);
- }
-
- 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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/swt/TriStateCheckBoxModelAdapterUITest.java
deleted file mode 100644
index 3993af3570..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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.ui.internal.swt.TriStateCheckBoxModelAdapter;
-import org.eclipse.jpt.ui.internal.widgets.DefaultWidgetFactory;
-import org.eclipse.jpt.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
deleted file mode 100644
index a0317832bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlAlignerTest.java
+++ /dev/null
@@ -1,800 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.*;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jpt.ui.internal.util.ControlAligner;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
deleted file mode 100644
index 88cb7f2e0d..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlEnablerTest.java
+++ /dev/null
@@ -1,84 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.*;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
deleted file mode 100644
index c124f603f6..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlSwitcherTest.java
+++ /dev/null
@@ -1,187 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.*;
-import org.eclipse.jpt.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
deleted file mode 100644
index 3a702d5f2c..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/ControlVisibilityEnablerTest.java
+++ /dev/null
@@ -1,86 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/JptUiUtilTests.java
deleted file mode 100644
index 81cfb08253..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledButtonTest.java
deleted file mode 100644
index dde3031a3b..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledButton;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledControlUpdaterTest.java
deleted file mode 100644
index bd2ce50228..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.jpt.ui.internal.util.LabeledControlUpdater;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/LabeledLabelTest.java
deleted file mode 100644
index f962284dae..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.ui.tests.internal.util;
-
-import static org.junit.Assert.assertEquals;
-import org.eclipse.core.runtime.AssertionFailedException;
-import org.eclipse.jpt.ui.internal.util.LabeledLabel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
deleted file mode 100644
index 5563e258fc..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneEnablerTest.java
+++ /dev/null
@@ -1,92 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.*;
-import org.eclipse.jpt.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
deleted file mode 100644
index 361b4c2115..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/util/PaneVisibilityEnablerTest.java
+++ /dev/null
@@ -1,92 +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.ui.tests.internal.util;
-
-import static org.junit.Assert.*;
-import org.eclipse.jpt.ui.internal.util.PaneVisibilityEnabler;
-import org.eclipse.jpt.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/BooleanStateControllerUITest.java
deleted file mode 100644
index 9219810f7a..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/CheckBoxModelBindingUITest.java
deleted file mode 100644
index e6f232c4e0..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
deleted file mode 100644
index 65499c2cb3..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/DropDownListBoxModelBindingUITest.java
+++ /dev/null
@@ -1,665 +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.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.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java
deleted file mode 100644
index ff19beb19b..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/ListBoxModelBindingUITest.java
+++ /dev/null
@@ -1,627 +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.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.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritableCollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java b/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/ui/tests/internal/utility/swt/TextFieldModelBindingUITest.java
deleted file mode 100644
index 4b3cb048c6..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/src/org/eclipse/jpt/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.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.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/.classpath b/jpa/tests/org.eclipse.jpt.utility.tests/.classpath
deleted file mode 100644
index ef8d91ca94..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
deleted file mode 100644
index c4ba612bad..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot
-temp.folder
-build.xml
-javaCompiler...args \ 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 aa5271e003..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index f68f9c2597..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Jan 15 11:12:26 EST 2008
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 84b5c4c710..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-#Sun May 27 14:55:58 EDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-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.utility.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.utility.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index 7b45019d32..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.utility.tests
-Bundle-Version: 1.5.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.jpt.utility;bundle-version="[1.2.0,2.0.0)",
- org.junit;bundle-version="3.8.0"
-Export-Package: org.eclipse.jpt.utility.tests.internal;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.enumerations;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.iterables;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.iterators;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.listener;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.prefs;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.model.value.swing;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.node;x-internal:=true,
- org.eclipse.jpt.utility.tests.internal.synchronizers;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/about.html b/jpa/tests/org.eclipse.jpt.utility.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/build.properties b/jpa/tests/org.eclipse.jpt.utility.tests/build.properties
deleted file mode 100644
index ebe9c08ef9..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.utility.tests/plugin.properties
deleted file mode 100644
index bc1a18f302..0000000000
--- a/jpa/tests/org.eclipse.jpt.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 - Utility Tests
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/resource/ClassTools.java
deleted file mode 100644
index aac17b6044..0000000000
--- a/jpa/tests/org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ArrayToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ArrayToolsTests.java
deleted file mode 100644
index eed7effdfc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/AsynchronousCommandExecutorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/AsynchronousCommandExecutorTests.java
deleted file mode 100644
index c2d7c3517c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.AsynchronousCommandExecutor;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BagTests.java
deleted file mode 100644
index 13c6750ccb..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiFilterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiFilterTests.java
deleted file mode 100644
index 3663c3cc6e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiStringConverterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiStringConverterTests.java
deleted file mode 100644
index ec60348959..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiTransformerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BidiTransformerTests.java
deleted file mode 100644
index 24cfea5866..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BitToolsTests.java
deleted file mode 100644
index f669a517ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BitTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanReferenceTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanReferenceTests.java
deleted file mode 100644
index e3380865ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanReferenceTests.java
+++ /dev/null
@@ -1,127 +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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.BooleanReference;
-
-@SuppressWarnings("nls")
-public class BooleanReferenceTests extends TestCase {
-
- public BooleanReferenceTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.getValue());
- }
-
- public void testGetValueDefault() {
- BooleanReference br = new BooleanReference();
- assertFalse(br.getValue());
- }
-
- public void testIs() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.is(true));
- assertFalse(br.is(false));
- }
-
- public void testIsNot() {
- BooleanReference br = new BooleanReference(true);
- assertFalse(br.isNot(true));
- assertTrue(br.isNot(false));
- }
-
- public void testIsTrue() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.isTrue());
- }
-
- public void testIsFalse() {
- BooleanReference br = new BooleanReference(true);
- assertFalse(br.isFalse());
- br.setFalse();
- assertTrue(br.isFalse());
- }
-
- public void testSetValue() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.getValue());
- br.setValue(false);
- assertFalse(br.getValue());
- }
-
- public void testFlip() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.getValue());
- assertFalse(br.flip());
- assertFalse(br.getValue());
- assertTrue(br.flip());
- assertTrue(br.getValue());
- }
-
- public void testSetNotBoolean() {
- BooleanReference br = new BooleanReference(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() {
- BooleanReference br = new BooleanReference(false);
- assertFalse(br.getValue());
- br.setTrue();
- assertTrue(br.getValue());
- }
-
- public void testSetFalse() {
- BooleanReference br = new BooleanReference(true);
- assertTrue(br.getValue());
- br.setFalse();
- assertFalse(br.getValue());
- }
-
- public void testClone() {
- BooleanReference br = new BooleanReference(true);
- BooleanReference clone = (BooleanReference) br.clone();
- assertTrue(clone.getValue());
- assertEquals(br, clone);
- }
-
- public void testEquals() {
- BooleanReference br1 = new BooleanReference(true);
- BooleanReference br2 = new BooleanReference(true);
- assertEquals(br1, br2);
-
- BooleanReference br3 = new BooleanReference(false);
- assertFalse(br1.equals(br3));
- }
-
- public void testHashCode() {
- BooleanReference br1 = new BooleanReference(true);
- assertEquals(1, br1.hashCode());
- br1.setFalse();
- assertEquals(0, br1.hashCode());
- }
-
- public void testToString() {
- BooleanReference br1 = new BooleanReference(true);
- assertEquals("[true]", br1.toString());
- br1.setFalse();
- assertEquals("[false]", br1.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/BooleanToolsTests.java
deleted file mode 100644
index 817044602a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.lang.reflect.InvocationTargetException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BooleanTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassNameTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClassNameTests.java
deleted file mode 100644
index b3cd7e8e05..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ClassName;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
deleted file mode 100644
index 19d7c67e7c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ClasspathTests.java
+++ /dev/null
@@ -1,401 +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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.Classpath;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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());
- if (Tools.jvmIsSun()) {
- assertTrue(entry.getCanonicalFileName().endsWith("rt.jar"));
- } else if (Tools.jvmIsIBM()) {
- assertTrue(entry.getCanonicalFileName().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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
deleted file mode 100644
index 39787aebc7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CollectionToolsTests.java
+++ /dev/null
@@ -1,2313 +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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.Range;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.enumerations.EmptyEnumeration;
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.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()));
- }
-
-
- // ********** 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 testInsertionIndexOfListComparable() {
- 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 testInsertionIndexOfListObjectComparator() {
- 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));
- }
-
-
- // ********** 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandExecutorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandExecutorTests.java
deleted file mode 100644
index 2dc789c632..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandRunnableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandRunnableTests.java
deleted file mode 100644
index 717d813f69..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CommandTests.java
deleted file mode 100644
index 24f592de63..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.CommandExecutor;
-import org.eclipse.jpt.utility.internal.CommandRunnable;
-import org.eclipse.jpt.utility.internal.RunnableCommand;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CompositeCommandTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/CompositeCommandTests.java
deleted file mode 100644
index ff81cd152c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.CommandRunnable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ExceptionHandlerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ExceptionHandlerTests.java
deleted file mode 100644
index af6793e351..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FileToolsTests.java
deleted file mode 100644
index cb02a0c888..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.FileTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FilterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/FilterTests.java
deleted file mode 100644
index 5b40cd50c7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/HashBagTests.java
deleted file mode 100644
index 3b20add7f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IdentityHashBagTests.java
deleted file mode 100644
index 7d69a5890b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.IdentityHashBag;
-import org.eclipse.jpt.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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IndentingPrintWriterTests.java
deleted file mode 100644
index cb19b1c640..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.io.StringWriter;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IntReferenceTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IntReferenceTests.java
deleted file mode 100644
index aaa5ea05b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/IntReferenceTests.java
+++ /dev/null
@@ -1,340 +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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.IntReference;
-
-@SuppressWarnings("nls")
-public class IntReferenceTests extends TestCase {
-
- public IntReferenceTests(String name) {
- super(name);
- }
-
- public void testCtors() {
- IntReference ir;
- ir = new IntReference();
- assertEquals(0, ir.getValue());
- ir = new IntReference(7);
- assertEquals(7, ir.getValue());
- ir = new IntReference(-7);
- assertEquals(-7, ir.getValue());
- }
-
- public void testEqualsInt() {
- IntReference ir;
- ir = new IntReference();
- assertTrue(ir.equals(0));
- assertFalse(ir.equals(7));
-
- ir = new IntReference(7);
- assertTrue(ir.equals(7));
- assertFalse(ir.equals(0));
- }
-
- public void testNotEqualsInt() {
- IntReference ir;
- ir = new IntReference();
- assertFalse(ir.notEquals(0));
- assertTrue(ir.notEquals(7));
-
- ir = new IntReference(7);
- assertFalse(ir.notEquals(7));
- assertTrue(ir.notEquals(0));
- }
-
- public void testIsZero() {
- IntReference ir;
- ir = new IntReference();
- assertTrue(ir.isZero());
-
- ir = new IntReference(7);
- assertFalse(ir.isZero());
- }
-
- public void testIsNotZero() {
- IntReference ir;
- ir = new IntReference();
- assertFalse(ir.isNotZero());
-
- ir = new IntReference(7);
- assertTrue(ir.isNotZero());
- }
-
- public void testIsGreaterThanInt() {
- IntReference ir;
- ir = new IntReference();
- assertTrue(ir.isGreaterThan(-1));
- assertFalse(ir.isGreaterThan(0));
- assertFalse(ir.isGreaterThan(7));
- }
-
- public void testIsGreaterThanOrEqualInt() {
- IntReference ir;
- ir = new IntReference();
- assertTrue(ir.isGreaterThanOrEqual(-1));
- assertTrue(ir.isGreaterThanOrEqual(0));
- assertFalse(ir.isGreaterThanOrEqual(7));
- }
-
- public void testIsLessThanInt() {
- IntReference ir;
- ir = new IntReference();
- assertFalse(ir.isLessThan(-1));
- assertFalse(ir.isLessThan(0));
- assertTrue(ir.isLessThan(7));
- }
-
- public void testIsLessThanOrEqualInt() {
- IntReference ir;
- ir = new IntReference();
- assertFalse(ir.isLessThanOrEqual(-1));
- assertTrue(ir.isLessThanOrEqual(0));
- assertTrue(ir.isLessThanOrEqual(7));
- }
-
- public void testIsPositive() {
- IntReference ir;
- ir = new IntReference(-3);
- assertFalse(ir.isPositive());
-
- ir = new IntReference();
- assertFalse(ir.isPositive());
-
- ir = new IntReference(7);
- assertTrue(ir.isPositive());
- }
-
- public void testIsNotPositive() {
- IntReference ir;
- ir = new IntReference(-3);
- assertTrue(ir.isNotPositive());
-
- ir = new IntReference();
- assertTrue(ir.isNotPositive());
-
- ir = new IntReference(7);
- assertFalse(ir.isNotPositive());
- }
-
- public void testIsNegative() {
- IntReference ir;
- ir = new IntReference(-3);
- assertTrue(ir.isNegative());
-
- ir = new IntReference();
- assertFalse(ir.isNegative());
-
- ir = new IntReference(7);
- assertFalse(ir.isNegative());
- }
-
- public void testIsNotNegative() {
- IntReference ir;
- ir = new IntReference(-3);
- assertFalse(ir.isNotNegative());
-
- ir = new IntReference();
- assertTrue(ir.isNotNegative());
-
- ir = new IntReference(7);
- assertTrue(ir.isNotNegative());
- }
-
- public void testSetValueInt() {
- IntReference ir;
- ir = new IntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(-3, ir.setValue(4));
- assertEquals(4, ir.getValue());
- }
-
- public void testAbs() {
- IntReference ir;
- ir = new IntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(3, ir.abs());
- assertEquals(3, ir.getValue());
-
- ir.setValue(3);
- assertEquals(3, ir.getValue());
- assertEquals(3, ir.abs());
- assertEquals(3, ir.getValue());
- }
-
- public void testNeg() {
- IntReference ir;
- ir = new IntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(3, ir.neg());
- assertEquals(3, ir.getValue());
-
- ir.setValue(3);
- assertEquals(3, ir.getValue());
- assertEquals(-3, ir.neg());
- assertEquals(-3, ir.getValue());
- }
-
- public void testSetZero() {
- IntReference ir;
- ir = new IntReference(-3);
- assertEquals(-3, ir.getValue());
- assertEquals(-3, ir.setZero());
- assertEquals(0, ir.getValue());
- }
-
- public void testAddInt() {
- IntReference ir;
- int value;
- ir = new IntReference();
- assertEquals(0, ir.getValue());
-
- value = ir.add(3);
- assertEquals(3, value);
- assertEquals(3, ir.getValue());
-
- value = ir.add(-7);
- assertEquals(-4, value);
- assertEquals(-4, ir.getValue());
- }
-
- public void testIncrement() {
- IntReference ir;
- int value;
- ir = new IntReference();
- assertEquals(0, ir.getValue());
-
- value = ir.increment();
- assertEquals(1, value);
- assertEquals(1, ir.getValue());
- }
-
- public void testSubtractInt() {
- IntReference ir;
- int count;
- ir = new IntReference();
- assertEquals(0, ir.getValue());
-
- count = ir.subtract(3);
- assertEquals(-3, count);
- assertEquals(-3, ir.getValue());
-
- count = ir.subtract(-7);
- assertEquals(4, count);
- assertEquals(4, ir.getValue());
- }
-
- public void testDecrement() {
- IntReference ir;
- int count;
- ir = new IntReference();
- assertEquals(0, ir.getValue());
-
- count = ir.decrement();
- assertEquals(-1, count);
- assertEquals(-1, ir.getValue());
- }
-
- public void testMultiplyInt() {
- IntReference ir;
- ir = new IntReference(3);
- assertEquals(3, ir.getValue());
- assertEquals(9, ir.multiply(3));
- assertEquals(9, ir.getValue());
- }
-
- public void testDivideInt() {
- IntReference ir;
- ir = new IntReference(24);
- assertEquals(24, ir.getValue());
- assertEquals(8, ir.divide(3));
- assertEquals(8, ir.getValue());
- }
-
- public void testRemainderInt() {
- IntReference ir;
- ir = new IntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(1, ir.remainder(3));
- assertEquals(1, ir.getValue());
- }
-
- public void testMinInt() {
- IntReference ir;
- ir = new IntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(3, ir.min(3));
- assertEquals(3, ir.getValue());
- assertEquals(3, ir.min(25));
- assertEquals(3, ir.getValue());
- }
-
- public void testMaxInt() {
- IntReference ir;
- ir = new IntReference(25);
- assertEquals(25, ir.getValue());
- assertEquals(25, ir.max(3));
- assertEquals(25, ir.getValue());
- assertEquals(30, ir.max(30));
- assertEquals(30, ir.getValue());
- }
-
- public void testPowInt() {
- IntReference ir;
- ir = new IntReference(5);
- assertEquals(5, ir.getValue());
- assertEquals(25, ir.pow(2));
- assertEquals(25, ir.getValue());
- assertEquals(625, ir.pow(2));
- assertEquals(625, ir.getValue());
- }
-
- public void testCompareToIntReference() {
- IntReference ir1 = new IntReference(44);
- IntReference ir2 = new IntReference(44);
- assertTrue(ir1.compareTo(ir2) == 0);
- ir2 = new IntReference(55);
- assertTrue(ir1.compareTo(ir2) < 0);
- ir2 = new IntReference(33);
- assertTrue(ir1.compareTo(ir2) > 0);
- }
-
- public void testClone() {
- IntReference ir1 = new IntReference(44);
- IntReference ir2 = (IntReference) ir1.clone();
- assertEquals(44, ir2.getValue());
- assertEquals(ir1, ir2);
- assertNotSame(ir1, ir2);
- }
-
- public void testEquals() {
- IntReference ir1 = new IntReference(44);
- IntReference ir2 = new IntReference(44);
- assertEquals(ir1, ir2);
- assertEquals(ir1.hashCode(), ir2.hashCode());
- assertFalse(ir1.equals(null));
- }
-
- public void testSerialization() throws Exception {
- IntReference ir1 = new IntReference(44);
- IntReference ir2 = TestTools.serialize(ir1);
- assertEquals(44, ir2.getValue());
- assertEquals(ir1, ir2);
- assertNotSame(ir1, ir2);
- }
-
- public void testToString() {
- IntReference ir;
- ir = new IntReference(5);
- assertEquals("[5]", ir.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JDBCTypeTests.java
deleted file mode 100644
index 117aba69c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.sql.Types;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JavaTypeTests.java
deleted file mode 100644
index eda195b404..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
deleted file mode 100644
index d602e5f397..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/JptUtilityTests.java
+++ /dev/null
@@ -1,89 +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.utility.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.jpt.utility.tests.internal.enumerations.JptUtilityEnumerationsTests;
-import org.eclipse.jpt.utility.tests.internal.iterables.JptUtilityIterablesTests;
-import org.eclipse.jpt.utility.tests.internal.iterators.JptUtilityIteratorsTests;
-import org.eclipse.jpt.utility.tests.internal.model.JptUtilityModelTests;
-import org.eclipse.jpt.utility.tests.internal.node.JptUtilityNodeTests;
-import org.eclipse.jpt.utility.tests.internal.synchronizers.JptUtilitySynchronizersTests;
-
-/**
- * decentralize test creation code
- */
-public class JptUtilityTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUtilityTests.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(BooleanReferenceTests.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(IntReferenceTests.class);
- suite.addTestSuite(JavaTypeTests.class);
- suite.addTestSuite(JDBCTypeTests.class);
- suite.addTestSuite(ListenerListTests.class);
- suite.addTestSuite(MethodSignatureTests.class);
- suite.addTestSuite(NameToolsTests.class);
- suite.addTestSuite(NotNullFilterTests.class);
- suite.addTestSuite(ObjectReferenceTests.class);
- suite.addTestSuite(RangeTests.class);
- suite.addTestSuite(ReflectionToolsTests.class);
- suite.addTestSuite(ReverseComparatorTests.class);
- suite.addTestSuite(SimpleAssociationTests.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(XMLStringEncoderTests.class);
-
- return suite;
- }
-
- private JptUtilityTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ListenerListTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ListenerListTests.java
deleted file mode 100644
index 98cbfe6609..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.io.Serializable;
-import java.util.EventListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MethodSignatureTests.java
deleted file mode 100644
index 62aae52944..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.JavaType;
-import org.eclipse.jpt.utility.MethodSignature;
-import org.eclipse.jpt.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MultiThreadedTestCase.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/MultiThreadedTestCase.java
deleted file mode 100644
index 0fae1fe7dc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Vector;
-import java.util.concurrent.ThreadFactory;
-
-import org.eclipse.jpt.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NameToolsTests.java
deleted file mode 100644
index a389583e0d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NotNullFilterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/NotNullFilterTests.java
deleted file mode 100644
index 9d092f4d75..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ObjectReferenceTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ObjectReferenceTests.java
deleted file mode 100644
index 563747227c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ObjectReferenceTests.java
+++ /dev/null
@@ -1,103 +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.utility.tests.internal;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.ObjectReference;
-
-@SuppressWarnings("nls")
-public class ObjectReferenceTests extends TestCase {
-
- public ObjectReferenceTests(String name) {
- super(name);
- }
-
- public void testGetValue() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertNull(or.getValue());
- or.setValue("foo");
- assertEquals("foo", or.getValue());
- }
-
- public void testValueEqualsObject() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertTrue(or.valueEquals(null));
- assertFalse(or.valueEquals("foo"));
-
- or.setValue("foo");
- assertFalse(or.valueEquals(null));
- assertTrue(or.valueEquals("foo"));
- }
-
- public void testValueNotEqualObject() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertFalse(or.valueNotEqual(null));
- assertTrue(or.valueNotEqual("foo"));
-
- or.setValue("foo");
- assertTrue(or.valueNotEqual(null));
- assertFalse(or.valueNotEqual("foo"));
- }
-
- public void testIsNull() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertTrue(or.isNull());
- or.setValue("foo");
- assertFalse(or.isNull());
- }
-
- public void testIsNotNull() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertFalse(or.isNotNull());
- or.setValue("foo");
- assertTrue(or.isNotNull());
- }
-
- public void testSetNull() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertNull(or.getValue());
- or.setValue("foo");
- assertEquals("foo", or.getValue());
- or.setNull();
- assertNull(or.getValue());
- }
-
- public void testClone() {
- ObjectReference<String> or = new ObjectReference<String>("foo");
- @SuppressWarnings("cast")
- ObjectReference<String> clone = (ObjectReference<String>) or.clone();
- assertEquals("foo", clone.getValue());
- assertEquals(or, clone);
- }
-
- public void testEquals() {
- ObjectReference<String> or1 = new ObjectReference<String>("foo");
- ObjectReference<String> or2 = new ObjectReference<String>("foo");
- assertTrue(or1.equals(or2));
- ObjectReference<String> or3 = new ObjectReference<String>("bar");
- assertFalse(or1.equals(or3));
- }
-
- public void testHashCode() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertEquals(0, or.hashCode());
- or.setValue("foo");
- assertEquals("foo".hashCode(), or.hashCode());
- }
-
- public void testToString() {
- ObjectReference<String> or = new ObjectReference<String>();
- assertEquals("[null]", or.toString());
- or.setValue("foo");
- assertEquals("[foo]", or.toString());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/RangeTests.java
deleted file mode 100644
index d7f2cce428..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReflectionToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReflectionToolsTests.java
deleted file mode 100644
index afdfc679fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/ReverseComparatorTests.java
deleted file mode 100644
index 1661b0ca8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleAssociationTests.java
deleted file mode 100644
index 36c706a330..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.utility.internal.Association;
-import org.eclipse.jpt.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.key());
- }
-
- public void testGetValue() {
- assertEquals("bar", this.assoc.value());
- }
-
- public void testSetValue() {
- assertEquals("bar", this.assoc.value());
- this.assoc.setValue("baz");
- assertEquals("baz", this.assoc.value());
- }
-
- 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.key(), actual.key());
- assertSame(expected.key(), actual.key());
- assertEquals(expected.value(), actual.value());
- assertSame(expected.value(), actual.value());
- }
-
- 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.key(), assoc2.key());
- assertNotSame(this.assoc.key(), assoc2.key());
- assertEquals(this.assoc.value(), assoc2.value());
- assertNotSame(this.assoc.value(), assoc2.value());
- }
-
- private SimpleAssociation<String, String> copy(SimpleAssociation<String, String> sa) {
- return new SimpleAssociation<String, String>(sa.key(), sa.value());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleQueueTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleQueueTests.java
deleted file mode 100644
index 7f70889200..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.Queue;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SimpleStackTests.java
deleted file mode 100644
index 369620a187..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.EmptyStackException;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
deleted file mode 100644
index 8319dc0c11..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/StringToolsTests.java
+++ /dev/null
@@ -1,1724 +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.utility.tests.internal;
-
-import java.io.StringWriter;
-import java.io.Writer;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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());
- }
-
- // ********** 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()));
- }
-
- // ********** 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.java
deleted file mode 100644
index 54f8657378..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedBooleanTests.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.utility.tests.internal;
-
-import org.eclipse.jpt.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 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 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());
- }
-
- public void testEquals() throws Exception {
- this.sb.setValue(false);
- SynchronizedBoolean sb2 = new SynchronizedBoolean(false);
- assertEquals(this.sb, sb2);
-
- this.sb.setValue(true);
- assertFalse(this.sb.equals(sb2));
-
- sb2.setValue(true);
- assertEquals(this.sb, sb2);
- }
-
- public void testHashCode() {
- this.sb.setValue(false);
- assertEquals(0, this.sb.hashCode());
-
- this.sb.setValue(true);
- assertEquals(1, this.sb.hashCode());
- }
-
- /**
- * 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedIntTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedIntTests.java
deleted file mode 100644
index 11e9b1bc06..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedIntTests.java
+++ /dev/null
@@ -1,385 +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.utility.tests.internal;
-
-import org.eclipse.jpt.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 testNotEqualsInt() throws Exception {
- assertTrue(this.si.notEquals(7));
- this.si.setValue(this.value);
- assertTrue(this.si.notEquals(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());
- assertEquals(this.value, this.si.getValue());
- }
-
- 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());
- assertEquals(-this.value, this.si.getValue());
- this.si.setValue(-this.value);
- assertEquals(this.value, this.si.neg());
- assertEquals(this.value, this.si.getValue());
- }
-
- 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());
- }
-
- public void testEquals() throws Exception {
- this.si.setValue(0);
- SynchronizedInt so2 = new SynchronizedInt(0);
- assertEquals(this.si, so2);
-
- this.si.setValue(this.value);
- assertFalse(this.si.equals(so2));
-
- so2.setValue(this.value);
- assertEquals(this.si, so2);
- }
-
- public void testHashCode() {
- this.si.setValue(this.value);
- assertEquals(this.value, this.si.hashCode());
-
- this.si.setValue(0);
- assertEquals(0, this.si.hashCode());
- }
-
- /**
- * 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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
deleted file mode 100644
index 5c1aca4d10..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedObjectTests.java
+++ /dev/null
@@ -1,259 +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.utility.tests.internal;
-
-import org.eclipse.jpt.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());
- }
-
- public void testEquals() throws Exception {
- this.so.setValue(null);
- SynchronizedObject<Object> so2 = new SynchronizedObject<Object>(null);
- assertEquals(this.so, so2);
-
- this.so.setValue(this.value);
- assertFalse(this.so.equals(so2));
-
- so2.setValue(this.value);
- assertEquals(this.so, so2);
- }
-
- public void testHashCode() {
- this.so.setValue(this.value);
- assertEquals(this.value.hashCode(), this.so.hashCode());
-
- this.so.setValue(null);
- assertEquals(0, this.so.hashCode());
- }
-
- /**
- * 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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedQueueTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedQueueTests.java
deleted file mode 100644
index 6473f5e435..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.Queue;
-import org.eclipse.jpt.utility.internal.SimpleQueue;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/SynchronizedStackTests.java
deleted file mode 100644
index 6b0338f6d6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import java.util.EmptyStackException;
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/TestTools.java
deleted file mode 100644
index 78b5c39898..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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 = (TestFailure) result.failures().nextElement();
- } else {
- failure = (TestFailure) 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/XMLStringEncoderTests.java
deleted file mode 100644
index eda0e7f432..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.FileTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/EmptyEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/EmptyEnumerationTests.java
deleted file mode 100644
index 0bda77fa25..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.enumerations;
-
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/IteratorEnumerationTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/IteratorEnumerationTests.java
deleted file mode 100644
index 545b349472..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/enumerations/JptUtilityEnumerationsTests.java
deleted file mode 100644
index 8fd14c3a1d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayIterableTests.java
deleted file mode 100644
index 0cd9451f3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ArrayListIterableTests.java
deleted file mode 100644
index e810e83daa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ListIterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayListIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ChainIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ChainIterableTests.java
deleted file mode 100644
index 67255da19b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CloneIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CloneIterableTests.java
deleted file mode 100644
index f8eff94e23..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeIterableTests.java
deleted file mode 100644
index b59857e4ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/CompositeListIterableTests.java
deleted file mode 100644
index aca4d95f72..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyIterableTests.java
deleted file mode 100644
index ae269e9c42..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/EmptyListIterableTests.java
deleted file mode 100644
index b037ace764..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/FilteringIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/FilteringIterableTests.java
deleted file mode 100644
index 713163e06f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.Filter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/GraphIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/GraphIterableTests.java
deleted file mode 100644
index e1b74caf29..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterables.GraphIterable;
-import org.eclipse.jpt.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/JptUtilityIterablesTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/JptUtilityIterablesTests.java
deleted file mode 100644
index 9394bd0501..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneIterableTests.java
deleted file mode 100644
index 466d4213c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/LiveCloneListIterableTests.java
deleted file mode 100644
index 47ba2ed357..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/PeekableIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/PeekableIterableTests.java
deleted file mode 100644
index 118184f8d0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.utility.internal.iterables.PeekableIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/QueueIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/QueueIterableTests.java
deleted file mode 100644
index 42fbb19df5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.Queue;
-import org.eclipse.jpt.utility.internal.SimpleQueue;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyCompositeListIterableTests.java
deleted file mode 100644
index 5e18ab93d0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.ReadOnlyCompositeListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListListIterable;
-
-@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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyIterableTests.java
deleted file mode 100644
index 8bf2b79fc6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/ReadOnlyListIterableTests.java
deleted file mode 100644
index 20bb6e7262..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.Vector;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.utility.internal.iterables.ListListIterable;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementIterableTests.java
deleted file mode 100644
index 138737ebff..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SingleElementListIterableTests.java
deleted file mode 100644
index b3e19f9260..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneIterableTests.java
deleted file mode 100644
index fd187a8a81..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.List;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SnapshotCloneListIterableTests.java
deleted file mode 100644
index 426670f050..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.List;
-import java.util.ListIterator;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/StackIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/StackIterableTests.java
deleted file mode 100644
index 750895042d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.SimpleStack;
-import org.eclipse.jpt.utility.internal.Stack;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SuperIterableWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/SuperIterableWrapperTests.java
deleted file mode 100644
index f56b76bbdd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collections;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationIterableTests.java
deleted file mode 100644
index 011942d978..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationListIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TransformationListIterableTests.java
deleted file mode 100644
index 684bcc8ec5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TreeIterableTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterables/TreeIterableTests.java
deleted file mode 100644
index e01c440e24..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterables;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.iterables.TreeIterable;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayIteratorTests.java
deleted file mode 100644
index a99d88d3fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ArrayListIteratorTests.java
deleted file mode 100644
index 9685b6ff60..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ChainIteratorTests.java
deleted file mode 100644
index 97d6cee45d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneIteratorTests.java
deleted file mode 100644
index a548cc77e9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CloneListIteratorTests.java
deleted file mode 100644
index 69c1cd8254..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeIteratorTests.java
deleted file mode 100644
index 573c1d93b0..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/CompositeListIteratorTests.java
deleted file mode 100644
index 3da104a4a3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyIteratorTests.java
deleted file mode 100644
index d54ccd0e99..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EmptyListIteratorTests.java
deleted file mode 100644
index b4ac671869..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/EnumerationIteratorTests.java
deleted file mode 100644
index cd34295f6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/FilteringIteratorTests.java
deleted file mode 100644
index 8e1fe4ce6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.Filter;
-import org.eclipse.jpt.utility.internal.SimpleFilter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/GraphIteratorTests.java
deleted file mode 100644
index b0e7ebd428..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.GraphIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/JptUtilityIteratorsTests.java
deleted file mode 100644
index 0cd247c942..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/PeekableIteratorTests.java
deleted file mode 100644
index 9fcea76674..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyCompositeListIteratorTests.java
deleted file mode 100644
index 30cbfe9ffc..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyIteratorTests.java
deleted file mode 100644
index c6351b7021..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import java.util.Vector;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/ReadOnlyListIteratorTests.java
deleted file mode 100644
index c5a1548dde..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementIteratorTests.java
deleted file mode 100644
index b7e226934b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-import junit.framework.TestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SingleElementListIteratorTests.java
deleted file mode 100644
index 1ad48b2232..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SuperIteratorWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SuperIteratorWrapperTests.java
deleted file mode 100644
index 080062f860..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedIteratorTests.java
deleted file mode 100644
index e44e72ec3e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.SynchronizedIterator;
-import org.eclipse.jpt.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/SynchronizedListIteratorTests.java
deleted file mode 100644
index 727da0caa6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.iterators;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.NoSuchElementException;
-
-import org.eclipse.jpt.utility.internal.iterators.SynchronizedListIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationIteratorTests.java
deleted file mode 100644
index 0cfa7fa796..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Transformer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TransformationListIteratorTests.java
deleted file mode 100644
index 28863e7428..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Transformer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/iterators/TreeIteratorTests.java
deleted file mode 100644
index cd658d2bb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/ChangeSupportTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/ChangeSupportTests.java
deleted file mode 100644
index b7f430b7e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.Tools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.StateChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeAdapter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/JptUtilityModelTests.java
deleted file mode 100644
index ebd6330401..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.utility.tests.internal.model.listener.JptUtilityModelListenerTests;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/NewEventTests.java
deleted file mode 100644
index 22276502f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model;
-
-import java.util.EventListener;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.ListenerList;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.ChangeEvent;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/SingleAspectChangeSupportTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/SingleAspectChangeSupportTests.java
deleted file mode 100644
index f934ec18ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeAdapter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/JptUtilityModelListenerTests.java
deleted file mode 100644
index 084a9b8ab3..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveCollectionChangeListenerTests.java
deleted file mode 100644
index 43adcd065e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveListChangeListenerTests.java
deleted file mode 100644
index 8a3965d1ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectivePropertyChangeListenerTests.java
deleted file mode 100644
index 8ca4f3a10e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveStateChangeListenerTests.java
deleted file mode 100644
index 28aed8f49f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.listener;
-
-import java.lang.reflect.Method;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/listener/ReflectiveTreeChangeListenerTests.java
deleted file mode 100644
index 52581adaa4..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.ReflectiveChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/BufferedWritablePropertyValueModelTests.java
deleted file mode 100644
index 366cb55312..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.Date;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationPropertyValueModelTests.java
deleted file mode 100644
index 0107fd0add..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CachingTransformationPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CachingTransformationWritablePropertyValueModelTests.java
deleted file mode 100644
index 49905c2427..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CachingTransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionAspectAdapterTests.java
deleted file mode 100644
index 4d3008d116..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionListValueModelAdapterTests.java
deleted file mode 100644
index 68357006c1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CollectionPropertyValueModelAdapterTests.java
deleted file mode 100644
index d89dac762f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionPropertyValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeBooleanPropertyValueModelTests.java
deleted file mode 100644
index 6600ff679e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.value.CompositeBooleanPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeCollectionValueModelTests.java
deleted file mode 100644
index 30ab72f1f6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositeListValueModelTests.java
deleted file mode 100644
index 06e7cde4a2..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CompositePropertyValueModelTests.java
deleted file mode 100644
index b8082e548d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.value.CompositePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedBag.java
deleted file mode 100644
index d45fad6ff1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/CoordinatedList.java
deleted file mode 100644
index 70ea298224..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ExtendedListValueModelWrapperTests.java
deleted file mode 100644
index 7f64503bd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringCollectionValueModelTests.java
deleted file mode 100644
index bf03010b88..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.Filter;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/FilteringPropertyValueModelTests.java
deleted file mode 100644
index b676dda6a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BidiFilter;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.FilteringWritablePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemCollectionListValueModelAdapterTests.java
deleted file mode 100644
index e35d3c137d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemCollectionListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemListListValueModelAdapterTests.java
deleted file mode 100644
index aaaa7f8dba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemListListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemPropertyListValueModelAdapterTests.java
deleted file mode 100644
index a30ced90e7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ItemStateListValueModelAdapterTests.java
deleted file mode 100644
index 890249a190..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ItemStateListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/JptUtilityModelValueTests.java
deleted file mode 100644
index 8bfbe02b49..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.utility.tests.internal.model.value.prefs.JptUtilityModelValuePrefsTests;
-import org.eclipse.jpt.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(TransformationListValueModelAdapterTests.class);
- suite.addTestSuite(TransformationListValueModelAdapterTests.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListAspectAdapterTests.java
deleted file mode 100644
index 37c6718d6d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCollectionValueModelAdapterTests.java
deleted file mode 100644
index 0c083da9ee..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ListCuratorTests.java
deleted file mode 100644
index 49ce46fdd6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListCurator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullCollectionValueModelTests.java
deleted file mode 100644
index 2bcc7387c8..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.model.value.NullCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullListValueModelTests.java
deleted file mode 100644
index e42bf48b12..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/NullPropertyValueModelTests.java
deleted file mode 100644
index 754850691f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.model.value.NullPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyAspectAdapterTests.java
deleted file mode 100644
index 06abc834ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyCollectionValueModelAdapterTests.java
deleted file mode 100644
index 9661ef4d4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.Collection;
-
-import javax.swing.JList;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/PropertyListValueModelAdapterTests.java
deleted file mode 100644
index d91b03d473..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.SingleElementIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ReadOnlyWritablePropertyValueModelWrapperTests.java
deleted file mode 100644
index c8678a7dfa..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SetCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SetCollectionValueModelTests.java
deleted file mode 100644
index ceb9c8a063..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleCollectionValueModelTests.java
deleted file mode 100644
index 48bac559d7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimpleListValueModelTests.java
deleted file mode 100644
index f4122fd9fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SimplePropertyValueModelTests.java
deleted file mode 100644
index e1a617fc71..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
deleted file mode 100644
index a1e0d0188b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelAdapterTests.java
+++ /dev/null
@@ -1,220 +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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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 listChanged(ListChangeEvent 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/SortedListValueModelWrapperTests.java
deleted file mode 100644
index 63815b9b45..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.ReverseComparator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticCollectionValueModelTests.java
deleted file mode 100644
index c7d0e9bcaf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.Collection;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticListValueModelTests.java
deleted file mode 100644
index d7a7d24810..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/StaticValueModelTests.java
deleted file mode 100644
index 14e3d9a014..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.java
deleted file mode 100644
index 83ce590d81..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationListValueModelAdapterTests.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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.Transformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.utility.model.event.ListEvent;
-import org.eclipse.jpt.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.tests.internal.TestTools;
-
-@SuppressWarnings("nls")
-public class TransformationListValueModelAdapterTests 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 TransformationListValueModelAdapterTests(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 TransformationListValueModelAdapter<String, String>(lvm) {
- @Override
- protected String transformItem(String s) {
- return (s == null) ? null : 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) {
- TransformationListValueModelAdapterTests.this.eventType = ADD;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- @Override
- public void itemsRemoved(ListRemoveEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REMOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- @Override
- public void itemsReplaced(ListReplaceEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = REPLACE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- @Override
- public void itemsMoved(ListMoveEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = MOVE;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- @Override
- public void listCleared(ListClearEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CLEAR;
- TransformationListValueModelAdapterTests.this.event = e;
- }
- @Override
- public void listChanged(ListChangeEvent e) {
- TransformationListValueModelAdapterTests.this.eventType = CHANGE;
- TransformationListValueModelAdapterTests.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 TransformationListValueModelAdapterTests {
- public TransformerTests(String name) {
- super(name);
- }
- @Override
- ListValueModel<String> buildTransformedListHolder(ListValueModel<String> lvm) {
- return new TransformationListValueModelAdapter<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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TransformationPropertyValueModelTests.java
deleted file mode 100644
index 0aaa6e4ee5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.BidiTransformer;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/TreeAspectAdapterTests.java
deleted file mode 100644
index 4f851b4e9c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.ChainIterator;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.iterators.TreeIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TreeAspectAdapter;
-import org.eclipse.jpt.utility.model.event.TreeAddEvent;
-import org.eclipse.jpt.utility.model.event.TreeChangeEvent;
-import org.eclipse.jpt.utility.model.event.TreeClearEvent;
-import org.eclipse.jpt.utility.model.event.TreeEvent;
-import org.eclipse.jpt.utility.model.event.TreeRemoveEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.TreeChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueCollectionAdapterTests.java
deleted file mode 100644
index f9e5e72674..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueCollectionAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueListAdapterTests.java
deleted file mode 100644
index 89d3c25a42..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValuePropertyAdapterTests.java
deleted file mode 100644
index e3912484c5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValuePropertyAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/ValueStateAdapterTests.java
deleted file mode 100644
index e0002e388a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.ValueStateAdapter;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/JptUtilityModelValuePrefsTests.java
deleted file mode 100644
index 043da07fbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencePropertyValueModelTests.java
deleted file mode 100644
index c8dc777f8e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.model.Model;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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 shouldSetPreference(Object oldValue, Object newValue) {
- return true;
- }
-
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesCollectionValueModelTests.java
deleted file mode 100644
index 390429f54c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.prefs.PreferencesCollectionValueModel;
-import org.eclipse.jpt.utility.model.event.CollectionAddEvent;
-import org.eclipse.jpt.utility.model.event.CollectionChangeEvent;
-import org.eclipse.jpt.utility.model.event.CollectionClearEvent;
-import org.eclipse.jpt.utility.model.event.CollectionEvent;
-import org.eclipse.jpt.utility.model.event.CollectionRemoveEvent;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ChangeAdapter;
-import org.eclipse.jpt.utility.model.listener.ChangeListener;
-import org.eclipse.jpt.utility.model.listener.CollectionChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/prefs/PreferencesTestCase.java
deleted file mode 100644
index 7f23c7d063..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterTests.java
deleted file mode 100644
index f29d9118a6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/CheckBoxModelAdapterUITest.java
deleted file mode 100644
index 7dcf11311e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterTests.java
deleted file mode 100644
index 0bc9a5793b..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.internal.swing.SimpleDisplayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest.java
deleted file mode 100644
index afae125606..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.FilteringListBrowser;
-import org.eclipse.jpt.utility.internal.swing.ListChooser;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ComboBoxModelAdapterUITest2.java
deleted file mode 100644
index afc1c15a02..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value.swing;
-
-import javax.swing.ListCellRenderer;
-import org.eclipse.jpt.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.swing.SimpleListCellRenderer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DateSpinnerModelAdapterTests.java
deleted file mode 100644
index a24b75b3bf..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterTests.java
deleted file mode 100644
index e980515201..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/DocumentAdapterUITest.java
deleted file mode 100644
index c57649b86a..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/JptUtilityModelValueSwingTests.java
deleted file mode 100644
index b531bd3c73..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterTests.java
deleted file mode 100644
index 86f3b698e9..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.Bag;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListModelAdapterUITest.java
deleted file mode 100644
index 168ee487f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ListSpinnerModelAdapterTests.java
deleted file mode 100644
index 087fefc813..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/NumberSpinnerModelAdapterTests.java
deleted file mode 100644
index 1debef863e..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ObjectListSelectionModelTests.java
deleted file mode 100644
index 8a60f65876..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/PrimitiveListTreeModelTests.java
deleted file mode 100644
index bbeac0e5fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.iterators.ReadOnlyListIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.PrimitiveListTreeModel;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterTests.java
deleted file mode 100644
index 908f4bee86..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/RadioButtonModelAdapterUITest.java
deleted file mode 100644
index fba6f626ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.RadioButtonModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/ReadOnlyTableModelAdapterUITest.java
deleted file mode 100644
index 3bfb66f4ba..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.model.value.swing;
-
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterTests.java
deleted file mode 100644
index 3d9ac7344d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.SpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/SpinnerModelAdapterUITest.java
deleted file mode 100644
index 83d340ea5d..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.ArrayTools;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterTests.java
deleted file mode 100644
index ce51ef0776..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TableModelAdapterUITest.java
deleted file mode 100644
index 78854f61bd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.swing.CheckBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ColumnAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ComboBoxModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DateSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.DocumentAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ListModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.NumberSpinnerModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TableModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.CheckBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.ComboBoxTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.SpinnerTableCellRenderer;
-import org.eclipse.jpt.utility.internal.swing.TableCellEditorAdapter;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Crowd;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TableModelAdapterTests.Person;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterTests.java
deleted file mode 100644
index 760d17b36c..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.IndentingPrintWriter;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.StringTools;
-import org.eclipse.jpt.utility.internal.iterators.ReadOnlyIterator;
-import org.eclipse.jpt.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.utility.internal.model.value.AbstractTreeNodeValueModel;
-import org.eclipse.jpt.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.NullListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.SortedListValueModelWrapper;
-import org.eclipse.jpt.utility.internal.model.value.StaticPropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.TransformationListValueModelAdapter;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.utility.model.value.ListValueModel;
-import org.eclipse.jpt.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.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 TransformationListValueModelAdapter<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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/model/value/swing/TreeModelAdapterUITest.java
deleted file mode 100644
index 7339172161..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.iterators.EnumerationIterator;
-import org.eclipse.jpt.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.utility.internal.model.value.swing.TreeModelAdapter;
-import org.eclipse.jpt.utility.internal.swing.Displayable;
-import org.eclipse.jpt.utility.model.value.TreeNodeValueModel;
-import org.eclipse.jpt.utility.model.value.WritablePropertyValueModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.SortedTestNode;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestModel;
-import org.eclipse.jpt.utility.tests.internal.model.value.swing.TreeModelAdapterTests.TestNode;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/AbstractNodeTests.java
deleted file mode 100644
index 8171433be6..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.node;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.CollectionTools;
-import org.eclipse.jpt.utility.internal.HashBag;
-import org.eclipse.jpt.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.utility.internal.node.Node;
-import org.eclipse.jpt.utility.internal.node.Problem;
-import org.eclipse.jpt.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", 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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/node/JptUtilityNodeTests.java
deleted file mode 100644
index 94f682d878..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/AsynchronousSynchronizerTests.java
deleted file mode 100644
index a30814a2fd..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.synchronizers;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.CompositeException;
-import org.eclipse.jpt.utility.internal.ConsumerThreadCoordinator;
-import org.eclipse.jpt.utility.internal.ReflectionTools;
-import org.eclipse.jpt.utility.internal.synchronizers.AsynchronousSynchronizer;
-import org.eclipse.jpt.utility.internal.synchronizers.Synchronizer;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/JptUtilitySynchronizersTests.java
deleted file mode 100644
index 6a7869d13f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronizerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronizerTests.java
deleted file mode 100644
index 95d9d50315..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronizerTests.java
+++ /dev/null
@@ -1,42 +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.utility.tests.internal.synchronizers;
-
-import junit.framework.TestCase;
-
-import org.eclipse.jpt.utility.internal.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/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java b/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/utility/tests/internal/synchronizers/SynchronousSynchronizerTests.java
deleted file mode 100644
index 2ceea2b2f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/src/org/eclipse/jpt/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.utility.tests.internal.synchronizers;
-
-import org.eclipse.jpt.utility.Command;
-import org.eclipse.jpt.utility.internal.CompositeException;
-import org.eclipse.jpt.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.utility.internal.synchronizers.Synchronizer;
-import org.eclipse.jpt.utility.internal.synchronizers.SynchronousSynchronizer;
-import org.eclipse.jpt.utility.tests.internal.MultiThreadedTestCase;
-import org.eclipse.jpt.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/jpa/tests/org.eclipse.jpt.utility.tests/test.xml b/jpa/tests/org.eclipse.jpt.utility.tests/test.xml
deleted file mode 100644
index bd8fc8a333..0000000000
--- a/jpa/tests/org.eclipse.jpt.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.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.utility.tests.internal.JptUtilityTests" />
- <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

Back to the top